continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r693692 - in /continuum/branches/continuum-transient-state: continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/ continuum-data-management/data-management-jdo/src/test/resources/ continuum-store/src/test/java/org/apach...
Date Wed, 10 Sep 2008 03:38:28 GMT
Author: ctan
Date: Tue Sep  9 20:38:28 2008
New Revision: 693692

URL: http://svn.apache.org/viewvc?rev=693692&view=rev
Log:
fixed test cases

Modified:
    continuum/branches/continuum-transient-state/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
    continuum/branches/continuum-transient-state/continuum-data-management/data-management-jdo/src/test/resources/expected.xml
    continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
    continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
    continuum/branches/continuum-transient-state/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java

Modified: continuum/branches/continuum-transient-state/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-transient-state/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java?rev=693692&r1=693691&r2=693692&view=diff
==============================================================================
--- continuum/branches/continuum-transient-state/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
(original)
+++ continuum/branches/continuum-transient-state/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
Tue Sep  9 20:38:28 2008
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.notification.MessageContext;
@@ -50,8 +51,9 @@
         MailContinuumNotifier notifier = (MailContinuumNotifier) lookup( Notifier.class.getName(),
"mail" );
         notifier.setToOverride( "recipient@host.com" );
 
-        Project project = makeStubProject( "Test Project" );
-        project.setGroupId( "foo.bar" );
+        ProjectGroup group = createStubProjectGroup( "foo.bar", "" );
+
+        Project project = addProject( "Test Project", group );
 
         BuildResult build = makeBuild( ContinuumProjectState.OK );
 
@@ -65,8 +67,9 @@
     public void testFailedBuild()
         throws Exception
     {
-        Project project = makeStubProject( "Test Project" );
-        project.setGroupId( "foo.bar" );
+        ProjectGroup group = createStubProjectGroup( "foo.bar", "" );
+
+        Project project = addProject( "Test Project", group );
 
         BuildResult build = makeBuild( ContinuumProjectState.FAILED );
 
@@ -80,8 +83,9 @@
     public void testErrorenousBuild()
         throws Exception
     {
-        Project project = makeStubProject( "Test Project" );
-        project.setGroupId( "foo.bar" );
+        ProjectGroup group = createStubProjectGroup( "foo.bar", "" );
+
+        Project project = addProject( "Test Project", group );
 
         BuildResult build = makeBuild( ContinuumProjectState.ERROR );
 

Modified: continuum/branches/continuum-transient-state/continuum-data-management/data-management-jdo/src/test/resources/expected.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-transient-state/continuum-data-management/data-management-jdo/src/test/resources/expected.xml?rev=693692&r1=693691&r2=693692&view=diff
==============================================================================
--- continuum/branches/continuum-transient-state/continuum-data-management/data-management-jdo/src/test/resources/expected.xml
(original)
+++ continuum/branches/continuum-transient-state/continuum-data-management/data-management-jdo/src/test/resources/expected.xml
Tue Sep  9 20:38:28 2008
@@ -542,7 +542,8 @@
   </directoryPurgeConfigurations>
   <projectScmRoots>
     <projectScmRoot>
-      <scmUrl>scmUrl1</scmUrl>
+      <id>1</id>
+      <scmRootAddress>scmRootAddress1</scmRootAddress>
       <state>1</state>
       <error>error1</error>
       <projectGroup id="2"></projectGroup>

Modified: continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java?rev=693692&r1=693691&r2=693692&view=diff
==============================================================================
--- continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
(original)
+++ continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
Tue Sep  9 20:38:28 2008
@@ -594,7 +594,7 @@
             systemConfiguration = systemConfigurationDao.addSystemConfiguration( systemConfiguration
);
         }
         
-        testProjectScmRoot = createTestProjectScmRoot( "scmRootAddress1", 1, "error1", group
);
+        testProjectScmRoot = createTestProjectScmRoot( "scmRootAddress1", 1, 0, "error1",
group );
         
         if ( addToStore )
         {
@@ -1377,13 +1377,14 @@
                       actualConfig.isEnabled() );
     }
     
-    protected static ProjectScmRoot createTestProjectScmRoot( String scmRootAddress, int
state, 
+    protected static ProjectScmRoot createTestProjectScmRoot( String scmRootAddress, int
state, int oldState,
                                                               String error, ProjectGroup
group )
     {
         ProjectScmRoot projectScmRoot = new ProjectScmRoot();
         
         projectScmRoot.setScmRootAddress( scmRootAddress );
         projectScmRoot.setState( state );
+        projectScmRoot.setOldState( oldState );
         projectScmRoot.setError( error );
         projectScmRoot.setProjectGroup( group );
         
@@ -1392,9 +1393,11 @@
     
     protected static void assertProjectScmRootEquals( ProjectScmRoot expectedConfig, ProjectScmRoot
actualConfig )
     {
+        assertEquals( "compare project scm root - id", expectedConfig.getId(), actualConfig.getId()
);
         assertEquals( "compare project scm root - scmUrl", expectedConfig.getScmRootAddress(),

                                                            actualConfig.getScmRootAddress()
);
         assertEquals( "compare project scm root - state", expectedConfig.getState(), actualConfig.getState()
);
+        assertEquals( "compare project scm root - oldState", expectedConfig.getOldState(),
actualConfig.getOldState() );
         assertEquals( "compare project scm root - error", expectedConfig.getError(), actualConfig.getError()
);
     }
 

Modified: continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java?rev=693692&r1=693691&r2=693692&view=diff
==============================================================================
--- continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
(original)
+++ continuum/branches/continuum-transient-state/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
Tue Sep  9 20:38:28 2008
@@ -1254,7 +1254,7 @@
         throws Exception
     {
         ProjectGroup projectGroup = projectGroupDao.getProjectGroup( testProjectGroup2.getId()
);
-        ProjectScmRoot projectScmRoot = createTestProjectScmRoot( "scmUrl", 1, "", projectGroup
);
+        ProjectScmRoot projectScmRoot = createTestProjectScmRoot( "scmRootAddress", 1, 0,
"", projectGroup );
         
         projectScmRoot = projectScmRootDao.addProjectScmRoot( projectScmRoot );
         

Modified: continuum/branches/continuum-transient-state/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-transient-state/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=693692&r1=693691&r2=693692&view=diff
==============================================================================
--- continuum/branches/continuum-transient-state/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
(original)
+++ continuum/branches/continuum-transient-state/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
Tue Sep  9 20:38:28 2008
@@ -420,8 +420,33 @@
 
         projectGroup.setName( name );
 
+        projectGroup.setGroupId( name );
+        
         projectGroup.setDescription( description );
 
         return projectGroup;
     }
+
+    public Project addProject( String name, ProjectGroup group )
+        throws Exception
+    {
+        Project project = makeStubProject( name );
+
+        project.setGroupId( group.getGroupId() );
+
+        group.addProject( project );
+
+        try
+        {
+            projectGroupDao.getProjectGroup( group.getId() );
+
+            projectGroupDao.updateProjectGroup( group );
+        }
+        catch ( ContinuumObjectNotFoundException e )
+        {
+            projectGroupDao.addProjectGroup( group );
+        }
+        
+        return projectDao.getProject( project.getId() );
+    }
 }



Mime
View raw message