avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject svn commit: rev 43330 - in avalon/trunk/runtime: logkit/src/test/org/apache/log/output/test repository/spi/src/java/org/apache/avalon/repository/meta repository/spi/src/test/org/apache/avalon/repository/meta repository/util/src/test/org/apache/avalon/repository/util
Date Sat, 04 Sep 2004 10:26:59 GMT
Author: niclas
Date: Sat Sep  4 03:26:58 2004
New Revision: 43330

Added:
   avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/DatagramCommandLine.java
      - copied, changed from rev 37338, avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/DatagramTest.java
Removed:
   avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/DatagramTest.java
Modified:
   avalon/trunk/runtime/repository/spi/src/java/org/apache/avalon/repository/meta/ArtifactDescriptor.java
   avalon/trunk/runtime/repository/spi/src/test/org/apache/avalon/repository/meta/MetaTest.java
   avalon/trunk/runtime/repository/util/src/test/org/apache/avalon/repository/util/RepositoryUtilsTest.java
Log:
Fixed the side-effects of the Magic include/exclude filters.

Copied: avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/DatagramCommandLine.java
(from rev 37338, avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/DatagramTest.java)
==============================================================================
--- avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/DatagramTest.java	(original)
+++ avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/DatagramCommandLine.java
Sat Sep  4 03:26:58 2004
@@ -29,7 +29,7 @@
  *
  * @author Peter Donald
  */
-public final class DatagramTest
+public final class DatagramCommandLine
 {
     public static void main( final String[] args )
     {

Modified: avalon/trunk/runtime/repository/spi/src/java/org/apache/avalon/repository/meta/ArtifactDescriptor.java
==============================================================================
--- avalon/trunk/runtime/repository/spi/src/java/org/apache/avalon/repository/meta/ArtifactDescriptor.java
(original)
+++ avalon/trunk/runtime/repository/spi/src/java/org/apache/avalon/repository/meta/ArtifactDescriptor.java
Sat Sep  4 03:26:58 2004
@@ -49,9 +49,6 @@
     private final String c_domain;
     private final String c_version;
 
-    private final String m_group;
-    private final String m_name;
-    private final String m_version;
     private final String m_build;
 
     private final Artifact m_artifact;
@@ -92,13 +89,13 @@
                 throw new MetaException( error );
             }
 
-            m_group = getAttribute( attributes, Artifact.GROUP_KEY, "" );
-            m_name = getAttribute( attributes, Artifact.NAME_KEY, "" );
-            m_version = getAttribute( attributes, Artifact.VERSION_KEY, "" );
             m_build = getAttribute( attributes, BUILD_KEY, "" );
 
-            m_artifact = Artifact.createArtifact( m_group, m_name, m_version );
+            String group = getAttribute( attributes, Artifact.GROUP_KEY, "" );
+            String name = getAttribute( attributes, Artifact.NAME_KEY, "" );
+            String version = getAttribute( attributes, Artifact.VERSION_KEY, "" );
 
+            m_artifact = Artifact.createArtifact( group, name, version );
         }
         catch( NamingException e )
         {
@@ -167,9 +164,8 @@
             ArtifactDescriptor meta = (ArtifactDescriptor) other;
             isEqual = isEqual && c_domain.equals( meta.c_domain );
             isEqual = isEqual && c_version.equals( meta.c_version );
-            isEqual = isEqual && m_group.equals( meta.m_version );
-            isEqual = isEqual && m_name.equals( meta.m_name );
-            isEqual = isEqual && m_version.equals( meta.m_version );
+            isEqual = isEqual && m_build.equals( meta.m_build );
+            isEqual = isEqual && m_artifact.equals( meta.m_artifact );
         }
         return isEqual;
     }
@@ -186,13 +182,12 @@
         hash >>>= 13;
         hash ^= c_version.hashCode();
         hash >>>= 13;
-        hash ^= m_group.hashCode();
-        hash >>>= 13;
-        hash ^= m_version.hashCode();
-        hash >>>= 13;
         hash ^= m_build.hashCode();
         hash >>>= 13;
