You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by br...@apache.org on 2012/08/14 14:18:56 UTC
svn commit: r1372854 - in /continuum/trunk/continuum-webapp-test/src/test:
resources/ testng/org/apache/continuum/web/test/
testng/org/apache/continuum/web/test/parent/
Author: brett
Date: Tue Aug 14 12:18:56 2012
New Revision: 1372854
URL: http://svn.apache.org/viewvc?rev=1372854&view=rev
Log:
make maven 2 tests more independent and adjust for flow on effects
Removed:
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildQueueTest.java
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
Modified:
continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
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/NotifierTest.java
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReportTest.java
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
Modified: continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Tue Aug 14 12:18:56 2012
@@ -36,7 +36,32 @@ ADMIN_MAIL=admin@mail.com
MAVEN2_POM_URL=http://localhost:9595/example-projects/simple-example/pom.xml
MAVEN2_POM_USERNAME=
MAVEN2_POM_PASSWORD=
-MAVEN2_PROJECT_NAME=Continuum Simple Example Project
+MAVEN2_POM_PROJECT_NAME=Continuum Simple Example Project
+# values used for "Defined by POM" - tests should clean up this group afterwards if added
+MAVEN2_POM_PROJECT_GROUP_NAME=Continuum Simple Example Project
+MAVEN2_POM_PROJECT_GROUP_ID=org.apache.continuum.examples.simple
+MAVEN2_POM_PROJECT_GROUP_DESCRIPTION=
+MAVEN2_POM_PROJECT_GROUP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/simple-example
+
+MAVEN2_PROJECT_WITH_TAG_POM_URL=http://localhost:9595/example-projects/continuum-2437-example/pom.xml
+# values used for "Defined by POM" - tests should clean up this group afterwards if added
+MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_GROUP_NAME=Continuum 2437 Example Project
+MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_GROUP_ID=org.apache.continuum.examples
+MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_GROUP_DESCRIPTION=
+
+MAVEN2_FAILING_PROJECT_POM_URL=http://localhost:9595/example-projects/continuum-failing-project/pom.xml
+# values used for "Defined by POM" - tests should clean up this group afterwards if added
+MAVEN2_FAILING_PROJECT_POM_PROJECT_GROUP_NAME=Continuum Sample Failing Project
+MAVEN2_FAILING_PROJECT_POM_PROJECT_GROUP_ID=org.apache.continuum.failing.project
+MAVEN2_FAILING_PROJECT_POM_PROJECT_GROUP_DESCRIPTION=Sample project that has a build failure
+
+MAVEN2_QUEUE_TEST_POM_URL=http://localhost:9595/example-projects/continuum-build-queue-test-data/pom.xml
+MAVEN2_QUEUE_TEST_POM_USERNAME=
+MAVEN2_QUEUE_TEST_POM_PASSWORD=
+# values used for "Defined by POM" - tests should clean up this group afterwards if added
+MAVEN2_QUEUE_TEST_POM_PROJECT_GROUP_NAME=ContinuumBuildQueueTestData
+MAVEN2_QUEUE_TEST_POM_PROJECT_GROUP_ID=org.apache.continuum
+MAVEN2_QUEUE_TEST_POM_PROJECT_GROUP_DESCRIPTION=Project for testing continuum build queue
# Ant projects to load
@@ -54,6 +79,23 @@ MAVEN1_POM_URL=http://localhost:9595/exa
MAVEN1_POM_USERNAME=
MAVEN1_POM_PASSWORD=
+# Default project group
+
+DEFAULT_PROJECT_GROUP_NAME=Default Project Group
+DEFAULT_PROJECT_GROUP_ID=default
+DEFAULT_PROJECT_GROUP_DESCRIPTION=Contains all projects that do not have a group of their own
+
+# Schedule detail data
+SCHEDULE_DESCRIPTION=schedule_description
+SCHEDULE_EXPR_SECOND=10
+SCHEDULE_EXPR_MINUTE=10
+SCHEDULE_EXPR_HOUR=20
+SCHEDULE_EXPR_DAY_MONTH=*
+SCHEDULE_EXPR_MONTH=*
+SCHEDULE_EXPR_DAY_WEEK=?
+SCHEDULE_EXPR_YEAR=2009
+SCHEDULE_MAX_TIME=60000
+SCHEDULE_PERIOD=36000
### The following properties should not be shared across groups ###
@@ -85,6 +127,28 @@ MAVEN1_MISSING_REPO_POM_URL=http://local
MAVEN1_EXTENDED_POM_URL=http://localhost:9595/example-projects/maven-one-projects/extend-element-project.xml
MAVEN1_UNPARSEABLE_POM_URL=http://localhost:9595/example-projects/maven-one-projects/unparseable-content-project.xml
+# Maven 2 test properties
+
+MAVEN2_SAME_LETTER_FLAT_POM_URL=http://localhost:9595/example-projects/flat-example/flat-parent/pom.xml
+MAVEN2_SAME_LETTER_FLAT_PROJECT_GROUP_NAME=Flat Example
+MAVEN2_SAME_LETTER_FLAT_PROJECT_GROUP_ID=com.example.flat
+MAVEN2_SAME_LETTER_FLAT_PROJECT_GROUP_DESCRIPTION=
+MAVEN2_SAME_LETTER_FLAT_PROJECT_GROUP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/flat-example
+
+MAVEN2_NON_DEFAULT_PROJECT_GROUP_NAME=Maven Non-Default Project Group Name
+MAVEN2_NON_DEFAULT_PROJECT_GROUP_ID=org.apache.continuum.examples.maven2.nondefaultgroup
+MAVEN2_NON_DEFAULT_PROJECT_GROUP_DESCRIPTION=
+
+MAVEN2_MOVE_PROJECT_TARGET_PROJECT_GROUP_NAME=Maven Move Project Target Group Name
+MAVEN2_MOVE_PROJECT_TARGET_PROJECT_GROUP_ID=org.apache.continuum.examples.maven2.moveproject
+MAVEN2_MOVE_PROJECT_TARGET_PROJECT_GROUP_DESCRIPTION=
+
+# SCM element is missing from pom
+MAVEN2_NO_SCM_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-scm-element-pom.xml
+MAVEN2_MISS_CONNECTION_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-connection-element-pom.xml
+MAVEN2_MISS_PARENT_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-parent-pom.xml
+MAVEN2_MISS_SUBPRO_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-modules-pom.xml
+
# Ant test properties
ANT_PROJECT_GROUP_NAME=Ant Project Group
@@ -101,6 +165,28 @@ RELEASE_PROJECT_VERSION=1.0
RELEASE_PROJECT_DEVELOPMENT_VERSION=1.1-SNAPSHOT
RELEASE_PROJECT_SCM_URL=scm:svn:${svn.base.url}/trunk/simple-example
+# Report test properties
+
+REPORT_PROJECT_GROUP_NAME=Report Test Project Group
+REPORT_PROJECT_GROUP_ID=org.apache.continuum.examples.report
+REPORT_PROJECT_GROUP_DESCRIPTION=
+
+# Build definition tests
+
+BUILD_DEFINITION_PROJECT_GROUP_NAME=Build Definition Test Project Group
+BUILD_DEFINITION_PROJECT_GROUP_ID=org.apache.continuum.examples.builddefinition
+BUILD_DEFINITION_PROJECT_GROUP_DESCRIPTION=Test project group for the build definition project group tests
+
+BUILD_DEFINITION_POM_NAME=pom.xml
+BUILD_DEFINITION_GOALS=test
+BUILD_DEFINITION_ARGUMENTS=--batch-mode --non-recursive
+BUILD_DEFINITION_DESCRIPTION=Maven Build Definition Description
+
+# Build queue tests
+
+BUILD_QUEUE_NAME=name_build_queue
+QUEUE_SCHEDULE_NAME=queue_schedule
+
#####
DEFAULT_PROJ_GRP_NAME=Default Project Group
@@ -118,26 +204,11 @@ M2_POM_PASSWORD=
M2_PROJ_GRP_NAME=ContinuumBuildQueueTestData
M2_PROJ_GRP_ID=org.apache.continuum
M2_PROJ_GRP_DESCRIPTION=Project for testing continuum build queue
-M2_PROJ_GRP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/continuum-build-queue-test-data
# Properties for testDeleteMavenTwoProject
M2_DELETE_POM_URL=http://localhost:9595/example-projects/simple-example/pom.xml
M2_DELETE_PROJ_GRP_NAME=Continuum Simple Example Project
M2_DELETE_PROJ_GRP_ID=org.apache.continuum.examples.simple
-M2_DELETE_PROJ_GRP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/simple-example
-
-# SCM element is missing from pom
-NOT_SCM_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-scm-element-pom.xml
-MISS_CONECT_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-connection-element-pom.xml
-MISS_PARENT_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-parent-pom.xml
-MISS_SUBPRO_POM_URL=http://localhost:9595/example-projects/maven-two-projects/missing-modules-pom.xml
-
-# Properties for testAddMavenTwoProjectModuleNameWithSameLetter
-M2_SAME_LETTER_POM_URL=http://localhost:9595/example-projects/flat-example/flat-parent/pom.xml
-M2_SAME_LETTER_PROJ_GRP_NAME=Flat Example
-M2_SAME_LETTER_PROJ_GRP_ID=com.example.flat
-M2_SAME_LETTER_PROJ_GRP_DESCRIPTION=
-M2_SAME_LETTER_PROJ_GRP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/flat-example
# Properties for testBuildMaven2ProjectWithTag
M2_PROJ_WITH_TAG_POM_URL=http://localhost:9595/example-projects/continuum-2437-example/pom.xml
@@ -149,11 +220,6 @@ M2_RELEASE_BUILD_ENV=RELEASE_BUILD_ENV
M2_RELEASE_AGENT_GROUP=RELEASE_BUILDAGENT_GROUP
M2_RELEASE_NO_AGENT_MESSAGE=Unable to prepare release because build agent
-M2_FAILING_PROJ_POM_URL=http://localhost:9595/example-projects/continuum-failing-project/pom.xml
-M2_FAILING_PROJ_GRP_NAME=Continuum Sample Failing Project
-M2_FAILING_PROJ_GRP_ID=org.apache.continuum.failing.project
-M2_FAILING_PROJ_DESCRIPTION=Sample project that has a build failure
-
########################
# shellProject group
########################
@@ -206,19 +272,6 @@ TEST_PROJ_GRP_ID_THREE=My Group Id
TEST_PROJ_GRP_DESCRIPTION_THREE=Third project group for members test
########################
-# buildDefinition group
-########################
-BUILD_POM_NAME=pom.xml
-BUILD_GOALS=test
-BUILD_ARGUMENTS=--batch-mode --non-recursive
-BUILD_DESCRIPTION=Maven Build Definition Description
-
-########################
-# queue group
-########################
-BUILD_QUEUE_NAME=name_build_queue
-
-########################
# purge group
########################
PURGE_REPOSITORY_DESCRIPTION=repository_description
@@ -238,16 +291,6 @@ LOCAL_REPOSITORY_LOCATION=/usr/m2/reposi
# schedules group
########################
SCHEDULE_NAME=schedule_name
-SCHEDULE_DESCRIPTION=schedule_description
-SCHEDULE_EXPR_SECOND=10
-SCHEDULE_EXPR_MINUTE=10
-SCHEDULE_EXPR_HOUR=20
-SCHEDULE_EXPR_DAY_MONTH=*
-SCHEDULE_EXPR_MONTH=*
-SCHEDULE_EXPR_DAY_WEEK=?
-SCHEDULE_EXPR_YEAR=2009
-SCHEDULE_MAX_TIME=60000
-SCHEDULE_PERIOD=36000
########################
# installations group
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java Tue Aug 14 12:18:56 2012
@@ -20,24 +20,80 @@ package org.apache.continuum.web.test;
*/
import org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @author José Morales MartÃnez
* @version $Id$
*/
-@Test( groups = {"buildDefinition"} )
+@Test( groups = { "buildDefinition" } )
public class BuildDefinitionTest
extends AbstractAdminTest
{
- public void testDefaultGroupBuildDefinition()
+
+ private String defaultProjectGroupName;
+
+ private String defaultProjectGroupId;
+
+ private String defaultProjectGroupDescription;
+
+ private String projectGroupName;
+
+ private String projectGroupId;
+
+ private String projectGroupDescription;
+
+ private String buildDefinitionPomName;
+
+ private String buildDefinitionGoals;
+
+ private String buildDefinitionArguments;
+
+ private String buildDefinitionDescription;
+
+ private String projectName;
+
+ @BeforeClass
+ public void createProject()
+ {
+ projectGroupName = getProperty( "BUILD_DEFINITION_PROJECT_GROUP_NAME" );
+ projectGroupId = getProperty( "BUILD_DEFINITION_PROJECT_GROUP_ID" );
+ projectGroupDescription = getProperty( "BUILD_DEFINITION_PROJECT_GROUP_DESCRIPTION" );
+
+ projectName = getProperty( "MAVEN2_POM_PROJECT_NAME" );
+ String projectPomUrl = getProperty( "MAVEN2_POM_URL" );
+ String pomUsername = getProperty( "MAVEN2_POM_USERNAME" );
+ String pomPassword = getProperty( "MAVEN2_POM_PASSWORD" );
+
+ loginAsAdmin();
+ addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true, false );
+ clickLinkWithText( projectGroupName );
+ if ( !isLinkPresent( projectName ) )
+ {
+ addMavenTwoProject( projectPomUrl, pomUsername, pomPassword, projectGroupName, true );
+ }
+ }
+
+ @BeforeMethod
+ protected void setUp()
throws Exception
{
- String DEFAULT_PROJ_GRP_NAME = getProperty( "DEFAULT_PROJ_GRP_NAME" );
- String DEFAULT_PROJ_GRP_ID = getProperty( "DEFAULT_PROJ_GRP_ID" );
- String DEFAULT_PROJ_GRP_DESCRIPTION = getProperty( "DEFAULT_PROJ_GRP_DESCRIPTION" );
+ defaultProjectGroupName = getProperty( "DEFAULT_PROJECT_GROUP_NAME" );
+ defaultProjectGroupId = getProperty( "DEFAULT_PROJECT_GROUP_ID" );
+ defaultProjectGroupDescription = getProperty( "DEFAULT_PROJECT_GROUP_DESCRIPTION" );
- goToGroupBuildDefinitionPage( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION );
+ buildDefinitionPomName = getProperty( "BUILD_DEFINITION_POM_NAME" );
+ buildDefinitionGoals = getProperty( "BUILD_DEFINITION_GOALS" );
+ buildDefinitionArguments = getProperty( "BUILD_DEFINITION_ARGUMENTS" );
+ buildDefinitionDescription = getProperty( "BUILD_DEFINITION_DESCRIPTION" );
+ }
+
+ public void testDefaultGroupBuildDefinition()
+ throws Exception
+ {
+ goToGroupBuildDefinitionPage( defaultProjectGroupName, defaultProjectGroupId, defaultProjectGroupDescription );
String tableElement = "ec_table";
assertCellValueFromTable( "Goals", tableElement, 0, 0 );
assertCellValueFromTable( "Arguments", tableElement, 0, 1 );
@@ -66,28 +122,20 @@ public class BuildDefinitionTest
assertImgWithAlt( "Build" );
}
- @Test( dependsOnMethods = {"testAddProjectGroup2"} )
public void testAddInvalidGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
+ goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription );
clickButtonWithValue( "Add" );
setFieldValue( "buildFile", "" );
clickButtonWithValue( "Save" );
assertTextPresent( "Build file is required and cannot contain spaces only" );
}
- @Test( dependsOnMethods = {"testAddProjectGroup2"} )
public void testAddGroupBuildDefinitionWithXSS()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
+ goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription );
clickButtonWithValue( "Add" );
setFieldValue( "buildFile", "<script>alert('xss')</script>" );
setFieldValue( "description", "<script>alert('xss')</script>" );
@@ -95,124 +143,81 @@ public class BuildDefinitionTest
assertTextPresent( "Build file contains invalid characters." );
}
- @Test( dependsOnMethods = {"testAddProjectGroup2"} )
public void testBuildFromGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
+ goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription );
clickImgWithAlt( "Build" );
- assertProjectGroupSummaryPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
+ assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
}
- @Test( dependsOnMethods = {"testAddProjectGroup2"} )
- public void testAddDefautltGroupBuildDefinition()
+ public void testAddDefaultGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- String BUILD_POM_NAME = getProperty( "BUILD_POM_NAME" );
- String BUILD_GOALS = getProperty( "BUILD_GOALS" );
- String BUILD_ARGUMENTS = getProperty( "BUILD_ARGUMENTS" );
- String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
- goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
+ goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription );
clickButtonWithValue( "Add" );
- addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
- BUILD_DESCRIPTION, true, false, true );
+ addEditGroupBuildDefinition( projectGroupName, buildDefinitionPomName, buildDefinitionGoals,
+ buildDefinitionArguments, buildDefinitionDescription, true, false, true );
}
- @Test( dependsOnMethods = {"testAddProjectGroup2"} )
- public void testAddNotDefautltGroupBuildDefinition()
+ public void testAddNotDefaultGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- String BUILD_POM_NAME = getProperty( "BUILD_POM_NAME" );
- String BUILD_GOALS = getProperty( "BUILD_GOALS" );
- String BUILD_ARGUMENTS = getProperty( "BUILD_ARGUMENTS" );
- String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
- goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
+ goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription );
clickButtonWithValue( "Add" );
- addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
- BUILD_DESCRIPTION, false, false, false );
+ addEditGroupBuildDefinition( projectGroupName, buildDefinitionPomName, buildDefinitionGoals,
+ buildDefinitionArguments, buildDefinitionDescription, false, false, false );
}
- @Test( dependsOnMethods = {"testAddNotDefautltGroupBuildDefinition"} )
+ @Test( dependsOnMethods = { "testAddNotDefaultGroupBuildDefinition" } )
public void testEditGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- String BUILD_POM_NAME = getProperty( "BUILD_POM_NAME" );
- String BUILD_GOALS = getProperty( "BUILD_GOALS" );
- String BUILD_ARGUMENTS = getProperty( "BUILD_ARGUMENTS" );
- String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
String newPom = "newpom.xml";
String newGoals = "new goals";
String newArguments = "new arguments";
String newDescription = "new description";
- goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
+ goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription );
clickImgWithAlt( "Edit" );
- addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, newPom, newGoals, newArguments, newDescription, false, false,
+ addEditGroupBuildDefinition( projectGroupName, newPom, newGoals, newArguments, newDescription, false, false,
false );
clickImgWithAlt( "Edit" );
- addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
- BUILD_DESCRIPTION, true, true, false );
+ addEditGroupBuildDefinition( projectGroupName, buildDefinitionPomName, buildDefinitionGoals,
+ buildDefinitionArguments, buildDefinitionDescription, true, true, false );
clickImgWithAlt( "Edit" );
- addEditGroupBuildDefinition( TEST2_PROJ_GRP_NAME, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS,
- BUILD_DESCRIPTION, false, true, false );
+ addEditGroupBuildDefinition( projectGroupName, buildDefinitionPomName, buildDefinitionGoals,
+ buildDefinitionArguments, buildDefinitionDescription, false, true, false );
}
- @Test( dependsOnMethods = {"testEditGroupBuildDefinition"} )
+ @Test( dependsOnMethods = { "testEditGroupBuildDefinition" } )
public void testDeleteGroupBuildDefinition()
throws Exception
{
- String TEST2_PROJ_GRP_NAME = getProperty( "TEST2_PROJ_GRP_NAME" );
- String TEST2_PROJ_GRP_ID = getProperty( "TEST2_PROJ_GRP_ID" );
- String TEST2_PROJ_GRP_DESCRIPTION = getProperty( "TEST2_PROJ_GRP_DESCRIPTION" );
- String BUILD_GOALS = getProperty( "BUILD_GOALS" );
- String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
- goToGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME, TEST2_PROJ_GRP_ID, TEST2_PROJ_GRP_DESCRIPTION );
+ goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription );
// Click in Delete Image
clickLinkWithXPath( "(//a[contains(@href,'removeGroupBuildDefinition')])//img" );
- assertDeleteBuildDefinitionPage( BUILD_DESCRIPTION, BUILD_GOALS );
+ assertDeleteBuildDefinitionPage( buildDefinitionDescription, buildDefinitionGoals );
clickButtonWithValue( "Delete" );
- assertGroupBuildDefinitionPage( TEST2_PROJ_GRP_NAME );
+ assertGroupBuildDefinitionPage( projectGroupName );
}
- @Test( dependsOnMethods = {"testMoveProject"} )
- public void testAddNotDefautltProjectBuildDefinition()
+ public void testAddNotDefaultProjectBuildDefinition()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String BUILD_POM_NAME = getProperty( "BUILD_POM_NAME" );
- String BUILD_GOALS = getProperty( "BUILD_GOALS" );
- String BUILD_ARGUMENTS = getProperty( "BUILD_ARGUMENTS" );
- String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
+ goToProjectInformationPage( projectGroupName, projectName );
clickLinkWithXPath( "//input[contains(@id,'buildDefinition')]" );
- addEditGroupBuildDefinition( null, BUILD_POM_NAME, BUILD_GOALS, BUILD_ARGUMENTS, BUILD_DESCRIPTION, false,
- false, false );
+ addEditGroupBuildDefinition( null, buildDefinitionPomName, buildDefinitionGoals, buildDefinitionArguments,
+ buildDefinitionDescription, false, false, false );
}
- @Test( dependsOnMethods = {"testAddNotDefautltProjectBuildDefinition"} )
+ @Test( dependsOnMethods = { "testAddNotDefaultProjectBuildDefinition" } )
public void testDeleteProjectBuildDefinition()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String BUILD_GOALS = getProperty( "BUILD_GOALS" );
- String BUILD_DESCRIPTION = getProperty( "BUILD_DESCRIPTION" );
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
+ goToProjectInformationPage( projectGroupName, projectName );
// Click in Delete Image
clickLinkWithXPath( "(//a[contains(@href,'removeProjectBuildDefinition')])//img" );
- assertDeleteBuildDefinitionPage( BUILD_DESCRIPTION, BUILD_GOALS );
+ assertDeleteBuildDefinitionPage( buildDefinitionDescription, buildDefinitionGoals );
clickButtonWithValue( "Delete" );
assertProjectInformationPage();
}
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java Tue Aug 14 12:18:56 2012
@@ -30,7 +30,7 @@ import org.testng.annotations.Test;
* @author José Morales MartÃnez
* @version $Id$
*/
-@Test( groups = {"distributed"} )
+@Test( groups = { "distributed" } )
public class DistributedBuildTest
extends AbstractBuildAgentsTest
{
@@ -56,7 +56,7 @@ public class DistributedBuildTest
disableDistributedBuilds();
}
- @Test( dependsOnMethods = {"testDeleteBuildAgentGroup"} )
+ @Test( dependsOnMethods = { "testDeleteBuildAgentGroup" } )
public void testBuildProjectGroupNoBuildAgentConfigured()
throws Exception
{
@@ -67,8 +67,8 @@ public class DistributedBuildTest
String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
projectGroupName = M2_PROJ_GRP_NAME;
- addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ), getProperty(
- "M2_POM_PASSWORD" ), null, true );
+ addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ),
+ getProperty( "M2_POM_PASSWORD" ), null, true );
goToProjectGroupsSummaryPage();
assertLinkPresent( projectGroupName );
clickLinkWithText( projectGroupName );
@@ -90,14 +90,15 @@ public class DistributedBuildTest
addBuildAgent( getBuildAgentUrl() );
- addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ), getProperty(
- "M2_POM_PASSWORD" ), null, true );
+ addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ),
+ getProperty( "M2_POM_PASSWORD" ), null, true );
buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME, true );
}
@Test(
- dependsOnMethods = {"testAddBuildAgentGroupWithEmptyBuildAgent", "testAddBuildEnvironmentWithBuildAgentGroup"} )
+ dependsOnMethods = { "testAddBuildAgentGroupWithEmptyBuildAgent",
+ "testAddBuildEnvironmentWithBuildAgentGroup" } )
public void testProjectGroupNoBuildAgentConfiguredInBuildAgentGroup()
throws Exception
{
@@ -106,8 +107,8 @@ public class DistributedBuildTest
String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
projectGroupName = M2_PROJ_GRP_NAME;
- addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ), getProperty(
- "M2_POM_PASSWORD" ), null, true );
+ addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ),
+ getProperty( "M2_POM_PASSWORD" ), null, true );
goToProjectGroupsSummaryPage();
assertLinkPresent( M2_PROJ_GRP_NAME );
clickLinkWithText( M2_PROJ_GRP_NAME );
@@ -195,4 +196,24 @@ public class DistributedBuildTest
submit();
}
+
+ public void testQueuePageWithProjectCurrentlyBuildingInDistributedBuilds()
+ 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" );
+
+ buildProjectForQueuePageTest( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+
+ //check queue page while building
+ getSelenium().open( "/continuum/admin/displayQueues!display.action" );
+ assertPage( "Continuum - View Distributed Builds" );
+ assertTextPresent( "Current Build" );
+ assertTextPresent( "Build Queue" );
+ assertTextPresent( "Current Prepare Build" );
+ assertTextPresent( "Prepare Build Queue" );
+ assertTextPresent( M2_PROJ_GRP_NAME );
+ assertTextPresent( "Build Agent URL" );
+ }
}
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=1372854&r1=1372853&r2=1372854&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 Aug 14 12:18:56 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,56 +30,79 @@ import org.testng.annotations.Test;
* @author José Morales MartÃnez
* @version $Id$
*/
-@Test( groups = {"mavenTwoProject"} )
+@Test( groups = { "mavenTwoProject" } )
public class MavenTwoProjectTest
extends AbstractAdminTest
{
- public void testAddMavenTwoProjectWithNoDefaultBuildDefinitionInTemplate()
+ private String pomUrl;
+
+ private String pomUsername;
+
+ private String pomPassword;
+
+ private String projectGroupName;
+
+ private String projectGroupId;
+
+ private String projectGroupDescription;
+
+ private String projectGroupScmRootUrl;
+
+ private boolean readdDefaultBuildDefinitionToTemplate;
+
+ private String projectName;
+
+ @BeforeMethod
+ protected void setUp()
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" );
+ pomUrl = getProperty( "MAVEN2_POM_URL" );
+ pomUsername = getProperty( "MAVEN2_POM_USERNAME" );
+ pomPassword = getProperty( "MAVEN2_POM_PASSWORD" );
- removeDefaultBuildDefinitionFromTemplate( "maven2" );
+ projectName = getProperty( "MAVEN2_POM_PROJECT_NAME" );
+ projectGroupName = getProperty( "MAVEN2_POM_PROJECT_GROUP_NAME" );
+ projectGroupId = getProperty( "MAVEN2_POM_PROJECT_GROUP_ID" );
+ projectGroupDescription = getProperty( "MAVEN2_POM_PROJECT_GROUP_DESCRIPTION" );
+ projectGroupScmRootUrl = getProperty( "MAVEN2_POM_PROJECT_GROUP_SCM_ROOT_URL" );
- addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+ readdDefaultBuildDefinitionToTemplate = false;
+ }
- assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+ @AfterMethod
+ public void tearDown()
+ {
+ removeProjectGroup( projectGroupName, false );
- assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+ if ( readdDefaultBuildDefinitionToTemplate )
+ {
+ addDefaultBuildDefinitionFromTemplate( "maven2" );
+ }
+ }
- // Delete project group
- removeProjectGroup( M2_PROJ_GRP_NAME );
+ public void testAddMavenTwoProject()
+ throws Exception
+ {
+ // Enter values into Add Maven Two Project fields, and submit
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
+
+ // Wait Struts Listener
+ assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
- // Re-add default build definition of template
- addDefaultBuildDefinitionFromTemplate( "maven2" );
+ assertTextPresent( projectGroupScmRootUrl );
}
- @Test( dependsOnMethods = {"testAddMavenTwoProjectWithNoDefaultBuildDefinitionInTemplate"} )
- public void testAddMavenTwoProject()
+ 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" );
+ readdDefaultBuildDefinitionToTemplate = true;
- // 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 );
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
+
+ assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
- assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+ assertTextPresent( projectGroupScmRootUrl );
}
/**
@@ -86,69 +111,59 @@ public class MavenTwoProjectTest
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" );
+ pomUrl = getProperty( "MAVEN2_SAME_LETTER_FLAT_POM_URL" );
+ pomUsername = "";
+ pomPassword = "";
- String M2_PROJ_GRP_SCM_ROOT_URL = getProperty( "M2_SAME_LETTER_PROJ_GRP_SCM_ROOT_URL" );
+ projectGroupName = getProperty( "MAVEN2_SAME_LETTER_FLAT_PROJECT_GROUP_NAME" );
+ projectGroupId = getProperty( "MAVEN2_SAME_LETTER_FLAT_PROJECT_GROUP_ID" );
+ projectGroupDescription = getProperty( "MAVEN2_SAME_LETTER_FLAT_PROJECT_GROUP_DESCRIPTION" );
+ projectGroupScmRootUrl = getProperty( "MAVEN2_SAME_LETTER_FLAT_PROJECT_GROUP_SCM_ROOT_URL" );
- addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
- assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+ assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
- assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+ assertTextPresent( projectGroupScmRootUrl );
}
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" );
-
- removeProjectGroup( TEST_PROJ_GRP_NAME, false );
-
- 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" );
+ projectGroupName = getProperty( "MAVEN2_NON_DEFAULT_PROJECT_GROUP_NAME" );
+ projectGroupId = getProperty( "MAVEN2_NON_DEFAULT_PROJECT_GROUP_ID" );
+ projectGroupDescription = getProperty( "MAVEN2_NON_DEFAULT_PROJECT_GROUP_DESCRIPTION" );
- addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, TEST_PROJ_GRP_NAME, true );
+ addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true );
- assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, projectGroupName, true );
- assertTextPresent( TEST_PROJ_GRP_SCM_ROOT_URL );
+ assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
- removeProjectGroup( TEST_PROJ_GRP_NAME );
+ assertTextPresent( projectGroupScmRootUrl );
}
- @Test( dependsOnMethods = {"testProjectGroupAllBuildSuccess"} )
public void testMoveProject()
throws Exception
{
- 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" );
-
- 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 );
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
+ assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
+ assertTextPresent( projectGroupScmRootUrl );
+
+ String targetGroupName = getProperty( "MAVEN2_MOVE_PROJECT_TARGET_PROJECT_GROUP_NAME" );
+ String targetGroupId = getProperty( "MAVEN2_MOVE_PROJECT_TARGET_PROJECT_GROUP_ID" );
+ String targetGroupDescription = getProperty( "MAVEN2_MOVE_PROJECT_TARGET_PROJECT_GROUP_DESCRIPTION" );
+ addProjectGroup( targetGroupName, targetGroupId, targetGroupDescription, true );
+
+ // Move the project
+ moveProjectToProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, projectName,
+ targetGroupName );
+ showProjectGroup( targetGroupName, targetGroupId, targetGroupDescription );
assertTextPresent( "Member Projects" );
+ assertTextPresent( projectName );
+
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+ assertTextNotPresent( "Member Projects" );
}
/**
@@ -167,7 +182,7 @@ public class MavenTwoProjectTest
public void testMissingScmElementPom()
throws Exception
{
- String pomUrl = getProperty( "NOT_SCM_POM_URL" );
+ String pomUrl = getProperty( "MAVEN2_NO_SCM_POM_URL" );
submitAddMavenTwoProjectPage( pomUrl );
assertTextPresent( "Missing ''scm'' element in the POM, project Maven Two Project" );
}
@@ -190,7 +205,7 @@ public class MavenTwoProjectTest
public void testMissingConnectionElement()
throws Exception
{
- String pomUrl = getProperty( "MISS_CONECT_POM_URL" );
+ String pomUrl = getProperty( "MAVEN2_MISS_CONNECTION_POM_URL" );
submitAddMavenTwoProjectPage( pomUrl );
assertTextPresent( "Missing 'connection' sub-element in the 'scm' element in the POM." );
}
@@ -212,7 +227,7 @@ public class MavenTwoProjectTest
public void testMissingParentPom()
throws Exception
{
- String pomUrl = getProperty( "MISS_PARENT_POM_URL" );
+ String pomUrl = getProperty( "MAVEN2_MISS_PARENT_POM_URL" );
submitAddMavenTwoProjectPage( pomUrl );
assertTextPresent(
"Missing artifact trying to build the POM. Check that its parent POM is available or add it first in Continuum." );
@@ -224,7 +239,7 @@ public class MavenTwoProjectTest
public void testMissingModules()
throws Exception
{
- String pomUrl = getProperty( "MISS_SUBPRO_POM_URL" );
+ String pomUrl = getProperty( "MAVEN2_MISS_SUBPRO_POM_URL" );
submitAddMavenTwoProjectPage( pomUrl );
assertTextPresent( "Unknown error trying to build POM." );
}
@@ -252,25 +267,19 @@ public class MavenTwoProjectTest
assertAboutPage();
}
- @Test( dependsOnMethods = {"testAddMavenTwoProject"} )
public void testDeleteMavenTwoProject()
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
- addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ), getProperty(
- "M2_POM_PASSWORD" ), null, true );
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
goToProjectGroupsSummaryPage();
- assertLinkPresent( M2_PROJ_GRP_NAME );
- clickLinkWithText( M2_PROJ_GRP_NAME );
+ assertLinkPresent( projectGroupName );
+ clickLinkWithText( projectGroupName );
assertPage( "Continuum - Project Group" );
- assertTextPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+ assertTextPresent( projectGroupScmRootUrl );
- // 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();
@@ -279,21 +288,22 @@ public class MavenTwoProjectTest
clickButtonWithValue( "Delete" );
assertPage( "Continuum - Project Group" );
assertTextNotPresent( "Unable to delete project" );
- assertLinkNotPresent( M2_PROJ_GRP_NAME );
- assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
+ assertLinkNotPresent( projectGroupName );
+ assertTextNotPresent( projectGroupScmRootUrl );
+ }
- // remove group for next test
- removeProjectGroup( M2_PROJ_GRP_NAME );
- assertLinkNotPresent( M2_PROJ_GRP_NAME );
-
- // delete project - "Delete Project(s)" button
- addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ), getProperty(
- "M2_POM_PASSWORD" ), null, true );
+ public void testDeleteMavenTwoProjects()
+ throws Exception
+ {
goToProjectGroupsSummaryPage();
- assertLinkPresent( M2_PROJ_GRP_NAME );
- clickLinkWithText( M2_PROJ_GRP_NAME );
+
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
+ goToProjectGroupsSummaryPage();
+ assertLinkPresent( projectGroupName );
+ clickLinkWithText( projectGroupName );
assertPage( "Continuum - Project Group" );
+
//wait for project to finish checkout
waitForProjectCheckout();
@@ -303,43 +313,24 @@ public class MavenTwoProjectTest
clickButtonWithValue( "Delete" );
assertPage( "Continuum - Project Group" );
assertTextNotPresent( "Unable to delete project" );
- assertLinkNotPresent( M2_PROJ_GRP_NAME );
- assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
-
- // remove project group
- removeProjectGroup( M2_PROJ_GRP_NAME );
- assertLinkNotPresent( M2_PROJ_GRP_NAME );
+ assertLinkNotPresent( projectGroupName );
+ assertTextNotPresent( projectGroupScmRootUrl );
}
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 = "";
+ pomUrl = getProperty( "MAVEN2_PROJECT_WITH_TAG_POM_URL" );
+ pomUsername = "";
+ pomPassword = "";
+
+ projectGroupName = getProperty( "MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_GROUP_NAME" );
+ projectGroupId = getProperty( "MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_GROUP_ID" );
+ projectGroupDescription = getProperty( "MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_GROUP_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 );
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
+ assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
- 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 = {"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();
+ buildProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, projectGroupName, true );
}
}
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java Tue Aug 14 12:18:56 2012
@@ -28,7 +28,7 @@ import org.testng.annotations.Test;
* @author José Morales MartÃnez
* @version $Id$
*/
-@Test( groups = {"notifier"} )
+@Test( groups = { "notifier" } )
public class NotifierTest
extends AbstractAdminTest
{
@@ -71,7 +71,7 @@ public class NotifierTest
projectGroupId = getProperty( "NOTIFIER_PROJECT_GROUP_ID" );
projectGroupDescription = getProperty( "NOTIFIER_PROJECT_GROUP_DESCRIPTION" );
- projectName = getProperty( "MAVEN2_PROJECT_NAME" );
+ projectName = getProperty( "MAVEN2_POM_PROJECT_NAME" );
String projectPomUrl = getProperty( "MAVEN2_POM_URL" );
String pomUsername = getProperty( "MAVEN2_POM_USERNAME" );
String pomPassword = getProperty( "MAVEN2_POM_PASSWORD" );
@@ -119,7 +119,7 @@ public class NotifierTest
assertTextPresent( "Address is invalid" );
}
- @Test( dependsOnMethods = {"testAddValidMailProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidMailProjectNotifier" } )
public void testEditValidMailProjectNotifier()
throws Exception
{
@@ -129,7 +129,7 @@ public class NotifierTest
editMailNotifier( projectGroupName, projectName, newMail, mailNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidMailProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidMailProjectNotifier" } )
public void testEditInvalidMailProjectNotifier()
throws Exception
{
@@ -151,7 +151,7 @@ public class NotifierTest
addMailNotifier( projectGroupName, null, mailNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidMailGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidMailGroupNotifier" } )
public void testEditValidMailGroupNotifier()
throws Exception
{
@@ -163,7 +163,7 @@ public class NotifierTest
editMailNotifier( projectGroupName, null, newMail, mailNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidMailGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidMailGroupNotifier" } )
public void testEditInvalidMailGroupNotifier()
throws Exception
{
@@ -198,7 +198,7 @@ public class NotifierTest
assertTextPresent( "Channel contains invalid character" );
}
- @Test( dependsOnMethods = {"testAddValidIrcProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidIrcProjectNotifier" } )
public void testEditValidIrcProjectNotifier()
throws Exception
{
@@ -211,7 +211,7 @@ public class NotifierTest
true );
}
- @Test( dependsOnMethods = {"testAddValidIrcProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidIrcProjectNotifier" } )
public void testEditInvalidIrcProjectNotifier()
throws Exception
{
@@ -235,7 +235,7 @@ public class NotifierTest
addIrcNotifier( projectGroupName, null, ircNotifierHost, ircNotifierChannel, true );
}
- @Test( dependsOnMethods = {"testAddValidIrcGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidIrcGroupNotifier" } )
public void testEditValidIrcGroupNotifier()
throws Exception
{
@@ -248,7 +248,7 @@ public class NotifierTest
editIrcNotifier( projectGroupName, null, newHost, newChannel, ircNotifierHost, ircNotifierChannel, true );
}
- @Test( dependsOnMethods = {"testAddValidIrcGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidIrcGroupNotifier" } )
public void testEditInvalidIrcGroupNotifier()
throws Exception
{
@@ -287,7 +287,7 @@ public class NotifierTest
assertTextPresent( "Address is invalid" );
}
- @Test( dependsOnMethods = {"testAddValidJabberProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidJabberProjectNotifier" } )
public void testEditValidJabberProjectNotifier()
throws Exception
{
@@ -302,7 +302,7 @@ public class NotifierTest
jabberNotifierLogin, jabberNotifierPassword, jabberNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidJabberProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidJabberProjectNotifier" } )
public void testEditInvalidJabberProjectNotifier()
throws Exception
{
@@ -330,7 +330,7 @@ public class NotifierTest
jabberNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidJabberGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidJabberGroupNotifier" } )
public void testEditValidJabberGroupNotifier()
throws Exception
{
@@ -347,7 +347,7 @@ public class NotifierTest
jabberNotifierLogin, jabberNotifierPassword, jabberNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidJabberGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidJabberGroupNotifier" } )
public void testEditInvalidJabberGroupNotifier()
throws Exception
{
@@ -387,7 +387,7 @@ public class NotifierTest
assertTextPresent( "Address is invalid" );
}
- @Test( dependsOnMethods = {"testAddValidMsnProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidMsnProjectNotifier" } )
public void testEditValidMsnProjectNotifier()
throws Exception
{
@@ -401,7 +401,7 @@ public class NotifierTest
msnNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidMsnProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidMsnProjectNotifier" } )
public void testEditInvalidMsnProjectNotifier()
throws Exception
{
@@ -426,7 +426,7 @@ public class NotifierTest
addMsnNotifier( projectGroupName, null, msnNotifierLogin, msnNotifierPassword, msnNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidMsnGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidMsnGroupNotifier" } )
public void testEditValidMsnGroupNotifier()
throws Exception
{
@@ -442,7 +442,7 @@ public class NotifierTest
msnNotifierAddress, true );
}
- @Test( dependsOnMethods = {"testAddValidMsnGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidMsnGroupNotifier" } )
public void testEditInvalidMsnGroupNotifier()
throws Exception
{
@@ -478,7 +478,7 @@ public class NotifierTest
assertTextPresent( "Destination URL is invalid" );
}
- @Test( dependsOnMethods = {"testAddValidWagonProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidWagonProjectNotifier" } )
public void testEditValidWagonProjectNotifier()
throws Exception
{
@@ -490,7 +490,7 @@ public class NotifierTest
true );
}
- @Test( dependsOnMethods = {"testAddValidWagonProjectNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidWagonProjectNotifier" } )
public void testEditInvalidWagonProjectNotifier()
throws Exception
{
@@ -514,7 +514,7 @@ public class NotifierTest
addWagonNotifierPage( projectGroupName, null, wagonNotifierUrl, wagonServerId, true );
}
- @Test( dependsOnMethods = {"testAddValidWagonGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidWagonGroupNotifier" } )
public void testEditValidWagonGroupNotifier()
throws Exception
{
@@ -526,7 +526,7 @@ public class NotifierTest
editWagonNotifier( projectGroupName, null, wagonNotifierUrl, newId, wagonNotifierUrl, wagonServerId, true );
}
- @Test( dependsOnMethods = {"testAddValidWagonGroupNotifier"} )
+ @Test( dependsOnMethods = { "testAddValidWagonGroupNotifier" } )
public void testEditInvalidWagonGroupNotifier()
throws Exception
{
@@ -545,7 +545,7 @@ public class NotifierTest
assertTextPresent( "Server Id is required" );
}
- @Test( dependsOnMethods = {"testEditValidMailGroupNotifier", "testEditInvalidMailGroupNotifier"} )
+ @Test( dependsOnMethods = { "testEditValidMailGroupNotifier", "testEditInvalidMailGroupNotifier" } )
public void testDeleteGroupNotifier()
throws Exception
{
@@ -559,7 +559,7 @@ public class NotifierTest
assertGroupNotifierPage( projectGroupName );
}
- @Test( dependsOnMethods = {"testEditValidMailProjectNotifier", "testEditInvalidMailProjectNotifier"} )
+ @Test( dependsOnMethods = { "testEditValidMailProjectNotifier", "testEditInvalidMailProjectNotifier" } )
public void testDeleteProjectNotifier()
throws Exception
{
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/QueueTest.java Tue Aug 14 12:18:56 2012
@@ -19,7 +19,8 @@ package org.apache.continuum.web.test;
* under the License.
*/
-import org.apache.continuum.web.test.parent.AbstractBuildQueueTest;
+import org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -27,21 +28,25 @@ import org.testng.annotations.Test;
* @author José Morales MartÃnez
* @version $Id$
*/
-
-
-@Test( groups = {"queue"} )
+@Test( groups = { "queue" } )
public class QueueTest
- extends AbstractBuildQueueTest
+ extends AbstractAdminTest
{
+ private String buildQueueName;
+
+ @BeforeMethod
+ protected void setUp()
+ throws Exception
+ {
+ buildQueueName = getProperty( "BUILD_QUEUE_NAME" );
+ }
public void testAddBuildQueue()
{
setMaxBuildQueue( 2 );
- String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
- addBuildQueue( BUILD_QUEUE_NAME, true );
+ addBuildQueue( buildQueueName, true );
}
- @Test( dependsOnMethods = {"testAddBuildQueue"} ) //"testDeleteBuildQueue" } )
public void testQueuePageWithoutBuild()
{
clickAndWait( "link=Queues" );
@@ -56,53 +61,49 @@ public class QueueTest
assertTextPresent( "Prepare Build Queue" );
}
- @Test( dependsOnMethods = {"testAddBuildQueue", "testAddSchedule"} )
+ @Test( dependsOnMethods = { "testAddBuildQueue" } )
public void testAddBuildQueueToSchedule()
{
- ScheduleTest sched = new ScheduleTest();
+ String scheduleName = getProperty( "QUEUE_SCHEDULE_NAME" );
+ String scheduleDescription = getProperty( "SCHEDULE_DESCRIPTION" );
+ String second = getProperty( "SCHEDULE_EXPR_SECOND" );
+ String minute = getProperty( "SCHEDULE_EXPR_MINUTE" );
+ String hour = getProperty( "SCHEDULE_EXPR_HOUR" );
+ String dayOfMonth = getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
+ String month = getProperty( "SCHEDULE_EXPR_MONTH" );
+ String dayOfWeek = getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
+ String year = getProperty( "SCHEDULE_EXPR_YEAR" );
+ String maxTime = getProperty( "SCHEDULE_MAX_TIME" );
+ String period = getProperty( "SCHEDULE_PERIOD" );
+
+ goToAddSchedule();
+ addEditSchedule( scheduleName, scheduleDescription, second, minute, hour, dayOfMonth, month, dayOfWeek, year,
+ maxTime, period, true, true );
+ goToEditSchedule( scheduleName, scheduleDescription, second, minute, hour, dayOfMonth, month, dayOfWeek, year,
+ maxTime, period );
- String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
- String SCHEDULE_DESCRIPTION = getProperty( "SCHEDULE_DESCRIPTION" );
- String SCHEDULE_EXPR_SECOND = getProperty( "SCHEDULE_EXPR_SECOND" );
- String SCHEDULE_EXPR_MINUTE = getProperty( "SCHEDULE_EXPR_MINUTE" );
- String SCHEDULE_EXPR_HOUR = getProperty( "SCHEDULE_EXPR_HOUR" );
- String SCHEDULE_EXPR_DAY_MONTH = getProperty( "SCHEDULE_EXPR_DAY_MONTH" );
- String SCHEDULE_EXPR_MONTH = getProperty( "SCHEDULE_EXPR_MONTH" );
- String SCHEDULE_EXPR_DAY_WEEK = getProperty( "SCHEDULE_EXPR_DAY_WEEK" );
- String SCHEDULE_EXPR_YEAR = getProperty( "SCHEDULE_EXPR_YEAR" );
- String SCHEDULE_MAX_TIME = getProperty( "SCHEDULE_MAX_TIME" );
- String SCHEDULE_PERIOD = getProperty( "SCHEDULE_PERIOD" );
-
- String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
-
- sched.goToEditSchedule( SCHEDULE_NAME, SCHEDULE_DESCRIPTION, SCHEDULE_EXPR_SECOND, SCHEDULE_EXPR_MINUTE,
- SCHEDULE_EXPR_HOUR, SCHEDULE_EXPR_DAY_MONTH, SCHEDULE_EXPR_MONTH,
- SCHEDULE_EXPR_DAY_WEEK, SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD );
- getSelenium().addSelection( "saveSchedule_availableBuildQueuesIds", "label=" + BUILD_QUEUE_NAME );
+ getSelenium().addSelection( "saveSchedule_availableBuildQueuesIds", "label=" + buildQueueName );
getSelenium().click( "//input[@value='->']" );
submit();
-
}
- @Test( dependsOnMethods = {"testAddBuildQueue"} )
+ @Test( dependsOnMethods = { "testAddBuildQueue" } )
public void testAddNotAllowedBuildQueue()
{
setMaxBuildQueue( 1 );
- String secodQueue = "second_queue_name";
- addBuildQueue( secodQueue, false );
+ String secondQueue = "second_queue_name";
+ addBuildQueue( secondQueue, false );
assertTextPresent( "You are only allowed 1 number of builds in parallel." );
}
- @Test( dependsOnMethods = {"testAddBuildQueue"} )
+ @Test( dependsOnMethods = { "testAddBuildQueue" } )
public void testAddAlreadyExistBuildQueue()
{
setMaxBuildQueue( 3 );
- String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
- addBuildQueue( BUILD_QUEUE_NAME, false );
+ addBuildQueue( buildQueueName, false );
assertTextPresent( "Build queue name already exists." );
}
- @Test( dependsOnMethods = {"testAddAlreadyExistBuildQueue"} )
public void testAddEmptyBuildQueue()
{
setMaxBuildQueue( 3 );
@@ -110,24 +111,34 @@ public class QueueTest
assertTextPresent( "You must define a name" );
}
- @Test( dependsOnMethods = {"testAddBuildQueueToSchedule"} )
public void testDeleteBuildQueue()
{
+ setMaxBuildQueue( 3 );
goToBuildQueuePage();
- String BUILD_QUEUE_NAME = getProperty( "BUILD_QUEUE_NAME" );
- removeBuildQueue( BUILD_QUEUE_NAME );
- assertTextNotPresent( BUILD_QUEUE_NAME );
+ String testBuildQueue = "test_build_queue";
+ addBuildQueue( testBuildQueue, true );
+
+ removeBuildQueue( testBuildQueue );
+ assertTextNotPresent( testBuildQueue );
}
- @Test( dependsOnMethods = {"testAddMavenTwoProject"} )
+ @Test( dependsOnMethods = { "testQueuePageWithoutBuild" } )
public void testQueuePageWithProjectCurrentlyBuilding()
throws Exception
{
+ String pomUrl = getProperty( "MAVEN2_QUEUE_TEST_POM_URL" );
+ String pomUsername = getProperty( "MAVEN2_QUEUE_TEST_POM_USERNAME" );
+ String pomPassword = getProperty( "MAVEN2_QUEUE_TEST_POM_PASSWORD" );
+
+ String projectGroupName = getProperty( "MAVEN2_QUEUE_TEST_POM_PROJECT_GROUP_NAME" );
+ String projectGroupId = getProperty( "MAVEN2_QUEUE_TEST_POM_PROJECT_GROUP_ID" );
+ String projectGroupDescription = getProperty( "MAVEN2_QUEUE_TEST_POM_PROJECT_GROUP_DESCRIPTION" );
+
//build a project
- 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" );
- buildProjectForQueuePageTest( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+ goToAddMavenTwoProjectPage();
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
+
+ buildProjectForQueuePageTest( projectGroupName, projectGroupId, projectGroupDescription );
String location = getSelenium().getLocation();
//check queue page while building
@@ -140,39 +151,66 @@ public class QueueTest
assertTextPresent( "Current Prepare Build" );
assertTextPresent( "Prepare Build Queue" );
assertElementPresent( "//table[@id='ec_table']/tbody/tr/td[4]" );
- assertTextPresent( M2_PROJ_GRP_NAME );
+ assertTextPresent( projectGroupName );
getSelenium().open( location );
waitPage();
waitForElementPresent( "//img[@alt='Success']" );
}
- @Test( dependsOnMethods = {"testQueuePageWithProjectCurrentlyBuilding", "testAddBuildAgent"} )
- public void testQueuePageWithProjectCurrentlyBuildingInDistributedBuilds()
- throws Exception
+ protected void goToBuildQueuePage()
{
- 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" );
+ clickLinkWithText( "Build Queue" );
- try
- {
- enableDistributedBuilds();
- buildProjectForQueuePageTest( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
+ assertBuildQueuePage();
+ }
- //check queue page while building
- getSelenium().open( "/continuum/admin/displayQueues!display.action" );
- assertPage( "Continuum - View Distributed Builds" );
- assertTextPresent( "Current Build" );
- assertTextPresent( "Build Queue" );
- assertTextPresent( "Current Prepare Build" );
- assertTextPresent( "Prepare Build Queue" );
- assertTextPresent( M2_PROJ_GRP_NAME );
- assertTextPresent( "Build Agent URL" );
+ void assertBuildQueuePage()
+ {
+ assertPage( "Continumm - Parallel Build Queue" );
+ assertTextPresent( "Continuum - Parallel Build Queue" );
+ assertTextPresent( "Name" );
+ assertTextPresent( "DEFAULT_BUILD_QUEUE" );
+ assertButtonWithValuePresent( "Add" );
+ }
+
+ protected void removeBuildQueue( String queueName )
+ {
+ clickLinkWithXPath(
+ "(//a[contains(@href,'deleteBuildQueue.action') and contains(@href, '" + queueName + "')])//img" );
+ assertTextPresent( "Delete Parallel Build Queue" );
+ assertTextPresent( "Are you sure you want to delete the build queue \"" + queueName + "\"?" );
+ assertButtonWithValuePresent( "Delete" );
+ assertButtonWithValuePresent( "Cancel" );
+ clickButtonWithValue( "Delete" );
+ assertBuildQueuePage();
+ }
+
+ void assertAddBuildQueuePage()
+ {
+ assertPage( "Continuum - Add/Edit Parallel Build Queue" );
+ assertTextPresent( "Continuum - Add/Edit Parallel Build Queue" );
+ assertTextPresent( "Name*" );
+ assertElementPresent( "name" );
+ assertButtonWithValuePresent( "Save" );
+ assertButtonWithValuePresent( "Cancel" );
+ }
+
+ protected void addBuildQueue( String name, boolean success )
+ {
+ goToBuildQueuePage();
+ assertBuildQueuePage();
+ submit();
+ assertAddBuildQueuePage();
+ setFieldValue( "name", name );
+ submit();
+ if ( success )
+ {
+ assertBuildQueuePage();
+ assertTextPresent( name );
}
- finally
+ else
{
- disableDistributedBuilds();
+ assertAddBuildQueuePage();
}
}
-
}
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java Tue Aug 14 12:18:56 2012
@@ -33,7 +33,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
-@Test( groups = {"release"} )
+@Test( groups = { "release" } )
public class ReleaseTest
extends AbstractAdminTest
{
@@ -73,7 +73,7 @@ public class ReleaseTest
String pomUrl = getProperty( "MAVEN2_POM_URL" );
String pomUsername = getProperty( "MAVEN2_POM_USERNAME" );
String pomPassword = getProperty( "MAVEN2_POM_PASSWORD" );
- String projectName = getProperty( "MAVEN2_PROJECT_NAME" );
+ String projectName = getProperty( "MAVEN2_POM_PROJECT_NAME" );
addProjectGroup( projectGroupName, projectGroupId, description, true, false );
clickLinkWithText( projectGroupName );
@@ -187,7 +187,7 @@ public class ReleaseTest
assertPreparedReleasesFileCreated();
}
- @Test( dependsOnMethods = {"testReleasePrepareProjectWithNoBuildEnvironment"} )
+ @Test( dependsOnMethods = { "testReleasePrepareProjectWithNoBuildEnvironment" } )
public void testReleasePerformUsingProvidedParametersWithDistributedBuilds()
throws Exception
{
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReportTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReportTest.java?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReportTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReportTest.java Tue Aug 14 12:18:56 2012
@@ -20,13 +20,55 @@ package org.apache.continuum.web.test;
*/
import org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-@Test( groups = {"report"} )
+@Test( groups = { "report" } )
public class ReportTest
extends AbstractAdminTest
{
- @Test( dependsOnMethods = {"testProjectGroupAllBuildSuccess"} )
+ private String projectGroupName;
+
+ private String failedProjectGroupName;
+
+ @BeforeClass
+ public void createProject()
+ {
+ projectGroupName = getProperty( "REPORT_PROJECT_GROUP_NAME" );
+ String projectGroupId = getProperty( "REPORT_PROJECT_GROUP_ID" );
+ String projectGroupDescription = getProperty( "REPORT_PROJECT_GROUP_DESCRIPTION" );
+
+ String projectName = getProperty( "MAVEN2_POM_PROJECT_NAME" );
+ String projectPomUrl = getProperty( "MAVEN2_POM_URL" );
+ String pomUsername = getProperty( "MAVEN2_POM_USERNAME" );
+ String pomPassword = getProperty( "MAVEN2_POM_PASSWORD" );
+
+ loginAsAdmin();
+ addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true, false );
+ clickLinkWithText( projectGroupName );
+ if ( !isLinkPresent( projectName ) )
+ {
+ addMavenTwoProject( projectPomUrl, pomUsername, pomPassword, projectGroupName, true );
+
+ buildProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, projectName, true );
+ }
+ }
+
+ @BeforeMethod
+ protected void setUp()
+ throws Exception
+ {
+ failedProjectGroupName = getProperty( "MAVEN2_FAILING_PROJECT_POM_PROJECT_GROUP_NAME" );
+ }
+
+ @AfterMethod
+ public void tearDown()
+ {
+ removeProjectGroup( failedProjectGroupName, false );
+ }
+
public void testViewBuildsReportWithSuccessfulBuild()
throws Exception
{
@@ -35,7 +77,7 @@ public class ReportTest
clickButtonWithValue( "View Report" );
assertProjectBuildReportWithResult();
- assertTextPresent( getProperty( "M2_PROJ_GRP_NAME" ) );
+ assertTextPresent( projectGroupName );
assertImgWithAlt( "Success" );
}
@@ -46,7 +88,7 @@ public class ReportTest
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" );
-
+
for ( int ctr = 0; ctr < 10; ctr++ )
{
buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME, true );
@@ -103,18 +145,18 @@ public class ReportTest
public void testViewBuildsReportWithFailedBuild()
throws Exception
{
- String M2_POM_URL = getProperty( "M2_FAILING_PROJ_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_FAILING_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_ID = getProperty( "M2_FAILING_PROJ_GRP_ID" );
- String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_FAILING_PROJ_DESCRIPTION" );
+ String pomUrl = getProperty( "MAVEN2_FAILING_PROJECT_POM_URL" );
+ String pomUsername = "";
+ String pomPassword = "";
+
+ String failedProjectGroupId = getProperty( "MAVEN2_FAILING_PROJECT_POM_PROJECT_GROUP_ID" );
+ String failedProjectGroupDescription = getProperty( "MAVEN2_FAILING_PROJECT_POM_PROJECT_GROUP_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 );
+ addMavenTwoProject( pomUrl, pomUsername, pomPassword, null, true );
+ assertProjectGroupSummaryPage( failedProjectGroupName, failedProjectGroupId, failedProjectGroupDescription );
- buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME, false );
+ buildProjectGroup( failedProjectGroupName, failedProjectGroupId, failedProjectGroupDescription,
+ failedProjectGroupName, false );
goToProjectBuildsReport();
selectValue( "buildStatus", "Failed" );
@@ -122,7 +164,7 @@ public class ReportTest
assertProjectBuildReportWithResult();
assertImgWithAlt( "Failed" );
- assertTextPresent( M2_PROJ_GRP_NAME );
+ assertTextPresent( failedProjectGroupName );
}
public void testViewBuildsReportWithErrorBuild()
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ScheduleTest.java Tue Aug 14 12:18:56 2012
@@ -19,16 +19,16 @@ package org.apache.continuum.web.test;
* under the License.
*/
-import org.apache.continuum.web.test.parent.AbstractScheduleTest;
+import org.apache.continuum.web.test.parent.AbstractAdminTest;
import org.testng.annotations.Test;
/**
* @author José Morales MartÃnez
* @version $Id$
*/
-@Test( groups = {"schedule"} )
+@Test( groups = { "schedule" } )
public class ScheduleTest
- extends AbstractScheduleTest
+ extends AbstractAdminTest
{
public void testAddScheduleNoBuildQueueToBeUsed()
{
@@ -50,7 +50,7 @@ public class ScheduleTest
assertTextPresent( "Used Build Queues cannot be empty" );
}
- @Test( dependsOnMethods = {"testAddScheduleNoBuildQueueToBeUsed"} )
+ @Test( dependsOnMethods = { "testAddScheduleNoBuildQueueToBeUsed" } )
public void testAddSchedule()
{
String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
@@ -70,7 +70,7 @@ public class ScheduleTest
SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, true, true );
}
- @Test( dependsOnMethods = {"testAddScheduleNoBuildQueueToBeUsed"} )
+ @Test( dependsOnMethods = { "testAddScheduleNoBuildQueueToBeUsed" } )
public void testAddScheduleWithInvalidValues()
{
String SCHEDULE_NAME = "!@#$<>?etc";
@@ -100,7 +100,7 @@ public class ScheduleTest
assertTextPresent( "Description is required and cannot contain spaces only" );
}
- @Test( dependsOnMethods = {"testAddSchedule"} )
+ @Test( dependsOnMethods = { "testAddSchedule" } )
public void testAddDuplicatedSchedule()
{
String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
@@ -121,7 +121,7 @@ public class ScheduleTest
assertTextPresent( "A Schedule with the same name already exists" );
}
- @Test( dependsOnMethods = {"testAddDuplicatedSchedule"} )
+ @Test( dependsOnMethods = { "testAddDuplicatedSchedule" } )
public void testEditSchedule()
{
String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
@@ -157,10 +157,23 @@ public class ScheduleTest
SCHEDULE_EXPR_YEAR, SCHEDULE_MAX_TIME, SCHEDULE_PERIOD, false, true );
}
- @Test( dependsOnMethods = {"testEditSchedule"} )
+ @Test( dependsOnMethods = { "testEditSchedule" } )
public void testDeleteSchedule()
{
String SCHEDULE_NAME = getProperty( "SCHEDULE_NAME" );
removeSchedule( SCHEDULE_NAME );
}
+
+ protected void removeSchedule( String name )
+ {
+ goToSchedulePage();
+ clickLinkWithXPath( "(//a[contains(@href,'removeSchedule.action') and contains(@href, '" + name + "')])//img" );
+ assertPage( "Continuum - Delete Schedule" );
+ assertTextPresent( "Delete Schedule" );
+ assertTextPresent( "Are you sure you want to delete the schedule \"" + name + "\"?" );
+ assertButtonWithValuePresent( "Delete" );
+ assertButtonWithValuePresent( "Cancel" );
+ clickButtonWithValue( "Delete" );
+ assertSchedulePage();
+ }
}
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java?rev=1372854&r1=1372853&r2=1372854&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java Tue Aug 14 12:18:56 2012
@@ -624,12 +624,12 @@ public abstract class AbstractContinuumT
assertElementPresent( "m1PomFile" );
assertTextPresent( "Project Group" );
assertElementPresent( "selectedProjectGroup" );
- assertOptionPresent( "selectedProjectGroup", new String[]{"Defined by POM", "Default Project Group"} );
+ assertOptionPresent( "selectedProjectGroup", new String[]{ "Defined by POM", "Default Project Group" } );
assertTextPresent( "Build Definition Template" );
assertElementPresent( "buildDefinitionTemplateId" );
assertOptionPresent( "buildDefinitionTemplateId",
- new String[]{"Default", "Default Ant Template", "Default Maven 1 Template",
- "Default Maven Template", "Default Shell Template"} );
+ new String[]{ "Default", "Default Ant Template", "Default Maven 1 Template",
+ "Default Maven Template", "Default Shell Template" } );
assertButtonWithValuePresent( "Add" );
assertButtonWithValuePresent( "Cancel" );
}
@@ -698,12 +698,12 @@ public abstract class AbstractContinuumT
assertElementPresent( "projectScmUseCache" );
assertTextPresent( "Project Group" );
assertElementPresent( "selectedProjectGroup" );
- assertOptionPresent( "selectedProjectGroup", new String[]{"Default Project Group"} );
+ assertOptionPresent( "selectedProjectGroup", new String[]{ "Default Project Group" } );
assertTextPresent( "Build Definition Template" );
assertElementPresent( "buildDefinitionTemplateId" );
assertOptionPresent( "buildDefinitionTemplateId",
- new String[]{"Default", "Default Ant Template", "Default Maven 1 Template",
- "Default Maven Template", "Default Shell Template"} );
+ new String[]{ "Default", "Default Ant Template", "Default Maven 1 Template",
+ "Default Maven Template", "Default Shell Template" } );
assertButtonWithValuePresent( "Add" );
assertButtonWithValuePresent( "Cancel" );
}
@@ -1015,7 +1015,7 @@ public abstract class AbstractContinuumT
}
@BeforeSuite( alwaysRun = true )
- @Parameters( {"baseUrl", "browser", "seleniumHost", "seleniumPort"} )
+ @Parameters( { "baseUrl", "browser", "seleniumHost", "seleniumPort" } )
public void initializeContinuum( @Optional( "http://localhost:9595/continuum" ) String baseUrl,
@Optional( "*firefox" ) String browser,
@Optional( "localhost" ) String seleniumHost,
@@ -1079,4 +1079,145 @@ public abstract class AbstractContinuumT
getSelenium().click( "loginForm__login" );
getSelenium().waitForPageToLoad( maxWaitTimeInMs );
}
+
+ protected void goToSchedulePage()
+ {
+ clickLinkWithText( "Schedules" );
+
+ assertSchedulePage();
+ }
+
+ protected void assertSchedulePage()
+ {
+ assertPage( "Continuum - Schedules" );
+ assertTextPresent( "Schedules" );
+ assertTextPresent( "Name" );
+ assertTextPresent( "Description" );
+ assertTextPresent( "Quiet Period" );
+ assertTextPresent( "Cron Expression" );
+ assertTextPresent( "Max Job Time" );
+ assertTextPresent( "Active" );
+ assertTextPresent( "DEFAULT_SCHEDULE" );
+ assertImgWithAlt( "Edit" );
+ assertImgWithAlt( "Delete" );
+ assertButtonWithValuePresent( "Add" );
+ }
+
+ protected void assertAddSchedulePage()
+ {
+ assertPage( "Continuum - Edit Schedule" );
+ assertTextPresent( "Edit Schedule" );
+ assertTextPresent( "Name" );
+ assertElementPresent( "name" );
+ assertTextPresent( "Description" );
+ assertElementPresent( "description" );
+ assertTextPresent( "Cron Expression" );
+ assertTextPresent( "Second" );
+ assertElementPresent( "second" );
+ assertTextPresent( "Minute" );
+ assertElementPresent( "minute" );
+ assertTextPresent( "Hour" );
+ assertElementPresent( "hour" );
+ assertTextPresent( "Day of Month" );
+ assertElementPresent( "dayOfMonth" );
+ assertTextPresent( "Month" );
+ assertElementPresent( "month" );
+ assertTextPresent( "Day of Week" );
+ assertElementPresent( "dayOfWeek" );
+ assertTextPresent( "Year [optional]" );
+ assertElementPresent( "year" );
+ assertTextPresent( "Maximum job execution time" );
+ assertElementPresent( "maxJobExecutionTime" );
+ assertTextPresent( "Quiet Period (seconds):" );
+ assertElementPresent( "delay" );
+ assertTextPresent( "Add Build Queue" );
+ assertElementPresent( "availableBuildQueuesIds" );
+ assertElementPresent( "selectedBuildQueuesIds" );
+ assertElementPresent( "active" );
+ assertTextPresent( "Enable/Disable the schedule" );
+ assertButtonWithValuePresent( "Save" );
+ assertButtonWithValuePresent( "Cancel" );
+ }
+
+ public void goToEditSchedule( String name, String description, String second, String minute, String hour,
+ String dayMonth, String month, String dayWeek, String year, String maxTime,
+ String period )
+ {
+ goToSchedulePage();
+ String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Edit']";
+ clickLinkWithXPath( xPath );
+ assertAddSchedulePage();
+ assertFieldValue( name, "name" );
+ assertFieldValue( description, "description" );
+ assertFieldValue( second, "second" );
+ assertFieldValue( minute, "minute" );
+ assertFieldValue( hour, "hour" );
+ assertFieldValue( dayMonth, "dayOfMonth" );
+ assertFieldValue( month, "month" );
+ assertFieldValue( dayWeek, "dayOfWeek" );
+ assertFieldValue( year, "year" );
+ assertFieldValue( maxTime, "maxJobExecutionTime" );
+ assertFieldValue( period, "delay" );
+ }
+
+ protected void buildProjectForQueuePageTest( String projectGroupName, String groupId, String description )
+ {
+ showProjectGroup( projectGroupName, groupId, description );
+ clickButtonWithValue( "Build all projects" );
+ waitForElementPresent( "//img[@alt='Building']" );
+ }
+
+ protected void goToAddSchedule()
+ {
+ goToSchedulePage();
+ clickButtonWithValue( "Add" );
+ assertAddSchedulePage();
+ }
+
+ protected void addEditSchedule( String name, String description, String second, String minute, String hour,
+ String dayMonth, String month, String dayWeek, String year, String maxTime,
+ String period, boolean buildQueue, boolean success )
+ {
+ if ( buildQueue )
+ {
+ setFieldValue( "name", name );
+ setFieldValue( "description", description );
+ setFieldValue( "second", second );
+ setFieldValue( "minute", minute );
+ setFieldValue( "hour", hour );
+ setFieldValue( "dayOfMonth", dayMonth );
+ setFieldValue( "month", month );
+ setFieldValue( "dayOfWeek", dayWeek );
+ setFieldValue( "year", year );
+ setFieldValue( "maxJobExecutionTime", maxTime );
+ setFieldValue( "delay", period );
+ getSelenium().addSelection( "saveSchedule_availableBuildQueuesIds", "label=DEFAULT_BUILD_QUEUE" );
+ getSelenium().click( "//input[@value='->']" );
+ submit();
+ }
+ else
+ {
+ setFieldValue( "name", name );
+ setFieldValue( "description", description );
+ setFieldValue( "second", second );
+ setFieldValue( "minute", minute );
+ setFieldValue( "hour", hour );
+ setFieldValue( "dayOfMonth", dayMonth );
+ setFieldValue( "month", month );
+ setFieldValue( "dayOfWeek", dayWeek );
+ setFieldValue( "year", year );
+ setFieldValue( "maxJobExecutionTime", maxTime );
+ setFieldValue( "delay", period );
+ submit();
+ }
+
+ if ( success )
+ {
+ assertSchedulePage();
+ }
+ else
+ {
+ assertAddSchedulePage();
+ }
+ }
}