I tried to scan through this as quickly as I could. I haven't reviewed the repository content classes at this point. I'm frankly not comfortable with the size of this change and inclined to have it moved to a branch until it can be more closely examined.

Here are my obligatory questions and comments...

On 10/10/2007, at 11:47 AM, [EMAIL PROTECTED] wrote:
- Have not swung all code over to new repositorycontent object yet.

what is left to do?

     /**
      * Purge the repo. Update db and index of removed artifacts.
      *
      * @param artifactFiles
      * @throws RepositoryIndexException
      */
-    protected void purge( File[] artifactFiles )
+    protected void purge( Set<ArtifactReference> references )

Was the behaviour of this changed? It looks like we now go File -> ArtifactReference -> File which seems redundant?

From what I can tell, you added functionality to delete support files (great!), but it wasn't referenced in the commit log or a JIRA. It's hard to track when multiple changes like that occur - can you clarify?

Something is not working, since as soon as I run it I get this:

INFO | jvm 1 | 2007/10/10 13:47:41 | 2007-10-10 13:47:41,036 [SocketListener0-4] ERROR org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers:d efault - Consumer [repository-purge] had an error when processi ng file [/Applications/Archiva/archiva/data/repositories/snapshots/ org/codehaus/plexus/plexus-expression-evaluator/1.0-alpha-2-SNAPSHOT/ plexus-expression-evaluator-1.0-alpha-2-20070928.003615-2.jar]: For input string: "alph" INFO | jvm 1 | 2007/10/10 13:47:41 | java.lang.NumberFormatException: For input string: "alph" INFO | jvm 1 | 2007/10/10 13:47:41 | at java.lang.NumberFormatException.forInputString (NumberFormatException.java:48) INFO | jvm 1 | 2007/10/10 13:47:41 | at java.lang.Integer.parseInt(Integer.java:447) INFO | jvm 1 | 2007/10/10 13:47:41 | at java.lang.Integer.parseInt(Integer.java:497)


+ System.err.println( "Purging: " + artifactFile.getAbsolutePath() );

Oops.

+ System.err.println( "Requesting (retention) purge of " + ArtifactReference.toKey( reference ) );

Oops.



Modified: maven/archiva/trunk/archiva-base/archiva-consumers/ archiva-core-consumers/src/test/conf/repository-manager-daysOld.xml URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/ archiva-consumers/archiva-core-consumers/src/test/conf/repository- manager-daysOld.xml?rev=583412&r1=583411&r2=583412&view=diff ====================================================================== ======== --- maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core- consumers/src/test/conf/repository-manager-daysOld.xml (original) +++ maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core- consumers/src/test/conf/repository-manager-daysOld.xml Wed Oct 10 02:47:20 2007
@@ -20,58 +20,47 @@

and....

Modified: maven/archiva/trunk/archiva-base/archiva-consumers/ archiva-core-consumers/src/test/conf/repository-manager.xml URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/ archiva-consumers/archiva-core-consumers/src/test/conf/repository- manager.xml?rev=583412&r1=583411&r2=583412&view=diff ====================================================================== ======== --- maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core- consumers/src/test/conf/repository-manager.xml (original) +++ maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core- consumers/src/test/conf/repository-manager.xml Wed Oct 10 02:47:20 2007
@@ -20,58 +20,47 @@

 <configuration>
   <version>1</version>
-  <repositories>
-    <repository>
+  <managedRepositories>
+    <managedRepository>
       <id>internal</id>
       <name>Archiva Managed Internal Repository</name>
-      <url>file://${appserver.base}/repositories/internal</url>
+      <location>${appserver.base}/repositories/internal</location>

These changes are incorrect, if it is version '1', it is the old format, you can't update the content (I'm surprised it works).


On 10/10/2007, at 11:47 AM, [EMAIL PROTECTED] wrote:
-        assertFalse( el.getValue().equals( "20070315032817" ) );
+ // FIXME: assertFalse( el.getValue().equals ( "20070315032817" ) );

what happened here? (2 more instances in the file)

         // check if metadata file was updated
-        File artifactMetadataFile =
- new File( "target/test/test-repo/org/apache/maven/ plugins/maven-source-plugin/maven-metadata-local.xml" );
+        File artifactMetadataFile = new File(
+ "target/test/test- repo/org/apache/maven/plugins/maven-source-plugin/maven- metadata.xml" );

