]> source.dussan.org Git - archiva.git/commitdiff
[MRM-134] remove old timestamp code and tests
authorBrett Porter <brett@apache.org>
Mon, 4 Sep 2006 05:42:14 +0000 (05:42 +0000)
committerBrett Porter <brett@apache.org>
Mon, 4 Sep 2006 05:42:14 +0000 (05:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@439937 13f79535-47bb-0310-9956-ffa450edef68

archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/AbstractArtifactDiscoverer.java
archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/AbstractDiscoverer.java
archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AbstractArtifactDiscovererTest.java
archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultMetadataDiscovererTest.java

index 5a3297b9e174aca02974b5919722ee95d58a5d74..844daad0635312a5e7203f56863ec8864225dc61 100644 (file)
@@ -74,7 +74,6 @@ public abstract class AbstractArtifactDiscoverer
                     artifacts.add( artifact );
                 }
                 // TODO: else add to excluded? [!]
-                // TODO! excluded/kickout tracking should be optional
             }
             catch ( DiscovererException e )
             {
index dabe2f787a9c3fd750120c2bcaaa07585f2e2993..d509be6847e5ee7f535035c69eacee34380676ac 100644 (file)
@@ -52,13 +52,6 @@ public abstract class AbstractDiscoverer
      */
     private boolean trackOmittedPaths;
 
-    /** TODO!
-     * @plexus.configuration default-value="60000"
-    protected int blackoutPeriod;
-
-    protected static final String DATE_FMT = "yyyyMMddHHmmss";
-     */
-
     /**
      * Add a path to the list of files that were kicked out due to being invalid.
      *
index cb7944266ce7a75c0cdce8d5ef62309b460405a4..78a7a6cbe3313d792314f0bfdce21bd8e331e401 100644 (file)
@@ -51,9 +51,6 @@ public abstract class AbstractArtifactDiscovererTest
         factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
 
         repository = getRepository();
-
-        // TODO!
-//        removeTimestampMetadata();
     }
 
     protected ArtifactRepository getRepository()
@@ -87,174 +84,4 @@ public abstract class AbstractArtifactDiscovererTest
     {
         return factory.createArtifactWithClassifier( groupId, artifactId, version, type, classifier );
     }
-
-/*                                   TODO!
-    public void testUpdatedInRepository()
-        throws ComponentLookupException, DiscovererException, ParseException, IOException
-    {
-        // Set repository time to 1-1-2000, a time in the distant past so definitely updated
-        discoverer.setLastCheckedTime( repository, UPDATE_OPERATION,
-                                       new SimpleDateFormat( "yyyy-MM-dd", Locale.US ).parse( "2000-01-01" ) );
-
-        List artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertTrue( "Check included",
-                    artifacts.contains( createArtifact( "org.apache.maven.update", "test-updated", "1.0" ) ) );
-
-        // try again with the updated timestamp
-        artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertFalse( "Check not included",
-                     artifacts.contains( createArtifact( "org.apache.maven.update", "test-updated", "1.0" ) ) );
-    }
-
-    public void testNotUpdatedInRepository()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        // Set repository time to now, which is after any artifacts, so definitely not updated
-        discoverer.setLastCheckedTime( repository, UPDATE_OPERATION, new Date() );
-
-        List artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertFalse( "Check not included",
-                     artifacts.contains( createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" ) ) );
-    }
-
-    public void testNotUpdatedInRepositoryForcedDiscovery()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        discoverer.resetLastCheckedTime( repository, UPDATE_OPERATION );
-
-        List artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertTrue( "Check included",
-                    artifacts.contains( createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" ) ) );
-
-        // try again with the updated timestamp
-        artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertFalse( "Check not included",
-                     artifacts.contains( createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" ) ) );
-    }
-
-    public void testUpdatedInRepositoryBlackout()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        discoverer.resetLastCheckedTime( repository, UPDATE_OPERATION );
-
-        Artifact artifact = createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" );
-        artifact.getFile().setLastModified( System.currentTimeMillis() );
-
-        List artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertFalse( "Check not included", artifacts.contains( artifact ) );
-
-        // try again with the updated timestamp
-        artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertFalse( "Check not included", artifacts.contains( artifact ) );
-    }
-
-    public void testUpdatedInRepositoryNotBlackout()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        discoverer.resetLastCheckedTime( repository, UPDATE_OPERATION );
-
-        Artifact artifact = createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" );
-        artifact.getFile().setLastModified( System.currentTimeMillis() - 61000 );
-
-        List artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertTrue( "Check included", artifacts.contains( artifact ) );
-
-        // try again with the updated timestamp
-        artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertFalse( "Check not included", artifacts.contains( artifact ) );
-    }
-
-    public void testNotUpdatedInRepositoryForcedDiscoveryMetadataAlreadyExists()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        discoverer.setLastCheckedTime( repository, UPDATE_OPERATION, new Date() );
-
-        discoverer.resetLastCheckedTime( repository, UPDATE_OPERATION );
-
-        List artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertTrue( "Check included",
-                    artifacts.contains( createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" ) ) );
-
-        // try again with the updated timestamp
-        artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertFalse( "Check not included",
-                     artifacts.contains( createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" ) ) );
-    }
-
-    public void testNotUpdatedInRepositoryForcedDiscoveryOtherMetadataAlreadyExists()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        discoverer.setLastCheckedTime( repository, "test", new Date() );
-
-        discoverer.resetLastCheckedTime( repository, UPDATE_OPERATION );
-
-        List artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertTrue( "Check included",
-                    artifacts.contains( createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" ) ) );
-
-        // try again with the updated timestamp
-        artifacts = discoverUpdateArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertFalse( "Check not included",
-                     artifacts.contains( createArtifact( "org.apache.maven.update", "test-not-updated", "1.0" ) ) );
-    }
-
-    public void testNoRepositoryMetadata()
-        throws ComponentLookupException, DiscovererException, ParseException, IOException
-    {
-        removeTimestampMetadata();
-
-        // should find all
-        List artifacts = discoverArtifactsWithSnapshots();
-        assertNotNull( "Check artifacts not null", artifacts );
-
-        assertTrue( "Check included",
-                    artifacts.contains( createArtifact( "org.apache.maven.update", "test-updated", "1.0" ) ) );
-    }
-
-    private List discoverUpdateArtifactsWithSnapshots()
-        throws DiscovererException
-    {
-        return discoverer.discoverArtifacts( repository, UPDATE_OPERATION, null, new AcceptAllArtifactFilter() );
-    }
-
-    private List discoverArtifactsWithSnapshots()
-        throws DiscovererException
-    {
-        return discoverer.discoverArtifacts( repository, TEST_OPERATION, null, new AcceptAllArtifactFilter() );
-    }
-
-    private void removeTimestampMetadata()
-    {
-        // remove the metadata that tracks time
-        File file = new File( repository.getBasedir(), "maven-metadata.xml" );
-        file.delete();
-        assertFalse( file.exists() );
-    }
-*/
 }
