portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asfgr...@apache.org
Subject [21/22] portals-pluto git commit: PLUTO-733 Allow tests to be run in Liferay
Date Thu, 25 Oct 2018 20:19:53 GMT
PLUTO-733 Allow tests to be run in Liferay


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/71d740a6
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/71d740a6
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/71d740a6

Branch: refs/heads/master
Commit: 71d740a612706fdc6db24cbb9fafbe71298af0fc
Parents: 5e5ff90
Author: Kyle Stiemann <stiemannkj1@gmail.com>
Authored: Fri Oct 19 11:28:43 2018 -0400
Committer: Neil Griffin <neil.griffin.scm@gmail.com>
Committed: Thu Oct 25 15:48:31 2018 -0400

----------------------------------------------------------------------
 .../src/main/webapp/WEB-INF/liferay-portlet.xml |  1 +
 .../java/basic/portlet/ParamTestPortlet.java    |  4 +-
 .../java/basic/portlet/UrlAPTestPortlet.java    | 12 +++---
 .../java/basic/portlet/UrlRPTestPortlet.java    |  4 +-
 .../main/java/basic/portlet/UrlTestPortlet.java | 20 ++++-----
 .../src/main/webapp/WEB-INF/liferay-portlet.xml |  4 ++
 demo-integration-tests/pom.xml                  |  2 +
 .../demo/integration/test/ChatRoomDemoIT.java   | 16 +++----
 .../demo/integration/test/DependencyDemoIT.java |  4 +-
 .../test/FragmentIdentifierDemoIT.java          |  2 +-
 .../test/ParameterPortletsDemoBase.java         |  2 +-
 .../demo/integration/test/PortletHubDemoIT.java | 45 ++++++++++----------
 .../demo/integration/test/StatusCodeDemoIT.java |  2 +-
 .../pluto/demo/integration/test/Util.java       | 16 +++++--
 14 files changed, 72 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/liferay-portlet.xml
----------------------------------------------------------------------
diff --git a/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/liferay-portlet.xml b/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/liferay-portlet.xml
index 132e560..19bf0f7 100644
--- a/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/liferay-portlet.xml
+++ b/PortletV3AnnotatedDemo/src/main/webapp/WEB-INF/liferay-portlet.xml
@@ -26,6 +26,7 @@
 	</portlet>
 	<portlet>
 		<portlet-name>BeanPortlet</portlet-name>
+		<instanceable>true</instanceable>
 		<requires-namespaced-parameters>false</requires-namespaced-parameters>
 	</portlet>
 	<portlet>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/PortletV3Demo/src/main/java/basic/portlet/ParamTestPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/ParamTestPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/ParamTestPortlet.java
