continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r170898 - in /maven/continuum/trunk/continuum-core/src: main/java/org/apache/maven/continuum/store/ test/java/org/apache/maven/continuum/buildqueue/ test/java/org/apache/maven/continuum/notification/ test/java/org/apache/maven/continuum/store/ test/resources/org/apache/maven/continuum/buildqueue/
Date Thu, 19 May 2005 09:32:44 GMT
Author: trygvis
Date: Thu May 19 02:32:43 2005
New Revision: 170898

URL: http://svn.apache.org/viewcvs?rev=170898&view=rev
Log:
o Fixing broken tests.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
    maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/buildqueue/BuildQueueTest.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java?rev=170898&r1=170897&r2=170898&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
Thu May 19 02:32:43 2005
@@ -42,7 +42,7 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: ModelloJPoxContinuumStore.java,v 1.2 2005/04/03 21:31:33 trygvis Exp $
+ * @version $Id$
  */
 public class ModelloJPoxContinuumStore
     extends AbstractContinuumStore
@@ -98,12 +98,12 @@
     {
         if ( getProjectByName( name ) != null )
         {
-            throw new ContinuumStoreException( "A project with the specified name already
exist." );
+            throw new ContinuumStoreException( "A project with the name '" + name + "' already
exist." );
         }
 
         if ( getProjectByScmUrl( scmUrl ) != null )
         {
-            throw new ContinuumStoreException( "A project with the specified scm url already
exist." );
+            throw new ContinuumStoreException( "A project with the scm url '" + scmUrl +
"' already exist." );
         }
 
         ContinuumProject project = new ContinuumProject();

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java?rev=170898&r1=170897&r2=170898&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
Thu May 19 02:32:43 2005
@@ -25,7 +25,7 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: BuildQueueTest.java,v 1.1.1.1 2005/03/29 20:42:04 trygvis Exp $
+ * @version $Id$
  */
 public class BuildQueueTest
     extends PlexusTestCase
@@ -47,9 +47,9 @@
     public void testTestTheQueueWithASingleProject()
         throws Exception
     {
-        String name = "Project 1";
+        System.err.println( this.getClassLoader() );
 
-        String projectId = ModelloJPoxContinuumStoreTest.addProject( store, name );
+        String projectId = ModelloJPoxContinuumStoreTest.addProject( store, "Build Queue
Project 1", "1" );
 
         buildProject( projectId, false );
 
@@ -72,13 +72,9 @@
     public void testTheQueueWithMultipleProjects()
         throws Exception
     {
-        String name1 = "Project 1";
+        String projectId1 = ModelloJPoxContinuumStoreTest.addProject( store, "Build Queue
Project 2", "foo" );
 
-        String name2 = "Project 2";
-
-        String projectId1 = ModelloJPoxContinuumStoreTest.addProject( store, name1 );
-
-        String projectId2 = ModelloJPoxContinuumStoreTest.addProject( store, name2 );
+        String projectId2 = ModelloJPoxContinuumStoreTest.addProject( store, "Build Queue
Project 3", "bar" );
 
         buildProject( projectId1, false );
 
@@ -112,9 +108,9 @@
     public void testTestTheQueueWithASingleProjectAndForcedBuilds()
         throws Exception
     {
-        String name = "Project 1";
+        String name = "Build Queue Project 4";
 
-        String projectId = ModelloJPoxContinuumStoreTest.addProject( store, name );
+        String projectId = ModelloJPoxContinuumStoreTest.addProject( store, name, "4" );
 
         buildProject( projectId, true );
 

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java?rev=170898&r1=170897&r2=170898&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
Thu May 19 02:32:43 2005
@@ -23,7 +23,7 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: ContinuumNotificationDispatcherTest.java,v 1.2 2005/04/07 23:27:40 trygvis
Exp $
+ * @version $Id$
  */
 public class ContinuumNotificationDispatcherTest
     extends PlexusTestCase
@@ -36,9 +36,9 @@
 
         ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.ROLE );
 
-        String projectId = ModelloJPoxContinuumStoreTest.addProject( store, "Test Project"
);
-
-//        store.setBuildSignalled( projectId );
+        String projectId = ModelloJPoxContinuumStoreTest.addProject( store,
+                                                                     "Notification Dispatcher
Test Project",
+                                                                     "scm:notification/dispatcher"
);
 
         store.setIsUpdating( projectId );
 

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java?rev=170898&r1=170897&r2=170898&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
Thu May 19 02:32:43 2005
@@ -25,6 +25,7 @@
 import java.util.Properties;
 
 import org.apache.maven.continuum.execution.shell.ShellBuildResult;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumJPoxStore;
@@ -39,7 +40,7 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: ModelloJPoxContinuumStoreTest.java,v 1.2 2005/04/07 23:27:41 trygvis Exp
$
+ * @version $Id$
  */
 public class ModelloJPoxContinuumStoreTest
     extends PlexusTestCase
@@ -205,15 +206,21 @@
     {
         ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.ROLE );
 
-        String name = "Test Project";
-        String scmUrl = "scm:local:src/test/repo";
+        String name = "Test Project 2";
+        String scmUrl = "scm:local:jalla";
         String nagEmailAddress = "foo@bar.com";
         String version = "1.0";
         String builderId = "maven2";
         String workingDirectory = "/tmp";
         Properties properties = new Properties();
 
-        String projectId = store.addProject( name, scmUrl, nagEmailAddress, version, builderId,
workingDirectory, properties );
+        String projectId = store.addProject( name,
+                                             scmUrl,
+                                             nagEmailAddress,
+                                             version,
+                                             builderId,
+                                             workingDirectory,
+                                             properties );
 
         // ----------------------------------------------------------------------
         //
@@ -286,17 +293,23 @@
         ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.ROLE );
 
         String name1 = "Test Project 1";
-        String scmUrl1 = "scm:local:src/test/repo";
+        String scmUrl1 = "scm:local:src/test/repo/foo";
         String nagEmailAddress1 = "foo@bar.com";
         String version1 = "1.0";
         String builderId1 = "maven2";
         String workingDirectory1 = "/tmp";
         Properties configuration1 = new Properties();
 
-        String id1 = store.addProject( name1, scmUrl1, nagEmailAddress1, version1, builderId1,
workingDirectory1, configuration1 );
+        String id1 = store.addProject( name1,
+                                       scmUrl1,
+                                       nagEmailAddress1,
+                                       version1,
+                                       builderId1,
+                                       workingDirectory1,
+                                       configuration1 );
 
         String name2 = "Test Project 2";
-        String scmUrl2 = "scm:local:src/test/repo";
+        String scmUrl2 = "scm:local:src/test/repo/bar";
         String nagEmailAddress2 = "foo@bar.com";
         String version2 = "1.0";
         String builderId2 = "maven2";
@@ -334,7 +347,7 @@
     {
         ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.ROLE );
 
-        String projectId = addProject( "Test Project" );
+        String projectId = addProject( "Update Test Project", "scm:update-project" );
 
         ContinuumProject project = store.getProject( projectId );
 
@@ -366,7 +379,7 @@
     {
         ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.ROLE );
 
-        String projectId = addProject( "Test Project" );
+        String projectId = addProject( "Remove Test Project", "scm:remove-project" );
 
         store.setIsUpdating( projectId );
 
@@ -398,28 +411,26 @@
         // Test projects with duplicate names
         // ----------------------------------------------------------------------
 
-        String projectId = addProject( "trygve" );
+        String projectId = addProject( "trygve", "trygve-foo" );
 
         assertEquals( projectId, store.getProjectByName( "trygve" ).getId() );
 
         try
         {
-            addProject( "trygve" );
+            addProject( "trygve", "trygve-bar" );
 
             fail( "Expected a exception" );
         }
         catch( ContinuumStoreException e )
         {
-            // expected
+            assertTrue( e.getMessage().indexOf( "project with the name" ) != -1 );
         }
 
-        ContinuumProject project = makeStubProject( "brett" );
-
-        project.setScmUrl( "foo" );
+        ContinuumProject project = makeStubProject( "brett", "brett-bar" );
 
         addProject( project );
 
-        assertNotNull( store.getProjectByScmUrl( "foo" ) );
+        assertNotNull( store.getProjectByScmUrl( "brett-bar" ) );
 
         try
         {
@@ -431,7 +442,7 @@
         }
         catch ( ContinuumStoreException e )
         {
-            // expected
+            assertTrue( e.getMessage().indexOf( "project with the scm url" ) != -1 );
         }
     }
 
@@ -448,7 +459,7 @@
 
         jdoFactory.getPersistenceManagerFactory().close();
 
-        String projectId = addProject( "Test Project" );
+        String projectId = addProject( "Build Test Project", "scm:build" );
 
         store.setIsUpdating( projectId );
 
@@ -482,19 +493,19 @@
         // Set up projects
         // ----------------------------------------------------------------------
 
-        String projectId = addProject( "Test Project" );
+        String projectId = addProject( "Association Test Project", "scm:association" );
 
         store.setIsUpdating( projectId );
 
         store.setUpdateDone( projectId );
 
-        String projectIdFoo = addProject( "Foo Project" );
+        String projectIdFoo = addProject( "Foo Project", "scm:association-foo" );
 
         store.setIsUpdating( projectIdFoo );
 
         store.setUpdateDone( projectIdFoo );
 
-        String projectIdBar = addProject( "Bar Project" );
+        String projectIdBar = addProject( "Bar Project", "scm:association-bar" );
 
         store.setIsUpdating( projectIdBar );
 
@@ -551,7 +562,7 @@
         //
         // ----------------------------------------------------------------------
 
-        String projectId = addProject( "Test Project" );
+        String projectId = addProject( "Build Result Project", "scm:build/result" );
 
         store.setIsUpdating( projectId );
 
@@ -639,22 +650,41 @@
     }
 
     // ----------------------------------------------------------------------
-    // Utility methods
+    // Private utility methods
     // ----------------------------------------------------------------------
 
-    public static ContinuumProject makeStubProject( String name )
+    private String addProject( String name, String scmUrl )
+        throws Exception
     {
-        ContinuumProject project = new ContinuumProject();
+        return addProject( (ContinuumStore) lookup( ContinuumStore.ROLE ),
+                           makeStubProject( name, scmUrl ) );
+    }
 
-        project.setName( name );
-        project.setScmUrl( "scm:local:src/test/repo" );
-        project.setNagEmailAddress( "foo@bar.com" );
-        project.setVersion( "1.0" );
-        project.setExecutorId( "maven2" );
-        project.setWorkingDirectory( "/tmp" );
-        project.setConfiguration( new Properties() );
+    private String addProject( ContinuumProject project )
+        throws Exception
+    {
+        return addProject( (ContinuumStore) lookup( ContinuumStore.ROLE ), project );
+    }
 
-        return project;
+    // ----------------------------------------------------------------------
+    // Public utility methods
+    // ----------------------------------------------------------------------
+
+//    public static ContinuumProject makeStubProject( String name )
+//    {
+//        return makeStubProject( name,
+//                                "scm:local:src/test/repo" );
+//    }
+
+    public static ContinuumProject makeStubProject( String name, String scmUrl )
+    {
+        return makeProject( name,
+                            scmUrl,
+                            "foo@bar.com",
+                            "1.0",
+                            ContinuumBuildExecutor.MAVEN_TWO_EXECUTOR_ID,
+                            "/tmp",
+                            new Properties() );
     }
 
     public static ContinuumProject makeProject( String name,
@@ -678,18 +708,6 @@
         return project;
     }
 
-    private String addProject( String name )
-        throws Exception
-    {
-        return addProject( (ContinuumStore) lookup( ContinuumStore.ROLE ), makeStubProject(
name ) );
-    }
-
-    private String addProject( ContinuumProject project )
-        throws Exception
-    {
-        return addProject( (ContinuumStore) lookup( ContinuumStore.ROLE ), project );
-    }
-
     public static String addProject( ContinuumStore store, ContinuumProject project )
         throws Exception
     {
@@ -703,10 +721,16 @@
                            project.getConfiguration() );
     }
 
-    public static String addProject( ContinuumStore store, String name )
+//    public static String addProject( ContinuumStore store, String name )
+//        throws Exception
+//    {
+//        return addProject( store, makeStubProject( name ) );
+//    }
+
+    public static String addProject( ContinuumStore store, String name, String scmUrl )
         throws Exception
     {
-        return addProject( store, makeStubProject( name ) );
+        return addProject( store, makeStubProject( name, scmUrl ) );
     }
 
     public static String addProject( ContinuumStore store,

Modified: maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/buildqueue/BuildQueueTest.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/buildqueue/BuildQueueTest.xml?rev=170898&r1=170897&r2=170898&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/buildqueue/BuildQueueTest.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/buildqueue/BuildQueueTest.xml
Thu May 19 02:32:43 2005
@@ -15,7 +15,7 @@
           </property>
           <property>
             <name>javax.jdo.option.ConnectionURL</name>
-            <value>jdbc:hsqldb:mem:.</value>
+            <value>jdbc:hsqldb:.</value>
           </property>
           <property>
             <name>javax.jdo.option.ConnectionUserName</name>
@@ -25,24 +25,6 @@
             <name>javax.jdo.option.ConnectionPassword</name>
             <value></value>
           </property>
-<!--
-          <property>
-            <name>javax.jdo.option.ConnectionDriverName</name>
-            <value>org.postgresql.Driver</value>
-          </property>
-          <property>
-            <name>javax.jdo.option.ConnectionURL</name>
-            <value>jdbc:postgresql://localhost/continuum</value>
-          </property>
-          <property>
-            <name>javax.jdo.option.ConnectionUserName</name>
-            <value>trygvis</value>
-          </property>
-          <property>
-            <name>javax.jdo.option.ConnectionPassword</name>
-            <value></value>
-          </property>
- -->
           <property>
             <name>org.jpox.autoCreateSchema</name>
             <value>true</value>



Mime
View raw message