JBoss Portal SVN: r13375 - branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-05-15 07:39:02 -0400 (Fri, 15 May 2009)
New Revision: 13375
Modified:
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
Log:
- Added checkNameValidity(name, targetForErrorMessage, checkForDuplicates) method for better control over validation
Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-05-14 22:03:40 UTC (rev 13374)
+++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-05-15 11:39:02 UTC (rev 13375)
@@ -47,6 +47,11 @@
public String checkNameValidity(String name, String targetForErrorMessage)
{
+ return checkNameValidity(name, targetForErrorMessage, true);
+ }
+
+ public String checkNameValidity(String name, String targetForErrorMessage, boolean checkForDuplicates)
+ {
if (ParameterValidation.isNullOrEmpty(name))
{
beanContext.createTargetedErrorMessage(targetForErrorMessage, INVALID_NAME, name, getLocalizedType());
@@ -68,7 +73,7 @@
}
// Check for duplicate
- if (isAlreadyExisting(name))
+ if (checkForDuplicates && isAlreadyExisting(name))
{
beanContext.createTargetedErrorMessage(targetForErrorMessage, DUPLICATE, name, getLocalizedType());
return null;
15 years
JBoss Portal SVN: r13374 - branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-05-14 18:03:40 -0400 (Thu, 14 May 2009)
New Revision: 13374
Modified:
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java
Log:
- Made resource name where error messages are found injectable.
- Better handling of non-existent localization key: now display the key and log info instead of failing.
Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java 2009-05-14 16:59:23 UTC (rev 13373)
+++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java 2009-05-14 22:03:40 UTC (rev 13374)
@@ -23,11 +23,13 @@
package org.jboss.portal.faces.gui;
+import org.apache.log4j.Logger;
import org.jboss.portal.common.util.ParameterValidation;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.Map;
+import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
@@ -37,13 +39,26 @@
*/
public abstract class BeanContext
{
+ protected final static Logger log = Logger.getLogger(BeanContext.class);
+
public static final String STATUS = "status";
- private static final String RESOURCE_NAME = "Resource";
+ private static final String DEFAULT_RESOURCE_NAME = "Resource";
private static final String UNEXPECTED_ERROR = "bean_support_unexpected_error";
private static final String CAUSE = "bean_support_cause";
private static final String CURRENT_PLACEHOLDER = "###";
+ private String resourceName = DEFAULT_RESOURCE_NAME;
+ public void setResourceName(String resourceName)
+ {
+ this.resourceName = resourceName;
+ }
+
+ public String getResourceName()
+ {
+ return resourceName;
+ }
+
/**
* Retrieves the value of the parameter which name is given from the JSF request.
*
@@ -91,15 +106,34 @@
public String getMessageFromBundle(String localizedMessageId, Object... params)
{
- return getLocalizedMessage(localizedMessageId, getLocale(), params);
+ return getLocalizedMessage(localizedMessageId, getLocale(), resourceName, params);
}
public static String getLocalizedMessage(String localizationKey, Locale locale, Object... params)
{
- ResourceBundle rb = ResourceBundle.getBundle(RESOURCE_NAME, locale);
- return MessageFormat.format(rb.getString(localizationKey), params);
+ return getLocalizedMessage(localizationKey, locale, DEFAULT_RESOURCE_NAME, params);
}
+ public static String getLocalizedMessage(String localizationKey, Locale locale, String resourceName, Object... params)
+ {
+ ResourceBundle rb = ResourceBundle.getBundle(resourceName, locale);
+
+ String message;
+ try
+ {
+ message = rb.getString(localizationKey);
+ }
+ catch (MissingResourceException e)
+ {
+ // if the key doesn't exist, return it instead of failing
+ log.info("Couldn't find localization message for key '" + localizationKey + "' in bundle " + resourceName
+ + " for locale " + locale.getDisplayName());
+ return localizationKey;
+ }
+
+ return MessageFormat.format(message, params);
+ }
+
public void createErrorMessageFrom(Exception e)
{
createErrorMessageFrom(STATUS, e);
Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java 2009-05-14 16:59:23 UTC (rev 13373)
+++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java 2009-05-14 22:03:40 UTC (rev 13374)
@@ -88,7 +88,7 @@
else
{
// todo: do something better here
- System.out.println("Couldn't resolve component target: " + target);
+ log.info("Couldn't resolve component target: " + target);
}
FacesMessage msg = new FacesMessage(jsfSeverity, message, message);
15 years
JBoss Portal SVN: r13373 - in branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium: cms and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-14 12:59:23 -0400 (Thu, 14 May 2009)
New Revision: 13373
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
Log:
[selenium] - access denied message, longer timeouts
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java 2009-05-14 01:43:22 UTC (rev 13372)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java 2009-05-14 16:59:23 UTC (rev 13373)
@@ -9,7 +9,7 @@
@Test(groups = { "test_samples" }, enabled = true)
public class PortalAjaxSamplesTestCase extends JBossPortalSeleniumTestCase {
- public static long AJAX_TIMEOUT = 4500;
+ public static long AJAX_TIMEOUT = 12500;
public static String casePfx = "samples.ajax.";
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-05-14 01:43:22 UTC (rev 13372)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-05-14 16:59:23 UTC (rev 13373)
@@ -15,6 +15,8 @@
@Test(groups = { "cms_secure" }, enabled = true, description = "Setting permissions on the default portlet.")
public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
+ private static final String ACCESS_DENIED = "Access to this resource is denied";
+
private final String casePfx = "cms.sec.";
private final String LNK_EXPLORE = getProp(casePfx + "lnk.explore", "//area[@href='/portal/content/default/epp.html']");
@@ -118,7 +120,7 @@
public void testSetAdminReadPer() {
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent(ACCESS_DENIED), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -142,10 +144,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent(ACCESS_DENIED), "Secured resource is visible.#1");
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#2");
+ Assert.assertTrue(selenium.isTextPresent(ACCESS_DENIED), "Secured resource is visible.#2");
logout();
}
@@ -157,7 +159,7 @@
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent(ACCESS_DENIED), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -182,7 +184,7 @@
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent(ACCESS_DENIED), "Non secured resource is not visible.#1");
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -201,10 +203,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent(ACCESS_DENIED), "Secured resource is visible.#1");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#2");
+ Assert.assertFalse(selenium.isTextPresent(ACCESS_DENIED), "Secured resource is visible.#2");
logout();
}
@@ -215,7 +217,7 @@
assignRole("user", "user(a)portal.com", "secRole", "secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent(ACCESS_DENIED), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -236,10 +238,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible after logout.");
+ Assert.assertTrue(selenium.isTextPresent(ACCESS_DENIED), "Secured resource is visible after logout.");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible for the \"user\".");
+ Assert.assertFalse(selenium.isTextPresent(ACCESS_DENIED), "Non secured resource is not visible for the \"user\".");
logout();
}
@@ -250,7 +252,7 @@
deassignRole("user", "user(a)portal.com", "secRole", "secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"));
+ Assert.assertFalse(selenium.isTextPresent(ACCESS_DENIED));
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
selenium.click(LNK_ADMIN);
@@ -270,11 +272,11 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access Denied"));
+ Assert.assertTrue(selenium.isTextPresent(ACCESS_DENIED));
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access Denied"));
+ Assert.assertTrue(selenium.isTextPresent(ACCESS_DENIED));
logout();
}
@@ -285,7 +287,7 @@
deassignRole("user", "user(a)portal.com", "secRole", "secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"));
+ Assert.assertFalse(selenium.isTextPresent(ACCESS_DENIED));
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
selenium.click(LNK_ADMIN);
15 years
JBoss Portal SVN: r13372 - branches/Enterprise_Portal_Platform_4_3_GA_JBEPP-73/build.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 21:43:22 -0400 (Wed, 13 May 2009)
New Revision: 13372
Modified:
branches/Enterprise_Portal_Platform_4_3_GA_JBEPP-73/build/build-thirdparty.xml
Log:
[JBEPP-73] - Updated to use patch branch
Modified: branches/Enterprise_Portal_Platform_4_3_GA_JBEPP-73/build/build-thirdparty.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3_GA_JBEPP-73/build/build-thirdparty.xml 2009-05-14 01:01:28 UTC (rev 13371)
+++ branches/Enterprise_Portal_Platform_4_3_GA_JBEPP-73/build/build-thirdparty.xml 2009-05-14 01:43:22 UTC (rev 13372)
@@ -44,7 +44,7 @@
<componentref name="jboss-portal/modules/common" version="1.2.3"/>
<componentref name="jboss-portal/modules/web" version="1.2.3"/>
<componentref name="jboss-portal/modules/test" version="1.0.4"/>
- <componentref name="jboss-portal/modules/portlet" version="trunk-SNAPSHOT"/>
+ <componentref name="jboss-portal/modules/portlet" version="2.0.5_JBEPP-73"/>
<componentref name="jboss-portal/modules/identity" version="1.0.7"/>
<componentref name="jboss-portal/modules/cms" version="1.2.4"/>
<componentref name="antlr" version="2.7.6-brew"/>
15 years
JBoss Portal SVN: r13371 - in modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73: bridge and 12 other directories.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 21:01:28 -0400 (Wed, 13 May 2009)
New Revision: 13371
Modified:
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/bridge/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/build/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/controller/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/docs/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/docs/user-guide/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/federation/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/jsr168api/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/management/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/mc/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portal/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/samples/pom.xml
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/test/pom.xml
Log:
[JBEPP-73] - Modifying pom versions
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/bridge/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/bridge/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/bridge/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/build/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/build/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/build/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module</name>
<description>JBoss Portal Portlet Module</description>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/controller/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/controller/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/controller/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/docs/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/docs/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/docs/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -4,13 +4,13 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Docs Aggregator</name>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<url>http://labs.jboss.com/jbossportal</url>
<modules>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/docs/user-guide/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/docs/user-guide/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/docs/user-guide/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -11,7 +11,7 @@
</parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>user-guide-${translation}</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<packaging>jdocbook</packaging>
<name>User_Guide_(${translation})</name>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/federation/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/federation/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/federation/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/jsr168api/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/jsr168api/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/jsr168api/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/management/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/management/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/management/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/mc/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/mc/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/mc/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -5,7 +5,7 @@
<artifactId>module-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module Aggregator</name>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portal/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portal/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portal/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/samples/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/samples/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/samples/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/test/pom.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/test/pom.xml 2009-05-14 00:57:17 UTC (rev 13370)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/test/pom.xml 2009-05-14 01:01:28 UTC (rev 13371)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>2.0.5_JBEPP-60</version>
+ <version>2.0.5_JBEPP-73</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
15 years
JBoss Portal SVN: r13370 - modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 20:57:17 -0400 (Wed, 13 May 2009)
New Revision: 13370
Modified:
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
Log:
[JBEPP-73] - Fix for duplicate HTTP headers
Modified: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java 2009-05-14 00:45:50 UTC (rev 13369)
+++ modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java 2009-05-14 00:57:17 UTC (rev 13370)
@@ -96,7 +96,15 @@
public void setProperty(String key, String value) throws IllegalArgumentException
{
- addProperty(key, value);
+ if (key == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("Value cannot be null");
+ }
+ getProperties().getTransportHeaders().setValue(key, value);
}
public void addProperty(Cookie cookie)
15 years
JBoss Portal SVN: r13369 - modules/portlet/branches.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 20:45:50 -0400 (Wed, 13 May 2009)
New Revision: 13369
Added:
modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73/
Log:
[JBEPP-73] - Branch for patch
Copied: modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-73 (from rev 13187, modules/portlet/branches/JBP_PORTLET_2_0_5_JBEPP-60)
15 years
JBoss Portal SVN: r13368 - in branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests: apps and 2 other directories.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 20:24:26 -0400 (Wed, 13 May 2009)
New Revision: 13368
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/apps/httpHeader-portlet.war
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java
Removed:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/testng.xml
Log:
[JBEPP-81] - Added test case
Copied: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/apps/httpHeader-portlet.war (from rev 13367, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/apps/httpHeader-portlet.war)
===================================================================
(Binary files differ)
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml 2009-05-14 00:07:28 UTC (rev 13367)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml 2009-05-14 00:24:26 UTC (rev 13368)
@@ -100,6 +100,8 @@
<target name="copyApps">
<echo message="Copying userInterceptor portlet into the ${portal.instance} server" />
<copy file="apps/userDetail-portlet.war" tofile="${jboss.home}/server/${portal.instance}/deploy/userDetail-portlet.war" />
+ <echo message="Copying httpHeader portlet into the ${portal.instance} server" />
+ <copy file="apps/httpHeader-portlet.war" tofile="${jboss.home}/server/${portal.instance}/deploy/httpHeader-portlet.war" />
</target>
<target name="clean">
Copied: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core (from rev 13367, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core)
Deleted: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java 2009-05-14 00:07:28 UTC (rev 13367)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java 2009-05-14 00:24:26 UTC (rev 13368)
@@ -1,78 +0,0 @@
-package org.jboss.portal.test.selenium.core;
-
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
- */
-@Test(groups = { "portlet_http_header" }, enabled = true, description = "Checking http headers and cookies of portlet responses.")
-public class HttpHeaderTestCase extends JBossPortalSeleniumTestCase
-{
- @Test(enabled = true, description = "Checking http headers of portlet responses.")
- public void testHttpHeaders()
- {
- try
- {
- HttpURLConnection connection;
- Map<String,List<String>> headers;
- connection = (HttpURLConnection)new URL("http://localhost:8080/portal/portal/HttpHeaderPortal/default/HttpHeaderPo...").openConnection();
- headers = connection.getHeaderFields();
- //System.out.println(headers);
- List<String> others1 = headers.get("Foo");
- List<String> others2 = headers.get("Foo2");
- List<String> others3 = headers.get("partialRefresh");
- List<String> others4 = headers.get("Expires");
- List<String> others5 = headers.get("Pragma");
- List<String> others6 = headers.get("Cache-Control");
-
- Assert.assertTrue(others1 == null, "Expected no Foo as it is set in processAction!");
- Assert.assertTrue(others2.size() == 2, "Expected 2 Foo2!");
- Assert.assertTrue(others3.size() == 1, "Expected 1 partialRefresh!");
- Assert.assertTrue(others4.size() == 1, "Expected 1 Expires!");
- Assert.assertTrue(others5.size() == 1, "Expected 1 Pragma!");
- Assert.assertTrue(others6.size() == 1, "Expected 1 Cache-Control!");
-
- Assert.assertTrue(others2.get(0).equals("BarView2")
- && others2.get(1).equals("BarView1"), "Foo2 not found!");
- Assert.assertTrue(others3.get(0).equals("true"), "partialRefresh not found!");
- Assert.assertTrue(others4.get(0).equals("0"), "Expires not found!");
- Assert.assertTrue(others5.get(0).equals("no-cache"), "Pragma not found!");
- Assert.assertTrue(others6.get(0).equals("private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0, s-maxage=0"),
- "Cache-Control not found!");
- connection.disconnect();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- @Test(enabled = true, description = "Checking cookies of portlet responses.")
- public void testHttpCookies()
- {
- logoutIfPossible();
- login("admin", "admin");
- selenium.open("portal/HttpHeaderPortal");
- selenium.waitForPageToLoad(PAGE_LOAD);
- String cookie = selenium.getCookie();
- // This is set in doView()
- Assert.assertTrue(cookie.indexOf("MyIdea=1.1") >= 0,"Custom Cookie set in doView not found!");
-
- selenium.click("link=doAction");
- selenium.waitForPageToLoad(PAGE_LOAD);
- cookie = selenium.getCookie();
- // Cookie order is unknown, but all cookies are set properly.
- // Sometimes it is set multiple times too...
- Assert.assertTrue(cookie.indexOf("MyIdea=1.1") >= 0
- && cookie.indexOf("MyIdea2=2.0") >= 0,"Custom Cookies set in processAction not found!");
- logout();
- }
-}
Copied: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java (from rev 13367, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java)
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java (rev 0)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java 2009-05-14 00:24:26 UTC (rev 13368)
@@ -0,0 +1,78 @@
+package org.jboss.portal.test.selenium.core;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
+ */
+@Test(groups = { "portlet_http_header" }, enabled = true, description = "Checking http headers and cookies of portlet responses.")
+public class HttpHeaderTestCase extends JBossPortalSeleniumTestCase
+{
+ @Test(enabled = true, description = "Checking http headers of portlet responses.")
+ public void testHttpHeaders()
+ {
+ try
+ {
+ HttpURLConnection connection;
+ Map<String,List<String>> headers;
+ connection = (HttpURLConnection)new URL("http://localhost:8080/portal/portal/HttpHeaderPortal/default/HttpHeaderPo...").openConnection();
+ headers = connection.getHeaderFields();
+ //System.out.println(headers);
+ List<String> others1 = headers.get("Foo");
+ List<String> others2 = headers.get("Foo2");
+ List<String> others3 = headers.get("partialRefresh");
+ List<String> others4 = headers.get("Expires");
+ List<String> others5 = headers.get("Pragma");
+ List<String> others6 = headers.get("Cache-Control");
+
+ Assert.assertTrue(others1 == null, "Expected no Foo as it is set in processAction!");
+ Assert.assertTrue(others2.size() == 2, "Expected 2 Foo2!");
+ Assert.assertTrue(others3.size() == 1, "Expected 1 partialRefresh!");
+ Assert.assertTrue(others4.size() == 1, "Expected 1 Expires!");
+ Assert.assertTrue(others5.size() == 1, "Expected 1 Pragma!");
+ Assert.assertTrue(others6.size() == 1, "Expected 1 Cache-Control!");
+
+ Assert.assertTrue(others2.get(0).equals("BarView2")
+ && others2.get(1).equals("BarView1"), "Foo2 not found!");
+ Assert.assertTrue(others3.get(0).equals("true"), "partialRefresh not found!");
+ Assert.assertTrue(others4.get(0).equals("0"), "Expires not found!");
+ Assert.assertTrue(others5.get(0).equals("no-cache"), "Pragma not found!");
+ Assert.assertTrue(others6.get(0).equals("private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0, s-maxage=0"),
+ "Cache-Control not found!");
+ connection.disconnect();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ @Test(enabled = true, description = "Checking cookies of portlet responses.")
+ public void testHttpCookies()
+ {
+ logoutIfPossible();
+ login("admin", "admin");
+ selenium.open("portal/HttpHeaderPortal");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ String cookie = selenium.getCookie();
+ // This is set in doView()
+ Assert.assertTrue(cookie.indexOf("MyIdea=1.1") >= 0,"Custom Cookie set in doView not found!");
+
+ selenium.click("link=doAction");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ cookie = selenium.getCookie();
+ // Cookie order is unknown, but all cookies are set properly.
+ // Sometimes it is set multiple times too...
+ Assert.assertTrue(cookie.indexOf("MyIdea=1.1") >= 0
+ && cookie.indexOf("MyIdea2=2.0") >= 0,"Custom Cookies set in processAction not found!");
+ logout();
+ }
+}
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/testng.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/testng.xml 2009-05-14 00:07:28 UTC (rev 13367)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/testng.xml 2009-05-14 00:24:26 UTC (rev 13368)
@@ -118,6 +118,12 @@
<class name="org.jboss.portal.test.selenium.cms.CMSArchiveUploadTestCase"></class></classes>
</test>
+ <test name="org.jboss.portal.test.selenium.core.HttpHeaderTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.core.HttpHeaderTestCase"></class></classes>
+ </test>
+
<listeners>
<!-- <listener class-name="org.testng.reporters.JUnitXMLReporter"></listener> -->
<listener class-name="org.jboss.portal.test.selenium.JBossSeleniumTestListener"/>
15 years
JBoss Portal SVN: r13367 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests: apps and 2 other directories.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 20:07:28 -0400 (Wed, 13 May 2009)
New Revision: 13367
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/apps/httpHeader-portlet.war
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml
Log:
[JBPORTAL-2369] - Added test case
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/apps/httpHeader-portlet.war
===================================================================
(Binary files differ)
Property changes on: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/apps/httpHeader-portlet.war
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml 2009-05-13 21:06:49 UTC (rev 13366)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml 2009-05-14 00:07:28 UTC (rev 13367)
@@ -115,6 +115,8 @@
<target name="copyApps">
<echo message="Copying userInterceptor portlet into the ${portal.instance} server" />
<copy file="apps/userDetail-portlet.war" tofile="${jboss.home}/server/${portal.instance}/deploy/userDetail-portlet.war" />
+ <echo message="Copying httpHeader portlet into the ${portal.instance} server" />
+ <copy file="apps/httpHeader-portlet.war" tofile="${jboss.home}/server/${portal.instance}/deploy/httpHeader-portlet.war" />
</target>
<target name="clean">
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/core/HttpHeaderTestCase.java 2009-05-14 00:07:28 UTC (rev 13367)
@@ -0,0 +1,78 @@
+package org.jboss.portal.test.selenium.core;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
+ */
+@Test(groups = { "portlet_http_header" }, enabled = true, description = "Checking http headers and cookies of portlet responses.")
+public class HttpHeaderTestCase extends JBossPortalSeleniumTestCase
+{
+ @Test(enabled = true, description = "Checking http headers of portlet responses.")
+ public void testHttpHeaders()
+ {
+ try
+ {
+ HttpURLConnection connection;
+ Map<String,List<String>> headers;
+ connection = (HttpURLConnection)new URL("http://localhost:8080/portal/portal/HttpHeaderPortal/default/HttpHeaderPo...").openConnection();
+ headers = connection.getHeaderFields();
+ //System.out.println(headers);
+ List<String> others1 = headers.get("Foo");
+ List<String> others2 = headers.get("Foo2");
+ List<String> others3 = headers.get("partialRefresh");
+ List<String> others4 = headers.get("Expires");
+ List<String> others5 = headers.get("Pragma");
+ List<String> others6 = headers.get("Cache-Control");
+
+ Assert.assertTrue(others1 == null, "Expected no Foo as it is set in processAction!");
+ Assert.assertTrue(others2.size() == 2, "Expected 2 Foo2!");
+ Assert.assertTrue(others3.size() == 1, "Expected 1 partialRefresh!");
+ Assert.assertTrue(others4.size() == 1, "Expected 1 Expires!");
+ Assert.assertTrue(others5.size() == 1, "Expected 1 Pragma!");
+ Assert.assertTrue(others6.size() == 1, "Expected 1 Cache-Control!");
+
+ Assert.assertTrue(others2.get(0).equals("BarView2")
+ && others2.get(1).equals("BarView1"), "Foo2 not found!");
+ Assert.assertTrue(others3.get(0).equals("true"), "partialRefresh not found!");
+ Assert.assertTrue(others4.get(0).equals("0"), "Expires not found!");
+ Assert.assertTrue(others5.get(0).equals("no-cache"), "Pragma not found!");
+ Assert.assertTrue(others6.get(0).equals("private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0, s-maxage=0"),
+ "Cache-Control not found!");
+ connection.disconnect();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ @Test(enabled = true, description = "Checking cookies of portlet responses.")
+ public void testHttpCookies()
+ {
+ logoutIfPossible();
+ login("admin", "admin");
+ selenium.open("portal/HttpHeaderPortal");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ String cookie = selenium.getCookie();
+ // This is set in doView()
+ Assert.assertTrue(cookie.indexOf("MyIdea=1.1") >= 0,"Custom Cookie set in doView not found!");
+
+ selenium.click("link=doAction");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ cookie = selenium.getCookie();
+ // Cookie order is unknown, but all cookies are set properly.
+ // Sometimes it is set multiple times too...
+ Assert.assertTrue(cookie.indexOf("MyIdea=1.1") >= 0
+ && cookie.indexOf("MyIdea2=2.0") >= 0,"Custom Cookies set in processAction not found!");
+ logout();
+ }
+}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2009-05-13 21:06:49 UTC (rev 13366)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2009-05-14 00:07:28 UTC (rev 13367)
@@ -124,6 +124,12 @@
<class name="org.jboss.portal.test.selenium.cms.CMSArchiveUploadTestCase"></class></classes>
</test>
+ <test name="org.jboss.portal.test.selenium.core.HttpHeaderTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.core.HttpHeaderTestCase"></class></classes>
+ </test>
+
<listeners>
<!-- <listener class-name="org.testng.reporters.JUnitXMLReporter"></listener> -->
<listener class-name="org.jboss.portal.test.selenium.JBossSeleniumTestListener"/>
15 years
JBoss Portal SVN: r13366 - branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 17:06:49 -0400 (Wed, 13 May 2009)
New Revision: 13366
Modified:
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java
Log:
[JBEPP-72] - Added provision for multi-valued Headers
Modified: branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java 2009-05-13 20:59:35 UTC (rev 13365)
+++ branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java 2009-05-13 21:06:49 UTC (rev 13366)
@@ -22,28 +22,24 @@
******************************************************************************/
package org.jboss.portal.core.aspects.portlet;
-import java.util.List;
+import java.util.Iterator;
import org.jboss.portal.common.util.MultiValuedPropertyMap;
-import org.jboss.portal.core.metadata.portlet.MarkupElement;
-import org.jboss.portal.core.portlet.info.MarkupHeaderInfo;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse;
-import org.w3c.dom.Element;
-import javax.portlet.MimeResponse;
import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
/**
* @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
* @version $Revision: 11068 $
*/
public class HttpHeaderInterceptor extends CorePortletInterceptor
@@ -79,11 +75,8 @@
{
addCookie(invocation, cookie);
}
- for (String key: unsr.getProperties().getTransportHeaders().keySet())
- {
- String value = unsr.getProperties().getTransportHeaders().getValue(key);
- ((AbstractServerContext) invocation.getServerContext()).getResponse().setHeader(key, value);
- }
+ setHeaders(unsr.getProperties().getTransportHeaders(),
+ ((AbstractServerContext) invocation.getServerContext()).getResponse());
}
}
else if (response instanceof FragmentResponse)
@@ -95,17 +88,14 @@
{
addCookie(invocation, cookie);
}
- for (String key: fr.getProperties().getTransportHeaders().keySet())
- {
- String value = fr.getProperties().getTransportHeaders().getValue(key);
- ((AbstractServerContext) invocation.getServerContext()).getResponse().setHeader(key, value);
- }
+ setHeaders(fr.getProperties().getTransportHeaders(),
+ ((AbstractServerContext) invocation.getServerContext()).getResponse());
}
}
//
return response;
}
-
+
private void addCookie(PortletInvocation invocation, Cookie cookie)
{
if ((cookie.getPath() == null || "".equals(cookie.getPath().trim())) && defaultCookiePath != null)
@@ -114,4 +104,26 @@
}
((AbstractServerContext) invocation.getServerContext()).getResponse().addCookie(cookie);
}
+
+ private void setHeaders(MultiValuedPropertyMap<String> map, HttpServletResponse response)
+ {
+ for (String key: map.keySet())
+ {
+ // It might have already been added by another portlet or
+ // its the first time we are adding it so reset it with first value.
+ // The winner is the portlet in the last order of render phase.
+ response.setHeader(key, map.getValue(key));
+
+ if (map.size() > 1)
+ {
+ // If multiple values found just add them
+ String value;
+ for (Iterator<String> i = map.getValues(key).listIterator(1); i.hasNext();)
+ {
+ value = i.next();
+ response.addHeader(key, value);
+ }
+ }
+ }
+ }
}
15 years