From eaa81fa1d996f0aee845c0d7c9b86bf99778ba94 Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Fri, 27 Jun 2008 08:03:35 +0000 Subject: [PATCH] removed set method for start time git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@672184 13f79535-47bb-0310-9956-ffa450edef68 --- .../scanner/RepositoryContentConsumers.java | 15 +++------------ .../scanner/RepositoryContentConsumersStub.java | 12 ++++-------- .../scanner/RepositoryContentConsumersTest.java | 4 ++-- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java index bafc9ab66..c952475ba 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java @@ -72,8 +72,6 @@ public class RepositoryContentConsumers private List selectedInvalidConsumers; - private Date startTime; - /** *

* Get the list of Ids associated with those {@link KnownRepositoryContentConsumer} that have @@ -309,17 +307,10 @@ public class RepositoryContentConsumers { this.selectedInvalidConsumers = selectedInvalidConsumers; } - - public void setStartTime( Date startTime ) - { - this.startTime = startTime; - } - public Date getStartTime() - { - startTime = new Date( System.currentTimeMillis() ); - - return startTime; + protected Date getStartTime() + { + return new Date( System.currentTimeMillis() ); } public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java index 6cd952e74..8d3780c26 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java @@ -4,16 +4,12 @@ import java.util.Date; public class RepositoryContentConsumersStub extends RepositoryContentConsumers -{ - private Date startTimeForTest; - - public void setStartTime( Date startTimeForTest ) - { - this.startTimeForTest = startTimeForTest; - } - +{ public Date getStartTime() { + Date startTimeForTest = new Date( System.currentTimeMillis() ); + startTimeForTest.setTime( 12345678 ); + return startTimeForTest; } } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java index cf7d7726f..b2bfa7215 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java @@ -223,6 +223,7 @@ public class RepositoryContentConsumersTest File testFile = getTestFile( "target/test-repo/path/to/test-file.txt" ); Date startTime = new Date( System.currentTimeMillis() ); + startTime.setTime( 12345678 ); selectedKnownConsumer.beginScan( repo, startTime ); selectedKnownConsumer.getExcludes(); @@ -236,8 +237,7 @@ public class RepositoryContentConsumersTest selectedInvalidConsumer.beginScan( repo, startTime ); // invalidConsumer.completeScan(); invalidControl.replay(); - - consumers.setStartTime( startTime ); + consumers.executeConsumers( repo, testFile ); knownControl.verify(); -- 2.39.5