continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1367567 - in /continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test: ./ parent/
Date Tue, 31 Jul 2012 14:15:51 GMT
Author: brett
Date: Tue Jul 31 14:15:51 2012
New Revision: 1367567

URL: http://svn.apache.org/viewvc?rev=1367567&view=rev
Log:
fix maven two tests, split out distributed tests

Added:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
      - copied, changed from r1367507, continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java

Copied: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
(from r1367507, continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java)
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java?p2=continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java&p1=continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java&r1=1367507&r2=1367567&rev=1367567&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
Tue Jul 31 14:15:51 2012
@@ -20,6 +20,8 @@ package org.apache.continuum.web.test;
  */
 
 import org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 /**
@@ -28,332 +30,59 @@ import org.testng.annotations.Test;
  * @author José Morales Martínez
  * @version $Id$
  */
-@Test( groups = { "mavenTwoProject" } )
-public class MavenTwoProjectTest
+@Test( groups = { "distributed" } )
+public class DistributedBuildTest
     extends AbstractAdminTest
 {
-
-    public void testAddMavenTwoProjectWithNoDefaultBuildDefinitionInTemplate()
-        throws Exception
-    {
-        String M2_POM_URL = getProperty( "M2_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-
-        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
-        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
-        String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_PROJ_GRP_SCM_ROOT_URL" );
-
-        removeDefaultBuildDefinitionFromTemplate( "maven2" );
-
-        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
-
-        assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
-
-        assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
-
-        // Delete project group
-        removeProjectGroup( M2_PROJ_GRP_NAME );
-
-        // Re-add default build definition of template
-        addDefaultBuildDefinitionFromTemplate( "maven2" );
-    }
-
-    @Test( dependsOnMethods = { "testAddMavenTwoProjectWithNoDefaultBuildDefinitionInTemplate"
} )
-    public void testAddMavenTwoProject()
-        throws Exception
-    {
-        String M2_POM_URL = getProperty( "M2_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-
-        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
-        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
-        String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_PROJ_GRP_SCM_ROOT_URL" );
-        
-        // Enter values into Add Maven Two Project fields, and submit
-        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
-        // Wait Struct Listener
-        assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
-
-        assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
-    }
-
-    /**
-     * Test flat multi module project with names that start with the same letter
-     */
-    public void testAddMavenTwoProjectModuleNameWithSameLetter()
-        throws Exception
-    {
-        String M2_POM_URL = getProperty( "M2_SAME_LETTER_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-
-        String M2_PROJ_GRP_NAME = getProperty( "M2_SAME_LETTER_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_SAME_LETTER_PROJ_GRP_ID" );
-        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_SAME_LETTER_PROJ_GRP_DESCRIPTION"
);
-
-        String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_SAME_LETTER_PROJ_GRP_SCM_ROOT_URL"
);
-
-        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
-
-        assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
-
-        assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
-    }
-
-    @Test( dependsOnMethods = { "testAddProjectGroup" } )
-    public void testAddMavenTwoProjectFromRemoteSourceToNonDefaultProjectGroup()
-        throws Exception
-    {
-        String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
-        String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
-        String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
-        String TEST_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_PROJ_GRP_SCM_ROOT_URL" );
-
-        String M2_POM_URL = getProperty( "M2_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-        
-        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, TEST_PROJ_GRP_NAME,
true );
-
-        assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
-
-        assertTextPresent( TEST_PROJ_GRP_SCM_ROOT_URL );
-    }
-
-    @Test( dependsOnMethods = { "testAddMavenTwoProjectFromRemoteSourceToNonDefaultProjectGroup"
} )
-    public void testMoveProject()
-        throws Exception
-    {
-        String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
-        String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
-        String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
-        String DEFAULT_PROJ_GRP_NAME = getProperty( "DEFAULT_PROJ_GRP_NAME" );
-        String DEFAULT_PROJ_GRP_ID = getProperty( "DEFAULT_PROJ_GRP_NAME" );
-        String DEFAULT_PROJ_GRP_DESCRIPTION = getProperty( "DEFAULT_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
-
-        // TODO: need to wait for checkout to complete. Can we add a special IT type of project
that doesn't require checkout?
-        //       currently we get away with it due to the usualy duration between the dependant
test and this test
-        // move the project of the test project group to the default project group
-        moveProjectToProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
M2_PROJ_GRP_NAME,
-                                   DEFAULT_PROJ_GRP_NAME );
-        showProjectGroup( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION
);
-        assertTextPresent( "Member Projects" );
-        // Restore project to test project group
-        moveProjectToProjectGroup( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION,
-                                   M2_PROJ_GRP_NAME, TEST_PROJ_GRP_NAME );
-        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
-        assertTextPresent( "Member Projects" );
-    }
-
-    /**
-     * Test invalid pom url
-     */
-    public void testNoPomSpecified()
-        throws Exception
-    {
-        submitAddMavenTwoProjectPage( "", false );
-        assertTextPresent( "Either POM URL or Upload POM is required." );
-    }
-
-    /**
-     * Test when scm element is missing from pom
-     */
-    public void testMissingScmElementPom()
-        throws Exception
-    {
-        String pomUrl = getProperty( "NOT_SCM_POM_URL" );
-        submitAddMavenTwoProjectPage( pomUrl, false );
-        assertTextPresent( "Missing ''scm'' element in the POM, project Maven Two Project"
);
-    }
-
-    /**
-     * test with a malformed pom url
-     */
-    public void testMalformedPomUrl()
-        throws Exception
-    {
-        String pomUrl = "aaa";
-        submitAddMavenTwoProjectPage( pomUrl, false );
-        assertTextPresent( "The specified resource cannot be accessed. Please try again later
or contact your administrator." );
-    }
-
-    /**
-     * Test when the connection element is missing from the scm tag
-     */
-    public void testMissingConnectionElement()
-        throws Exception
-    {
-        String pomUrl = getProperty( "MISS_CONECT_POM_URL" );
-        submitAddMavenTwoProjectPage( pomUrl, false );
-        assertTextPresent( "Missing 'connection' sub-element in the 'scm' element in the
POM." );
-    }
-
-    /**
-     * test unallowed file protocol
-     */
-    public void testNotAllowedProtocol()
-        throws Exception
-    {
-        String pomUrl = "file:///pom.xml";
-        submitAddMavenTwoProjectPage( pomUrl, false );
-        assertTextPresent( "The specified resource isn't a file or the protocol used isn't
allowed." );
-    }
-
-    /**
-     * Test when the parent pom is missing or not yet added in continuum
-     */
-    public void testMissingParentPom()
-        throws Exception
-    {
-        String pomUrl = getProperty( "MISS_PARENT_POM_URL" );
-        submitAddMavenTwoProjectPage( pomUrl, false );
-        assertTextPresent( "Missing artifact trying to build the POM. Check that its parent
POM is available or add it first in Continuum." );
-    }
-
-    /**
-     * Test when the modules/subprojects specified in the pom are not found
-     */
-    public void testMissingModules()
-        throws Exception
+    @BeforeMethod
+    public void setUp()
     {
-        String pomUrl = getProperty( "MISS_SUBPRO_POM_URL" );
-        submitAddMavenTwoProjectPage( pomUrl, false );
-        assertTextPresent( "Unknown error trying to build POM." );
+        enableDistributedBuilds();
     }
 
-    /**
-     * test with an inaccessible pom url
-     */
-    public void testInaccessiblePomUrl()
-        throws Exception
+    @AfterMethod
+    public void tearDown()
     {
-        String pomUrl = "http://localhost:9595/";
-        submitAddMavenTwoProjectPage( pomUrl, false );
-        assertTextPresent( "POM file does not exist. Either the POM you specified or one
of its modules does not exist." );
+        disableDistributedBuilds();
     }
 
-    /**
-     * test cancel button
-     */
-    public void testCancelButton()
-    {
-        goToAboutPage();
-        goToAddMavenTwoProjectPage();
-        clickButtonWithValue( "Cancel" );
-        assertAboutPage();
-    }
-
-    @Test( dependsOnMethods = { "testAddMavenTwoProject" } )
-    public void testDeleteMavenTwoProject()
+    public void testBuildProjectGroupNoBuildAgentConfigured()
         throws Exception
     {
         String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_DELETE_PROJ_GRP_SCM_ROOT_URL"
);
-        goToProjectGroupsSummaryPage();
-        
-        // delete project - delete icon
-        addMaven2Project( M2_PROJ_GRP_NAME );
-        clickLinkWithText( M2_PROJ_GRP_NAME );
-
-        assertPage( "Continuum - Project Group" );
-        assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
-
-        // TODO: this doesn't always seem to work, perhaps because of changes in the way
icons are displayed
-        // wait for project to finish checkout
-        waitForProjectCheckout();
-
-        clickLinkWithXPath( "//tbody/tr['0']/td['10']/a/img[@alt='Delete']" );
-        assertTextPresent( "Delete Continuum Project" );
-        clickButtonWithValue( "Delete" );
-        assertPage( "Continuum - Project Group" );
-        assertTextNotPresent( "Unable to delete project" );
-        assertLinkNotPresent( M2_PROJ_GRP_NAME );
-        assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
-
-        // remove group for next test
-        removeProjectGroup( M2_PROJ_GRP_NAME );
-        assertLinkNotPresent( M2_PROJ_GRP_NAME );
+        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
 
-        // delete project - "Delete Project(s)" button
         addMaven2Project( M2_PROJ_GRP_NAME );
         clickLinkWithText( M2_PROJ_GRP_NAME );
 
         assertPage( "Continuum - Project Group" );
-        //wait for project to finish checkout
-        waitForProjectCheckout();
 
-        checkField( "//tbody/tr['0']/td['0']/input[@name='selectedProjects']" );
-        clickButtonWithValue( "Delete Project(s)" );
-        assertTextPresent( "Delete Continuum Projects" );
-        clickButtonWithValue( "Delete" );
-        assertPage( "Continuum - Project Group" );
-        assertTextNotPresent( "Unable to delete project" );
-        assertLinkNotPresent( M2_PROJ_GRP_NAME );
-        assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+        showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+        clickButtonWithValue( "Build all projects" );
+
+        assertTextPresent( "Unable to build projects because no build agent is configured"
);
 
-        // remove project group
         removeProjectGroup( M2_PROJ_GRP_NAME );
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
     }
 
-    public void testBuildProjectGroupNoBuildAgentConfigured()
+    public void testProjectGroupAllBuildSuccessWithDistributedBuilds()
         throws Exception
     {
         String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
         String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
 
-        try
-        {
-            enableDistributedBuilds();
-            addMaven2Project( M2_PROJ_GRP_NAME );
-            clickLinkWithText( M2_PROJ_GRP_NAME );
-    
-            assertPage( "Continuum - Project Group" );
-    
-            showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
-            clickButtonWithValue( "Build all projects" );
-
-            assertTextPresent( "Unable to build projects because no build agent is configured"
);
-
-            removeProjectGroup( M2_PROJ_GRP_NAME );
-            assertLinkNotPresent( M2_PROJ_GRP_NAME );
-        }
-        finally
-        {
-            disableDistributedBuilds();
-        }
-    }
+        addBuildAgent( getBuildAgentUrl() );
 
-    @Test( dependsOnMethods = { "testDeleteMavenTwoProject", "testAddBuildAgent" } )
-    public void testProjectGroupAllBuildSuccessWithDistributedBuilds()
-        throws Exception
-    {
-        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
+        addMaven2Project( M2_PROJ_GRP_NAME );
+        clickLinkWithText( M2_PROJ_GRP_NAME );
 
-        try
-        {
-            enableDistributedBuilds();
+        assertPage( "Continuum - Project Group" );
 
-            addMaven2Project( M2_PROJ_GRP_NAME );
-            clickLinkWithText( M2_PROJ_GRP_NAME );
-    
-            assertPage( "Continuum - Project Group" );
-    
-            showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
-            clickButtonWithValue( "Build all projects" );
+        showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+        clickButtonWithValue( "Build all projects" );
 
-            buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME, true
);
-        }
-        finally
-        {
-            disableDistributedBuilds();   
-        }
+        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME, true );
     }
 
     @Test( dependsOnMethods = { "testAddBuildAgentGroupWithEmptyBuildAgent", "testAddBuildEnvironmentWithBuildAgentGroup"
} )
@@ -364,56 +93,27 @@ public class MavenTwoProjectTest
         String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
         String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
 
-        try
-        {
-            enableDistributedBuilds();
-            addMaven2Project( M2_PROJ_GRP_NAME );
-            clickLinkWithText( M2_PROJ_GRP_NAME );
-
-            assertPage( "Continuum - Project Group" );
-
-            goToGroupBuildDefinitionPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
-            clickImgWithAlt( "Edit" );
-            assertAddEditBuildDefinitionPage();
-            selectValue( "profileId", BUILD_ENV_NAME );
-            submit();
-            assertGroupBuildDefinitionPage( M2_PROJ_GRP_NAME );
-
-            clickLinkWithText( "Project Group Summary" );
-            clickButtonWithValue( "Build all projects" );
-
-            assertTextPresent( "Unable to build projects because no build agent is configured
in the build agent group" );
-
-            removeProjectGroup( M2_PROJ_GRP_NAME );
-            assertLinkNotPresent( M2_PROJ_GRP_NAME );
-        }
-        finally
-        {
-            disableDistributedBuilds();
-        }
-    }
+        addMaven2Project( M2_PROJ_GRP_NAME );
+        clickLinkWithText( M2_PROJ_GRP_NAME );
+
+        assertPage( "Continuum - Project Group" );
+
+        goToGroupBuildDefinitionPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+        clickImgWithAlt( "Edit" );
+        assertAddEditBuildDefinitionPage();
+        selectValue( "profileId", BUILD_ENV_NAME );
+        submit();
+        assertGroupBuildDefinitionPage( M2_PROJ_GRP_NAME );
+
+        clickLinkWithText( "Project Group Summary" );
+        clickButtonWithValue( "Build all projects" );
+
+        assertTextPresent( "Unable to build projects because no build agent is configured
in the build agent group" );
 
-    public void testBuildMaven2ProjectWithTag()
-        throws Exception
-    {
-        String M2_POM_URL = getProperty( "M2_PROJ_WITH_TAG_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-    
-        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_ID" );
-        String M2_PROJ_GRP_DESCRIPTION = "";
-    
-        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
-        assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
-    
-        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME,
true );
-    
         removeProjectGroup( M2_PROJ_GRP_NAME );
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
     }
-    
-    @Test( dependsOnMethods = { "testAddBuildAgent" } )
+
     public void testBuildMaven2ProjectWithTagDistributedBuild()
         throws Exception
     {
@@ -424,47 +124,16 @@ public class MavenTwoProjectTest
         String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_NAME" );
         String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_ID" );
         String M2_PROJ_GRP_DESCRIPTION = "";
-    
-        try
-        {
-            enableDistributedBuilds();
-        
-            addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true
);
-            assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
-        
-            buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION,
M2_PROJ_GRP_NAME, true );
-        
-            removeProjectGroup( M2_PROJ_GRP_NAME );
-            assertLinkNotPresent( M2_PROJ_GRP_NAME );
-        }
-        finally
-        {
-            disableDistributedBuilds();
-        }
-    }
 
-    @Test( dependsOnMethods = { "testAddMavenTwoProject" } )
-    public void testProjectGroupAllBuildSuccess()
-        throws Exception
-    {
-        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
-        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
-        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME,
true );
-        clickButtonWithValue( "Release" );
-        assertReleaseSuccess();
-    }
+        addBuildAgent( getBuildAgentUrl() );
 
-    private void addMaven2Project( String groupName )
-        throws Exception
-    {
-        String M2_POM_URL = getProperty( "M2_DELETE_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_DELETE_PROJ_GRP_DESCRIPTION" );
-        
         addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
-        goToProjectGroupsSummaryPage();
-        assertLinkPresent( groupName );
+        assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
+
+        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME,
true );
+
+        removeProjectGroup( M2_PROJ_GRP_NAME );
+        assertLinkNotPresent( M2_PROJ_GRP_NAME );
     }
+
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java?rev=1367567&r1=1367566&r2=1367567&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
Tue Jul 31 14:15:51 2012
@@ -32,7 +32,6 @@ import org.testng.annotations.Test;
 public class MavenTwoProjectTest
     extends AbstractAdminTest
 {
-
     public void testAddMavenTwoProjectWithNoDefaultBuildDefinitionInTemplate()
         throws Exception
     {
@@ -104,7 +103,6 @@ public class MavenTwoProjectTest
         assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
     }
 
-    @Test( dependsOnMethods = { "testAddProjectGroup" } )
     public void testAddMavenTwoProjectFromRemoteSourceToNonDefaultProjectGroup()
         throws Exception
     {
@@ -113,6 +111,8 @@ public class MavenTwoProjectTest
         String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
         String TEST_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_PROJ_GRP_SCM_ROOT_URL" );
 
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
true );
+
         String M2_POM_URL = getProperty( "M2_POM_URL" );
         String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
         String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
@@ -122,23 +122,22 @@ public class MavenTwoProjectTest
         assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
 
         assertTextPresent( TEST_PROJ_GRP_SCM_ROOT_URL );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME );
     }
 
