continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ken...@apache.org
Subject svn commit: r434572 - in /maven/continuum/trunk/continuum-core/src/test: java/org/apache/maven/continuum/ java/org/apache/maven/continuum/notification/mail/ java/org/apache/maven/continuum/project/builder/maven/ resources/projects/continuum/ resources/...
Date Thu, 24 Aug 2006 23:50:01 GMT
Author: kenney
Date: Thu Aug 24 16:50:00 2006
New Revision: 434572

URL: http://svn.apache.org/viewvc?rev=434572&view=rev
Log:
Enabled the notifiers in the test projects and added some unit tests
for parents and dependencies.

Modified:
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumUnitTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
    maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-irc/pom.xml
    maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-jabber/pom.xml
    maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/pom.xml
    maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumUnitTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumUnitTest.java?rev=434572&r1=434571&r2=434572&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumUnitTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumUnitTest.java
Thu Aug 24 16:50:00 2006
@@ -25,7 +25,7 @@
 
 /**
  * Test for {@link DefaultContinuum}.
- * 
+ *
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
  * @version $Id$
  */
@@ -42,7 +42,7 @@
 
         Mock actionManagerMock = new Mock( ActionManager.class );
 
-        actionManagerMock.expects( once() ).will( returnValue( (Action) actionMock.proxy()
) );
+        actionManagerMock.expects( once() ).will( returnValue( actionMock.proxy() ) );
 
         continuum.setActionManager( (ActionManager) actionManagerMock.proxy() );
 

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java?rev=434572&r1=434571&r2=434572&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java
Thu Aug 24 16:50:00 2006
@@ -1,6 +1,3 @@
-/*
- * Copyright (c) 2005 Your Corporation. All Rights Reserved.
- */
 package org.apache.maven.continuum.notification.mail;
 
 import junit.framework.TestCase;

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?rev=434572&r1=434571&r2=434572&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
Thu Aug 24 16:50:00 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectDependency;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
@@ -30,6 +31,7 @@
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -42,8 +44,8 @@
     public void testGetEmailAddressWhenTypeIsSetToEmail()
         throws Exception
     {
-        ContinuumProjectBuilder projectBuilder =
-            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID
);
+        ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE,
+                                                                                   MavenTwoContinuumProjectBuilder.ID
);
 
         File pom = getTestFile( "src/test/repository/maven-builder-helper-1.xml" );
 
@@ -73,8 +75,8 @@
     public void testGetEmailAddressWhenTypeIsntSet()
         throws Exception
     {
-        ContinuumProjectBuilder projectBuilder =
-            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID
);
+        ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE,
+                                                                                   MavenTwoContinuumProjectBuilder.ID
);
 
         File pom = getTestFile( "src/test/repository/maven-builder-helper-2.xml" );
 
@@ -104,8 +106,8 @@
     public void testGetScmUrlWithParams()
         throws Exception
     {
-        ContinuumProjectBuilder projectBuilder =
-            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID
);
+        ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE,
+                                                                                   MavenTwoContinuumProjectBuilder.ID
);
 
         File pom = getTestFile( "src/test/repository/maven-builder-helper-3.xml" );
 
@@ -143,19 +145,26 @@
     public void testCreateProjectsWithModules()
         throws Exception
     {
-        ContinuumProjectBuilder projectBuilder =
-            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID
);
+        ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE,
+                                                                                   MavenTwoContinuumProjectBuilder.ID
);
 
-        String url = getTestFile( "src/test/resources/projects/continuum/pom.xml" ).toURL().toExternalForm();
+        URL url = getClass().getClassLoader().getResource( "projects/continuum/pom.xml" );
 
         // Eat System.out
         PrintStream ps = System.out;
 
-        System.setOut( new PrintStream( new ByteArrayOutputStream() ) );
+        ContinuumProjectBuildingResult result;
 
-        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
new URL( url ), null, null );
+        try
+        {
+            System.setOut( new PrintStream( new ByteArrayOutputStream() ) );
 
-        System.setOut( ps );
+            result = projectBuilder.buildProjectsFromMetadata( url, null, null );
+        }
+        finally
+        {
+            System.setOut( ps );
+        }
 
         assertNotNull( result );
 