index 7755cab23c6ced2aba761df0e684290bf7deb442..8a7dece976785616a42d25f71346eea9b1b0d3b0 100644 (file)
@@ -163,118 +163,6 @@ public class DefaultMetadataDiscovererTest
         assertTrue( "Check included", containsMetadata( metadataPaths, metadata ) );
     }
 
-/*          TODO!
-    public void testUpdatedInRepository()
-        throws ComponentLookupException, DiscovererException, ParseException, IOException
-    {
-        // Set repository time to 1-1-2000, a time in the distant past so definitely updated
-        discoverer.setLastCheckedTime( repository, "update",
-                                       new SimpleDateFormat( "yyyy-MM-dd", Locale.US ).parse( "2000-01-01" ) );
-
-        List metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        RepositoryMetadata metadata =
-            new ArtifactRepositoryMetadata( createArtifact( "org.apache.maven.update", "test-updated" ) );
-        assertTrue( "Check included", containsMetadata( metadataPaths, metadata ) );
-
-        // try again with the updated timestamp
-        metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        assertFalse( "Check not included", containsMetadata( metadataPaths, metadata ) );
-    }
-
-    public void testNotUpdatedInRepository()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        // Set repository time to now, which is after any artifacts, so definitely not updated
-        discoverer.setLastCheckedTime( repository, "update", new Date() );
-
-        List metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        RepositoryMetadata metadata =
-            new ArtifactRepositoryMetadata( createArtifact( "org.apache.maven.update", "test-not-updated" ) );
-        assertFalse( "Check not included", containsMetadata( metadataPaths, metadata ) );
-    }
-
-    public void testNotUpdatedInRepositoryForcedDiscovery()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        discoverer.resetLastCheckedTime( repository, "update" );
-
-        List metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        RepositoryMetadata metadata =
-            new ArtifactRepositoryMetadata( createArtifact( "org.apache.maven.update", "test-not-updated" ) );
-        assertTrue( "Check included", containsMetadata( metadataPaths, metadata ) );
-
-        // try again with the updated timestamp
-        metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        assertFalse( "Check not included", containsMetadata( metadataPaths, metadata ) );
-    }
-
-    public void testNotUpdatedInRepositoryForcedDiscoveryMetadataAlreadyExists()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        discoverer.setLastCheckedTime( repository, "update", new Date() );
-
-        discoverer.resetLastCheckedTime( repository, "update" );
-
-        List metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        RepositoryMetadata metadata =
-            new ArtifactRepositoryMetadata( createArtifact( "org.apache.maven.update", "test-not-updated" ) );
-        assertTrue( "Check included", containsMetadata( metadataPaths, metadata ) );
-
-        // try again with the updated timestamp
-        metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        assertFalse( "Check not included", containsMetadata( metadataPaths, metadata ) );
-    }
-
-    public void testNotUpdatedInRepositoryForcedDiscoveryOtherMetadataAlreadyExists()
-        throws ComponentLookupException, DiscovererException, IOException
-    {
-        discoverer.setLastCheckedTime( repository, "test", new Date() );
-
-        discoverer.resetLastCheckedTime( repository, "update" );
-
-        List metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        RepositoryMetadata metadata =
-            new ArtifactRepositoryMetadata( createArtifact( "org.apache.maven.update", "test-not-updated" ) );
-        assertTrue( "Check included", containsMetadata( metadataPaths, metadata ) );
-
-        // try again with the updated timestamp
-        metadataPaths = discoverer.discoverMetadata( repository, "update", null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        assertFalse( "Check not included", containsMetadata( metadataPaths, metadata ) );
-    }
-
-    public void testNoRepositoryMetadata()
-        throws ComponentLookupException, DiscovererException, ParseException, IOException
-    {
-        removeTimestampMetadata();
-
-        // should find all
-        List metadataPaths = discoverer.discoverMetadata( repository, TEST_OPERATION, null );
-        assertNotNull( "Check metadata not null", metadataPaths );
-
-        RepositoryMetadata metadata =
-            new ArtifactRepositoryMetadata( createArtifact( "org.apache.maven.update", "test-updated" ) );
-        assertTrue( "Check included", containsMetadata( metadataPaths, metadata ) );
-    }
-*/
-
     protected Artifact createArtifact( String groupId, String artifactId )
     {
         return createArtifact( groupId, artifactId, "1.0" );