-    @Test( dependsOnMethods = { "testAddMavenTwoProjectFromRemoteSourceToNonDefaultProjectGroup"
} )
+    @Test( dependsOnMethods = { "testProjectGroupAllBuildSuccess" } )
     public void testMoveProject()
         throws Exception
     {
-        String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
-        String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
-        String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
+        String TEST_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
+        String TEST_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
+        String TEST_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
         String DEFAULT_PROJ_GRP_NAME = getProperty( "DEFAULT_PROJ_GRP_NAME" );
         String DEFAULT_PROJ_GRP_ID = getProperty( "DEFAULT_PROJ_GRP_NAME" );
         String DEFAULT_PROJ_GRP_DESCRIPTION = getProperty( "DEFAULT_PROJ_GRP_NAME" );
         String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
 
-        // TODO: need to wait for checkout to complete. Can we add a special IT type of project
that doesn't require checkout?
-        //       currently we get away with it due to the usualy duration between the dependant
test and this test
-        // move the project of the test project group to the default project group
         moveProjectToProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
M2_PROJ_GRP_NAME,
                                    DEFAULT_PROJ_GRP_NAME );
         showProjectGroup( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION
);
@@ -301,98 +300,6 @@ public class MavenTwoProjectTest
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
     }
 
-    public void testBuildProjectGroupNoBuildAgentConfigured()
-        throws Exception
-    {
-        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
-
-        try
-        {
-            enableDistributedBuilds();
-            addMaven2Project( M2_PROJ_GRP_NAME );
-            clickLinkWithText( M2_PROJ_GRP_NAME );
-    
-            assertPage( "Continuum - Project Group" );
-    
-            showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
-            clickButtonWithValue( "Build all projects" );
-
-            assertTextPresent( "Unable to build projects because no build agent is configured"
);
-
-            removeProjectGroup( M2_PROJ_GRP_NAME );
-            assertLinkNotPresent( M2_PROJ_GRP_NAME );
-        }
-        finally
-        {
-            disableDistributedBuilds();
-        }
-    }
-
-    @Test( dependsOnMethods = { "testDeleteMavenTwoProject", "testAddBuildAgent" } )
-    public void testProjectGroupAllBuildSuccessWithDistributedBuilds()
-        throws Exception
-    {
-        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
-
-        try
-        {
-            enableDistributedBuilds();
-
-            addMaven2Project( M2_PROJ_GRP_NAME );
-            clickLinkWithText( M2_PROJ_GRP_NAME );
-    
-            assertPage( "Continuum - Project Group" );
-    
-            showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
-            clickButtonWithValue( "Build all projects" );
-
-            buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME, true
);
-        }
-        finally
-        {
-            disableDistributedBuilds();   
-        }
-    }
-
-    @Test( dependsOnMethods = { "testAddBuildAgentGroupWithEmptyBuildAgent", "testAddBuildEnvironmentWithBuildAgentGroup"
} )
-    public void testProjectGroupNoBuildAgentConfiguredInBuildAgentGroup()
-        throws Exception
-    {
-        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
-        String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
-
-        try
-        {
-            enableDistributedBuilds();
-            addMaven2Project( M2_PROJ_GRP_NAME );
-            clickLinkWithText( M2_PROJ_GRP_NAME );
-
-            assertPage( "Continuum - Project Group" );
-
-            goToGroupBuildDefinitionPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
-            clickImgWithAlt( "Edit" );
-            assertAddEditBuildDefinitionPage();
-            selectValue( "profileId", BUILD_ENV_NAME );
-            submit();
-            assertGroupBuildDefinitionPage( M2_PROJ_GRP_NAME );
-
-            clickLinkWithText( "Project Group Summary" );
-            clickButtonWithValue( "Build all projects" );
-
-            assertTextPresent( "Unable to build projects because no build agent is configured
in the build agent group" );
-
-            removeProjectGroup( M2_PROJ_GRP_NAME );
-            assertLinkNotPresent( M2_PROJ_GRP_NAME );
-        }
-        finally
-        {
-            disableDistributedBuilds();
-        }
-    }
-
     public void testBuildMaven2ProjectWithTag()
         throws Exception
     {
@@ -412,36 +319,6 @@ public class MavenTwoProjectTest
         removeProjectGroup( M2_PROJ_GRP_NAME );
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
     }
-    
-    @Test( dependsOnMethods = { "testAddBuildAgent" } )
-    public void testBuildMaven2ProjectWithTagDistributedBuild()
-        throws Exception
-    {
-        String M2_POM_URL = getProperty( "M2_PROJ_WITH_TAG_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-    
-        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_ID" );
-        String M2_PROJ_GRP_DESCRIPTION = "";
-    
-        try
-        {
-            enableDistributedBuilds();
-        
-            addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true
);
-            assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION
);
-        
-            buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION,
M2_PROJ_GRP_NAME, true );
-        
-            removeProjectGroup( M2_PROJ_GRP_NAME );
-            assertLinkNotPresent( M2_PROJ_GRP_NAME );
-        }
-        finally
-        {
-            disableDistributedBuilds();
-        }
-    }
 
     @Test( dependsOnMethods = { "testAddMavenTwoProject" } )
     public void testProjectGroupAllBuildSuccess()
