maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r359981 - /maven/repository-manager/trunk/maven-repository-discovery/src/test/java/org/apache/maven/repository/discovery/DefaultMetadataDiscovererTest.java
Date Fri, 30 Dec 2005 04:05:29 GMT
Author: brett
Date: Thu Dec 29 20:05:25 2005
New Revision: 359981

URL: http://svn.apache.org/viewcvs?rev=359981&view=rev
Log:
cleanup formatting, and force all paths to use '/' so it works on Windows and Unix

Modified:
    maven/repository-manager/trunk/maven-repository-discovery/src/test/java/org/apache/maven/repository/discovery/DefaultMetadataDiscovererTest.java

Modified: maven/repository-manager/trunk/maven-repository-discovery/src/test/java/org/apache/maven/repository/discovery/DefaultMetadataDiscovererTest.java
URL: http://svn.apache.org/viewcvs/maven/repository-manager/trunk/maven-repository-discovery/src/test/java/org/apache/maven/repository/discovery/DefaultMetadataDiscovererTest.java?rev=359981&r1=359980&r2=359981&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-discovery/src/test/java/org/apache/maven/repository/discovery/DefaultMetadataDiscovererTest.java
(original)
+++ maven/repository-manager/trunk/maven-repository-discovery/src/test/java/org/apache/maven/repository/discovery/DefaultMetadataDiscovererTest.java
Thu Dec 29 20:05:25 2005
@@ -25,74 +25,83 @@
 /**
  * This class tests the DefaultMetadataDiscoverer class.
  */
-public class DefaultMetadataDiscovererTest extends PlexusTestCase {
-	private MetadataDiscoverer discoverer;
-
-	private File repositoryLocation;
-
-	/**
-	 * 
-	 */
-	public void setUp() throws Exception {
-		super.setUp();
-
-		discoverer = (MetadataDiscoverer) lookup(MetadataDiscoverer.ROLE,
-				"default");
-		repositoryLocation = getTestFile("src/test/repository");
-	}
-
-	/**
-	 * 
-	 */
-	public void tearDown() throws Exception {
-		super.tearDown();
-		discoverer = null;
-	}
-
-	/**
-	 * Test DefaultMetadataDiscoverer when the all metadata paths are valid.
-	 * 
-	 */
-	public void testMetadataDiscovererSuccess() {
-		List metadataPaths = discoverer.discoverMetadata(repositoryLocation,
-				null);
-		assertNotNull("Check metadata not null", metadataPaths);
-		assertTrue(metadataPaths.size() == 3);
-	}
-
-	/**
-	 * Test if metadata file in wrong directory was added to the kickedOutPaths.
-	 */
-	public void testKickoutWrongDirectory() {
-		List metadataPaths = discoverer.discoverMetadata(repositoryLocation,
-				null);
-		Iterator iter = discoverer.getKickedOutPathsIterator();
-		boolean found = false;
-		while (iter.hasNext() && !found) {
-			String dir = (String) iter.next();
-			if (dir.equals("javax\\maven-metadata-repository.xml")) {
-				found = true;
-			}
-		}
-		assertTrue(found);
-	}
-
-	/**
-	 * Test if blank metadata file was added to the kickedOutPaths.
-	 */
-	public void testKickoutBlankMetadata() {
-		List metadataPaths = discoverer.discoverMetadata(repositoryLocation,
-				null);
-		Iterator iter = discoverer.getKickedOutPathsIterator();
-		boolean found = false;
-		while (iter.hasNext() && !found) {
-			String dir = (String) iter.next();
-			if (dir
-					.equals("org\\apache\\maven\\some-ejb\\1.0\\maven-metadata-repository.xml")) {
-				found = true;
-			}
-		}
-		assertTrue(found);
-	}
+public class DefaultMetadataDiscovererTest
+    extends PlexusTestCase
+{
+    private MetadataDiscoverer discoverer;
+
+    private File repositoryLocation;
+
+    /**
+     *
+     */
+    public void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        discoverer = (MetadataDiscoverer) lookup( MetadataDiscoverer.ROLE, "default" );
+        repositoryLocation = getTestFile( "src/test/repository" );
+    }
+
+    /**
+     *
+     */
+    public void tearDown()
+        throws Exception
+    {
+        super.tearDown();
+        discoverer = null;
+    }
+
+    /**
+     * Test DefaultMetadataDiscoverer when the all metadata paths are valid.
+     */
+    public void testMetadataDiscovererSuccess()
+    {
+        List metadataPaths = discoverer.discoverMetadata( repositoryLocation, null );
+        assertNotNull( "Check metadata not null", metadataPaths );
+        assertTrue( metadataPaths.size() == 3 );
+    }
+
+    /**
+     * Test if metadata file in wrong directory was added to the kickedOutPaths.
+     */
+    public void testKickoutWrongDirectory()
+    {
+        List metadataPaths = discoverer.discoverMetadata( repositoryLocation, null );
+        Iterator iter = discoverer.getKickedOutPathsIterator();
+        boolean found = false;
+        while ( iter.hasNext() && !found )
+        {
+            String dir = (String) iter.next();
+            String normalizedDir = dir.replace( '\\', '/' );
+            if ( "javax/maven-metadata-repository.xml".equals( normalizedDir ) )
+            {
+                found = true;
+            }
+        }
+        assertTrue( found );
+    }
+
+    /**
+     * Test if blank metadata file was added to the kickedOutPaths.
+     */
+    public void testKickoutBlankMetadata()
+    {
+        List metadataPaths = discoverer.discoverMetadata( repositoryLocation, null );
+        Iterator iter = discoverer.getKickedOutPathsIterator();
+        boolean found = false;
+        while ( iter.hasNext() && !found )
+        {
+            String dir = (String) iter.next();
+            String normalizedDir = dir.replace( '\\', '/' );
+            if ( "org/apache/maven/some-ejb/1.0/maven-metadata-repository.xml".equals( normalizedDir
) )
+            {
+                found = true;
+            }
+        }
+        assertTrue( found );
+    }
 
 }



Mime
View raw message