maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r751509 - /maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/processor/DependenciesProcessorTest.java
Date Sun, 08 Mar 2009 19:37:31 GMT
Author: sisbell
Date: Sun Mar  8 19:37:31 2009
New Revision: 751509

URL: http://svn.apache.org/viewvc?rev=751509&view=rev
Log:
Additional unit tests.

Modified:
    maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/processor/DependenciesProcessorTest.java

Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/processor/DependenciesProcessorTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/processor/DependenciesProcessorTest.java?rev=751509&r1=751508&r2=751509&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/processor/DependenciesProcessorTest.java
(original)
+++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/processor/DependenciesProcessorTest.java
Sun Mar  8 19:37:31 2009
@@ -42,4 +42,135 @@
         assertEquals(1, target.getDependencies().size());
         assertEquals("aid", target.getDependencies().get( 0 ).getArtifactId());
     }    
+    
+    public void testDependencyOrder()
+    {
+        Dependency dependency1 = new Dependency();
+        dependency1.setArtifactId( "aid1" );    
+        Model child = new Model();
+        child.addDependency( dependency1 );
+        
+        Dependency dependency = new Dependency();
+        dependency.setArtifactId( "aid" );    
+        Model parent = new Model();
+        parent.addDependency( dependency ); 
+        
+        Model target = new Model();
+        
+        DependenciesProcessor processor = new DependenciesProcessor();
+        processor.process( parent, child, target, false );
+        
+        assertEquals(2, target.getDependencies().size());
+        assertEquals("aid1", target.getDependencies().get( 0 ).getArtifactId());
+        assertEquals("aid", target.getDependencies().get( 1 ).getArtifactId());
+    }  
+    
+    public void testJoin_NullVersion()
+    {
+        Dependency dependency1 = new Dependency();
+        dependency1.setArtifactId( "aid-c" );
+        dependency1.setGroupId( "gid-c" ); 
+ 
+        
+        Model child = new Model();
+        child.addDependency( dependency1 );
+        
+        Dependency dependency = new Dependency();
+        dependency.setArtifactId( "aid-c" );
+        dependency.setGroupId( "gid-c" ); 
+        dependency.setSystemPath("sp");
+        
+        Model parent = new Model();
+        parent.addDependency( dependency ); 
+        
+        Model target = new Model();
+        
+        DependenciesProcessor processor = new DependenciesProcessor();
+        processor.process( parent, child, target, false );
+        
+        assertEquals(1, target.getDependencies().size());
+        assertEquals("sp", target.getDependencies().get( 0 ).getSystemPath());
+    }   
+    
+    public void testJoin_DefaultType()
+    {
+        Dependency dependency1 = new Dependency();
+        dependency1.setArtifactId( "aid-c" );
+        dependency1.setGroupId( "gid-c" ); 
+        dependency1.setVersion( "1.0" ); 
+        dependency1.setType( "jar" );
+        Model child = new Model();
+        child.addDependency( dependency1 );
+        
+        Dependency dependency = new Dependency();
+        dependency.setArtifactId( "aid-c" );
+        dependency.setGroupId( "gid-c" );
+        dependency.setVersion( "1.0" ); 
+        dependency.setSystemPath("sp");
+        
+        Model parent = new Model();
+        parent.addDependency( dependency ); 
+        
+        Model target = new Model();
+        
+        DependenciesProcessor processor = new DependenciesProcessor();
+        processor.process( parent, child, target, false );
+        
+        assertEquals(1, target.getDependencies().size());
+        assertEquals("sp", target.getDependencies().get( 0 ).getSystemPath());
+    } 
+    
+    public void testJoin_DifferentClassifiers()
+    {
+        Dependency dependency1 = new Dependency();
+        dependency1.setArtifactId( "aid-c" );
+        dependency1.setGroupId( "gid-c" ); 
+        dependency1.setVersion( "1.0" ); 
+        dependency1.setClassifier( "c1" );
+        
+        Model child = new Model();
+        child.addDependency( dependency1 );
+        
+        Dependency dependency = new Dependency();
+        dependency.setArtifactId( "aid-c" );
+        dependency.setGroupId( "gid-c" );
+        dependency.setVersion( "1.0" ); 
+        dependency1.setClassifier( "c2" );
+        
+        Model parent = new Model();
+        parent.addDependency( dependency ); 
+        
+        Model target = new Model();
+        
+        DependenciesProcessor processor = new DependenciesProcessor();
+        processor.process( parent, child, target, false );
+        
+        assertEquals(2, target.getDependencies().size());
+    } 
+    
+    public void testJoin_DifferentVersions()
+    {
+        Dependency dependency1 = new Dependency();
+        dependency1.setArtifactId( "aid-c" );
+        dependency1.setGroupId( "gid-c" ); 
+        dependency1.setVersion( "1.1" ); 
+        
+        Model child = new Model();
+        child.addDependency( dependency1 );
+        
+        Dependency dependency = new Dependency();
+        dependency.setArtifactId( "aid-c" );
+        dependency.setGroupId( "gid-c" );
+        dependency.setVersion( "1.0" ); 
+        
+        Model parent = new Model();
+        parent.addDependency( dependency ); 
+        
+        Model target = new Model();
+        
+        DependenciesProcessor processor = new DependenciesProcessor();
+        processor.process( parent, child, target, false );
+        
+        assertEquals(2, target.getDependencies().size());
+    }       
 }



Mime
View raw message