incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r558667 - in /incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src: main/java/org/apache/maven/dotnet/dao/impl/ test/java/org/apache/maven/dotnet/dao/impl/ test/resources/
Date Mon, 23 Jul 2007 09:03:52 GMT
Author: sisbell
Date: Mon Jul 23 02:03:51 2007
New Revision: 558667

URL: http://svn.apache.org/viewvc?view=rev&rev=558667
Log:
Fixed bug dealing with not finding transitive dependencies that had been stored within the
rdf repo.

Modified:
    incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java
    incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImplTest.java
    incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test-1.0.0.xml
    incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test2-1.0.0.xml

Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java?view=diff&rev=558667&r1=558666&r2=558667
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java
(original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java
Mon Jul 23 02:03:51 2007
@@ -310,6 +310,8 @@
                                 Artifact assembly =
                                     ProjectFactory.createArtifactFrom( projectDependency,
artifactFactory );
                                 artifactDependencies.add( assembly );
+                                artifactDependencies.addAll(
+                                    this.storeProjectAndResolveDependencies( projectDependency,
artifactRepositories ) );
                             }
                         }
                         catch ( IOException e )

Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImplTest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImplTest.java?view=diff&rev=558667&r1=558666&r2=558667
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImplTest.java
(original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImplTest.java
Mon Jul 23 02:03:51 2007
@@ -116,11 +116,12 @@
         project1.setArtifactId( "NMaven.Plugin" );
         project1.setVersion( "0.14.0.0" );
 
-        project1.addProjectDependency( this.createProjectDependency( "NMaven", "NMaven.Test",
"1.0.0" ) );
+        project1.addProjectDependency( this.createProjectDependency( "NMaven", "NMaven.Test4",
"1.0.0" ) );
 
+        Set<Artifact> artifacts = null;
         try
         {
-            dao.storeProjectAndResolveDependencies( project1, new ArrayList<ArtifactRepository>()
);
+            artifacts = dao.storeProjectAndResolveDependencies( project1, new ArrayList<ArtifactRepository>()
);
         }
         catch ( java.io.IOException e )
         {
@@ -128,6 +129,13 @@
             fail( "Could not store the project: " + e.getMessage() );
         }
 
+        assertEquals( "Incorrect number of returned artifacts", 1, artifacts.size() );
+
+        Artifact artifact = (Artifact) artifacts.toArray()[0];
+        assertEquals( "Group Id is incorrect", "NMaven", artifact.getGroupId() );
+        assertEquals( "Artifact Id is incorrect", "NMaven.Test4", artifact.getArtifactId()
);
+        assertEquals( "Version is incorrect", "1.0.0", artifact.getVersion() );
+
         Project testProject = null;
         try
         {
@@ -144,7 +152,52 @@
         ProjectDependency projectDependency = (ProjectDependency) projectDependencies.toArray()[0];
         assertTrue( "Could not find required dependency. Found Dependency: GroupId = " +
             projectDependency.getGroupId() + ", Artifact Id = " + projectDependency.getArtifactId(),
-                    this.hasDependency( "NMaven", "NMaven.Test", "1.0.0", projectDependencies
) );
+                    this.hasDependency( "NMaven", "NMaven.Test4", "1.0.0", projectDependencies
) );
+    }
+
+    public void testStoreTransitiveDependency()
+    {
+        ProjectDao dao = this.createProjectDao();
+
+        Project project = new Project();
+        project.setGroupId( "NMaven" );
+        project.setArtifactId( "NMaven.Test" );
+        project.setVersion( "1.0.0" );
+
+        ProjectDependency test2 = createProjectDependency( "NMaven", "NMaven.Test2", "1.0.0"
);
+        project.addProjectDependency( test2 );
+        Set<Artifact> artifacts = null;
+
+        try
+        {
+            artifacts = dao.storeProjectAndResolveDependencies( project, new ArrayList<ArtifactRepository>()
);
+        }
+        catch ( java.io.IOException e )
+        {
+            e.printStackTrace();
+            fail( "Could not store the project: " + e.getMessage() );
+        }
+        assertEquals( "Incorrect number of returned artifacts", 3, artifacts.size() );
+
+        Project testProject = null;
+        try
+        {
+            testProject = dao.getProjectFor( "NMaven", "NMaven.Test", "1.0.0", null, null
);
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+            fail( "Could not retrieve the project: " + e.getMessage() );
+        }
+
+        Set<ProjectDependency> projectDependencies =
+            ( (ProjectDependency) testProject.getProjectDependencies().toArray()[0] ).getProjectDependencies();
+        assertEquals( "Incorrect number of dependencies", 1, projectDependencies.size() );
+
+        ProjectDependency projectDependency = (ProjectDependency) projectDependencies.toArray()[0];
+        assertTrue( "Could not find required dependency. Found Dependency: GroupId = " +
+            projectDependency.getGroupId() + ", Artifact Id = " + projectDependency.getArtifactId(),
+                    this.hasDependency( "NMaven", "NMaven.Test3", "1.0.0", projectDependencies
) );
     }
 
     public void testSingleStore()

Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test-1.0.0.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test-1.0.0.xml?view=diff&rev=558667&r1=558666&r2=558667
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test-1.0.0.xml
(original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test-1.0.0.xml
Mon Jul 23 02:03:51 2007
@@ -23,6 +23,11 @@
   <artifactId>NMaven.Test</artifactId>
   <version>1.0.0</version>
   <name>NMaven.Test</name>
-  <description>
-  </description>
+  <dependencies>
+    <dependency>
+      <groupId>NMaven</groupId>
+      <artifactId>NMaven.Test2</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+  </dependencies>
 </project>

Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test2-1.0.0.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test2-1.0.0.xml?view=diff&rev=558667&r1=558666&r2=558667
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test2-1.0.0.xml
(original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/resources/NMaven-NMaven.Test2-1.0.0.xml
Mon Jul 23 02:03:51 2007
@@ -28,7 +28,7 @@
   <dependencies>
     <dependency>
       <groupId>NMaven</groupId>
-      <artifactId>NMaven.Test4</artifactId>
+      <artifactId>NMaven.Test3</artifactId>
       <version>1.0.0</version>
     </dependency>
   </dependencies>  



Mime
View raw message