index 4fbd043..5d0d1da 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/ParamTestPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/ParamTestPortlet.java
@@ -87,7 +87,7 @@ public class ParamTestPortlet extends GenericPortlet {
       
       StringBuilder txt = new StringBuilder();
       txt.append("<h3>Currently set render parameters:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       txt.append("   <table>");
 
       for (String pn : pnSet) {
@@ -106,7 +106,7 @@ public class ParamTestPortlet extends GenericPortlet {
       }
       
       txt.append("   </table>");
-      txt.append("</p>\n");
+      txt.append("</div>\n");
       
       req.setAttribute(ATTRIB_PARAMS, txt.toString());
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java
index 0ab4134..ce4301f 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/UrlAPTestPortlet.java
@@ -94,7 +94,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       
       StringBuilder txt = new StringBuilder();
       txt.append("<h3>Currently set render parameters:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       txt.append("   <table>");
 
       for (String pn : pnSet) {
@@ -116,7 +116,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       }
       
       txt.append("   </table>");
-      txt.append("</p>\n");
+      txt.append("</div>\n");
       
       req.setAttribute(ATTRIB_PARAMS, txt.toString());
       
@@ -328,7 +328,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
       String style = "style='min-width: 100px;'";
       
       txt.append("<h3>Render parameters for the last ActionRequest:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       if (mrp.isEmpty()) {
          txt.append("Render parameters is empty.");
       } else {
@@ -353,10 +353,10 @@ public class UrlAPTestPortlet extends GenericPortlet {
          
          txt.append("   </table>");
       }
-      txt.append("</p>\n");
+      txt.append("</div>\n");
       
       txt.append("<h3>Action parameters for the last ActionRequest:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       if (ap.isEmpty()) {
          txt.append("Action parameters is empty.");
       } else {
@@ -378,7 +378,7 @@ public class UrlAPTestPortlet extends GenericPortlet {
          
          txt.append("   </table>");
       }
-      txt.append("</p>\n");
+      txt.append("</div>\n");
 
       req.getPortletSession().setAttribute(ATTRIB_ACTPARAMS, txt.toString());
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java
index 2b9e472..10699db 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/UrlRPTestPortlet.java
@@ -102,7 +102,7 @@ public class UrlRPTestPortlet extends GenericPortlet {
       
       StringBuilder txt = new StringBuilder();
       txt.append("<h3>Currently set render parameters:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       txt.append("   <table>");
 
       for (String pn : pnSet) {
@@ -124,7 +124,7 @@ public class UrlRPTestPortlet extends GenericPortlet {
       }
       
       txt.append("   </table>");
-      txt.append("</p>\n");
+      txt.append("</div>\n");
       
       req.setAttribute(ATTRIB_PARAMS, txt.toString());
       

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java
index 67be574..8b434ff 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/UrlTestPortlet.java
@@ -97,7 +97,7 @@ public class UrlTestPortlet extends GenericPortlet {
       
       StringBuilder txt = new StringBuilder();
       txt.append("<h3>Currently set render parameters:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       txt.append("   <table>");
 
       for (String pn : pnSet) {
@@ -116,7 +116,7 @@ public class UrlTestPortlet extends GenericPortlet {
       }
       
       txt.append("   </table>");
-      txt.append("</p>\n");
+      txt.append("</div>\n");
       
       req.setAttribute(ATTRIB_PARAMS, txt.toString());
       
@@ -240,7 +240,7 @@ public class UrlTestPortlet extends GenericPortlet {
       String style = "style='min-width: 100px;'";
       
       txt.append("<h3>Render parameters for the ResourceRequest:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       txt.append("   <table>");
 
       // don't display the control parameters
@@ -261,10 +261,10 @@ public class UrlTestPortlet extends GenericPortlet {
       }
       
       txt.append("   </table>");
-      txt.append("</p>\n");
+      txt.append("</div>\n");
       
       txt.append("<h3>Resource parameters for the ResourceRequest:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       txt.append("   <table>");
 
       for (String pn : rsp.getNames()) {
@@ -282,7 +282,7 @@ public class UrlTestPortlet extends GenericPortlet {
       }
       
       txt.append("   </table>");
-      txt.append("</p>\n");
+      txt.append("</div>\n");
       
       writer.write(txt.toString());
    }
@@ -311,7 +311,7 @@ public class UrlTestPortlet extends GenericPortlet {
       String style = "style='min-width: 100px;'";
       
       txt.append("<h3>Render parameters for the last ActionRequest:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       txt.append("   <table>");
 
       // don't display the control parameters
@@ -332,10 +332,10 @@ public class UrlTestPortlet extends GenericPortlet {
       }
       
       txt.append("   </table>");
-      txt.append("</p>\n");
+      txt.append("</div>\n");
       
       txt.append("<h3>Action parameters for the last ActionRequest:</h3>\n");
-      txt.append("<p>\n");
+      txt.append("<div>\n");
       txt.append("   <table>");
 
       for (String pn : ap.getNames()) {
@@ -353,7 +353,7 @@ public class UrlTestPortlet extends GenericPortlet {
       }
       
       txt.append("   </table>");
-      txt.append("</p>\n");
+      txt.append("</div>\n");
 
       req.getPortletSession().setAttribute(ATTRIB_ACTPARAMS, txt.toString());
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/PortletV3Demo/src/main/webapp/WEB-INF/liferay-portlet.xml
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/liferay-portlet.xml b/PortletV3Demo/src/main/webapp/WEB-INF/liferay-portlet.xml
index 263da12..d7788a5 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/liferay-portlet.xml
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/liferay-portlet.xml
@@ -46,6 +46,10 @@
 		<requires-namespaced-parameters>false</requires-namespaced-parameters>
 	</portlet>
 	<portlet>
+		<portlet-name>PortletConfigPortlet2</portlet-name>
+		<requires-namespaced-parameters>false</requires-namespaced-parameters>
+	</portlet>
+	<portlet>
 		<portlet-name>TagLibPortlet</portlet-name>
 		<single-page-application>false</single-page-application>
 		<requires-namespaced-parameters>false</requires-namespaced-parameters>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/demo-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/demo-integration-tests/pom.xml b/demo-integration-tests/pom.xml
index 65ab75d..74874dc 100644
--- a/demo-integration-tests/pom.xml
+++ b/demo-integration-tests/pom.xml
@@ -18,6 +18,7 @@
 --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
    <parent>
+      <relativePath>../pom.xml</relativePath>
       <groupId>org.apache.portals.pluto</groupId>
       <artifactId>pluto</artifactId>
       <version>3.0.2-SNAPSHOT</version>
@@ -245,6 +246,7 @@
          <properties>
             <test.portal.name>Liferay</test.portal.name>
             <test.server.login.url>http://${test.server.host}:${test.server.port}/group/pluto-demos</test.server.login.url>
+            <test.context.base>web/guest/</test.context.base>
          </properties>
       </profile>
       <profile>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ChatRoomDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ChatRoomDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ChatRoomDemoIT.java
index fa963df..b21a8e7 100644
--- a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ChatRoomDemoIT.java
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ChatRoomDemoIT.java
@@ -34,17 +34,14 @@ public class ChatRoomDemoIT extends DemoTestDriver {
    // Public Constants
    public static final String CHAT_ROOM_DEMO_URL = baseUrl + Util.encodeURL("Chat Room Demo");
 
-   // Private Constants
-   private static final String CHAT_ROOM_PORTLET_NAMESPACE = "Pluto_chatRoomDemo_BeanPortletDemo";
-
    @Test
    public void testChatRoomDemos() throws UnsupportedEncodingException {
       driver.get(CHAT_ROOM_DEMO_URL);
 
       // 1. Clear any previous chat history.
-      clickElement(driver, waitingAsserter, "input", CHAT_ROOM_PORTLET_NAMESPACE, "clear");
+      clickElement(driver, waitingAsserter, "input", "chatRoomDemo", "BeanPortletDemo", "clear");
 
-      String chatHistoryXpath = "(" + getXpath("div", CHAT_ROOM_PORTLET_NAMESPACE, "chatHistory")
+ ")[1]";
+      String chatHistoryXpath = "(" + getXpath("div", "chatRoomDemo", "BeanPortletDemo",
"chatHistory") + ")[1]";
       waitingAsserter.assertTrue(textEmpty(By.xpath(chatHistoryXpath)));
 
       // 2. Open a new window/tab to the same page.
@@ -84,18 +81,17 @@ public class ChatRoomDemoIT extends DemoTestDriver {
          }
 
          // See #3 and #9.
-         String formXpath = getXpath("form", CHAT_ROOM_PORTLET_NAMESPACE, "setParams");
+         String formXpath = getXpath("form", "chatRoomDemo", "BeanPortletDemo", "setParams");
          sendKeysToElement(driver, waitingAsserter, "(" + formXpath + "//input[@name='name'])[1]",
name);
          clickElement(driver, waitingAsserter, "(" + formXpath + "//input[@value='send'][@type='submit'])[1]");
 
          // See #4 and #10.
-         waitingAsserter.assertTrue(elementToBeClickable(By.xpath(
-               getXpath("div", CHAT_ROOM_PORTLET_NAMESPACE, "image") + "/img")));
+         waitingAsserter.assertTrue(elementToBeClickable(By.xpath(getXpath("div", "chatRoomDemo",
"BeanPortletDemo", "image") + "/img")));
 
          // See #5 and #11.
-         String messageInputXpath = "(" + getXpath("input", CHAT_ROOM_PORTLET_NAMESPACE,
"msg") + ")[1]";
+         String messageInputXpath = "(" + getXpath("input", "chatRoomDemo", "BeanPortletDemo",
"msg") + ")[1]";
          sendKeysToElement(driver, waitingAsserter, messageInputXpath, message);
-         clickElement(driver, waitingAsserter, "input", CHAT_ROOM_PORTLET_NAMESPACE, "send");
+         clickElement(driver, waitingAsserter, "input", "chatRoomDemo", "BeanPortletDemo",
"send");
 
          // See #6 and #12.
          assertMessageVisible(chatHistoryMessageByXpath, name, message);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/DependencyDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/DependencyDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/DependencyDemoIT.java
index 01ba4c2..c847207 100644
--- a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/DependencyDemoIT.java
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/DependencyDemoIT.java
@@ -56,8 +56,8 @@ public class DependencyDemoIT extends DemoTestDriver{
          versionRadioButtons.get(i).click();
          clickElement(driver, waitingAsserter,
                By.xpath("//button[contains(text(),'render with selected version')]"));
-         clickElement(driver, waitingAsserter, "button", "Pluto_PortletV3Demo_DependencyPortlet",
"button");
-         By versionTextByXpath = By.xpath(getXpath("p", "Pluto_PortletV3Demo_DependencyPortlet",
"fadeText") +
+         clickElement(driver, waitingAsserter, "button", "PortletV3Demo", "DependencyPortlet",
"button");
+         By versionTextByXpath = By.xpath(getXpath("p", "PortletV3Demo", "DependencyPortlet",
"fadeText") +
                "[text()]");
          waitingAsserter.assertTrue(and(visibilityOfElementLocated(versionTextByXpath),
                textToBe(versionTextByXpath, "jQuery version: " + expectedVersion)));

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
index 8aa5747..d86a417 100644
--- a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
@@ -40,7 +40,7 @@ public class FragmentIdentifierDemoIT extends DemoTestDriver {
       sendKeysToElement(driver, waitingAsserter, "//input[@name='frag'][@type='text']", fragmentId);
       sendKeysToElement(driver, waitingAsserter, "//input[@name='line'][@type='text']", "3");
       clickElement(driver, waitingAsserter,
-         "//input[contains(@id,'Pluto_PortletV3Demo_LongPortlet')][@value='send'][@type='submit']");
+         "//input[contains(@id,'PortletV3Demo')][contains(@id,'LongPortlet')][@value='send'][@type='submit']");
       clickElement(driver, waitingAsserter, "//a[text()='Jump to line 3']");
       waitingAsserter.assertTrue(new ExpectedCondition<Boolean>() {
          @Override

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ParameterPortletsDemoBase.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ParameterPortletsDemoBase.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ParameterPortletsDemoBase.java
index 57d2a5a..f4c1022 100644
--- a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ParameterPortletsDemoBase.java
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/ParameterPortletsDemoBase.java
@@ -211,7 +211,7 @@ public class ParameterPortletsDemoBase extends DemoTestDriver {
 
       stringBuilder.append("]");
 
-      return getXpath(stringBuilder.toString(), portletNumber) + "/following-sibling::p/table";
+      return getXpath(stringBuilder.toString(), portletNumber) + "/following-sibling::div/table";
    }
 
    protected static String getXpath(String xpath, int portletNumber) {

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletHubDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletHubDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletHubDemoIT.java
index 070f2d9..bc74d73 100644
--- a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletHubDemoIT.java
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletHubDemoIT.java
@@ -26,10 +26,10 @@ import org.junit.Test;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.Keys;
-import org.openqa.selenium.support.ui.ExpectedCondition;
 import org.openqa.selenium.support.ui.Select;
 
 import static org.apache.portals.pluto.demo.integration.test.Util.*;
+import org.openqa.selenium.JavascriptExecutor;
 import static org.openqa.selenium.support.ui.ExpectedConditions.*;
 
 /**
@@ -37,15 +37,10 @@ import static org.openqa.selenium.support.ui.ExpectedConditions.*;
  * @author Kyle Stiemann
  */
 public class PortletHubDemoIT extends DemoTestDriver {
-   private static final String COLOR_SELECTION_PORTLET_NAMESPACE = "Pluto_PortletHubDemo_PH_ColorSelPortlet";
-   private static final String IMAGE_SELECTION_PORTLET_NAMESPACE = "Pluto_PortletHubDemo_ImageSelPortlet";
    private static final List<String> IMAGE_OPTIONS = Util.unmodifiableList("golfball",
"baseball", "fussball");
-   private static final String MESSAGE_BOX_PORTLET_NAMESPACE = "Pluto_PortletHubDemo_MessageBoxPortlet";
-   private static final String PARTIAL_ACTION_PORTLET_NAMESPACE = "Pluto_PortletHubDemo_PartialActionPortlet";
-   private static final String RESOURCE_PORTLET_NAMESPACE = "Pluto_PortletHubDemo_PH_ResourcePortlet_PRP";
    private static final String TOKEN = "{0}";
    private static final String IMAGE_XPATH_TEMPLATE =
-         "//img[@src='/PortletHubDemo/resources/images/" + TOKEN + ".gif']";
+         "//img[contains(@src,'/PortletHubDemo/resources/images/" + TOKEN + ".gif')]";
 
    @Test
    public void testPortletHubDemo() throws UnsupportedEncodingException {
@@ -58,15 +53,15 @@ public class PortletHubDemoIT extends DemoTestDriver {
       for (String imageName : IMAGE_OPTIONS) {
 
          clickElement(driver, waitingAsserter,
-               getXpath("div", IMAGE_SELECTION_PORTLET_NAMESPACE) + "/input[@value='" + imageName
+ "']");
+               getXpath("div", "PortletHubDemo", "ImageSelPortlet") + "/input[@value='" +
imageName + "']");
          waitingAsserter.assertTrue(elementNotPresentOrNotVisible(imageByXpath));
          imageByXpath = By.xpath(IMAGE_XPATH_TEMPLATE.replace(TOKEN, imageName + "-trans"));
          waitingAsserter.assertTrue(visibilityOfElementLocated(imageByXpath));
       }
 
       // Verify that all the different images appear when clicking each dropdown option.
-      clickElement(driver, waitingAsserter, "input", IMAGE_SELECTION_PORTLET_NAMESPACE, "dropdown");
-      By imageSelectByXpath = By.xpath(getXpath("select", IMAGE_SELECTION_PORTLET_NAMESPACE)
+ "[@name='imgName']");
+      clickElement(driver, waitingAsserter, "input", "PortletHubDemo", "ImageSelPortlet",
"dropdown");
+      By imageSelectByXpath = By.xpath(getXpath("select", "PortletHubDemo", "ImageSelPortlet")
+ "[@name='imgName']");
       waitingAsserter.waitFor(elementToBeClickable(imageSelectByXpath));
       Select select = new Select(driver.findElement(imageSelectByXpath));
       select.selectByValue("default");
@@ -84,14 +79,14 @@ public class PortletHubDemoIT extends DemoTestDriver {
 
       // Verify that the border checkbox shows and hides the border on the image.
       waitingAsserter.assertTrue(and(visibilityOfElementLocated(imageByXpath), attributeEmpty(imageByXpath,
"style")));
-      clickElement(driver, waitingAsserter, "input", RESOURCE_PORTLET_NAMESPACE, "border");
+      clickElement(driver, waitingAsserter, "input", "PortletHubDemo", "PH", "ResourcePortlet",
"PRP", "border");
       waitingAsserter.assertTrue(and(visibilityOfElementLocated(imageByXpath),
             attributeContains(imageByXpath, "style", "border:")));
 
       // Verify that the different cacheability radion buttons change the visible cacheability
text.
       String cacheabilityRadioButtonXpathTemplate =
-            getXpath("input", RESOURCE_PORTLET_NAMESPACE) + "[@value='" + TOKEN + "']";
-      String resourcePortletDivXpath = getXpath("div", RESOURCE_PORTLET_NAMESPACE);
+            getXpath("input", "PortletHubDemo", "PH", "ResourcePortlet", "PRP") + "[@value='"
+ TOKEN + "']";
+      String resourcePortletDivXpath = getXpath("div", "PortletHubDemo", "PH", "ResourcePortlet",
"PRP");
       By actionButtonByXpath = By.xpath(resourcePortletDivXpath + "//input[@value='Action']");
 
       for (String cacheability : Util.unmodifiableList("Portlet", "Full", "Page")) {
@@ -119,11 +114,15 @@ public class PortletHubDemoIT extends DemoTestDriver {
       waitingAsserter.assertTrue(visibilityOfElementLocated(actionButtonByXpath));
 
       // Verify the background color changes.
+      navigateToPage("V3.0 Portlet Hub Demo");
+      ((JavascriptExecutor)driver).executeScript("window.scrollTo(0,document.body.scrollHeight);");
+
       By coloredTableByXpath =
-            By.xpath(getXpath("div", RESOURCE_PORTLET_NAMESPACE, "putResourceHere") + "//table[@style]");
+            By.xpath(getXpath("div", "PortletHubDemo", "PH", "ResourcePortlet", "PRP", "putResourceHere")
+
+			"//table[@style]");
       waitingAsserter.assertTrue(and(visibilityOfElementLocated(coloredTableByXpath),
             backgroundColor(coloredTableByXpath, 0xFF, 0xFF, 0xFF)));
-      String colorInputXpath = getXpath("input", COLOR_SELECTION_PORTLET_NAMESPACE, "color");
+      String colorInputXpath = getXpath("input", "PortletHubDemo", "PH", "ColorSelPortlet",
"color");
       sendKeysToElement(driver, waitingAsserter, colorInputXpath, "#FF0000", Keys.ENTER);
       waitingAsserter.assertTrue(and(visibilityOfElementLocated(coloredTableByXpath),
             backgroundColor(coloredTableByXpath, 0xFF, 0, 0)));
@@ -134,21 +133,21 @@ public class PortletHubDemoIT extends DemoTestDriver {
          for (ColorCombo colorCombo : ColorCombo.getAllPossibleCombos()) {
 
             String lowerCaseFormSubmissionMethod = formSubmissionMethod.toLowerCase(Locale.ENGLISH);
-            clickElement(driver, waitingAsserter, "input", COLOR_SELECTION_PORTLET_NAMESPACE,
+            clickElement(driver, waitingAsserter, "input", "PortletHubDemo", "PH", "ColorSelPortlet",
                   lowerCaseFormSubmissionMethod);
             testMessageSent(colorCombo);
          }
 
-         clickElement(driver, waitingAsserter, "input", MESSAGE_BOX_PORTLET_NAMESPACE, "clear");
+         clickElement(driver, waitingAsserter, "input", "PortletHubDemo", "MessageBoxPortlet",
"clear");
       }
 
       // Click the Do Partial Action button and check that the reponse text appears.
-      By responseDivByXpath = By.xpath(getXpath("div", PARTIAL_ACTION_PORTLET_NAMESPACE,
"responseDiv"));
+      By responseDivByXpath = By.xpath(getXpath("div", "PortletHubDemo", "PartialActionPortlet",
"responseDiv"));
       waitingAsserter.assertTrue(textEmpty(responseDivByXpath));
 
       for (int i = 1; i <= 10; i++) {
 
-         clickElement(driver, waitingAsserter, "input", PARTIAL_ACTION_PORTLET_NAMESPACE,
"doPA");
+         clickElement(driver, waitingAsserter, "input", "PortletHubDemo", "PartialActionPortlet",
"doPA");
          waitingAsserter.assertTrue(and(visibilityOfElementLocated(responseDivByXpath),
                textToBePresentInElementLocated(responseDivByXpath,
                      "Partial Action has been executed " + i + " times.")));
@@ -161,13 +160,13 @@ public class PortletHubDemoIT extends DemoTestDriver {
       handleColorCheckbox("green", colorCombo.isGreenSelected());
       handleColorCheckbox("blue", colorCombo.isBlueSelected());
 
-      String messageInputXpath = getXpath("input", COLOR_SELECTION_PORTLET_NAMESPACE, "msg");
+      String messageInputXpath = getXpath("input", "PortletHubDemo", "PH", "ColorSelPortlet",
"msg");
       String message = colorCombo.getHexString();
       sendKeysToElement(driver, waitingAsserter, messageInputXpath, message);
-      clickElement(driver, waitingAsserter, "input", COLOR_SELECTION_PORTLET_NAMESPACE, "send");
+      clickElement(driver, waitingAsserter, "input", "PortletHubDemo", "PH", "ColorSelPortlet",
"send");
 
       By messageOutputByXpath =
-            By.xpath(getXpath("div", MESSAGE_BOX_PORTLET_NAMESPACE, "responseDiv") +
+            By.xpath(getXpath("div", "PortletHubDemo", "MessageBoxPortlet", "responseDiv")
+
                   "/p[contains(text(),'" + colorCombo.getIndex() + ": " + message + "')]");
       waitingAsserter.assertTrue(and(visibilityOfElementLocated(messageOutputByXpath),
             or(attributeContains(messageOutputByXpath, "style", "color:#" + message + ";"),
@@ -177,7 +176,7 @@ public class PortletHubDemoIT extends DemoTestDriver {
    private void handleColorCheckbox(String colorName, boolean colorSelected) {
 
       WebElement colorCheckbox =
-            driver.findElement(By.xpath(getXpath("input", COLOR_SELECTION_PORTLET_NAMESPACE,
colorName)));
+            driver.findElement(By.xpath(getXpath("input", "PortletHubDemo", "PH", "ColorSelPortlet",
colorName)));
 
       if ((colorSelected && !colorCheckbox.isSelected()) || (!colorSelected &&
colorCheckbox.isSelected())) {
          colorCheckbox.click();

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
index 3efaa0e..2854d0a 100644
--- a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
@@ -38,7 +38,7 @@ public class StatusCodeDemoIT extends DemoTestDriver {
          navigateToPage("V3.0 Misc Tests - HTTP SC, fragment id");
          sendKeysToElement(driver, waitingAsserter, "//input[@name='statusCode'][@type='text']",
statusCode);
          clickElement(driver, waitingAsserter,
-               "//input[contains(@id,'Pluto_PortletV3Demo_AuthSCPortlet')][@value='send'][@type='submit']");
+               "//input[contains(@id,'PortletV3Demo')][contains(@id,'AuthSCPortlet')][@value='send'][@type='submit']");
          clickElement(driver, waitingAsserter, "//a[text()='Resource URL, status code = "
+ statusCode + "']");
          waitingAsserter.assertTrue(visibilityOfElementLocated(By.xpath(
                "//p[contains(text(),'Status code: " + statusCode + "')]")));

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/71d740a6/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/Util.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/Util.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/Util.java
index 57d809b..79087f3 100644
--- a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/Util.java
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/Util.java
@@ -23,6 +23,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.Locale;
 import org.openqa.selenium.By;
 import org.openqa.selenium.JavascriptExecutor;
 import org.openqa.selenium.WebDriver;
@@ -43,11 +44,18 @@ public final class Util {
 
    public static String encodeURL(String url) {
 
-      try {
-         return URLEncoder.encode(url, StandardCharsets.UTF_8.toString());
+      String portalName = System.getProperty("test.portal.name", "Pluto");
+
+      if ("Pluto".equalsIgnoreCase(portalName)) {
+         try {
+            return URLEncoder.encode(url, StandardCharsets.UTF_8.toString());
+         }
+         catch (UnsupportedEncodingException e) {
+           throw new RuntimeException(e);
+         }
       }
-      catch (UnsupportedEncodingException e) {
-        throw new RuntimeException(e);
+      else {
+         return url.replace(" ", "-").toLowerCase(Locale.ENGLISH);
       }
    }
 


Mime
View raw message