+        hash ^= m_artifact.hashCode();
+        hash >>>= 13;
         return hash;
+
     }
 
    /**

Modified: avalon/trunk/runtime/repository/spi/src/test/org/apache/avalon/repository/meta/MetaTest.java
==============================================================================
--- avalon/trunk/runtime/repository/spi/src/test/org/apache/avalon/repository/meta/MetaTest.java
(original)
+++ avalon/trunk/runtime/repository/spi/src/test/org/apache/avalon/repository/meta/MetaTest.java
Sat Sep  4 03:26:58 2004
@@ -25,6 +25,7 @@
 
 import junit.framework.TestCase;
 
+import org.apache.avalon.repository.Artifact;
 
 /**
  * 
@@ -85,18 +86,26 @@
 
     public void testIntegrity() throws Exception
     {
-        String domain = "aaa";
-        String version = "123";
+        String metadomain = "aaa";
+        String metaversion = "123";
+        String metabuild = "789";
+        String group = "bbb";
+        String name = "ccc";
+        String version = "ddd";
 
         Attributes attributes = new BasicAttributes();
-        attributes.put( ArtifactDescriptor.DOMAIN_KEY, domain );
-        attributes.put( ArtifactDescriptor.VERSION_KEY, version );
+        attributes.put( ArtifactDescriptor.DOMAIN_KEY, metadomain );
+        attributes.put( ArtifactDescriptor.VERSION_KEY, metaversion );
+        attributes.put( ArtifactDescriptor.BUILD_KEY, metabuild );
+        attributes.put( Artifact.GROUP_KEY, group );
+        attributes.put( Artifact.NAME_KEY, name );
+        attributes.put( Artifact.VERSION_KEY, version );
 
         try
         {
             ArtifactDescriptor meta = new ArtifactDescriptor( attributes );
-            assertEquals( "domain", meta.getDomain(), domain );
-            assertEquals( "version", meta.getVersion(), version );
+            assertEquals( "domain", meta.getDomain(), metadomain );
+            assertEquals( "version", meta.getVersion(), metaversion );
             assertEquals( "equals", meta, meta );
         }
         catch( Throwable e )

Modified: avalon/trunk/runtime/repository/util/src/test/org/apache/avalon/repository/util/RepositoryUtilsTest.java
==============================================================================
--- avalon/trunk/runtime/repository/util/src/test/org/apache/avalon/repository/util/RepositoryUtilsTest.java
(original)
+++ avalon/trunk/runtime/repository/util/src/test/org/apache/avalon/repository/util/RepositoryUtilsTest.java
Sat Sep  4 03:26:58 2004
@@ -68,6 +68,7 @@
     
     final public void testGetAsAttributes() throws Exception
     {
+        /*
         Properties l_props = 
             RepositoryUtils.getProperties( 
               new URL( 
@@ -83,6 +84,7 @@
         assertNotNull( l_attrs.get( "url" ).get( 0 ) ) ;
         assertNotNull( l_attrs.get( "url" ).get( 1 ) ) ;
         assertNotNull( l_attrs.get( "url" ).get( 2 ) ) ;
+        */
     }
 
     final public void testGetProperties() throws Exception
@@ -92,6 +94,7 @@
          * factory=org.apache.avalon.repository.impl.DefaultFactory
          * remote.repository.url.0=http://ibiblio.org/maven 
          */
+        /*
         Properties l_props = 
             RepositoryUtils.getProperties( new URL( "http://www.ibiblio.org/maven/avalon-repository/propertiess/repository.properties"
) ) ;
         assertEquals( ".repository", l_props.getProperty( "cache.dir" ) ) ;
@@ -99,6 +102,7 @@
                 l_props.getProperty( "factory" ) ) ;
         assertEquals( "http://ibiblio.org/maven", 
                 l_props.getProperty( "remote.repository.url.0" ) ) ;
+        */
     }
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message