You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ct...@apache.org on 2010/01/29 02:26:48 UTC
svn commit: r904336 - in /continuum/trunk/continuum-webapp-test: ./
src/appserver-base/ src/appserver-base/conf/ src/test/resources/
src/test/testng/config/ src/test/testng/org/apache/continuum/web/test/
src/test/testng/org/apache/continuum/web/test/pa...
Author: ctan
Date: Fri Jan 29 01:26:47 2010
New Revision: 904336
URL: http://svn.apache.org/viewvc?rev=904336&view=rev
Log:
[CONTINUUM-2450] added selenium test
Added:
continuum/trunk/continuum-webapp-test/src/appserver-base/
continuum/trunk/continuum-webapp-test/src/appserver-base/conf/
continuum/trunk/continuum-webapp-test/src/appserver-base/conf/continuum-buildagent.xml
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/parent/AbstractReleaseTest.java
Modified:
continuum/trunk/continuum-webapp-test/pom.xml
continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.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/ProjectGroupTest.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/AbstractContinuumTest.java
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
Modified: continuum/trunk/continuum-webapp-test/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/pom.xml?rev=904336&r1=904335&r2=904336&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/pom.xml (original)
+++ continuum/trunk/continuum-webapp-test/pom.xml Fri Jan 29 01:26:47 2010
@@ -129,6 +129,12 @@
<version>${project.version}</version>
<type>war</type>
</dependency>
+ <dependency>
+ <groupId>org.apache.continuum</groupId>
+ <artifactId>continuum-buildagent-webapp</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
<!-- container dependencies -->
<dependency>
@@ -275,10 +281,36 @@
<context>continuum</context>
</properties>
</deployable>
+ <deployable>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>continuum-buildagent-webapp</artifactId>
+ <type>war</type>
+ <properties>
+ <context>continuum-buildagent</context>
+ </properties>
+ </deployable>
</deployables>
</configuration>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy todir="${project.build.directory}">
+ <fileset dir="src/appserver-base" />
+ </copy>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
Added: continuum/trunk/continuum-webapp-test/src/appserver-base/conf/continuum-buildagent.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/appserver-base/conf/continuum-buildagent.xml?rev=904336&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/appserver-base/conf/continuum-buildagent.xml (added)
+++ continuum/trunk/continuum-webapp-test/src/appserver-base/conf/continuum-buildagent.xml Fri Jan 29 01:26:47 2010
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<continuum-buildagent-configuration>
+ <continuumServerUrl>http://localhost:9595/continuum/master-xmlrpc</continuumServerUrl>
+ <buildOutputDirectory>target/data/build-agent/build-output-directory</buildOutputDirectory>
+ <workingDirectory>target/data/build-agent/working-directory</workingDirectory>
+</continuum-buildagent-configuration>
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=904336&r1=904335&r2=904336&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Fri Jan 29 01:26:47 2010
@@ -34,6 +34,10 @@
M2_DELETE_PROJ_GRP_ID=org.apache.continuum.examples
M2_DELETE_PROJ_GRP_DESCRIPTION=Delete test project
M2_DELETE_PROJ_GRP_SCM_ROOT_URL=scm:svn:http://svn.apache.org/repos/asf/continuum/sandbox/simple-example
+M2_DELETE_PROJ_TAGBASE=scm:svn:https://svn.apache.org/repos/asf/continuum/sandbox/tags
+M2_DELETE_PROJ_TAG=simple-example-1.0
+M2_DELETE_PROJ_RELEASE_VERSION=1.0
+M2_DELETE_PROJ_DEVELOPMENT_VERSION=1.1-SNAPSHOT
# SCM element is missing from pom
NOT_SCM_POM_URL=http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml
@@ -271,10 +275,10 @@
########################
# buildAgents group
########################
-BUILD_AGENT_NAME =Agent_url_name
-BUILD_AGENT_DESCRIPTION =Agent_description
-BUILD_AGENT_NAME2 =Second_Agent
-BUILD_AGENT_DESCRIPTION2 =Agent_description2
-BUILD_AGENT_NAME3 =Third_Agent
-BUILD_AGENT_DESCRIPTION3 =Agent_description3
-BUILD_AGENT_GROUPNAME =agent_groupname
+BUILD_AGENT_NAME2=http://localhost:9595/continuum-buildagent/xmlrpc
+BUILD_AGENT_DESCRIPTION2=Agent_description2
+BUILD_AGENT_NAME=First_Agent
+BUILD_AGENT_DESCRIPTION=Agent_description
+BUILD_AGENT_NAME3=Third_Agent
+BUILD_AGENT_DESCRIPTION3=Agent_description3
+BUILD_AGENT_GROUPNAME=agent_groupname
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml?rev=904336&r1=904335&r2=904336&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml Fri Jan 29 01:26:47 2010
@@ -62,6 +62,7 @@
<include name="buildDefinitionTemplate" />
<include name="userroles"/>
<include name="agent"/>
+ <include name="release"/>
</run>
</groups>
<packages>
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java?rev=904336&r1=904335&r2=904336&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java Fri Jan 29 01:26:47 2010
@@ -23,65 +23,62 @@
import org.testng.annotations.Test;
import org.apache.continuum.web.test.parent.AbstractBuildAgentsTest;
-
@Test( groups = { "agent" }, dependsOnMethods = { "testDeleteBuildDefinitionTemplate" } )
public class BuildAgentsTest
extends AbstractBuildAgentsTest
{
-
+ @Test( dependsOnMethods = { "testProjectGroupAllBuildSuccess" } )
public void testAddBuildAgent()
{
- String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
- String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
- String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
- String BUILD_AGENT_DESCRIPTION2 = getProperty( "BUILD_AGENT_DESCRIPTION2" );
- String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
- String BUILD_AGENT_DESCRIPTION3 = getProperty( "BUILD_AGENT_DESCRIPTION3" );
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_DESCRIPTION2 = getProperty( "BUILD_AGENT_DESCRIPTION2" );
+ String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
+ String BUILD_AGENT_DESCRIPTION3 = getProperty( "BUILD_AGENT_DESCRIPTION3" );
- enableDistributedBuilds();
+ enableDistributedBuilds();
goToAddBuildAgent();
- addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, true );
+ addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, true, false );
goToAddBuildAgent();
- addBuildAgent( BUILD_AGENT_NAME2, BUILD_AGENT_DESCRIPTION2, true );
+ addBuildAgent( BUILD_AGENT_NAME2, BUILD_AGENT_DESCRIPTION2, true, true );
goToAddBuildAgent();
- addBuildAgent( BUILD_AGENT_NAME3, BUILD_AGENT_DESCRIPTION3, true );
+ addBuildAgent( BUILD_AGENT_NAME3, BUILD_AGENT_DESCRIPTION3, true, false );
disableDistributedBuilds();
- }
+ }
- @Test( dependsOnMethods = { "testEditBuildAgent" } )
+ @Test( dependsOnMethods = { "testEditBuildAgent" } )
public void testAddAnExistingBuildAgent()
{
- String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
- String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
- enableDistributedBuilds();
- goToAddBuildAgent();
- addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, false ) ;
+ enableDistributedBuilds();
+ goToAddBuildAgent();
+ addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, false, false ) ;
assertTextPresent( "Build agent already exists" );
disableDistributedBuilds();
}
- @Test( dependsOnMethods = { "testAddBuildAgent" } )
- public void testEditBuildAgent()
-
+ @Test( dependsOnMethods = { "testAddBuildAgent" } )
+ public void testEditBuildAgent()
{
- String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
- String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
- String new_agentDescription = "new_agentDescription";
-
- enableDistributedBuilds();
- goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION);
- addEditBuildAgent( BUILD_AGENT_NAME, new_agentDescription );
- goToEditBuildAgent( BUILD_AGENT_NAME, new_agentDescription);
- addEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
- disableDistributedBuilds();
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
+ String new_agentDescription = "new_agentDescription";
+
+ enableDistributedBuilds();
+ goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+ addEditBuildAgent( BUILD_AGENT_NAME, new_agentDescription );
+ goToEditBuildAgent( BUILD_AGENT_NAME, new_agentDescription);
+ addEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+ disableDistributedBuilds();
}
- @Test( dependsOnMethods = { "testAddAnExistingBuildAgent" } )
+ @Test( dependsOnMethods = { "testAddAnExistingBuildAgent" } )
public void testDeleteBuildAgent()
-
{
- enableDistributedBuilds();
+ enableDistributedBuilds();
goToBuildAgentPage();
String BUILD_AGENT_NAME3 = getProperty( "BUILD_AGENT_NAME3" );
removeBuildAgent( BUILD_AGENT_NAME3 );
@@ -96,69 +93,77 @@
enableDistributedBuilds();
goToAddBuildAgent();
- addBuildAgent( "", BUILD_AGENT_DESCRIPTION, false ) ;
+ addBuildAgent( "", BUILD_AGENT_DESCRIPTION, false, false ) ;
assertTextPresent( "Build agent url is required." );
disableDistributedBuilds();
}
//TESTS FOR BUILD AGENT GROUPS
- @Test( dependsOnMethods = { "testAddBuildAgent" } )
+ @Test( dependsOnMethods = { "testAddBuildAgent", "testDeleteBuildAgent" } )
public void testAddBuildAgentGroup()
- throws Exception
+ throws Exception
{
- String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
- enableDistributedBuilds();
- goToAddBuildAgentGroup();
- addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { "Agent_url_name", "Second_Agent" }, new String[] {}, true );
- disableDistributedBuilds();
- }
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
+ enableDistributedBuilds();
+ goToAddBuildAgentGroup();
+ addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME, BUILD_AGENT_NAME2 }, new String[] {}, true );
+ disableDistributedBuilds();
+ }
- @Test( dependsOnMethods = { "testAddBuildAgentGroup" } )
+ @Test( dependsOnMethods = { "testAddBuildAgentGroup" } )
public void testEditBuildAgentGroup()
throws Exception
{
- String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+
String newName = "new_agentgroupname";
enableDistributedBuilds();
- goToEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { "Agent_url_name", "Second_Agent" } );
+ goToEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME, BUILD_AGENT_NAME2 } );
addEditBuildAgentGroup( newName, new String[] {},
- new String[] { "Second_Agent" }, true );
- goToEditBuildAgentGroup( newName, new String[] { "Agent_url_name" } );
- addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { "Second_Agent" },
+ new String[] { BUILD_AGENT_NAME2 }, true );
+ goToEditBuildAgentGroup( newName, new String[] { BUILD_AGENT_NAME } );
+ addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME2 },
new String[] {}, true );
disableDistributedBuilds();
}
- @Test( dependsOnMethods = { "testEditBuildAgentGroup" } )
+ @Test( dependsOnMethods = { "testEditBuildAgentGroup" } )
public void testAddAnExistingBuildAgentGroup()
- throws Exception
+ throws Exception
{
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
enableDistributedBuilds();
- goToAddBuildAgentGroup();
- addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { "Agent_url_name", "Second_Agent" }, new String[] {}, false );
- assertTextPresent( "Build agent group already exists." );
- disableDistributedBuilds();
+ goToAddBuildAgentGroup();
+ addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[] { BUILD_AGENT_NAME, BUILD_AGENT_NAME2 }, new String[] {}, false );
+ assertTextPresent( "Build agent group already exists." );
+ disableDistributedBuilds();
}
@Test( dependsOnMethods = { "testAddAnExistingBuildAgentGroup" } )
public void testAddEmptyBuildAgentGroupName()
- throws Exception
+ throws Exception
{
enableDistributedBuilds();
- goToAddBuildAgentGroup();
- addEditBuildAgentGroup( "", new String[] {}, new String[] {}, false );
- assertTextPresent( "Build agent group name required." );
- disableDistributedBuilds();
+ goToAddBuildAgentGroup();
+ addEditBuildAgentGroup( "", new String[] {}, new String[] {}, false );
+ assertTextPresent( "Build agent group name required." );
+ disableDistributedBuilds();
}
@Test( dependsOnMethods = { "testAddEmptyBuildAgentGroupName" } )
public void testDeleteBuildAgentGroup()
{
- String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
- enableDistributedBuilds();
+ String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+ enableDistributedBuilds();
removeBuildAgentGroup( BUILD_AGENT_GROUPNAME );
disableDistributedBuilds();
}
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=904336&r1=904335&r2=904336&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 Fri Jan 29 01:26:47 2010
@@ -271,6 +271,14 @@
// remove project group
removeProjectGroup( M2_PROJ_GRP_NAME );
assertLinkNotPresent( M2_PROJ_GRP_NAME );
+
+ // re-add for later use
+ addMaven2Project( M2_PROJ_GRP_NAME );
+ clickLinkWithText( M2_PROJ_GRP_NAME );
+
+ assertPage( "Continuum - Project Group" );
+ //wait for project to finish checkout
+ waitForProjectCheckout();
}
private void addMaven2Project( String groupName )
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java?rev=904336&r1=904335&r2=904336&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java Fri Jan 29 01:26:47 2010
@@ -20,6 +20,7 @@
*/
import org.apache.continuum.web.test.parent.AbstractContinuumTest;
+import org.apache.continuum.web.test.parent.AbstractSeleniumTest;
import org.testng.annotations.Test;
/**
@@ -142,6 +143,25 @@
assertReleaseSuccess();
}
+ @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" );
+ String BUILD_AGENT_URL = getProperty( "BUILD_AGENT_NAME2" );
+
+ enableDistributedBuilds();
+ goToBuildAgentPage();
+ clickLinkWithText( BUILD_AGENT_URL );
+ assertTextPresent( "true" );
+
+ buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME );
+ clickButtonWithValue( "Release" );
+ assertReleaseSuccess();
+ disableDistributedBuilds();
+ }
+
@Test( dependsOnMethods = { "testAddProjectGroup" } )
public void testDeleteProjectGroup()
throws Exception
Added: 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=904336&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java (added)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java Fri Jan 29 01:26:47 2010
@@ -0,0 +1,84 @@
+package org.apache.continuum.web.test;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+import org.apache.continuum.web.test.parent.AbstractReleaseTest;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+@Test( groups = { "release" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
+public class ReleaseTest
+ extends AbstractReleaseTest
+{
+ @Test( dependsOnMethods = { "testProjectGroupAllBuildSuccessWithDistributedBuilds" } )
+ public void testReleasePrepareProjectWithInvalidUsernamePasswordInDistributedBuilds()
+ 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 M2_PROJ_USERNAME = "invalid";
+ String M2_PROJ_PASSWORD = "invalid";
+ String M2_PROJ_TAGBASE = getProperty( "M2_DELETE_PROJ_TAGBASE" );
+ String M2_PROJ_TAG = getProperty( "M2_DELETE_PROJ_TAG" );
+ String M2_PROJ_RELEASE_VERSION = getProperty( "M2_DELETE_PROJ_RELEASE_VERSION" );
+ String M2_PROJ_DEVELOPMENT_VERSION = getProperty( "M2_DELETE_PROJ_DEVELOPMENT_VERSION" );
+
+ init();
+ enableDistributedBuilds();
+ showProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+ clickButtonWithValue( "Release" );
+ assertReleaseSuccess();
+ releasePrepareProject( M2_PROJ_USERNAME, M2_PROJ_PASSWORD, M2_PROJ_TAGBASE, M2_PROJ_TAG,
+ M2_PROJ_RELEASE_VERSION, M2_PROJ_DEVELOPMENT_VERSION, false );
+
+ File file = new File( "target/conf/prepared-releases.xml" );
+ Assert.assertTrue( file.exists(), "prepared-releases.xml was not created" );
+
+ FileInputStream fis = new FileInputStream( file );
+ BufferedReader reader = new BufferedReader( new InputStreamReader( fis ) );
+
+ String BUILD_AGENT_URL = getProperty( "BUILD_AGENT_NAME2" );
+ String strLine;
+ StringBuffer str = new StringBuffer();
+ while( ( strLine = reader.readLine() ) != null )
+ {
+ str.append( strLine );
+ }
+
+ Assert.assertTrue( str.toString().contains( "<buildAgentUrl>" + BUILD_AGENT_URL + "</buildAgentUrl>" ), "prepared-releases.xml was not populated" );
+ disableDistributedBuilds();
+ }
+
+ private void init()
+ {
+ File file = new File( "target/conf/prepared-releases.xml" );
+
+ if ( file.exists() )
+ {
+ file.delete();
+ }
+ }
+}
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=904336&r1=904335&r2=904336&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 Fri Jan 29 01:26:47 2010
@@ -1,8 +1,5 @@
package org.apache.continuum.web.test.parent;
-//import org.testng.Assert;
-import org.apache.continuum.web.test.ConfigurationTest;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -25,75 +22,31 @@
public abstract class AbstractBuildAgentsTest
extends AbstractContinuumTest
{
- public void enableDistributedBuilds()
- {
- ConfigurationTest config = new ConfigurationTest();
- config.goToConfigurationPage();
- setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
- if ( !isChecked( "configuration_distributedBuildEnabled" ) )
- {
- checkField( "configuration_distributedBuildEnabled" );
- }
- clickAndWait( "configuration_" );
- assertTextPresent( "true" );
- assertTextPresent( "Distributed Builds" );
- assertElementPresent( "link=Build Agents" );
- }
-
- public void disableDistributedBuilds()
- {
- ConfigurationTest config = new ConfigurationTest();
- config.goToConfigurationPage();
- setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
- if ( isChecked( "configuration_distributedBuildEnabled" ) )
- {
- uncheckField( "configuration_distributedBuildEnabled" );
- }
- submit();
- assertTextPresent( "false" );
- assertElementNotPresent( "link=Build Agents" );
- }
-
- public void goToBuildAgentPage()
- {
- clickAndWait("link=Build Agents");
- assertPage("Continuum - Build Agents");
- }
-
- public void assertBuildAgentPage()
+ public void goToAddBuildAgent()
{
- assertPage("Continuum - Build Agents");
- assertTextPresent("Build Agents");
- assertTextPresent("Build Agent Groups");
- assertButtonWithValuePresent( "Add" );
-
- }
-
- public void goToAddBuildAgent()
- {
- goToBuildAgentPage();
- assertBuildAgentPage();
- clickAndWait("editBuildAgent_0"); //add button
- assertAddEditBuildAgentPage();
+ goToBuildAgentPage();
+ assertBuildAgentPage();
+ clickAndWait("editBuildAgent_0"); //add button
+ assertAddEditBuildAgentPage();
}
- public void assertAddEditBuildAgentPage()
+ public void assertAddEditBuildAgentPage()
{
- assertPage( "Continuum - Add/Edit Build Agent" );
+ assertPage( "Continuum - Add/Edit Build Agent" );
assertTextPresent( "Add/Edit Build Agent" );
assertTextPresent( "Build Agent URL*:" );
- assertTextPresent( "Description:" );
- assertTextPresent( "Enabled" );
+ assertTextPresent( "Description:" );
+ assertTextPresent( "Enabled" );
assertElementPresent( "saveBuildAgent_buildAgent_url" );
- assertElementPresent( "saveBuildAgent_buildAgent_description");
+ assertElementPresent( "saveBuildAgent_buildAgent_description");
assertButtonWithValuePresent( "Save" );
assertButtonWithValuePresent( "Cancel" );
}
- public void removeBuildAgent( String agentName )
- {
+ public void removeBuildAgent( String agentName )
+ {
clickLinkWithXPath( "(//a[contains(@href,'deleteBuildAgent.action') and contains(@href, '" + agentName + "')])//img" );
- assertPage("Continuum - Delete Build Agent");
+ assertPage("Continuum - Delete Build Agent");
assertTextPresent( "Delete Build Agent" );
assertTextPresent( "Are you sure you want to delete build agent " + agentName + " ?" );
assertButtonWithValuePresent( "Delete" );
@@ -102,97 +55,100 @@
assertBuildAgentPage();
}
- public void addBuildAgent( String agentURL, String description, boolean success )
- {
- setFieldValue( "saveBuildAgent_buildAgent_url", agentURL );
- setFieldValue("saveBuildAgent_buildAgent_description", description );
- checkField("saveBuildAgent_buildAgent_enabled");
- submit();
- if ( success )
- {
- assertBuildAgentPage();
- assertElementPresent( "link=" + agentURL );
-
- }
- else
- {
- assertAddEditBuildAgentPage();
- }
-
- }
+ public void addBuildAgent( String agentURL, String description, boolean success, boolean enabled )
+ {
+ setFieldValue( "saveBuildAgent_buildAgent_url", agentURL );
+ setFieldValue("saveBuildAgent_buildAgent_description", description );
- public void goToEditBuildAgent( String name, String description )
- {
- goToBuildAgentPage();
- clickImgWithAlt( "Edit" );
- assertAddEditBuildAgentPage();
- assertFieldValue( name, "saveBuildAgent_buildAgent_url" );
- assertFieldValue( description, "saveBuildAgent_buildAgent_description" );
+ if ( enabled )
+ {
+ checkField("saveBuildAgent_buildAgent_enabled");
+ }
- }
+ submit();
- public void addEditBuildAgent( String agentName, String newDesc )
- {
- assertFieldValue( agentName, "saveBuildAgent_buildAgent_url" );
- setFieldValue( "saveBuildAgent_buildAgent_description", newDesc );
- submit();
- assertBuildAgentPage();
- assertTextPresent( newDesc );
+ if ( success )
+ {
+ assertBuildAgentPage();
+ assertElementPresent( "link=" + agentURL );
+ clickLinkWithText( agentURL );
+ assertTextPresent( new Boolean( enabled ).toString() );
+ }
+ else
+ {
+ assertAddEditBuildAgentPage();
+ }
+ }
+ public void goToEditBuildAgent( String name, String description )
+ {
+ goToBuildAgentPage();
+ clickImgWithAlt( "Edit" );
+ assertAddEditBuildAgentPage();
+ assertFieldValue( name, "saveBuildAgent_buildAgent_url" );
+ assertFieldValue( description, "saveBuildAgent_buildAgent_description" );
}
+ public void addEditBuildAgent( String agentName, String newDesc )
+ {
+ assertFieldValue( agentName, "saveBuildAgent_buildAgent_url" );
+ setFieldValue( "saveBuildAgent_buildAgent_description", newDesc );
+ submit();
+ assertBuildAgentPage();
+ assertTextPresent( newDesc );
+ }
- public void goToAddBuildAgentGroup()
+ public void goToAddBuildAgentGroup()
{
- goToBuildAgentPage();
- clickAndWait("editBuildAgentGroup_0"); //add button
+ String BUILD_AGENT_NAME = getProperty( "BUILD_AGENT_NAME" );
+ String BUILD_AGENT_NAME2 = getProperty( "BUILD_AGENT_NAME2" );
+
+ goToBuildAgentPage();
+ clickAndWait("editBuildAgentGroup_0"); //add button
String[] options =
- new String[] { "--- Available Build Agents ---", "Agent_url_name", "Second_Agent" };
+ new String[] { "--- Available Build Agents ---", BUILD_AGENT_NAME, BUILD_AGENT_NAME2 };
assertAddEditBuildAgentGroupPage( options, null );
}
-
- public void addEditBuildAgentGroup( String name, String[] addBuildAgents, String[] removeBuildAgents,
+ public void addEditBuildAgentGroup( String name, String[] addBuildAgents, String[] removeBuildAgents,
boolean success ) throws Exception
- {
- setFieldValue( "saveBuildAgentGroup_buildAgentGroup_name", name );
- if ( addBuildAgents != null && addBuildAgents.length > 0 )
- {
- for ( String ba : addBuildAgents )
- {
- selectValue( "buildAgentIds", ba );
- clickButtonWithValue( "->", false );
- }
- }
- if ( removeBuildAgents != null && removeBuildAgents.length > 0 )
- {
- for ( String ba : removeBuildAgents )
- {
- selectValue( "selectedBuildAgentIds", ba );
- clickButtonWithValue( "<-", false );
- }
- }
- submit();
- if ( success )
- {
- assertBuildAgentPage();
- }
- else
- {
- assertAddEditBuildAgentGroupPage( null, null );
- }
-
-
- }
+ {
+ setFieldValue( "saveBuildAgentGroup_buildAgentGroup_name", name );
+ if ( addBuildAgents != null && addBuildAgents.length > 0 )
+ {
+ for ( String ba : addBuildAgents )
+ {
+ selectValue( "buildAgentIds", ba );
+ clickButtonWithValue( "->", false );
+ }
+ }
+ if ( removeBuildAgents != null && removeBuildAgents.length > 0 )
+ {
+ for ( String ba : removeBuildAgents )
+ {
+ selectValue( "selectedBuildAgentIds", ba );
+ clickButtonWithValue( "<-", false );
+ }
+ }
+ submit();
+ if ( success )
+ {
+ assertBuildAgentPage();
+ }
+ else
+ {
+ assertAddEditBuildAgentGroupPage( null, null );
+ }
+ }
- public void assertAddEditBuildAgentGroupPage( String[] availableBuildAgents, String[] usedBuildAgents )
+ public void assertAddEditBuildAgentGroupPage( String[] availableBuildAgents, String[] usedBuildAgents )
{
- assertPage( "Continuum - Add/Edit Build Agent Group" );
+ assertPage( "Continuum - Add/Edit Build Agent Group" );
assertTextPresent( "Add/Edit Build Agent Group" );
assertTextPresent( "Name*:" );
- assertTextPresent( "Configure the used Build Agents:" );
- assertElementPresent( "buildAgentGroup.name" );
- if ( availableBuildAgents != null && availableBuildAgents.length > 0 )
+ assertTextPresent( "Configure the used Build Agents:" );
+ assertElementPresent( "buildAgentGroup.name" );
+ if ( availableBuildAgents != null && availableBuildAgents.length > 0 )
{
assertOptionPresent( "buildAgentIds", availableBuildAgents );
}
@@ -201,32 +157,29 @@
assertOptionPresent( "selectedBuildAgentIds", usedBuildAgents );
}
- assertButtonWithValuePresent( "Save" );
+ assertButtonWithValuePresent( "Save" );
assertButtonWithValuePresent( "Cancel" );
}
- public void goToEditBuildAgentGroup( String name, String[] buildAgents )
+ public void goToEditBuildAgentGroup( String name, String[] buildAgents )
{
- goToBuildAgentPage();
+ goToBuildAgentPage();
String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Edit']";
clickLinkWithXPath( xPath );
assertAddEditBuildAgentGroupPage( null, buildAgents );
assertFieldValue( name, "buildAgentGroup.name" );
}
-
- public void removeBuildAgentGroup( String name )
- {
- goToBuildAgentPage();
- clickLinkWithXPath( "(//a[contains(@href,'deleteBuildAgentGroup.action') and contains(@href, '" + name + "')])//img" );
- assertPage("Continuum - Delete Build Agent Group");
- assertTextPresent( "Delete Build Agent" );
+ public void removeBuildAgentGroup( String name )
+ {
+ goToBuildAgentPage();
+ clickLinkWithXPath( "(//a[contains(@href,'deleteBuildAgentGroup.action') and contains(@href, '" + name + "')])//img" );
+ assertPage("Continuum - Delete Build Agent Group");
+ assertTextPresent( "Delete Build Agent" );
assertTextPresent( "Are you sure you want to delete build agent group " + name + " ?" );
assertButtonWithValuePresent( "Delete" );
assertButtonWithValuePresent( "Cancel" );
clickButtonWithValue( "Delete" );
assertBuildAgentPage();
}
-
-
}
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=904336&r1=904335&r2=904336&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 Fri Jan 29 01:26:47 2010
@@ -19,6 +19,7 @@
* under the License.
*/
+import org.apache.continuum.web.test.ConfigurationTest;
import org.testng.Assert;
/**
@@ -373,6 +374,10 @@
int maxIt = 10;
showProjectGroup( projectGroupName, groupId, description );
clickButtonWithValue( "Build all projects" );
+
+ Thread.sleep( 10000 );
+ getSelenium().refresh();
+
while ( isElementPresent( "//img[@alt='Building']" ) || isElementPresent( "//img[@alt='Updating']" ) )
{
Thread.sleep( 10000 );
@@ -384,6 +389,7 @@
}
currentIt++;
}
+
Thread.sleep( 10000 );
clickLinkWithText( projectName );
clickLinkWithText( "Builds" );
@@ -972,4 +978,51 @@
assertTextPresent( "Default Maven 2 Build Definition" );
assertTextPresent( "Default Shell Build Definition" );
}
+
+ // ////////////////////////////////////
+ // Distributed Builds
+ // ////////////////////////////////////
+
+ public void enableDistributedBuilds()
+ {
+ ConfigurationTest config = new ConfigurationTest();
+ config.goToConfigurationPage();
+ setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
+ if ( !isChecked( "configuration_distributedBuildEnabled" ) )
+ {
+ checkField( "configuration_distributedBuildEnabled" );
+ }
+ clickAndWait( "configuration_" );
+ assertTextPresent( "true" );
+ assertTextPresent( "Distributed Builds" );
+ assertElementPresent( "link=Build Agents" );
+ }
+
+ public void disableDistributedBuilds()
+ {
+ ConfigurationTest config = new ConfigurationTest();
+ config.goToConfigurationPage();
+ setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
+ if ( isChecked( "configuration_distributedBuildEnabled" ) )
+ {
+ uncheckField( "configuration_distributedBuildEnabled" );
+ }
+ submit();
+ assertTextPresent( "false" );
+ assertElementNotPresent( "link=Build Agents" );
+ }
+
+ public void goToBuildAgentPage()
+ {
+ clickAndWait("link=Build Agents");
+ assertPage("Continuum - Build Agents");
+ }
+
+ public void assertBuildAgentPage()
+ {
+ assertPage("Continuum - Build Agents");
+ assertTextPresent("Build Agents");
+ assertTextPresent("Build Agent Groups");
+ assertButtonWithValuePresent( "Add" );
+ }
}
Added: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java?rev=904336&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java (added)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java Fri Jan 29 01:26:47 2010
@@ -0,0 +1,79 @@
+package org.apache.continuum.web.test.parent;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public abstract class AbstractReleaseTest
+ extends AbstractContinuumTest
+{
+ public void releasePrepareProject( String username, String password, String tagBase, String tag, String releaseVersion, String developmentVersion, boolean success )
+ throws Exception
+ {
+ goToReleasePreparePage();
+ setFieldValue( "scmUsername", username );
+ setFieldValue( "scmPassword", password );
+ setFieldValue( "scmTag", tag );
+ setFieldValue( "scmTagBase", tagBase );
+ setFieldValue( "prepareGoals", "clean" );
+ setFieldValue( "relVersions", releaseVersion );
+ setFieldValue( "devVersions", developmentVersion );
+ submit();
+
+ while ( !isButtonWithValuePresent( "Done" ) )
+ {
+ Thread.sleep( 10000 );
+ }
+
+ assertButtonWithValuePresent( "Rollback changes" );
+
+ if ( success )
+ {
+ assertImgWithAltNotPresent( "Error" );
+ }
+ else
+ {
+ assertImgWithAlt( "Error" );
+ }
+ }
+
+ public void goToReleasePreparePage()
+ {
+ clickLinkWithLocator( "goal", false );
+ submit();
+ assertReleasePreparePage();
+ }
+
+ public void assertReleasePreparePage()
+ {
+ assertPage( "Continuum - Release Project" );
+ assertTextPresent( "Prepare Project for Release" );
+ assertTextPresent( "Release Prepare Parameters" );
+ assertTextPresent( "SCM Username" );
+ assertTextPresent( "SCM Password" );
+ assertTextPresent( "SCM Tag" );
+ assertTextPresent( "SCM Tag Base" );
+ assertTextPresent( "SCM Comment Prefix" );
+ assertTextPresent( "Preparation Goals" );
+ assertTextPresent( "Arguments" );
+ assertTextPresent( "Build Environment" );
+ assertTextPresent( "Release Version" );
+ assertTextPresent( "Next Development Version" );
+ assertButtonWithValuePresent( "Submit" );
+ }
+}
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=904336&r1=904335&r2=904336&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 Fri Jan 29 01:26:47 2010
@@ -199,6 +199,11 @@
assertElementPresent( locator );
}
+ public void assertImgWithAltNotPresent( String alt )
+ {
+ assertElementNotPresent( "//img[@alt='" + alt + "']" );
+ }
+
public void assertCellValueFromTable( String expected, String tableElement, int row, int column )
{
Assert.assertEquals( expected, getCellValueFromTable( tableElement, row, column ) );