continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r219972 - /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java
Date Thu, 21 Jul 2005 01:17:33 GMT
Author: jvanzyl
Date: Wed Jul 20 18:17:32 2005
New Revision: 219972

URL: http://svn.apache.org/viewcvs?rev=219972&view=rev
Log:
test for build settings <--> project group interaction

Modified:
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java?rev=219972&r1=219971&r2=219972&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/NewModelTest.java
Wed Jul 20 18:17:32 2005
@@ -242,6 +242,72 @@
         assertNotNull( buildGroup );
     }
 
+    public void testBuildSettingsAdditionAndRemovalFromProjectGroup()
+        throws Exception
+    {
+        // create buildSettings
+        ContinuumBuildSettings buildSettings = createStubBuildSettings( "buildSettings1",
"1.3" );
+
+        String buildSettingsId = getStore().addBuildSettings( buildSettings );
+
+        buildSettings = getStore().getBuildSettings( buildSettingsId );
+
+        // create projectGroup
+        ContinuumProjectGroup projectGroup = createStubProjectGroup( "projectGroup1", "projectGroup1"
);
+
+        String projectGroupId = getStore().addProjectGroup( projectGroup );
+
+        projectGroup = getStore().getProjectGroup( projectGroupId );
+
+        // add build group
+        buildSettings.addProjectGroup( projectGroup );
+
+        // update buildSettings
+        getStore().updateBuildSettings( buildSettings );
+
+        // retrieve buildSettings
+        buildSettings = getStore().getBuildSettings( buildSettingsId );
+
+        assertNotNull( buildSettings );
+
+        // get projectGroups out of the buildSettings
+        Set projectGroups = buildSettings.getProjectGroups();
+
+        assertEquals( 1, projectGroups.size() );
+
+        // get individual build group
+        projectGroup = (ContinuumProjectGroup) buildSettings.getProjectGroups().iterator().next();
+
+        // test values within the build group
+        assertEquals( "projectGroup1", projectGroup.getName() );
+
+        // ----------------------------------------------------------------------
+        // Now lookup the build group on its own and make sure the build settings are
+        // present within the build build gropu.
+        // ----------------------------------------------------------------------
+
+        projectGroup = getStore().getProjectGroup( projectGroupId );
+
+        assertNotNull( projectGroup );
+
+        buildSettings = (ContinuumBuildSettings) projectGroup.getBuildSettings().iterator().next();
+
+        assertEquals( "buildSettings1", buildSettings.getName() );
+
+        // ----------------------------------------------------------------------
+        // Now delete the buildSettings from the getStore() and make sure that the build
group
+        // still remains in the getStore().
+        // ----------------------------------------------------------------------
+
+        buildSettings = getStore().getBuildSettings( buildSettingsId );
+
+        getStore().removeBuildSettings( buildSettings.getId() );
+
+        projectGroup = getStore().getProjectGroup( projectGroupId );
+
+        assertNotNull( projectGroup );
+    }
+
     // ----------------------------------------------------------------------
     // Simple utils
     // ----------------------------------------------------------------------



Mime
View raw message