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/10/08 10:15:18 UTC
svn commit: r1395466 - in /continuum/trunk:
continuum-webapp-test/src/test/resources/
continuum-webapp-test/src/test/testng/config/
continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/
continuum-webapp/src/main/webapp/WEB-INF/jsp/
Author: brett
Date: Mon Oct 8 08:15:17 2012
New Revision: 1395466
URL: http://svn.apache.org/viewvc?rev=1395466&view=rev
Log:
[CONTINUUM-2675] correct error when deleting build results
Added:
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildResultTest.java
Modified:
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/src/main/webapp/WEB-INF/jsp/buildResults.jsp
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=1395466&r1=1395465&r2=1395466&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Mon Oct 8 08:15:17 2012
@@ -222,6 +222,12 @@ BUILD_DEFINITION_DESCRIPTION=Maven Build
BUILD_QUEUE_NAME=name_build_queue
QUEUE_SCHEDULE_NAME=queue_schedule
+# Build result tests
+
+BUILD_RESULT_PROJECT_GROUP_NAME=Build Result Test Project Group
+BUILD_RESULT_PROJECT_GROUP_ID=org.apache.continuum.examples.buildresult
+BUILD_RESULT_PROJECT_GROUP_DESCRIPTION=Test project group for the build result project group tests
+
#####
DEFAULT_PROJ_GRP_NAME=Default Project Group
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=1395466&r1=1395465&r2=1395466&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 Mon Oct 8 08:15:17 2012
@@ -65,6 +65,7 @@
<include name="userroles"/>
<include name="csrf"/>
<include name="distributed"/>
+ <include name="buildResult"/>
</run>
</groups>
<packages>
Added: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildResultTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildResultTest.java?rev=1395466&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildResultTest.java (added)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildResultTest.java Mon Oct 8 08:15:17 2012
@@ -0,0 +1,81 @@
+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 org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+@Test( groups = { "buildResult" } )
+public class BuildResultTest
+ extends AbstractAdminTest
+{
+ private String projectGroupName;
+
+ private String projectGroupId;
+
+ private String projectGroupDescription;
+
+ private String projectName;
+
+ @BeforeClass
+ public void createProject()
+ {
+ projectGroupName = getProperty( "BUILD_RESULT_PROJECT_GROUP_NAME" );
+ projectGroupId = getProperty( "BUILD_RESULT_PROJECT_GROUP_ID" );
+ projectGroupDescription = getProperty( "BUILD_RESULT_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 );
+ }
+ }
+
+ public void testDeleteBuildResult()
+ {
+ buildProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, projectName, true );
+
+ // go to build results page
+ clickAndWait( "css=img[title='Build History']" );
+
+ assertPage( "Continuum - Build results" );
+ assertElementPresent( "css=tbody.tableBody tr" );
+
+ assertElementPresent( "selectedBuildResults_selector" );
+ getSelenium().click( "selectedBuildResults_selector" );
+ clickButtonWithValue( "Delete" );
+
+ assertPage( "Continuum - Delete Build Results" );
+
+ clickButtonWithValue( "Delete" );
+
+ assertPage( "Continuum - Build results" );
+ assertElementNotPresent( "css=tbody.tableBody tr" );
+ }
+
+}
Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp?rev=1395466&r1=1395465&r2=1395466&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp Mon Oct 8 08:15:17 2012
@@ -52,6 +52,8 @@
<form id="buildResultsForm" action="removeBuildResults.action" method="post">
<s:token/>
<s:set name="buildResults" value="buildResults" scope="request"/>
+ <s:hidden name="projectGroupId"/>
+ <s:hidden name="projectId"/>
<ec:table items="buildResults"
var="buildResult"
autoIncludeParameters="false"
@@ -103,8 +105,6 @@
<tr>
<td>
<redback:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
- <s:hidden name="projectGroupId"/>
- <s:hidden name="projectId"/>
<input type="button" name="delete-project" value="<s:text name="delete"/>" onclick="document.forms.buildResultsForm.submit();" />
</redback:ifAuthorized>
</td>