@@ -185,7 +194,7 @@
 
         assertEquals( "projectGroup.description", "Continuum Project Description", projectGroup.getDescription()
);
 
-//        assertEquals( "projectGroup.url", "http://cvs.continuum.codehaus.org/", projectGroup.getUrl()
);
+        // assertEquals( "projectGroup.url", "http://cvs.continuum.codehaus.org/", projectGroup.getUrl()
);
 
         // ----------------------------------------------------------------------
         // Assert the projects built
@@ -193,7 +202,7 @@
 
         assertNotNull( result.getProjects() );
 
-        assertEquals( 6, result.getProjects().size() );
+        assertEquals( 9, result.getProjects().size() );
 
         Map projects = new HashMap();
 
@@ -211,6 +220,45 @@
         assertMavenTwoProject( "Continuum Plexus Application", projects );
         assertMavenTwoProject( "Continuum Web", projects );
         assertMavenTwoProject( "Continuum XMLRPC Interface", projects );
+        assertMavenTwoProject( "Continuum Notifiers", projects );
+        assertMavenTwoProject( "Continuum IRC Notifier", projects );
+        assertMavenTwoProject( "Continuum Jabber Notifier", projects );
+
+        assertEquals( "continuum-parent-notifiers",
+                      ( (Project) projects.get( "Continuum IRC Notifier" ) ).getParent().getArtifactId()
);
+
+        assertEquals( "continuum-parent-notifiers",
+                      ( (Project) projects.get( "Continuum Jabber Notifier" ) ).getParent().getArtifactId()
);
+
+        assertDependency( "Continuum Model", "Continuum Web", projects );
+
+    }
+
+    private void assertDependency( String dep, String proj, Map projects )
+    {
+        Project p = (Project) projects.get( proj );
+
+        Project dependency = (Project) projects.get( dep );
+
+        assertNotNull( p );
+
+        assertNotNull( dependency );
+
+        assertNotNull( p.getDependencies() );
+
+        for ( Object d : p.getDependencies() )
+        {
+            ProjectDependency pd = (ProjectDependency) d;
+
+            if ( pd.getArtifactId().equals( dependency.getArtifactId() )
+                && pd.getGroupId().equals( dependency.getGroupId() )
+                && pd.getVersion().equals( dependency.getVersion() ) )
+            {
+                return;
+            }
+        }
+
+        assertFalse( true );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-irc/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-irc/pom.xml?rev=434572&r1=434571&r2=434572&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-irc/pom.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-irc/pom.xml
Thu Aug 24 16:50:00 2006
@@ -12,6 +12,7 @@
     <dependency>
       <groupId>org.apache.maven.continuum</groupId>
       <artifactId>continuum-notifier-api</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>

Modified: maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-jabber/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-jabber/pom.xml?rev=434572&r1=434571&r2=434572&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-jabber/pom.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/continuum-notifier-jabber/pom.xml
Thu Aug 24 16:50:00 2006
@@ -12,6 +12,7 @@
     <dependency>
       <groupId>org.apache.maven.continuum</groupId>
       <artifactId>continuum-notifier-api</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>

Modified: maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/pom.xml?rev=434572&r1=434571&r2=434572&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/pom.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/continuum-notifiers/pom.xml
Thu Aug 24 16:50:00 2006
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.continuum</groupId>
     <artifactId>continuum-parent</artifactId>
-    <version>1.0-alpha-4</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>continuum-parent-notifiers</artifactId>
   <version>1.0-alpha-4</version>
@@ -13,10 +13,12 @@
     <dependency>
       <groupId>org.apache.maven.continuum</groupId>
       <artifactId>continuum-api</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>
       <artifactId>plexus-notification</artifactId>
+      <version>1.0-alpha-5</version>
     </dependency>
   </dependencies>
   <modules>

Modified: maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml?rev=434572&r1=434571&r2=434572&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml (original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml Thu
Aug 24 16:50:00 2006
@@ -93,6 +93,7 @@
     <module>continuum-plexus-application</module>
     <module>continuum-web</module>
     <module>continuum-xmlrpc</module>
+    <module>continuum-notifiers</module>
     <module>I'm-not-here-project</module>
   </modules>
 </project>



Mime
View raw message