@@ -454,17 +331,4 @@ public class MavenTwoProjectTest
         clickButtonWithValue( "Release" );
         assertReleaseSuccess();
     }
-
-    private void addMaven2Project( String groupName )
-        throws Exception
-    {
-        String M2_POM_URL = getProperty( "M2_DELETE_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_DELETE_PROJ_GRP_DESCRIPTION" );
-        
-        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
-        goToProjectGroupsSummaryPage();
-        assertLinkPresent( groupName );
-    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java?rev=1367567&r1=1367566&r2=1367567&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java
Tue Jul 31 14:15:51 2012
@@ -42,4 +42,66 @@ public abstract class AbstractAdminTest
     {
         return baseUrl.replace( "/continuum", "/continuum-buildagent/xmlrpc" );
     }
+
+    protected void addBuildAgent( String buildAgentUrl )
+    {
+        goToBuildAgentPage();
+        assertBuildAgentPage();
+
+        if ( !isElementPresent( "link=" + buildAgentUrl ) )
+        {
+
+            clickAndWait( "editBuildAgent_0" ); //add button
+            assertAddEditBuildAgentPage( true );
+
+            setFieldValue( "saveBuildAgent_buildAgent_url", buildAgentUrl );
+            setFieldValue( "saveBuildAgent_buildAgent_description", "Default description"
);
+            checkField( "saveBuildAgent_buildAgent_enabled" );
+
+            submit();
+
+            assertBuildAgentPage();
+            assertElementPresent( "link=" + buildAgentUrl );
+        }
+    }
+
+    public void goToAddBuildAgent()
+    {
+        goToBuildAgentPage();
+        assertBuildAgentPage();
+        clickAndWait("editBuildAgent_0"); //add button
+        assertAddEditBuildAgentPage( true );
+    }
+
+    public void assertAddEditBuildAgentPage( boolean isChecked )
+    {
+        assertPage( "Continuum - Add/Edit Build Agent" );
+        assertTextPresent( "Add/Edit Build Agent" );
+        assertTextPresent( "Build Agent URL*:" );
+        assertTextPresent( "Description:" );
+        assertTextPresent( "Enabled" );
+        assertElementPresent( "saveBuildAgent_buildAgent_url" );
+        assertElementPresent( "saveBuildAgent_buildAgent_description");
+
+        if ( isChecked )
+        {
+            assertIsChecked( "saveBuildAgent_buildAgent_enabled" );
+        }
+
+        assertButtonWithValuePresent( "Save" );
+        assertButtonWithValuePresent( "Cancel" );
+    }
+
+    protected void addMaven2Project( String groupName )
+        throws Exception
+    {
+        String M2_POM_URL = getProperty( "M2_DELETE_POM_URL" );
+        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_DELETE_PROJ_GRP_DESCRIPTION" );
+
+        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+        goToProjectGroupsSummaryPage();
+        assertLinkPresent( groupName );
+    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java?rev=1367567&r1=1367566&r2=1367567&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
Tue Jul 31 14:15:51 2012
@@ -26,33 +26,6 @@ import java.net.URLEncoder;
 public abstract class AbstractBuildAgentsTest
     extends AbstractAdminTest
 {
-    public void goToAddBuildAgent()
-    {
-        goToBuildAgentPage();
-        assertBuildAgentPage();
-        clickAndWait("editBuildAgent_0"); //add button
-        assertAddEditBuildAgentPage( true );
-    }
-
-    public void assertAddEditBuildAgentPage( boolean isChecked )
-    {
-        assertPage( "Continuum - Add/Edit Build Agent" );
-        assertTextPresent( "Add/Edit Build Agent" );
-        assertTextPresent( "Build Agent URL*:" );
-        assertTextPresent( "Description:" );
-        assertTextPresent( "Enabled" );
-        assertElementPresent( "saveBuildAgent_buildAgent_url" );
-        assertElementPresent( "saveBuildAgent_buildAgent_description");
-
-        if ( isChecked )
-        {
-            assertIsChecked( "saveBuildAgent_buildAgent_enabled" );
-        }
-
-        assertButtonWithValuePresent( "Save" );
-        assertButtonWithValuePresent( "Cancel" );
-    }
-
     public void removeBuildAgent( String agentName )
         throws Exception
     {

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java?rev=1367567&r1=1367566&r2=1367567&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
Tue Jul 31 14:15:51 2012
@@ -25,6 +25,7 @@ import org.apache.commons.io.IOUtils;
 import org.testng.Assert;
 import org.testng.annotations.AfterSuite;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
@@ -67,6 +68,12 @@ public abstract class AbstractSeleniumTe
         p = new Properties();
         p.load( input );
 
+        String svnBaseUrl = "file://localhost/" + new File( "target/example-svn" ).getAbsolutePath();
+        for ( String key : p.stringPropertyNames() ) {
+            String value = p.getProperty( key ).replace( "${svn.base.url}", svnBaseUrl );
+            p.setProperty( key, value );
+        }
+
         maxWaitTimeInMs = getProperty( "MAX_WAIT_TIME_IN_MS" );
         maxProjectWaitTimeInMs = getProperty( "MAX_PROJECT_WAIT_TIME_IN_MS" );
 



Mime
View raw message