Did the file format change?

-        try
+ if ( !artifact.getArtifactId().equalsIgnoreCase ( model.getArtifactId() ) )

why are artifact IDs case insensitive?

+ if ( !artifact.getVersion().equalsIgnoreCase ( model.getVersion() ) && + !VersionUtil.getBaseVersion( artifact.getVersion () ).equalsIgnoreCase( model.getVersion() ) )

as above

On 10/10/2007, at 11:47 AM, [EMAIL PROTECTED] wrote:
+    /* FIXME
public void testLegacyRequestPluginConvertedToDefaultPathInManagedRepo()
         throws Exception
     {
@@ -400,7 +401,7 @@
         setupTestableManagedRepository( path );

         File expectedFile = new File( managedDefaultDir, path );
- ArtifactReference artifact = createArtifactReference ( "legacy", legacyPath ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );

         expectedFile.delete();
         assertFalse( expectedFile.exists() );
@@ -415,6 +416,7 @@
assertFileEquals( expectedFile, downloadedFile, proxiedFile );
         assertNoTempFiles( expectedFile );
     }
+    */

what happened here? (2 instances)

+    /**
+     * <p>
+ * Gather up the list of related artifacts to the ArtifactReference provided.
+     * This typically inclues the pom files, and those things with
+     * classifiers (such as doc, source code, test libs, etc...)
+     * </p>
+     *
+     * <p>
+ * <strong>NOTE:</strong> Some layouts (such as maven 1 "legacy") are not compatible with this query.
+     * </p>
+     *
+     * @param reference the reference to work off of.
+     * @return the set of ArtifactReferences for related artifacts.
+ * @throws ContentNotFoundException if the initial artifact reference does not exist within the repository.
+     * @throws LayoutException
+     */
+ public Set<ArtifactReference> getRelatedArtifacts ( ArtifactReference reference )
+        throws ContentNotFoundException, LayoutException;

How does this work if proxying? Or is it just for things already in the repository (ie, for the purge).

On 10/10/2007, at 11:47 AM, [EMAIL PROTECTED] wrote:
+    private static final SimpleDateFormat lastUpdatedFormat;
+
+    static
+    {
+        lastUpdatedFormat = new SimpleDateFormat( "yyyyMMddHHmmss" );
+        lastUpdatedFormat.setTimeZone( DateUtils.UTC_TIME_ZONE );
+    }

This makes the metadata tools not thread safe and needs to be changed. (I think I saw the same the purge changes).

On 10/10/2007, at 11:47 AM, [EMAIL PROTECTED] wrote:
-    /* TODO: Re-enabled in the future.
+    /*

Is this no longer going to be re-enabled? Are the tests valid? (3 instances)

+    /* TODO: Re-enabled in the future.
     public void testGoodFooEjbClient()

Did this break?

+    /*
     public void testGoodFooLibJavadoc()

What happened here? (2 instances)


On 10/10/2007, at 11:47 AM, [EMAIL PROTECTED] wrote:
Added: maven/archiva/trunk/archiva-base/archiva-repository-layer/ src/test/resources/m1-repo-filelist.txt URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/ archiva-repository-layer/src/test/resources/m1-repo-filelist.txt? rev=583412&view=auto ====================================================================== ======== --- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/ test/resources/m1-repo-filelist.txt (added) +++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/ test/resources/m1-repo-filelist.txt Wed Oct 10 02:47:20 2007
@@ -0,0 +1,6230 @@
+# Directory listing from people.apache.org
+# of path /www/people.apache.org/repo/m1-ibiblio-rsync-repository
+# Taken September 9, 2007
+#
+# File listing has been filtered using the following sed command.
+#
+# sed -e "/\.md5$/d" -e "/\.sha1$/d" -e "/\.asc$/d" -e "/\.meta$/ d" \
+#       -e "/LICENSE/d" -e "/\/licenses\//d"
+#
+# Any entries in here that are blatently wrong should be deleted.
+#

This is interesting as a one off, but not something I think we should be running in the unit tests. It's way too huge.

Cheers,
Brett

--
Brett Porter - [EMAIL PROTECTED]
Blog: http://www.devzuz.org/blogs/bporter/

Reply via email to