continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1491313 - 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-test/src/test/testng/org/apache/co...
Date Mon, 10 Jun 2013 00:06:38 GMT
Author: batkinson
Date: Mon Jun 10 00:06:38 2013
New Revision: 1491313

URL: http://svn.apache.org/r1491313
Log:
[CONTINUUM-2495] appearance.jsp should use POST instead of GET
Submitted by: Gwen Harold Autencio with modifications

Added:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AppearanceTest.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-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureFooterAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.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=1491313&r1=1491312&r2=1491313&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Mon Jun 10
00:06:38 2013
@@ -402,3 +402,8 @@ PROJECTUSER_DEFAULTPROJECTGROUP_FULLNAME
 ########################
 BUILD_AGENT_DESCRIPTION=Agent_description
 BUILD_AGENT_GROUPNAME=agent_groupname
+
+########################
+# appearance
+########################
+APPEARANCE_SAVE_FOOTER_URL=http://localhost:9595/continuum/admin/saveFooter!saveFooter.action

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=1491313&r1=1491312&r2=1491313&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 Jun 10 00:06:38
2013
@@ -63,6 +63,7 @@
         <include name="buildEnvironment"/>
         <include name="buildDefinitionTemplate"/>
         <include name="userroles"/>
+        <include name="appearance"/>
         <include name="csrf"/>
         <include name="distributed"/>
         <include name="buildResult"/>

Added: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AppearanceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AppearanceTest.java?rev=1491313&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AppearanceTest.java
(added)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AppearanceTest.java
Mon Jun 10 00:06:38 2013
@@ -0,0 +1,49 @@
+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.Assert;
+import org.testng.annotations.Test;
+
+@Test(groups = { "appearance" })
+public class AppearanceTest
+    extends AbstractAdminTest
+{
+
+    public void testAppearancePage()
+    {
+        goToAppearancePage();
+    }
+
+    @Test(dependsOnMethods = { "testAppearancePage" })
+    public void testSaveFooter()
+    {
+        goToAppearancePage();
+        getSelenium().type( "saveFooter_footer",
+                            "<div class=\"xright\">Continuum Test Footer</div>
<div class=\"clear\"><hr/></div>" );
+        clickButtonWithValue( "Save" );
+
+        assertTextPresent( "Successfully saved footer content." );
+
+        String SAVE_FOOTER_URL = getProperty( "APPEARANCE_SAVE_FOOTER_URL" );
+        Assert.assertEquals( getSelenium().getLocation(), SAVE_FOOTER_URL );
+    }
+}

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java?rev=1491313&r1=1491312&r2=1491313&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java
Mon Jun 10 00:06:38 2013
@@ -231,17 +231,4 @@ public class ConfigurationTest
             assertEditConfigurationPage();
         }
     }
-
-    protected void goToAppearancePage()
-    {
-        clickLinkWithText( "Appearance" );
-        assertAppearancePage();
-    }
-
-    void assertAppearancePage()
-    {
-        assertPage( "Configure Appearance" );
-        assertTextPresent( "Company Details" );
-        assertTextPresent( "Footer Content" );
-    }
 }

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=1491313&r1=1491312&r2=1491313&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
Mon Jun 10 00:06:38 2013
@@ -1308,4 +1308,23 @@ public abstract class AbstractContinuumT
         //windows
         return os.contains( "win" );
     }
+
+    // ////////////////////////////////////
+    // Appearance
+    // ////////////////////////////////////
+
+    protected void goToAppearancePage()
+    {
+        clickLinkWithText( "Appearance" );
+        assertAppearancePage();
+    }
+
+    protected void assertAppearancePage()
+    {
+        assertPage("Configure Appearance");
+        assertTextPresent("Appearance");
+        assertTextPresent("Company Details");
+        assertTextPresent("Footer Content");
+        assertButtonWithValuePresent( "Save" );
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureFooterAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureFooterAction.java?rev=1491313&r1=1491312&r2=1491313&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureFooterAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureFooterAction.java
Mon Jun 10 00:06:38 2013
@@ -43,6 +43,7 @@ public class ConfigureFooterAction
         throws IOException
     {
         appareanceConfiguration.saveFooter( getFooter() );
+        addActionMessage( getResourceBundle().getString( "appearance.footerContent.success"
) );
         return SUCCESS;
     }
 

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=1491313&r1=1491312&r2=1491313&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Mon Jun 10 00:06:38 2013
@@ -1113,6 +1113,7 @@ appearance.createCompanyPom = Create com
 appearance.htmlContent.label = HTML Content
 appearance.enterCompanyPom = Enter the details of the company super POM below. If it exists,
the organization name, URL and logo will be read from it.
 appearance.footerContent = Footer Content
+appearance.footerContent.success = Successfully saved footer content.
 
 # ----------------------------------------------------------------------
 # Page: Edit Company POM

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp?rev=1491313&r1=1491312&r2=1491313&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp Mon
Jun 10 00:06:38 2013
@@ -98,7 +98,9 @@
     </c:otherwise>
   </c:choose>
 </c:if>
-<s:form action="saveFooter!saveFooter.action" method="get" namespace="/admin">
+
+<s:actionmessage/>
+<s:form action="saveFooter!saveFooter.action" method="post" namespace="/admin">
   <s:token/>
   <div id="axial" class="h3">
     <h3><s:text name="appearance.footerContent"/></h3>



Mime
View raw message