maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ogusa...@apache.org
Subject svn commit: r758848 - /maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/dependency/tests/DependencyTreeBuilderTest.java
Date Thu, 26 Mar 2009 20:51:01 GMT
Author: ogusakov
Date: Thu Mar 26 20:51:01 2009
New Revision: 758848

URL: http://svn.apache.org/viewvc?rev=758848&view=rev
Log:
[MERCURY-106] - added more tree API tests

Modified:
    maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/dependency/tests/DependencyTreeBuilderTest.java

Modified: maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/dependency/tests/DependencyTreeBuilderTest.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/dependency/tests/DependencyTreeBuilderTest.java?rev=758848&r1=758847&r2=758848&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/dependency/tests/DependencyTreeBuilderTest.java
(original)
+++ maven/mercury/trunk/mercury-it/src/test/java/org/apache/maven/mercury/dependency/tests/DependencyTreeBuilderTest.java
Thu Mar 26 20:51:01 2009
@@ -273,5 +273,46 @@
     }
   }
   //----------------------------------------------------------------------------------------------
+  public void testResolvePluginAsTree()
+  throws Exception
+  {
+    String centralUrl = "http://repo1.maven.org/maven2";
+
+    String artifactId = "org.apache.maven.plugins:maven-clean-plugin:2.2";
+    
+    reps.clear();
+    
+    File pluginRepo = new File( "./target/repoPlugin" );
+    localRepo = new LocalRepositoryM2( "testLocalPluginRepo", pluginRepo, new MavenDependencyProcessor()
);
+    reps.add(  localRepo );
+
+    Server server = new Server( "id", new URL(centralUrl) );
+    remoteRepo = new RemoteRepositoryM2(server, new MavenDependencyProcessor());
+    remoteRepo.setUpdatePolicy( RepositoryUpdateIntervalPolicy.UPDATE_POLICY_NEVER );
+    reps.add( remoteRepo );
+    
+    depBuilder = DependencyBuilderFactory.create( DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL,
reps );
+//    depBuilder.register( new DumbListener() );
+    
+    ArtifactMetadata md = new ArtifactMetadata( artifactId );
+
+    MetadataTreeNode root = depBuilder.buildTree( md, ArtifactScopeEnum.compile );
+
+    assertNotNull( root );
+    
+    MetadataTreeNode res = depBuilder.resolveConflictsAsTree( root );
+    
+    assertNotNull( res );
+    
+    int nodeCount = res.countNodes();
+    
+    assertEquals( 15, nodeCount);
+    
+    System.out.println("Unique feature - junit is in the compile scope thanks to plexus-container-default
1.0.9");
+
+    MetadataTreeNode.showNode( res, 0 );
+
+  }
+  //----------------------------------------------------------------------------------------------
   //----------------------------------------------------------------------------------------------
 }
\ No newline at end of file



Mime
View raw message