gatein SVN: r6137 - in epp/portal/branches/EPP_5_1_Branch/webui: portal/src/main/java/org/exoplatform/portal/webui/application and 1 other directory.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-03-30 05:02:48 -0400 (Wed, 30 Mar 2011)
New Revision: 6137
Modified:
epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
Log:
JBEPP-773: "Preferences" tab is only showing up if portlet has been customized (Only possible though portal.xml)
Modified: epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2011-03-29 19:21:55 UTC (rev 6136)
+++ epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2011-03-30 09:02:48 UTC (rev 6137)
@@ -167,34 +167,34 @@
UIForm uiForm = getAncestorOfType(UIForm.class);
for (UIComponent inputEntry : getChildren())
{
- if (inputEntry.isRendered())
+ if (inputEntry instanceof UIFormInputBase)
{
- String label;
- try
+ if (inputEntry.isRendered())
{
- label = uiForm.getLabel(res, inputEntry.getId());
- if (inputEntry instanceof UIFormInputBase)
- ((UIFormInputBase)inputEntry).setLabel(label);
+ UIFormInputBase formInputBase = (UIFormInputBase) inputEntry;
+ String label;
+ if (formInputBase.getLabel() != null)
+ {
+ label = uiForm.getLabel(res, formInputBase.getLabel());
+ }
+ else
+ {
+ label = uiForm.getLabel(res, formInputBase.getId());
+ }
+ w.write("<tr>");
+ w.write("<td class=\"FieldLabel\">");
+
+ // if missing resource and the label hasn't been set before, don't print out the label.
+ if (formInputBase.getLabel() != null || (label != formInputBase.getId()))
+ {
+ w.write(label);
+ }
+ w.write("</td>");
+ w.write("<td class=\"FieldComponent\">");
+ renderUIComponent(formInputBase);
+ w.write("</td>");
+ w.write("</tr>");
}
- catch (MissingResourceException ex)
- {
- //label = " " ;
- label = inputEntry.getName();
- System.err.println("\n " + uiForm.getId() + ".label." + inputEntry.getId() + " not found value");
- }
- w.write("<tr>");
- w.write("<td class=\"FieldLabel\">");
-
- // if missing resource, don't print out the label.
- if(!label.equals(inputEntry.getName()))
- {
- w.write(label);
- }
- w.write("</td>");
- w.write("<td class=\"FieldComponent\">");
- renderUIComponent(inputEntry);
- w.write("</td>");
- w.write("</tr>");
}
}
w.write("</table>");
@@ -214,4 +214,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2011-03-29 19:21:55 UTC (rev 6136)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2011-03-30 09:02:48 UTC (rev 6137)
@@ -22,8 +22,8 @@
import org.exoplatform.commons.utils.ExceptionUtil;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.pc.ExoPortletState;
-import org.exoplatform.portal.pom.spi.portlet.Preference;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
+import org.exoplatform.portal.pom.spi.portlet.Preference;
import org.exoplatform.portal.pom.spi.wsrp.WSRP;
import org.exoplatform.portal.pom.spi.wsrp.WSRPPortletStateType;
import org.exoplatform.portal.portlet.PortletExceptionHandleService;
@@ -45,22 +45,15 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.form.UIFormCheckBoxInput;
-import org.exoplatform.webui.form.UIFormInputIconSelector;
-import org.exoplatform.webui.form.UIFormInputInfo;
-import org.exoplatform.webui.form.UIFormInputSet;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.UIFormTabPane;
-import org.exoplatform.webui.form.UIFormTextAreaInput;
+import org.exoplatform.webui.form.*;
import org.exoplatform.webui.form.validator.ExpressionValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
import org.exoplatform.webui.organization.UIListPermissionSelector;
import org.exoplatform.webui.organization.UIListPermissionSelector.EmptyIteratorValidator;
import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.PortletContext;
-import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.api.StatefulPortletContext;
+import org.gatein.pc.api.info.PreferenceInfo;
import org.gatein.pc.api.invocation.RenderInvocation;
import org.gatein.pc.api.invocation.response.ErrorResponse;
import org.gatein.pc.api.invocation.response.FragmentResponse;
@@ -68,23 +61,12 @@
import org.gatein.pc.api.spi.InstanceContext;
import org.gatein.pc.api.state.AccessMode;
import org.gatein.pc.api.state.PropertyChange;
-import org.gatein.pc.portlet.impl.spi.AbstractClientContext;
-import org.gatein.pc.portlet.impl.spi.AbstractPortalContext;
-import org.gatein.pc.portlet.impl.spi.AbstractSecurityContext;
-import org.gatein.pc.portlet.impl.spi.AbstractServerContext;
-import org.gatein.pc.portlet.impl.spi.AbstractUserContext;
-import org.gatein.pc.portlet.impl.spi.AbstractWindowContext;
+import org.gatein.pc.portlet.impl.spi.*;
import javax.portlet.PortletMode;
import javax.servlet.http.Cookie;
+import java.util.*;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.ResourceBundle;
-
/** Author : Nhu Dinh Thuan nhudinhthuan(a)yahoo.com Jun 8, 2006 */
@ComponentConfigs({
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/portal/webui/portal/UIPortletForm.gtmpl", events = {
@@ -115,7 +97,7 @@
addValidator(MandatoryValidator.class).setEditable(false)).
addUIFormInput(new UIFormStringInput("windowId", "windowId", null).setEditable(false)).*/
addUIFormInput(new UIFormInputInfo("displayName", "displayName", null)).addUIFormInput(
- new UIFormStringInput("title", "title", null).addValidator(StringLengthValidator.class, 3, 60).addValidator(ExpressionValidator.class, "[^\\<\\>]*",
+ new UIFormStringInput("title", "title", null).addValidator(StringLengthValidator.class, 3, 60).addValidator(ExpressionValidator.class, "[^\\<\\>]*",
"UIPortletForm.msg.InvalidPortletTitle"))
.addUIFormInput(
new UIFormStringInput("width", "width", null).addValidator(ExpressionValidator.class, "(^([1-9]\\d*)px$)?",
@@ -226,7 +208,7 @@
{
content = fragmentResponse.getContent();
}
-
+
}
else
{
@@ -262,7 +244,7 @@
}
portletContent.setLength(0);
-
+
portletContent.append(content);
}
catch (Throwable ex)
@@ -288,40 +270,59 @@
getChild(UIFormInputIconSelector.class).setSelectedIcon(icon);
getChild(UIFormInputThemeSelector.class).getChild(UIItemThemeSelector.class).setSelectedTheme(
uiPortlet.getSuitedTheme(null));
- WebuiRequestContext contextres = WebuiRequestContext.getCurrentInstance();
- ResourceBundle res = contextres.getApplicationResourceBundle();
if (hasEditMode())
{
uiPortlet.setCurrentPortletMode(PortletMode.EDIT);
}
else
{
+ Map<String, String> portletPreferenceMaps = new HashMap<String, String>();
+ org.gatein.pc.api.Portlet portlet = uiPortlet.getProducedOfferedPortlet();
+ Set<String> keySet = portlet.getInfo().getPreferences().getKeys();
- //
+ for (String key : keySet)
+ {
+ PreferenceInfo preferenceInfo = portlet.getInfo().getPreferences().getPreference(key);
+ if (!preferenceInfo.isReadOnly())
+ {
+ String ppValue = (preferenceInfo.getDefaultValue().size() > 0) ? preferenceInfo.getDefaultValue().get
+ (0) : "";
+ portletPreferenceMaps.put(key, ppValue);
+ }
+ }
+
Portlet pp = uiPortlet.getPreferences();
if (pp != null)
{
- UIFormInputSet uiPortletPrefSet = getChildById(FIELD_PORTLET_PREF);
- uiPortletPrefSet.getChildren().clear();
for (Preference pref : pp)
{
if (!pref.isReadOnly())
{
- UIFormStringInput templateStringInput =
- new UIFormStringInput(pref.getName(), null, pref.getValues().get(0));
- templateStringInput.setLabel(res.getString("UIPortletForm.tab.label.Template"));
- templateStringInput.addValidator(MandatoryValidator.class);
- uiPortletPrefSet.addUIFormInput(templateStringInput);
+ portletPreferenceMaps.put(pref.getName(), (pref.getValues().size() > 0) ? pref.getValues().get(0) :
+ "");
}
-
}
- if (uiPortletPrefSet.getChildren().size() > 0)
+ }
+
+ if (portletPreferenceMaps.size() > 0)
+ {
+ Set<String> ppKeySet = portletPreferenceMaps.keySet();
+ UIFormInputSet uiPortletPrefSet = getChildById(FIELD_PORTLET_PREF);
+ uiPortletPrefSet.getChildren().clear();
+ for (String ppKey : ppKeySet)
{
- uiPortletPrefSet.setRendered(true);
- setSelectedTab(FIELD_PORTLET_PREF);
- return;
+ String ppValue = portletPreferenceMaps.get(ppKey);
+ UIFormStringInput preferenceStringInput = new UIFormStringInput(ppKey, null, ppValue);
+ preferenceStringInput.setLabel(ppKey);
+ preferenceStringInput.addValidator(MandatoryValidator.class);
+ uiPortletPrefSet.addUIFormInput(preferenceStringInput);
}
+
+ uiPortletPrefSet.setRendered(true);
+ setSelectedTab(FIELD_PORTLET_PREF);
+ return;
}
+
setSelectedTab("PortletSetting");
}
}
@@ -336,12 +337,6 @@
return;
}
- //
- PortletInvoker portletInvoker = getApplicationComponent(PortletInvoker.class);
- PortletContext portletContext = uiPortlet_.getPortletContext();
-
- //
-
PropertyChange[] propertyChanges = new PropertyChange[uiFormInputs.size()];
for (int i = 0; i < uiFormInputs.size(); i++)
13 years, 9 months
gatein SVN: r6136 - in components/wci/trunk: test/core/src/main/java/org/gatein/wci/spi and 1 other directories.
by do-not-reply@jboss.org
Author: mstruk
Date: 2011-03-29 15:21:55 -0400 (Tue, 29 Mar 2011)
New Revision: 6136
Added:
components/wci/trunk/test/core/src/main/java/org/gatein/wci/spi/SPICrossContextLogoutTestCase.java
Modified:
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java
components/wci/trunk/test/core/src/main/resources/org/gatein/portal/test/web/spi/native/server-beans.xml
Log:
GTNPORTAL-1706 session cleanup after logout
- Added Jetty6 implementation
- Added a test case
Modified: components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java
===================================================================
--- components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java 2011-03-29 16:59:59 UTC (rev 6135)
+++ components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java 2011-03-29 19:21:55 UTC (rev 6136)
@@ -6,14 +6,21 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.AbstractHandler;
public class Jetty6Handler extends AbstractHandler
{
+ private static final Logger log = LoggerFactory.getLogger(Jetty6Handler.class);
+
+ /** Servlet context init parameter name that can be used to turn off cross-context logout */
+ private static final String CROSS_CONTEXT_LOGOUT_KEY = "org.gatein.wci.cross_context_logout";
+
Server server;
Jetty6ServletContainerContext containerContext;
-
+
public Jetty6Handler (Server server)
{
this.server = server;
@@ -24,6 +31,7 @@
protected void doStart() throws Exception {
super.doStart();
containerContext = new Jetty6ServletContainerContext(server);
+ containerContext.setCrossContextLogout(getCrossContextLogoutConfig());
containerContext.start();
}
@@ -43,5 +51,17 @@
// Do Nothing for now. This doesn't actually handle anything, but needs to be a handler
// to tie in the jetty lifecycle and to be able to have access to the server object..
}
-
+
+ private boolean getCrossContextLogoutConfig() {
+
+ String val = (String) server.getAttribute(CROSS_CONTEXT_LOGOUT_KEY);
+ if (val == null || Boolean.valueOf(val))
+ return true;
+
+ if (!"false".equalsIgnoreCase(val))
+ log.warn("Context init param " + CROSS_CONTEXT_LOGOUT_KEY + " value is invalid: " + val + " - falling back to: false");
+
+ log.info("Cross-context session invalidation on logout disabled");
+ return false;
+ }
}
\ No newline at end of file
Modified: components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
===================================================================
--- components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java 2011-03-29 16:59:59 UTC (rev 6135)
+++ components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java 2011-03-29 19:21:55 UTC (rev 6136)
@@ -8,8 +8,11 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
import org.gatein.wci.RequestDispatchCallback;
+import org.gatein.wci.ServletContainerVisitor;
+import org.gatein.wci.WebApp;
import org.gatein.wci.authentication.GenericAuthentication;
import org.gatein.wci.command.CommandDispatcher;
import org.gatein.wci.impl.DefaultServletContainerFactory;
@@ -39,7 +42,10 @@
private final Set<String> monitoredContexts = new HashSet<String>();
private final Set<String> monitoredContextHandlerCollection = new HashSet<String>();
-
+
+ /** Perform cross-context session invalidation on logout, or not */
+ private boolean crossContextLogout = true;
+
public Jetty6ServletContainerContext(Server server) {
this.server = server;
this.container = server.getContainer();
@@ -65,6 +71,11 @@
this.registration = null;
}
+ public void setCrossContextLogout(boolean val)
+ {
+ crossContextLogout = val;
+ }
+
public void login(HttpServletRequest request, HttpServletResponse response, Credentials credentials, long validityMillis) throws IOException
{
authentication.login(credentials, request, response, validityMillis, null);
@@ -77,7 +88,25 @@
public void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException
{
- authentication.logout(request, response);
+ HttpSession sess = request.getSession(false);
+
+ if (sess == null)
+ return;
+
+ sess.invalidate();
+
+ if (!crossContextLogout)
+ return;
+
+ final String sessId = sess.getId();
+ DefaultServletContainerFactory.getInstance().getServletContainer().visit(new ServletContainerVisitor()
+ {
+ public void accept(WebApp webApp)
+ {
+ webApp.invalidateSession(sessId);
+ }
+ });
+
}
public String getContainerInfo()
Modified: components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java
===================================================================
--- components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java 2011-03-29 16:59:59 UTC (rev 6135)
+++ components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java 2011-03-29 19:21:55 UTC (rev 6136)
@@ -26,9 +26,11 @@
import java.io.InputStream;
import javax.servlet.ServletContext;
+import javax.servlet.http.HttpSession;
import org.gatein.wci.command.CommandServlet;
import org.gatein.wci.spi.WebAppContext;
+import org.mortbay.jetty.SessionManager;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import org.w3c.dom.Document;
@@ -122,6 +124,16 @@
public boolean invalidateSession(String sessId)
{
+ SessionManager mgr = context.getSessionHandler().getSessionManager();
+ if (mgr != null)
+ {
+ HttpSession sess = mgr.getHttpSession(sessId);
+ if (sess != null)
+ {
+ sess.invalidate();
+ return true;
+ }
+ }
return false;
}
}
Added: components/wci/trunk/test/core/src/main/java/org/gatein/wci/spi/SPICrossContextLogoutTestCase.java
===================================================================
--- components/wci/trunk/test/core/src/main/java/org/gatein/wci/spi/SPICrossContextLogoutTestCase.java (rev 0)
+++ components/wci/trunk/test/core/src/main/java/org/gatein/wci/spi/SPICrossContextLogoutTestCase.java 2011-03-29 19:21:55 UTC (rev 6136)
@@ -0,0 +1,355 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.wci.spi;
+
+import org.gatein.wci.ServletContainer;
+import org.gatein.wci.ServletContextDispatcher;
+import org.gatein.wci.TestServlet;
+import org.gatein.wci.WebApp;
+import org.gatein.wci.WebAppRegistry;
+import org.gatein.wci.WebRequest;
+import org.gatein.wci.WebResponse;
+import org.gatein.wci.authentication.AuthenticationEvent;
+import org.gatein.wci.authentication.AuthenticationListener;
+import org.gatein.wci.authentication.GenericAuthentication;
+import org.gatein.wci.authentication.TicketService;
+import org.gatein.wci.endpoint.EndPointTestCase;
+import org.gatein.wci.impl.DefaultServletContainerFactory;
+import org.gatein.wci.security.Credentials;
+import org.gatein.wci.security.WCIController;
+import org.gatein.wci.spi.callbacks.NormalCallback;
+import org.jboss.unit.Failure;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.remote.driver.handler.deployer.response.DeployResponse;
+import org.jboss.unit.remote.driver.handler.deployer.response.UndeployResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import static org.jboss.unit.api.Assert.*;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+/**
+ * TestCase to test cross-context session invalidation on logout
+ *
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class SPICrossContextLogoutTestCase extends EndPointTestCase
+{
+ /**
+ * .
+ */
+ private final Value v = new Value();
+
+ /**
+ * .
+ */
+ private WCIController wciController = new TestController();
+
+ /**
+ * .
+ */
+ private WebAppRegistry registry;
+
+ /**
+ * .
+ */
+ private Set<String> keys;
+
+ /**
+ * .
+ */
+ private ServletContainer container;
+
+ /**
+ * Session attribute for the test - contains some session data
+ */
+ private static final String CROSS_CTX_TEST_ATTR = "cross-ctx-test";
+
+ /**
+ * Key to take note of include invocation
+ */
+ private static final String COUNT_KEY = "count";
+
+ public DriverResponse service(TestServlet testServlet, WebRequest req, WebResponse resp) throws ServletException, IOException
+ {
+ Credentials credentials = wciController.getCredentials(req, resp);
+
+ if (getRequestCount() == 1)
+ {
+ assertNull(req.getUserPrincipal());
+ container = DefaultServletContainerFactory.getInstance().getServletContainer();
+ container.addAuthenticationListener(new TestListener(v));
+ assertEquals("", v.value);
+ container.login(req, resp, credentials, TicketService.DEFAULT_VALIDITY);
+
+ if ("Tomcat/7.x".equals(container.getContainerInfo()) || "JBossas/6.x".equals(container.getContainerInfo()))
+ {
+ assertEquals("login", v.value);
+ assertNotNull(req.getUserPrincipal());
+ assertTrue(req.isUserInRole("test"));
+ }
+ else
+ {
+ // Test Ticket Service
+ String ticket = GenericAuthentication.TICKET_SERVICE.createTicket(credentials, TicketService.DEFAULT_VALIDITY);
+ Credentials resultCredentials = GenericAuthentication.TICKET_SERVICE.validateTicket(ticket, false);
+ assertEquals(credentials.getUsername(), resultCredentials.getUsername());
+ assertEquals(credentials.getPassword(), resultCredentials.getPassword());
+ assertNotNull(GenericAuthentication.TICKET_SERVICE.validateTicket(ticket, true));
+ assertNull(GenericAuthentication.TICKET_SERVICE.validateTicket(ticket, true));
+
+ // Test login Event
+ assertEquals("login", v.value);
+ assertTrue(resp.isCommitted());
+ }
+
+ String url = resp.renderURL("/", null, null);
+ return new InvokeGetResponse(url);
+ }
+ else if (getRequestCount() == 2)
+ {
+
+ // Counter to keep an eye on includes
+ final Map<String, String> rets = new HashMap<String, String>();
+
+ // Set some session state in this context
+ req.getSession().setAttribute(CROSS_CTX_TEST_ATTR, "1");
+
+ // Set some session state in another context
+ ServletContext appContext = testServlet.getServletContext().getContext("/test-spi-app");
+ ServletContextDispatcher dispatcher = new ServletContextDispatcher(req, resp, container);
+
+ NormalCallback cb = new NormalCallback(appContext, registry.getWebApp("/test-spi-app").getClassLoader())
+ {
+ public Object doCallback(ServletContext dispatchedServletContext, HttpServletRequest dispatchedRequest, HttpServletResponse dispatchedResponse, Object handback) throws ServletException, IOException
+ {
+ dispatchedRequest.getSession().setAttribute(CROSS_CTX_TEST_ATTR, "2");
+ rets.put(COUNT_KEY, "1");
+ return super.doCallback(dispatchedServletContext, dispatchedRequest, dispatchedResponse, handback);
+ }
+ };
+
+ DriverResponse response = cb.test(null, dispatcher);
+ if (response != null)
+ return response;
+
+ // Check that the callback was invoked and the other context really was used with another session
+ assertEquals("1", req.getSession().getAttribute(CROSS_CTX_TEST_ATTR));
+ assertEquals("1", rets.get(COUNT_KEY));
+
+ String url = resp.renderURL("/", null, null);
+ return new InvokeGetResponse(url);
+ }
+ else if (getRequestCount() == 3)
+ {
+ // Check that the sessions retained values between requests
+ // test-spi-server context
+ assertEquals("1", req.getSession().getAttribute(CROSS_CTX_TEST_ATTR));
+
+ // test-spi-app context
+
+ // Map to get data from includes
+ final Map<String, String> rets = new HashMap<String, String>();
+
+ ServletContext appContext = testServlet.getServletContext().getContext("/test-spi-app");
+ ServletContextDispatcher dispatcher = new ServletContextDispatcher(req, resp, container);
+
+ NormalCallback cb = new NormalCallback(appContext, registry.getWebApp("/test-spi-app").getClassLoader())
+ {
+ public Object doCallback(ServletContext dispatchedServletContext, HttpServletRequest dispatchedRequest, HttpServletResponse dispatchedResponse, Object handback) throws ServletException, IOException
+ {
+ rets.put(CROSS_CTX_TEST_ATTR, (String) dispatchedRequest.getSession().getAttribute(CROSS_CTX_TEST_ATTR));
+ rets.put(COUNT_KEY, "1");
+ return super.doCallback(dispatchedServletContext, dispatchedRequest, dispatchedResponse, handback);
+ }
+ };
+
+ DriverResponse response = cb.test(null, dispatcher);
+ if (response != null)
+ return response;
+
+ // Check that the callback was invoked and the other context really was used with another session
+ assertEquals("1", rets.get(COUNT_KEY));
+ assertEquals("2", rets.get(CROSS_CTX_TEST_ATTR));
+
+
+ // Perform logout
+
+ if ("Tomcat/7.x".equals(container.getContainerInfo()) || "JBossas/6.x".equals(container.getContainerInfo()))
+ {
+ assertEquals("login", v.value);
+
+ container.logout(req, resp);
+
+ assertEquals("logout", v.value);
+ assertNull(req.getUserPrincipal());
+ }
+ else
+ {
+ // Test logout
+ assertNotNull(req.getSession(false));
+ assertEquals("login", v.value);
+ container.logout(req, resp);
+ assertNull(req.getSession(false));
+
+ // Test logout Event
+ assertEquals("logout", v.value);
+ }
+
+ // Session state must be gone
+ assertNull(req.getSession().getAttribute(CROSS_CTX_TEST_ATTR));
+
+ // Get session state from the other context again
+ cb = new NormalCallback(appContext, registry.getWebApp("/test-spi-app").getClassLoader())
+ {
+ public Object doCallback(ServletContext dispatchedServletContext, HttpServletRequest dispatchedRequest, HttpServletResponse dispatchedResponse, Object handback) throws ServletException, IOException
+ {
+ rets.put(COUNT_KEY, "2");
+ rets.put(CROSS_CTX_TEST_ATTR, (String) dispatchedRequest.getSession().getAttribute("cross-ctx-test"));
+ return super.doCallback(dispatchedServletContext, dispatchedRequest, dispatchedResponse, handback);
+ }
+ };
+
+ response = cb.test(null, dispatcher);
+ if (response != null)
+ return response;
+
+ // check that in the other context session state is deleted as well
+ assertEquals("2", rets.get(COUNT_KEY));
+ assertEquals(null, rets.get(CROSS_CTX_TEST_ATTR));
+
+ return new UndeployResponse("test-spi-app.war");
+ }
+ else if (getRequestCount() == 4)
+ {
+ return new EndTestResponse();
+ }
+
+ return new FailureResponse(Failure.createAssertionFailure("End test reached"));
+ }
+
+ public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
+ {
+ if (getRequestCount() == -1)
+ {
+ container = DefaultServletContainerFactory.getInstance().getServletContainer();
+ if (container == null)
+ {
+ return new FailureResponse(Failure.createAssertionFailure("No servlet container present"));
+ }
+
+ // Register and save the deployed web apps
+ registry = new WebAppRegistry();
+ container.addWebAppListener(registry);
+ keys = new HashSet<String>(registry.getKeys());
+
+ // Deploy the application web app
+ return new DeployResponse("test-spi-app.war");
+ }
+ else if (getRequestCount() == 0)
+ {
+ FailureResponse failureResponse = checkDeployments("/test-spi-app", 1);
+ if (failureResponse != null)
+ {
+ return failureResponse;
+ }
+ else
+ {
+ // call service method
+ return new InvokeGetResponse("/test-spi-server");
+ }
+ }
+ else
+ {
+ return new FailureResponse(Failure.createAssertionFailure(""));
+ }
+ }
+
+ protected FailureResponse checkDeployments(String appContext, int count)
+ {
+ // Compute the difference with the previous deployed web apps
+ Set diff = new HashSet<String>(registry.getKeys());
+ diff.removeAll(keys);
+
+ // It should be 1
+ if (diff.size() != count)
+ {
+ return new FailureResponse(Failure.createAssertionFailure("The size of the new web application deployed should be " + count + ", it is " + diff.size() + " instead." +
+ "The previous set was " + keys + " and the new set is " + registry.getKeys()));
+ }
+ if (!diff.contains(appContext))
+ {
+ return new FailureResponse(Failure.createErrorFailure("Could not find the requested webapp [" + appContext + "] in the list of depoyed webapps."));
+ }
+
+ //
+ WebApp webApp = registry.getWebApp(appContext);
+ if (webApp == null)
+ {
+ return new FailureResponse(Failure.createAssertionFailure("The web app " + appContext + " was not found"));
+ }
+ if (!appContext.equals(webApp.getContextPath()))
+ {
+ return new FailureResponse(Failure.createAssertionFailure("The web app context is not equals to the expected value [" + appContext + "] but has the value " + webApp.getContextPath()));
+ }
+
+ return null;
+ }
+
+ class Value
+ {
+ public String value = "";
+ }
+
+ static class TestListener implements AuthenticationListener
+ {
+ private Value value;
+
+ public TestListener(Value value)
+ {
+ this.value = value;
+ }
+
+ public void onLogin(AuthenticationEvent ae)
+ {
+ value.value = "login";
+ }
+
+ public void onLogout(AuthenticationEvent ae)
+ {
+ value.value = "logout";
+ }
+ }
+
+}
Modified: components/wci/trunk/test/core/src/main/resources/org/gatein/portal/test/web/spi/native/server-beans.xml
===================================================================
--- components/wci/trunk/test/core/src/main/resources/org/gatein/portal/test/web/spi/native/server-beans.xml 2011-03-29 16:59:59 UTC (rev 6135)
+++ components/wci/trunk/test/core/src/main/resources/org/gatein/portal/test/web/spi/native/server-beans.xml 2011-03-29 19:21:55 UTC (rev 6136)
@@ -84,4 +84,13 @@
</uninstall>
</bean>
+ <bean name="SPICrossContextLogoutTestCase" class="org.gatein.wci.spi.SPICrossContextLogoutTestCase">
+ <install bean="TestSuite" method="mount">
+ <parameter><this/></parameter>
+ </install>
+ <uninstall bean="TestSuite" method="unmount">
+ <parameter><this/></parameter>
+ </uninstall>
+ </bean>
+
</deployment>
13 years, 9 months
gatein SVN: r6135 - portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-03-29 12:59:59 -0400 (Tue, 29 Mar 2011)
New Revision: 6135
Modified:
portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
Log:
- GTNWSRP-216: added missing nodetype declaration.
Modified: portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
===================================================================
--- portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2011-03-29 14:05:46 UTC (rev 6134)
+++ portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2011-03-29 16:59:59 UTC (rev 6135)
@@ -111,9 +111,6 @@
onParentVersion="COPY" protected="false" multiple="false">
<valueConstraints/>
</propertyDefinition>
- <propertyDefinition name="portlethandles" requiredType="String" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false" multiple="true">
- </propertyDefinition>
</propertyDefinitions>
<childNodeDefinitions>
<childNodeDefinition name="properties" defaultPrimaryType="wsrp:registrationproperties" autoCreated="false"
@@ -122,9 +119,32 @@
<requiredPrimaryType>wsrp:registrationproperties</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:portletcontext" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:portletcontext</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
</childNodeDefinitions>
</nodeType>
+ <nodeType name="wsrp:portletcontext" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="id" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="state" requiredType="Binary" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
<nodeType name="wsrp:registrationproperties" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
13 years, 9 months
gatein SVN: r6134 - in components/wsrp/trunk: admin-gui/src/main/webapp/WEB-INF/classes and 10 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-03-29 10:05:46 -0400 (Tue, 29 Mar 2011)
New Revision: 6134
Added:
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/BeanContextTestCase.java
components/wsrp/trunk/admin-gui/src/test/resources/
components/wsrp/trunk/admin-gui/src/test/resources/Resource.properties
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/registration/JCRRegistrationPersistenceManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/AbstractRegistrationPersistenceManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPersistenceManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/RegistrationSPI.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/RegistrationHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/invoker/RegistrationCheckingPortletInvoker.java
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationTestCase.java
Log:
- GTNWSRP-214: Do not swallow exceptions in the registration persistence code.
- Fixed error reporting and improper messages (do NOT forget to properly escape single-quotes in properties files >_<).
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -642,11 +642,23 @@
}
}
- beanContext.createLocalizedMessage(BeanContext.STATUS, IMPORT_SUCCESS, beanContext.getInfoSeverity(), importCount);
+ // only display success message if we have imported at least one portlet successfully
+ if (importCount > 0)
+ {
+ beanContext.createLocalizedMessage(BeanContext.STATUS, IMPORT_SUCCESS, beanContext.getInfoSeverity(), importCount);
+ }
+
SortedMap<QName, List<String>> errorCodesToFailedPortletHandlesMapping = info.getErrorCodesToFailedPortletHandlesMapping();
if (!errorCodesToFailedPortletHandlesMapping.isEmpty())
{
- beanContext.createErrorMessage(FAILED_PORTLETS, errorCodesToFailedPortletHandlesMapping);
+ for (Map.Entry<QName, List<String>> entry : errorCodesToFailedPortletHandlesMapping.entrySet())
+ {
+ QName errorCode = entry.getKey();
+ for (String handle : entry.getValue())
+ {
+ beanContext.createErrorMessage(FAILED_PORTLETS, handle + " (cause: " + errorCode + ")");
+ }
+ }
}
return ConsumerManagerBean.CONSUMERS;
@@ -656,7 +668,6 @@
beanContext.createErrorMessageFrom(e);
return null;
}
-
}
public String deleteExport()
@@ -704,12 +715,12 @@
{
return consumer.getMigrationService().isAvailableExportInfosEmpty();
}
-
+
public boolean isWssEnabled()
{
return consumer.getProducerInfo().getEndpointConfigurationInfo().getWSSEnabled();
}
-
+
public void setWssEnabled(boolean enable)
{
consumer.getProducerInfo().getEndpointConfigurationInfo().setWSSEnabled(enable);
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties 2011-03-29 14:05:46 UTC (rev 6134)
@@ -189,7 +189,7 @@
bean_consumer_malformed_url = ''{0}'' is not a valid URL: {1}
bean_consumer_update_success = Successfully updated consumer!
bean_consumer_import_success = {0} portlets were successfully imported!
-bean_consumer_import_failed_portlets = The following portlets couldn't be imported: {0}
+bean_consumer_import_failed_portlets = The following portlet couldn''t be imported: {0}
# ConsumerManagerBean
bean_consumermanager_invalid_new_consumer_name = Need a non-null, non-empty name for the new consumer!
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties 2011-03-29 14:05:46 UTC (rev 6134)
@@ -175,7 +175,7 @@
import_import=Importer
import_use=Importer?
bean_consumer_import_success=''{0}'' portlets ont �t� correctement import�es!
-bean_consumer_import_failed_portlets=Les portlets suivantes n'ont pas pu �tre import�es: {0}
+bean_consumer_import_failed_portlets=La portlet suivante n''a pas pu �tre import�e: {0}
edit_consumer_export=Exporter portlets
edit_consumer_export_title=Portlets en export
edit_consumer_import=Importer portlets
Added: components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/BeanContextTestCase.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/BeanContextTestCase.java (rev 0)
+++ components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/BeanContextTestCase.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -0,0 +1,119 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.gatein.wsrp.admin.ui;
+
+import junit.framework.TestCase;
+
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class BeanContextTestCase extends TestCase
+{
+ public void testMessageFormatting()
+ {
+ assertEquals("foo value", BeanContext.getLocalizedMessage("foo", Locale.getDefault()));
+ assertEquals("foo value", BeanContext.getLocalizedMessage("foo", Locale.getDefault(), "Resource", "blah"));
+ assertEquals("param value: foo", BeanContext.getLocalizedMessage("1param", Locale.getDefault(), "Resource", "foo"));
+ assertEquals("param1 value: foo param2 value: bar", BeanContext.getLocalizedMessage("2params", Locale.getDefault(), "Resource", "foo", "bar"));
+ }
+
+ public void testErrorMessage()
+ {
+ TestBeanContext context = new TestBeanContext();
+ context.createErrorMessage("1param", "error");
+ assertEquals("param value: error", context.getMessage());
+ assertEquals(TestBeanContext.ERROR, context.getSeverity());
+ }
+
+ private static class TestBeanContext extends BeanContext
+ {
+ private static final String ERROR = "ERROR";
+ private static final String INFO = "INFO";
+ private String message;
+ private Object severity;
+ private Object[] params;
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public Object getSeverity()
+ {
+ return severity;
+ }
+
+ public Object[] getParams()
+ {
+ return params;
+ }
+
+ @Override
+ public String getParameter(String key)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ protected void createMessage(String target, String message, Object severity, Object... additionalParams)
+ {
+ this.message = message;
+ this.severity = severity;
+ this.params = additionalParams;
+ }
+
+ @Override
+ protected Object getErrorSeverity()
+ {
+ return ERROR;
+ }
+
+ @Override
+ protected Object getInfoSeverity()
+ {
+ return INFO;
+ }
+
+ @Override
+ protected Locale getLocale()
+ {
+ return Locale.getDefault();
+ }
+
+ @Override
+ public String getServerAddress()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Map<String, Object> getSessionMap()
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+}
Added: components/wsrp/trunk/admin-gui/src/test/resources/Resource.properties
===================================================================
--- components/wsrp/trunk/admin-gui/src/test/resources/Resource.properties (rev 0)
+++ components/wsrp/trunk/admin-gui/src/test/resources/Resource.properties 2011-03-29 14:05:46 UTC (rev 6134)
@@ -0,0 +1,3 @@
+foo=foo value
+1param=param value: {0}
+2params=param1 value: {0} param2 value: {1}
\ No newline at end of file
Modified: components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/registration/JCRRegistrationPersistenceManager.java
===================================================================
--- components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/registration/JCRRegistrationPersistenceManager.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/registration/JCRRegistrationPersistenceManager.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -98,7 +98,7 @@
}
@Override
- protected RegistrationSPI internalRemoveRegistration(String registrationId)
+ protected RegistrationSPI internalRemoveRegistration(String registrationId) throws RegistrationException
{
Registration registration = getRegistration(registrationId);
remove(registration.getPersistentKey(), RegistrationMapping.class);
@@ -107,7 +107,7 @@
}
@Override
- protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map registrationProperties)
+ protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map registrationProperties) throws RegistrationException
{
ChromatticSession session = persister.getSession();
RegistrationSPI registration = null;
@@ -121,15 +121,15 @@
}
catch (Exception e)
{
- e.printStackTrace(); // todo fix me
persister.closeSession(false);
+ throw new RegistrationException(e);
}
return registration;
}
@Override
- protected ConsumerSPI internalRemoveConsumer(String consumerId)
+ protected ConsumerSPI internalRemoveConsumer(String consumerId) throws RegistrationException
{
remove(consumerId, ConsumerMapping.class);
@@ -144,7 +144,7 @@
}
@Override
- protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName)
+ protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName) throws RegistrationException
{
ConsumerSPI consumer = super.internalCreateConsumer(consumerId, consumerName);
@@ -160,15 +160,15 @@
}
catch (Exception e)
{
- e.printStackTrace(); // todo: fix me
persister.closeSession(false);
+ throw new RegistrationException(e);
}
return consumer;
}
@Override
- protected ConsumerSPI internalSaveChangesTo(Consumer consumer)
+ protected ConsumerSPI internalSaveChangesTo(Consumer consumer) throws RegistrationException
{
ConsumerSPI consumerSPI = super.internalSaveChangesTo(consumer);
@@ -181,14 +181,14 @@
}
catch (Exception e)
{
- e.printStackTrace(); // todo: fix me
persister.closeSession(false);
+ throw new RegistrationException(e);
}
return consumerSPI;
}
- protected RegistrationSPI internalSaveChangesTo(Registration registration)
+ protected RegistrationSPI internalSaveChangesTo(Registration registration) throws RegistrationException
{
RegistrationSPI registrationSPI = super.internalSaveChangesTo(registration);
@@ -201,15 +201,15 @@
}
catch (Exception e)
{
- e.printStackTrace(); //todo: fix me
persister.closeSession(false);
+ throw new RegistrationException(e);
}
return registrationSPI;
}
@Override
- protected ConsumerGroupSPI internalRemoveConsumerGroup(String name)
+ protected ConsumerGroupSPI internalRemoveConsumerGroup(String name) throws RegistrationException
{
try
{
@@ -225,7 +225,7 @@
}
@Override
- protected ConsumerGroupSPI internalCreateConsumerGroup(String name)
+ protected ConsumerGroupSPI internalCreateConsumerGroup(String name) throws RegistrationException
{
ConsumerGroupSPI group = super.internalCreateConsumerGroup(name);
@@ -240,8 +240,8 @@
}
catch (Exception e)
{
- e.printStackTrace(); // todo: fix me
persister.closeSession(false);
+ throw new RegistrationException(e);
}
return group;
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/AbstractRegistrationPersistenceManager.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/AbstractRegistrationPersistenceManager.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/AbstractRegistrationPersistenceManager.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -48,7 +48,7 @@
return consumer;
}
- public void saveChangesTo(Consumer consumer)
+ public void saveChangesTo(Consumer consumer) throws RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");
@@ -60,7 +60,7 @@
internalSaveChangesTo(consumer);
}
- public void saveChangesTo(Registration registration)
+ public void saveChangesTo(Registration registration) throws RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(registration, "Registration");
@@ -164,27 +164,27 @@
// internal methods: extension points for subclasses
- protected abstract void internalAddRegistration(RegistrationSPI registration);
+ protected abstract void internalAddRegistration(RegistrationSPI registration) throws RegistrationException;
- protected abstract RegistrationSPI internalRemoveRegistration(String registrationId);
+ protected abstract RegistrationSPI internalRemoveRegistration(String registrationId) throws RegistrationException;
- protected abstract RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map<QName, Object> registrationProperties);
+ protected abstract RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map<QName, Object> registrationProperties) throws RegistrationException;
- protected abstract void internalAddConsumer(ConsumerSPI consumer);
+ protected abstract void internalAddConsumer(ConsumerSPI consumer) throws RegistrationException;
- protected abstract ConsumerSPI internalRemoveConsumer(String consumerId);
+ protected abstract ConsumerSPI internalRemoveConsumer(String consumerId) throws RegistrationException;
- protected abstract ConsumerSPI internalCreateConsumer(String consumerId, String consumerName);
+ protected abstract ConsumerSPI internalCreateConsumer(String consumerId, String consumerName) throws RegistrationException;
- protected abstract ConsumerSPI internalSaveChangesTo(Consumer consumer);
+ protected abstract ConsumerSPI internalSaveChangesTo(Consumer consumer) throws RegistrationException;
- protected abstract RegistrationSPI internalSaveChangesTo(Registration registration);
+ protected abstract RegistrationSPI internalSaveChangesTo(Registration registration) throws RegistrationException;
- protected abstract void internalAddConsumerGroup(ConsumerGroupSPI group);
+ protected abstract void internalAddConsumerGroup(ConsumerGroupSPI group) throws RegistrationException;
- protected abstract ConsumerGroupSPI internalRemoveConsumerGroup(String name);
+ protected abstract ConsumerGroupSPI internalRemoveConsumerGroup(String name) throws RegistrationException;
- protected abstract ConsumerGroupSPI internalCreateConsumerGroup(String name);
+ protected abstract ConsumerGroupSPI internalCreateConsumerGroup(String name) throws RegistrationException;
protected abstract ConsumerSPI getConsumerSPIById(String consumerId) throws RegistrationException;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPersistenceManager.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPersistenceManager.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPersistenceManager.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -49,14 +49,14 @@
*
* @param consumer
*/
- void saveChangesTo(Consumer consumer);
+ void saveChangesTo(Consumer consumer) throws RegistrationException;
/**
* Saves changes made to the specified registration.
*
* @param registration
*/
- void saveChangesTo(Registration registration);
+ void saveChangesTo(Registration registration) throws RegistrationException;
/**
* Retrieves the ConsumerGroup identified by the specified name.
@@ -94,13 +94,13 @@
RegistrationSPI addRegistrationFor(String consumerId, Map<QName, Object> registrationProperties) throws RegistrationException;
- Collection<? extends ConsumerGroup> getConsumerGroups();
+ Collection<? extends ConsumerGroup> getConsumerGroups() throws RegistrationException;
- Registration getRegistration(String registrationId);
+ Registration getRegistration(String registrationId) throws RegistrationException;
Consumer addConsumerToGroupNamed(String consumerId, String groupName) throws RegistrationException;
- Collection<? extends Consumer> getConsumers();
+ Collection<? extends Consumer> getConsumers() throws RegistrationException;
- Collection<? extends Registration> getRegistrations();
+ Collection<? extends Registration> getRegistrations() throws RegistrationException;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -26,6 +26,7 @@
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.PortletContext;
import org.gatein.registration.Registration;
+import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationStatus;
import org.gatein.registration.spi.ConsumerSPI;
@@ -84,13 +85,13 @@
return consumer;
}
- public void addPortletContext(PortletContext portletContext)
+ public void addPortletContext(PortletContext portletContext) throws RegistrationException
{
portletContexts.add(portletContext);
manager.getPersistenceManager().saveChangesTo(this);
}
- public void removePortletContext(PortletContext portletContext)
+ public void removePortletContext(PortletContext portletContext) throws RegistrationException
{
portletContexts.remove(portletContext);
manager.getPersistenceManager().saveChangesTo(this);
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -322,7 +322,7 @@
return consumer;
}
- private Object getConsumerOrRegistration(String registrationHandle, boolean getConsumer)
+ private Object getConsumerOrRegistration(String registrationHandle, boolean getConsumer) throws RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationHandle, "registration handle", null);
@@ -337,7 +337,7 @@
}
}
- public Collection<? extends ConsumerGroup> getConsumerGroups()
+ public Collection<? extends ConsumerGroup> getConsumerGroups() throws RegistrationException
{
return persistenceManager.getConsumerGroups();
}
@@ -360,7 +360,7 @@
removeConsumerGroup(getConsumerGroup(name));
}
- public Collection<? extends Consumer> getConsumers()
+ public Collection<? extends Consumer> getConsumers() throws RegistrationException
{
return persistenceManager.getConsumers();
}
@@ -394,18 +394,39 @@
log.debug("Registration properties have changed, existing registrations will be invalidated...");
}
- Collection registrations = persistenceManager.getRegistrations();
- for (Object registration : registrations)
+ try
{
- Registration reg = (Registration)registration;
+ Collection registrations = persistenceManager.getRegistrations();
+ for (Object registration : registrations)
+ {
+ Registration reg = (Registration)registration;
- // pending instead of invalid as technically, the registration is not yet invalid
- reg.setStatus(RegistrationStatus.PENDING);
+ // pending instead of invalid as technically, the registration is not yet invalid
+ reg.setStatus(RegistrationStatus.PENDING);
- // make changes persistent
- Consumer consumer = reg.getConsumer();
- persistenceManager.saveChangesTo(consumer);
+ // make changes persistent
+ Consumer consumer = reg.getConsumer();
+ try
+ {
+ persistenceManager.saveChangesTo(consumer);
+ }
+ catch (RegistrationException e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Couldn't persist changes to Consumer '" + consumer.getId() + "'", e);
+ }
+ }
+ }
}
+ catch (RegistrationException e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Couldn't retrieve registrations...", e);
+ }
+ }
+
}
/**
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -52,22 +52,22 @@
private Map<String, ConsumerGroupSPI> groups = new HashMap<String, ConsumerGroupSPI>();
private Map<String, RegistrationSPI> registrations = new HashMap<String, RegistrationSPI>();
- public Collection<ConsumerSPI> getConsumers()
+ public Collection<ConsumerSPI> getConsumers() throws RegistrationException
{
return Collections.unmodifiableCollection(consumers.values());
}
- public Collection<RegistrationSPI> getRegistrations()
+ public Collection<RegistrationSPI> getRegistrations() throws RegistrationException
{
return Collections.unmodifiableCollection(registrations.values());
}
- public Collection<ConsumerGroupSPI> getConsumerGroups()
+ public Collection<ConsumerGroupSPI> getConsumerGroups() throws RegistrationException
{
return Collections.unmodifiableCollection(groups.values());
}
- public Registration getRegistration(String registrationId)
+ public Registration getRegistration(String registrationId) throws RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationId, "Registration id", null);
@@ -89,19 +89,19 @@
}
@Override
- protected void internalAddRegistration(RegistrationSPI registration)
+ protected void internalAddRegistration(RegistrationSPI registration) throws RegistrationException
{
registrations.put(registration.getPersistentKey(), registration);
}
@Override
- protected RegistrationSPI internalRemoveRegistration(String registrationId)
+ protected RegistrationSPI internalRemoveRegistration(String registrationId) throws RegistrationException
{
return registrations.remove(registrationId);
}
@Override
- protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map<QName, Object> registrationProperties)
+ protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map<QName, Object> registrationProperties) throws RegistrationException
{
return newRegistrationSPI(consumer, registrationProperties, "" + lastRegistrationId++);
}
@@ -112,19 +112,19 @@
}
@Override
- protected void internalAddConsumer(ConsumerSPI consumer)
+ protected void internalAddConsumer(ConsumerSPI consumer) throws RegistrationException
{
consumers.put(consumer.getId(), consumer);
}
@Override
- protected ConsumerSPI internalRemoveConsumer(String consumerId)
+ protected ConsumerSPI internalRemoveConsumer(String consumerId) throws RegistrationException
{
return consumers.remove(consumerId);
}
@Override
- protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName)
+ protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName) throws RegistrationException
{
ConsumerSPI consumerSPI = newConsumerSPI(consumerId, consumerName);
consumerSPI.setPersistentKey(consumerId);
@@ -137,19 +137,19 @@
}
@Override
- protected void internalAddConsumerGroup(ConsumerGroupSPI group)
+ protected void internalAddConsumerGroup(ConsumerGroupSPI group) throws RegistrationException
{
groups.put(group.getName(), group);
}
@Override
- protected ConsumerGroupSPI internalRemoveConsumerGroup(String name)
+ protected ConsumerGroupSPI internalRemoveConsumerGroup(String name) throws RegistrationException
{
return groups.remove(name);
}
@Override
- protected ConsumerGroupSPI internalCreateConsumerGroup(String name)
+ protected ConsumerGroupSPI internalCreateConsumerGroup(String name) throws RegistrationException
{
ConsumerGroupSPI groupSPI = newConsumerGroupSPI(name);
groupSPI.setPersistentKey(name);
@@ -168,13 +168,13 @@
}
@Override
- protected ConsumerSPI internalSaveChangesTo(Consumer consumer)
+ protected ConsumerSPI internalSaveChangesTo(Consumer consumer) throws RegistrationException
{
return (ConsumerSPI)consumer; // nothing to do here, left up to subclasses to implement update in persistent store
}
-
+
@Override
- protected RegistrationSPI internalSaveChangesTo(Registration registration)
+ protected RegistrationSPI internalSaveChangesTo(Registration registration) throws RegistrationException
{
return (RegistrationSPI)registration; // nothing to do here, left up to subclasses to implement update in persistent store
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/RegistrationSPI.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/RegistrationSPI.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/RegistrationSPI.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -25,6 +25,7 @@
import org.gatein.pc.api.PortletContext;
import org.gatein.registration.Registration;
+import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationManager;
/**
@@ -35,9 +36,9 @@
{
ConsumerSPI getConsumer();
- void addPortletContext(PortletContext portletContext);
+ void addPortletContext(PortletContext portletContext) throws RegistrationException;
- void removePortletContext(PortletContext portletContext);
+ void removePortletContext(PortletContext portletContext) throws RegistrationException;
void setManager(RegistrationManager manager);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -862,7 +862,7 @@
else // default error message.
{
errorCode = ErrorCodes.Codes.OPERATIONFAILED;
- reason = "Error preparing portlet for export";
+ reason = "Error importing portlet.";
}
if (!failedPortletsMap.containsKey(errorCode.name()))
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/RegistrationHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/RegistrationHandler.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/RegistrationHandler.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -111,7 +111,7 @@
return registrationContext;
}
- private void updateRegistrationInformation(Registration registration, RegistrationData registrationData)
+ private void updateRegistrationInformation(Registration registration, RegistrationData registrationData) throws RegistrationException
{
registration.setStatus(RegistrationStatus.VALID);
Consumer consumer = registration.getConsumer();
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/invoker/RegistrationCheckingPortletInvoker.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/invoker/RegistrationCheckingPortletInvoker.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/invoker/RegistrationCheckingPortletInvoker.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -38,6 +38,7 @@
import org.gatein.pc.portlet.PortletInvokerInterceptor;
import org.gatein.registration.Registration;
import org.gatein.registration.RegistrationDestructionListener;
+import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationLocal;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPolicy;
@@ -149,7 +150,14 @@
PortletContext responseContext = wsrpIC.getPortletContext();
if (wsrpIC.wasModified() && !responseContext.getId().equals(portletContext.getId()))
{
- registration.addPortletContext(responseContext);
+ try
+ {
+ registration.addPortletContext(responseContext);
+ }
+ catch (RegistrationException e)
+ {
+ throw new PortletInvokerException("Couldn't add portlet context '" + responseContext + "' to registration '" + registration.getRegistrationHandle() + "'", e);
+ }
}
}
@@ -183,7 +191,14 @@
checkOperationIsAllowed(portletContext, registration, "createClone");
PortletContext clonedPortletContext = super.createClone(stateType, portletContext);
- registration.addPortletContext(clonedPortletContext);
+ try
+ {
+ registration.addPortletContext(clonedPortletContext);
+ }
+ catch (RegistrationException e)
+ {
+ throw new PortletInvokerException("Couldn't add portlet context '" + clonedPortletContext + "' to registration '" + registration.getRegistrationHandle() + "'", e);
+ }
return clonedPortletContext;
}
@@ -216,7 +231,14 @@
// only remove the portlet context if there are no failures or it's not part of the failed clones
if (noFailures || !cloneFailures.contains(new DestroyCloneFailure(portletContext.getId())))
{
- registration.removePortletContext(portletContext);
+ try
+ {
+ registration.removePortletContext(portletContext);
+ }
+ catch (RegistrationException e)
+ {
+ throw new PortletInvokerException("Couldn't remove portlet context '" + portletContext + "' to registration '" + registration.getRegistrationHandle() + "'", e);
+ }
}
}
}
@@ -250,7 +272,14 @@
if (!portletContext.getId().equals(updatedPortletContext.getId()))
{
- registration.addPortletContext(updatedPortletContext);
+ try
+ {
+ registration.addPortletContext(updatedPortletContext);
+ }
+ catch (RegistrationException e)
+ {
+ throw new PortletInvokerException("Couldn't add portlet context '" + updatedPortletContext + "' to registration '" + registration.getRegistrationHandle() + "'", e);
+ }
}
return updatedPortletContext;
@@ -275,7 +304,14 @@
if (!newPortletContext.getId().equals(originalPortletContext.getId()))
{
- registration.addPortletContext(newPortletContext);
+ try
+ {
+ registration.addPortletContext(newPortletContext);
+ }
+ catch (RegistrationException e)
+ {
+ throw new PortletInvokerException("Couldn't add portlet context '" + newPortletContext + "' to registration '" + registration.getRegistrationHandle() + "'", e);
+ }
}
return newPortletContext;
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationTestCase.java 2011-03-29 12:56:29 UTC (rev 6133)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationTestCase.java 2011-03-29 14:05:46 UTC (rev 6134)
@@ -158,7 +158,7 @@
assertTrue(!registration.hasEqualProperties(registrationProperties));
}
- public void testPortletContextOperations()
+ public void testPortletContextOperations() throws RegistrationException
{
PortletContext foo = PortletContext.createPortletContext("foo");
13 years, 9 months
gatein SVN: r6133 - in components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp: admin and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-03-29 08:56:29 -0400 (Tue, 29 Mar 2011)
New Revision: 6133
Added:
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/ConsumerBeanTestCase.java
Removed:
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java
Log:
- Really move the test to the proper package!
Deleted: components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java 2011-03-29 12:55:03 UTC (rev 6132)
+++ components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java 2011-03-29 12:56:29 UTC (rev 6133)
@@ -1,175 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.wsrp;
-
-import junit.framework.TestCase;
-import org.gatein.common.NotYetImplemented;
-import org.gatein.wsrp.admin.ui.BeanContext;
-import org.gatein.wsrp.admin.ui.ConsumerBean;
-import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
-import org.gatein.wsrp.consumer.registry.InMemoryConsumerRegistry;
-import org.gatein.wsrp.services.SOAPServiceFactory;
-import org.gatein.wsrp.test.protocol.v2.BehaviorBackedServiceFactory;
-import org.gatein.wsrp.test.support.MockEndpointConfigurationInfo;
-
-import javax.faces.model.DataModel;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 12612 $
- * @since 2.6
- */
-public class ConsumerBeanTestCase extends TestCase
-{
- private static final String CONSUMER_ID = "foo";
-
- /** Since our consumers use the MockEndpointConfigurationInfo, this is the WSDL they are configured with */
- private static final String WSDL = BehaviorBackedServiceFactory.DEFAULT_WSDL_URL;
- private ConsumerBean bean;
-
- protected void setUp() throws Exception
- {
- bean = new ConsumerBean();
- ConsumerRegistry registry = new TestInMemoryConsumerRegistry();
- registry.createConsumer(CONSUMER_ID, null, WSDL);
- bean.setRegistry(registry);
- bean.setBeanContext(new TestBeanContext());
-
- // consumer associated with bean is null at this point so it should be loaded from the registry
- bean.setId(CONSUMER_ID);
- }
-
- public void testInitialState()
- {
- assertEquals(CONSUMER_ID, bean.getId());
- assertEquals(bean.getProducerInfo().getId(), bean.getId());
-
- assertEquals(WSDL, bean.getWsdl());
- assertEquals(SOAPServiceFactory.DEFAULT_TIMEOUT_MS, bean.getTimeout().intValue());
-
- assertFalse(bean.isModified());
- assertTrue(bean.isRefreshNeeded());
-
- assertFalse(bean.isActive());
-
- assertFalse(bean.isRegistrationChecked());
- assertTrue(bean.isRegistrationCheckNeeded());
- assertFalse(bean.isRegistered());
- assertFalse(bean.isRegistrationLocallyModified());
- assertFalse(bean.isRegistrationPropertiesExisting());
-
- assertNull(bean.getCurrentExport());
-
- DataModel existingExports = bean.getExistingExports();
- assertNotNull(existingExports);
- assertEquals(0, existingExports.getRowCount());
-
- try
- {
- assertFalse(bean.isRegistrationRequired());
- fail("Can't know if registration is required without a refresh");
- }
- catch (IllegalStateException e)
- {
- // expected
- }
- try
- {
- assertFalse(bean.isRegistrationValid());
- fail("Can't know if registration is valid without a refresh");
- }
- catch (Exception e)
- {
- // expected
- }
- }
-
- public void testSetId()
- {
- String newId = "newId";
- bean.setId(newId);
- assertEquals(newId, bean.getId());
-
- assertTrue(bean.isModified());
- }
-
- public void testSetCache()
- {
- bean.setCache(300);
- assertEquals(300, bean.getCache().intValue());
- assertTrue(bean.isModified());
- }
-
- private static class TestBeanContext extends BeanContext
- {
- public String getParameter(String key)
- {
- throw new NotYetImplemented();
- }
-
- protected void createMessage(String target, String message, Object severity, Object... addtionalParams)
- {
- // ignore for tests
- }
-
- protected Object getErrorSeverity()
- {
- return null;
- }
-
- protected Object getInfoSeverity()
- {
- return null;
- }
-
- protected Locale getLocale()
- {
- return Locale.getDefault();
- }
-
- public String getServerAddress()
- {
- throw new NotYetImplemented();
- }
-
- public Map<String, Object> getSessionMap()
- {
- throw new NotYetImplemented();
- }
- }
-
- private static class TestInMemoryConsumerRegistry extends InMemoryConsumerRegistry
- {
- @Override
- public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds, String wsdlURL)
- {
- // Use a "real" consumer but with a fake endpoint configuration so we can fake WS access
- WSRPConsumer consumer = super.createConsumer(id, expirationCacheSeconds, wsdlURL);
- consumer.getProducerInfo().setEndpointConfigurationInfo(new MockEndpointConfigurationInfo());
- return consumer;
- }
- }
-}
Copied: components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/ConsumerBeanTestCase.java (from rev 6132, components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java)
===================================================================
--- components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/ConsumerBeanTestCase.java (rev 0)
+++ components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/admin/ui/ConsumerBeanTestCase.java 2011-03-29 12:56:29 UTC (rev 6133)
@@ -0,0 +1,174 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp.admin.ui;
+
+import junit.framework.TestCase;
+import org.gatein.common.NotYetImplemented;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import org.gatein.wsrp.consumer.registry.InMemoryConsumerRegistry;
+import org.gatein.wsrp.services.SOAPServiceFactory;
+import org.gatein.wsrp.test.protocol.v2.BehaviorBackedServiceFactory;
+import org.gatein.wsrp.test.support.MockEndpointConfigurationInfo;
+
+import javax.faces.model.DataModel;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 12612 $
+ * @since 2.6
+ */
+public class ConsumerBeanTestCase extends TestCase
+{
+ private static final String CONSUMER_ID = "foo";
+
+ /** Since our consumers use the MockEndpointConfigurationInfo, this is the WSDL they are configured with */
+ private static final String WSDL = BehaviorBackedServiceFactory.DEFAULT_WSDL_URL;
+ private ConsumerBean bean;
+
+ protected void setUp() throws Exception
+ {
+ bean = new ConsumerBean();
+ ConsumerRegistry registry = new TestInMemoryConsumerRegistry();
+ registry.createConsumer(CONSUMER_ID, null, WSDL);
+ bean.setRegistry(registry);
+ bean.setBeanContext(new TestBeanContext());
+
+ // consumer associated with bean is null at this point so it should be loaded from the registry
+ bean.setId(CONSUMER_ID);
+ }
+
+ public void testInitialState()
+ {
+ assertEquals(CONSUMER_ID, bean.getId());
+ assertEquals(bean.getProducerInfo().getId(), bean.getId());
+
+ assertEquals(WSDL, bean.getWsdl());
+ assertEquals(SOAPServiceFactory.DEFAULT_TIMEOUT_MS, bean.getTimeout().intValue());
+
+ assertFalse(bean.isModified());
+ assertTrue(bean.isRefreshNeeded());
+
+ assertFalse(bean.isActive());
+
+ assertFalse(bean.isRegistrationChecked());
+ assertTrue(bean.isRegistrationCheckNeeded());
+ assertFalse(bean.isRegistered());
+ assertFalse(bean.isRegistrationLocallyModified());
+ assertFalse(bean.isRegistrationPropertiesExisting());
+
+ assertNull(bean.getCurrentExport());
+
+ DataModel existingExports = bean.getExistingExports();
+ assertNotNull(existingExports);
+ assertEquals(0, existingExports.getRowCount());
+
+ try
+ {
+ assertFalse(bean.isRegistrationRequired());
+ fail("Can't know if registration is required without a refresh");
+ }
+ catch (IllegalStateException e)
+ {
+ // expected
+ }
+ try
+ {
+ assertFalse(bean.isRegistrationValid());
+ fail("Can't know if registration is valid without a refresh");
+ }
+ catch (Exception e)
+ {
+ // expected
+ }
+ }
+
+ public void testSetId()
+ {
+ String newId = "newId";
+ bean.setId(newId);
+ assertEquals(newId, bean.getId());
+
+ assertTrue(bean.isModified());
+ }
+
+ public void testSetCache()
+ {
+ bean.setCache(300);
+ assertEquals(300, bean.getCache().intValue());
+ assertTrue(bean.isModified());
+ }
+
+ private static class TestBeanContext extends BeanContext
+ {
+ public String getParameter(String key)
+ {
+ throw new NotYetImplemented();
+ }
+
+ protected void createMessage(String target, String message, Object severity, Object... addtionalParams)
+ {
+ // ignore for tests
+ }
+
+ protected Object getErrorSeverity()
+ {
+ return null;
+ }
+
+ protected Object getInfoSeverity()
+ {
+ return null;
+ }
+
+ protected Locale getLocale()
+ {
+ return Locale.getDefault();
+ }
+
+ public String getServerAddress()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, Object> getSessionMap()
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ private static class TestInMemoryConsumerRegistry extends InMemoryConsumerRegistry
+ {
+ @Override
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds, String wsdlURL)
+ {
+ // Use a "real" consumer but with a fake endpoint configuration so we can fake WS access
+ WSRPConsumer consumer = super.createConsumer(id, expirationCacheSeconds, wsdlURL);
+ consumer.getProducerInfo().setEndpointConfigurationInfo(new MockEndpointConfigurationInfo());
+ return consumer;
+ }
+ }
+}
13 years, 9 months
gatein SVN: r6132 - in components/wsrp/trunk: common/src/test/java/org/gatein/wsrp and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-03-29 08:55:03 -0400 (Tue, 29 Mar 2011)
New Revision: 6132
Added:
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java
Removed:
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java
Log:
- Moved tests to proper directories.
Copied: components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java (from rev 6131, components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java)
===================================================================
--- components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java (rev 0)
+++ components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/ConsumerBeanTestCase.java 2011-03-29 12:55:03 UTC (rev 6132)
@@ -0,0 +1,175 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp;
+
+import junit.framework.TestCase;
+import org.gatein.common.NotYetImplemented;
+import org.gatein.wsrp.admin.ui.BeanContext;
+import org.gatein.wsrp.admin.ui.ConsumerBean;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import org.gatein.wsrp.consumer.registry.InMemoryConsumerRegistry;
+import org.gatein.wsrp.services.SOAPServiceFactory;
+import org.gatein.wsrp.test.protocol.v2.BehaviorBackedServiceFactory;
+import org.gatein.wsrp.test.support.MockEndpointConfigurationInfo;
+
+import javax.faces.model.DataModel;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 12612 $
+ * @since 2.6
+ */
+public class ConsumerBeanTestCase extends TestCase
+{
+ private static final String CONSUMER_ID = "foo";
+
+ /** Since our consumers use the MockEndpointConfigurationInfo, this is the WSDL they are configured with */
+ private static final String WSDL = BehaviorBackedServiceFactory.DEFAULT_WSDL_URL;
+ private ConsumerBean bean;
+
+ protected void setUp() throws Exception
+ {
+ bean = new ConsumerBean();
+ ConsumerRegistry registry = new TestInMemoryConsumerRegistry();
+ registry.createConsumer(CONSUMER_ID, null, WSDL);
+ bean.setRegistry(registry);
+ bean.setBeanContext(new TestBeanContext());
+
+ // consumer associated with bean is null at this point so it should be loaded from the registry
+ bean.setId(CONSUMER_ID);
+ }
+
+ public void testInitialState()
+ {
+ assertEquals(CONSUMER_ID, bean.getId());
+ assertEquals(bean.getProducerInfo().getId(), bean.getId());
+
+ assertEquals(WSDL, bean.getWsdl());
+ assertEquals(SOAPServiceFactory.DEFAULT_TIMEOUT_MS, bean.getTimeout().intValue());
+
+ assertFalse(bean.isModified());
+ assertTrue(bean.isRefreshNeeded());
+
+ assertFalse(bean.isActive());
+
+ assertFalse(bean.isRegistrationChecked());
+ assertTrue(bean.isRegistrationCheckNeeded());
+ assertFalse(bean.isRegistered());
+ assertFalse(bean.isRegistrationLocallyModified());
+ assertFalse(bean.isRegistrationPropertiesExisting());
+
+ assertNull(bean.getCurrentExport());
+
+ DataModel existingExports = bean.getExistingExports();
+ assertNotNull(existingExports);
+ assertEquals(0, existingExports.getRowCount());
+
+ try
+ {
+ assertFalse(bean.isRegistrationRequired());
+ fail("Can't know if registration is required without a refresh");
+ }
+ catch (IllegalStateException e)
+ {
+ // expected
+ }
+ try
+ {
+ assertFalse(bean.isRegistrationValid());
+ fail("Can't know if registration is valid without a refresh");
+ }
+ catch (Exception e)
+ {
+ // expected
+ }
+ }
+
+ public void testSetId()
+ {
+ String newId = "newId";
+ bean.setId(newId);
+ assertEquals(newId, bean.getId());
+
+ assertTrue(bean.isModified());
+ }
+
+ public void testSetCache()
+ {
+ bean.setCache(300);
+ assertEquals(300, bean.getCache().intValue());
+ assertTrue(bean.isModified());
+ }
+
+ private static class TestBeanContext extends BeanContext
+ {
+ public String getParameter(String key)
+ {
+ throw new NotYetImplemented();
+ }
+
+ protected void createMessage(String target, String message, Object severity, Object... addtionalParams)
+ {
+ // ignore for tests
+ }
+
+ protected Object getErrorSeverity()
+ {
+ return null;
+ }
+
+ protected Object getInfoSeverity()
+ {
+ return null;
+ }
+
+ protected Locale getLocale()
+ {
+ return Locale.getDefault();
+ }
+
+ public String getServerAddress()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, Object> getSessionMap()
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ private static class TestInMemoryConsumerRegistry extends InMemoryConsumerRegistry
+ {
+ @Override
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds, String wsdlURL)
+ {
+ // Use a "real" consumer but with a fake endpoint configuration so we can fake WS access
+ WSRPConsumer consumer = super.createConsumer(id, expirationCacheSeconds, wsdlURL);
+ consumer.getProducerInfo().setEndpointConfigurationInfo(new MockEndpointConfigurationInfo());
+ return consumer;
+ }
+ }
+}
Copied: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java (from rev 6131, components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java)
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java (rev 0)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java 2011-03-29 12:55:03 UTC (rev 6132)
@@ -0,0 +1,541 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp;
+
+import junit.framework.TestCase;
+import org.gatein.pc.api.ContainerURL;
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.ParametersStateString;
+import org.gatein.pc.api.ResourceURL;
+import org.gatein.pc.api.StateString;
+import org.gatein.pc.api.WindowState;
+import org.gatein.pc.api.cache.CacheLevel;
+import org.gatein.wsrp.spec.v2.WSRP2RewritingConstants;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 13470 $
+ * @since 2.4 (Apr 28, 2006)
+ */
+public class WSRPPortletURLTestCase extends TestCase
+{
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ WSRPPortletURL.setStrict(true);
+ }
+
+ public void testResourceURL()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif" +
+ "&wsrp-requiresRewrite=false/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPResourceURL);
+ WSRPResourceURL resource = (WSRPResourceURL)url;
+ assertFalse(resource.requiresRewrite());
+ assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
+
+ //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
+ Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
+ String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
+ assertEquals("http://test.com/images/test.gif", resourceURL);
+
+ assertNull(resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID));
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ }
+
+ public void testResourceID()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
+ "&wsrp-requiresRewrite=false/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPResourceURL);
+ WSRPResourceURL resource = (WSRPResourceURL)url;
+ assertFalse(resource.requiresRewrite());
+ assertNull(resource.getResourceURL());
+
+ //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
+ Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
+ String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
+ assertEquals("resource_123", resourceID);
+
+ assertNull(resourceMap.get(WSRPRewritingConstants.RESOURCE_URL));
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ }
+
+ public void testResourceIDToken()
+ {
+ //Test what happens in the case where the url is created via token wsrp rewriting on the producer side
+ //In this case the resource ID will not be an encoded resource map.
+
+ Map<String, String> resourceMap = WSRPResourceURL.decodeResource("resource_123");
+ String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
+ assertEquals("resource_123", resourceID);
+
+ assertNull(resourceMap.get(WSRPRewritingConstants.RESOURCE_URL));
+ assertNull(resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ }
+
+ public void testResources()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
+ "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&wsrp-requiresRewrite=false/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPResourceURL);
+ WSRPResourceURL resource = (WSRPResourceURL)url;
+ assertFalse(resource.requiresRewrite());
+ assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
+
+ //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
+ Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
+ String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
+ assertEquals("resource_123", resourceID);
+
+ String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
+ assertEquals("http://test.com/images/test.gif", resourceURL);
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ }
+
+ public void testResourcesNoRequiresRewrite()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
+ "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPResourceURL);
+ WSRPResourceURL resource = (WSRPResourceURL)url;
+ assertFalse(resource.requiresRewrite());
+ assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
+
+ //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
+ Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
+ String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
+ assertEquals("resource_123", resourceID);
+
+ String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
+ assertEquals("http://test.com/images/test.gif", resourceURL);
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ }
+
+ public void testResourcesNoResourceURL()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
+ "&wsrp-requiresRewrite=false/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPResourceURL);
+ WSRPResourceURL resource = (WSRPResourceURL)url;
+ assertFalse(resource.requiresRewrite());
+
+ //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
+ Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
+ String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
+ assertEquals("resource_123", resourceID);
+
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ }
+
+ public void testPreferOperation()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
+ "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&wsrp-preferOperation=true&wsrp-requiresRewrite=false/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPResourceURL);
+ WSRPResourceURL resource = (WSRPResourceURL)url;
+ assertFalse(resource.requiresRewrite());
+ assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
+
+ //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
+ Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
+ String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
+ assertEquals("resource_123", resourceID);
+
+ String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
+ assertEquals("http://test.com/images/test.gif", resourceURL);
+
+ String preferOperation = resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION);
+ assertEquals("true", preferOperation);
+ }
+
+ public void testShouldSetPreferOperationToTrueWhenResourceIdIsPresent()
+ {
+ ResourceURL resourceURL = new TestResourceURL(TestResourceURL.RESID, TestResourceURL.DEFAULT_NS, CacheLevel.FULL);
+ WSRPPortletURL url = WSRPPortletURL.create(resourceURL, false, WSRPPortletURL.URLContext.EMPTY);
+
+ String actual = url.toString();
+ assertTrue(actual.contains("wsrp-urlType=resource"));
+ assertTrue(actual.contains("wsrp-resourceID=" + TestResourceURL.RESID));
+ assertTrue(actual.contains("wsrp-preferOperation=true"));
+ }
+
+ public void testShouldProperlyTransmitResourceState()
+ {
+ // create URL from container
+ ResourceURL resourceURL = new TestResourceURL("resparam", "resvalue");
+ WSRPPortletURL url = WSRPPortletURL.create(resourceURL, false, WSRPPortletURL.URLContext.EMPTY);
+
+ assertTrue(url instanceof WSRPResourceURL);
+ WSRPResourceURL resource = (WSRPResourceURL)url;
+ StateString resourceState = resource.getResourceState();
+ assertNotNull(resourceState);
+
+ // serialize URL to WSRP string format
+ String resourceAsString = resource.toString();
+
+ // and re-create it
+ url = WSRPPortletURL.create(resourceAsString);
+
+ // check that we have indeed the same state
+ assertTrue(url instanceof WSRPResourceURL);
+ resource = (WSRPResourceURL)url;
+ resourceState = resource.getResourceState();
+ assertNotNull(resourceState);
+ Map<String, String[]> state = StateString.decodeOpaqueValue(resourceState.getStringValue());
+ assertEquals("resvalue", state.get("resparam")[0]);
+ }
+
+ /** Declare a secure interaction back to the Portlet */
+ public void testSecureInteraction()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-secureURL=true" +
+ "&wsrp-navigationalState=a8h4K5JD9&wsrp-interactionState=fg4h923mdk/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPActionURL);
+ WSRPActionURL actionURL = (WSRPActionURL)url;
+ assertTrue(url.isSecure());
+ assertEquals("a8h4K5JD9", actionURL.getNavigationalState().getStringValue());
+ assertEquals("fg4h923mdk", actionURL.getInteractionState().getStringValue());
+ }
+
+ /** Request the Consumer render the Portlet in a different mode and window state */
+ public void testDifferentModeAndWindowState()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp:help&wsrp-windowState=wsrp:maximized/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPRenderURL);
+ assertEquals(Mode.HELP, url.getMode());
+ assertEquals(WindowState.MAXIMIZED, url.getWindowState());
+ }
+
+ public void testMinimal()
+ {
+ String minimalURLType = "wsrp_rewrite?wsrp-urlType=render/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(minimalURLType);
+
+ assertTrue(url instanceof WSRPRenderURL);
+ }
+
+ public void testInvalidParameterName()
+ {
+ String message = "Should have detected invalid parameter: ";
+
+ String invalid = "wsrp_rewrite?wsrp-urlType=render&foo=bar/wsrp_rewrite";
+ checkInvalidURL(invalid, message, "foo");
+ }
+
+ public void testDoublyEncodedAmpersand()
+ {
+ String expected = "wsrp_rewrite?wsrp-urlType=render&amp;wsrp-mode=wsrp:help&amp;wsrp-windowState=wsrp:maximized/wsrp_rewrite";
+ try
+ {
+ WSRPPortletURL.create(expected);
+ fail("Should have thrown an exception on doubly encoded &!");
+ }
+ catch (Exception e)
+ {
+ // expected
+ }
+ }
+
+ /** Relax validation and test that we now accept normally invalid URLs. */
+ public void testExtraParametersRelaxedValidation()
+ {
+ WSRPPortletURL.setStrict(false);
+
+ String validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=render&foo=bar/wsrp_rewrite";
+
+ WSRPPortletURL url = WSRPPortletURL.create(validInRelaxedMode);
+ assertTrue(url instanceof WSRPRenderURL);
+ assertTrue(url.toString().contains("foo=bar"));
+
+ validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=render/wsrp_rewrite&foo=bar";
+ url = WSRPPortletURL.create(validInRelaxedMode);
+ assertTrue(url instanceof WSRPRenderURL);
+ assertTrue(url.toString().endsWith("foo=bar"));
+
+ String stillInvalid = "wsrp_rewrite?wsrp-urlType=render&foo=bar";
+ checkInvalidURL(stillInvalid, "Should have detected missing end token", WSRPRewritingConstants.END_WSRP_REWRITE);
+ }
+
+ /*public void testExtraRelaxedValidation()
+ {
+ String valid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080%2Fhelloworld&wsrp-requiresRewrite=true/wsrp_rewrite/helloworld.jar";
+ WSRPPortletURL url = WSRPPortletURL.create(valid);
+ assertEquals("http://localhost:8080/helloworld/helloworld.jar", url.toString());
+
+ String invalid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080%2Fhelloworld&wsrp-requiresRewrite=true/wsrp_rewrite&foo=bar/helloworld.jar";
+ checkInvalidURL(invalid, "Should have detected improper position of end token", WSRPRewritingConstants.END_WSRP_REWRITE);
+
+ WSRPPortletURL.setStrict(false);
+ String validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080%2Fhelloworld&wsrp-requiresRewrite=true/wsrp_rewrite&foo=bar/helloworld.jar";
+ url = WSRPPortletURL.create(validInRelaxedMode);
+ assertEquals("http://localhost:8080/helloworld&foo=bar/helloworld.jar", url.toString());
+ }*/
+
+ public void testExtraParameters()
+ {
+ String validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=render&foo=bar/wsrp_rewrite";
+ checkInvalidURL(validInRelaxedMode, "Should have detected invalid parameter: ", "foo");
+
+ validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=render/wsrp_rewrite&foo=bar";
+ checkInvalidURL(validInRelaxedMode, "Should have detected URL doesn't end with end token", WSRPRewritingConstants.END_WSRP_REWRITE);
+ }
+
+ public void testInvalidMode()
+ {
+ String message = "Should have detected invalid mode: ";
+
+ String invalid = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=foo/wsrp_rewrite";
+ checkInvalidURL(invalid, message, "foo");
+ }
+
+ public void testCustomModeAndWindowState()
+ {
+ Set<String> modes = new HashSet<String>();
+ modes.add("urn:foo");
+
+ Set<String> windowStates = new HashSet<String>();
+ windowStates.add("urn:bar");
+
+ String urlString = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=urn%3Afoo&wsrp-windowState=urn%3Abar/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(urlString, modes, windowStates);
+ assertEquals("urn:foo", url.getMode().toString());
+ assertEquals("urn:bar", url.getWindowState().toString());
+ }
+
+ public void testEncodedMode()
+ {
+ String encoded = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp%3Aview/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(encoded);
+ assertEquals(Mode.VIEW, url.getMode());
+
+ encoded = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp%3aedit/wsrp_rewrite";
+ url = WSRPPortletURL.create(encoded);
+ assertEquals(Mode.EDIT, url.getMode());
+ }
+
+ public void testEncodedWindowState()
+ {
+ String encoded = "wsrp_rewrite?wsrp-urlType=render&wsrp-windowState=wsrp%3Amaximized/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(encoded);
+ assertEquals(WindowState.MAXIMIZED, url.getWindowState());
+
+ encoded = "wsrp_rewrite?wsrp-urlType=render&wsrp-windowState=wsrp%3aminimized/wsrp_rewrite";
+ url = WSRPPortletURL.create(encoded);
+ assertEquals(WindowState.MINIMIZED, url.getWindowState());
+ }
+
+ public void testInvalidResourceURLV1()
+ {
+ String message = "Should have detected missing parameter: ";
+
+ /*
+ // We now allow requiresRewrite to be missing and assume false instead... See GTNWSRP-103.
+ String invalid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%2F/wsrp_rewrite";
+ checkInvalidURL(invalid, message, WSRPRewritingConstants.RESOURCE_REQUIRES_REWRITE);
+ */
+
+ String invalid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-requiresRewrite=true/wsrp_rewrite";
+ checkInvalidURL(invalid, message, WSRPRewritingConstants.RESOURCE_URL);
+
+ invalid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=invalidURL&wsrp-requiresRewrite=true/wsrp_rewrite";
+ checkInvalidURL(invalid, "Should have detected invalid URL: ", "invalidURL");
+ }
+
+ public void testNullURL()
+ {
+ try
+ {
+ WSRPPortletURL.create(null);
+ fail("Should have detected null URL");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testInvalidURLType()
+ {
+ String wrongURLType = "wsrp_rewrite?wsrp-urlType=pipo&wsrp-mode=help/wsrp_rewrite";
+
+ try
+ {
+ WSRPPortletURL.create(wrongURLType);
+ fail("Should have detected wrong URL type");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testProperEndTokenInRelaxedMode()
+ {
+ WSRPPortletURL.setStrict(false);
+
+ WSRPPortletURL url = new WSRPPortletURL()
+ {
+ @Override
+ protected String getURLType()
+ {
+ return WSRPRewritingConstants.URL_TYPE_BLOCKING_ACTION;
+ }
+
+ @Override
+ protected void appendEnd(StringBuffer sb)
+ {
+ }
+ };
+ assertTrue(url.toString().contains(WSRPRewritingConstants.END_WSRP_REWRITE));
+ }
+
+ private void checkInvalidURL(String invalid, String message, String mustBeInException)
+ {
+ try
+ {
+ WSRPPortletURL.create(invalid);
+ fail(message + mustBeInException);
+ }
+ catch (IllegalArgumentException e)
+ {
+ assertTrue(e.getLocalizedMessage().contains(mustBeInException));
+ }
+ }
+
+ private static class TestContainerURL implements ContainerURL
+ {
+ private Mode mode;
+ private WindowState ws;
+ private StateString ns;
+ private Map<String, String> props;
+
+ static final StateString DEFAULT_NS;
+ static final Map<String, String[]> DEFAULT_PARAMS = new HashMap<String, String[]>(3);
+ static final String PARAM = "param";
+ static final String VALUE = "value";
+
+ static
+ {
+ DEFAULT_PARAMS.put(PARAM, new String[]{VALUE});
+ DEFAULT_NS = ParametersStateString.create(DEFAULT_PARAMS);
+ }
+
+ private TestContainerURL(Mode mode, WindowState ws, StateString ns, Map<String, String> props)
+ {
+ this.mode = mode;
+ this.ws = ws;
+ this.ns = ns;
+ this.props = props;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return ws;
+ }
+
+ public StateString getNavigationalState()
+ {
+ return ns;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return props;
+ }
+ }
+
+ private static class TestResourceURL extends TestContainerURL implements ResourceURL
+ {
+ private static final String RESID = "resid";
+ private String id;
+ private StateString state;
+ private CacheLevel cache;
+
+ private TestResourceURL(String id, StateString state, CacheLevel cache)
+ {
+ super(Mode.VIEW, WindowState.NORMAL, DEFAULT_NS, null);
+ init(id, state, cache);
+ }
+
+ private void init(String id, StateString state, CacheLevel cache)
+ {
+ this.id = id;
+ this.state = state;
+ this.cache = cache;
+ }
+
+ private TestResourceURL(String param, String value)
+ {
+ super(Mode.VIEW, WindowState.NORMAL, DEFAULT_NS, null);
+
+ HashMap<String, String[]> params = new HashMap<String, String[]>(3);
+ params.put(param, new String[]{value});
+
+ init(RESID, ParametersStateString.create(params), CacheLevel.FULL);
+ }
+
+ public String getResourceId()
+ {
+ return id;
+ }
+
+ public StateString getResourceState()
+ {
+ return state;
+ }
+
+ public CacheLevel getCacheability()
+ {
+ return cache;
+ }
+ }
+}
\ No newline at end of file
Property changes on: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/WSRPPortletURLTestCase.java
___________________________________________________________________
Added: svn:executable
+ *
Deleted: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java 2011-03-29 12:06:50 UTC (rev 6131)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java 2011-03-29 12:55:03 UTC (rev 6132)
@@ -1,546 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.wsrp.other;
-
-import junit.framework.TestCase;
-import org.gatein.pc.api.ContainerURL;
-import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.ParametersStateString;
-import org.gatein.pc.api.ResourceURL;
-import org.gatein.pc.api.StateString;
-import org.gatein.pc.api.WindowState;
-import org.gatein.pc.api.cache.CacheLevel;
-import org.gatein.wsrp.WSRPActionURL;
-import org.gatein.wsrp.WSRPPortletURL;
-import org.gatein.wsrp.WSRPRenderURL;
-import org.gatein.wsrp.WSRPResourceURL;
-import org.gatein.wsrp.WSRPRewritingConstants;
-import org.gatein.wsrp.spec.v2.WSRP2RewritingConstants;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 13470 $
- * @since 2.4 (Apr 28, 2006)
- */
-public class WSRPPortletURLTestCase extends TestCase
-{
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- WSRPPortletURL.setStrict(true);
- }
-
- public void testResourceURL()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif" +
- "&wsrp-requiresRewrite=false/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(expected);
-
- assertTrue(url instanceof WSRPResourceURL);
- WSRPResourceURL resource = (WSRPResourceURL)url;
- assertFalse(resource.requiresRewrite());
- assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
-
- //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
- Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
- String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
- assertEquals("http://test.com/images/test.gif", resourceURL);
-
- assertNull(resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID));
- assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
- }
-
- public void testResourceID()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-requiresRewrite=false/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(expected);
-
- assertTrue(url instanceof WSRPResourceURL);
- WSRPResourceURL resource = (WSRPResourceURL)url;
- assertFalse(resource.requiresRewrite());
- assertNull(resource.getResourceURL());
-
- //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
- Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
- String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
- assertEquals("resource_123", resourceID);
-
- assertNull(resourceMap.get(WSRPRewritingConstants.RESOURCE_URL));
- assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
- }
-
- public void testResourceIDToken()
- {
- //Test what happens in the case where the url is created via token wsrp rewriting on the producer side
- //In this case the resource ID will not be an encoded resource map.
-
- Map<String, String> resourceMap = WSRPResourceURL.decodeResource("resource_123");
- String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
- assertEquals("resource_123", resourceID);
-
- assertNull(resourceMap.get(WSRPRewritingConstants.RESOURCE_URL));
- assertNull(resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
- }
-
- public void testResources()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&wsrp-requiresRewrite=false/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(expected);
-
- assertTrue(url instanceof WSRPResourceURL);
- WSRPResourceURL resource = (WSRPResourceURL)url;
- assertFalse(resource.requiresRewrite());
- assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
-
- //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
- Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
- String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
- assertEquals("resource_123", resourceID);
-
- String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
- assertEquals("http://test.com/images/test.gif", resourceURL);
- assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
- }
-
- public void testResourcesNoRequiresRewrite()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(expected);
-
- assertTrue(url instanceof WSRPResourceURL);
- WSRPResourceURL resource = (WSRPResourceURL)url;
- assertFalse(resource.requiresRewrite());
- assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
-
- //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
- Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
- String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
- assertEquals("resource_123", resourceID);
-
- String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
- assertEquals("http://test.com/images/test.gif", resourceURL);
- assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
- }
-
- public void testResourcesNoResourceURL()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-requiresRewrite=false/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(expected);
-
- assertTrue(url instanceof WSRPResourceURL);
- WSRPResourceURL resource = (WSRPResourceURL)url;
- assertFalse(resource.requiresRewrite());
-
- //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
- Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
- String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
- assertEquals("resource_123", resourceID);
-
- assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
- }
-
- public void testPreferOperation()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&wsrp-preferOperation=true&wsrp-requiresRewrite=false/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(expected);
-
- assertTrue(url instanceof WSRPResourceURL);
- WSRPResourceURL resource = (WSRPResourceURL)url;
- assertFalse(resource.requiresRewrite());
- assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
-
- //resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
- Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
- String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
- assertEquals("resource_123", resourceID);
-
- String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
- assertEquals("http://test.com/images/test.gif", resourceURL);
-
- String preferOperation = resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION);
- assertEquals("true", preferOperation);
- }
-
- public void testShouldSetPreferOperationToTrueWhenResourceIdIsPresent()
- {
- ResourceURL resourceURL = new TestResourceURL(TestResourceURL.RESID, TestResourceURL.DEFAULT_NS, CacheLevel.FULL);
- WSRPPortletURL url = WSRPPortletURL.create(resourceURL, false, WSRPPortletURL.URLContext.EMPTY);
-
- String actual = url.toString();
- assertTrue(actual.contains("wsrp-urlType=resource"));
- assertTrue(actual.contains("wsrp-resourceID=" + TestResourceURL.RESID));
- assertTrue(actual.contains("wsrp-preferOperation=true"));
- }
-
- public void testShouldProperlyTransmitResourceState()
- {
- // create URL from container
- ResourceURL resourceURL = new TestResourceURL("resparam", "resvalue");
- WSRPPortletURL url = WSRPPortletURL.create(resourceURL, false, WSRPPortletURL.URLContext.EMPTY);
-
- assertTrue(url instanceof WSRPResourceURL);
- WSRPResourceURL resource = (WSRPResourceURL)url;
- StateString resourceState = resource.getResourceState();
- assertNotNull(resourceState);
-
- // serialize URL to WSRP string format
- String resourceAsString = resource.toString();
-
- // and re-create it
- url = WSRPPortletURL.create(resourceAsString);
-
- // check that we have indeed the same state
- assertTrue(url instanceof WSRPResourceURL);
- resource = (WSRPResourceURL)url;
- resourceState = resource.getResourceState();
- assertNotNull(resourceState);
- Map<String, String[]> state = StateString.decodeOpaqueValue(resourceState.getStringValue());
- assertEquals("resvalue", state.get("resparam")[0]);
- }
-
- /** Declare a secure interaction back to the Portlet */
- public void testSecureInteraction()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-secureURL=true" +
- "&wsrp-navigationalState=a8h4K5JD9&wsrp-interactionState=fg4h923mdk/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(expected);
-
- assertTrue(url instanceof WSRPActionURL);
- WSRPActionURL actionURL = (WSRPActionURL)url;
- assertTrue(url.isSecure());
- assertEquals("a8h4K5JD9", actionURL.getNavigationalState().getStringValue());
- assertEquals("fg4h923mdk", actionURL.getInteractionState().getStringValue());
- }
-
- /** Request the Consumer render the Portlet in a different mode and window state */
- public void testDifferentModeAndWindowState()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp:help&wsrp-windowState=wsrp:maximized/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(expected);
-
- assertTrue(url instanceof WSRPRenderURL);
- assertEquals(Mode.HELP, url.getMode());
- assertEquals(WindowState.MAXIMIZED, url.getWindowState());
- }
-
- public void testMinimal()
- {
- String minimalURLType = "wsrp_rewrite?wsrp-urlType=render/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(minimalURLType);
-
- assertTrue(url instanceof WSRPRenderURL);
- }
-
- public void testInvalidParameterName()
- {
- String message = "Should have detected invalid parameter: ";
-
- String invalid = "wsrp_rewrite?wsrp-urlType=render&foo=bar/wsrp_rewrite";
- checkInvalidURL(invalid, message, "foo");
- }
-
- public void testDoublyEncodedAmpersand()
- {
- String expected = "wsrp_rewrite?wsrp-urlType=render&amp;wsrp-mode=wsrp:help&amp;wsrp-windowState=wsrp:maximized/wsrp_rewrite";
- try
- {
- WSRPPortletURL.create(expected);
- fail("Should have thrown an exception on doubly encoded &!");
- }
- catch (Exception e)
- {
- // expected
- }
- }
-
- /** Relax validation and test that we now accept normally invalid URLs. */
- public void testExtraParametersRelaxedValidation()
- {
- WSRPPortletURL.setStrict(false);
-
- String validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=render&foo=bar/wsrp_rewrite";
-
- WSRPPortletURL url = WSRPPortletURL.create(validInRelaxedMode);
- assertTrue(url instanceof WSRPRenderURL);
- assertTrue(url.toString().contains("foo=bar"));
-
- validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=render/wsrp_rewrite&foo=bar";
- url = WSRPPortletURL.create(validInRelaxedMode);
- assertTrue(url instanceof WSRPRenderURL);
- assertTrue(url.toString().endsWith("foo=bar"));
-
- String stillInvalid = "wsrp_rewrite?wsrp-urlType=render&foo=bar";
- checkInvalidURL(stillInvalid, "Should have detected missing end token", WSRPRewritingConstants.END_WSRP_REWRITE);
- }
-
- /*public void testExtraRelaxedValidation()
- {
- String valid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080%2Fhelloworld&wsrp-requiresRewrite=true/wsrp_rewrite/helloworld.jar";
- WSRPPortletURL url = WSRPPortletURL.create(valid);
- assertEquals("http://localhost:8080/helloworld/helloworld.jar", url.toString());
-
- String invalid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080%2Fhelloworld&wsrp-requiresRewrite=true/wsrp_rewrite&foo=bar/helloworld.jar";
- checkInvalidURL(invalid, "Should have detected improper position of end token", WSRPRewritingConstants.END_WSRP_REWRITE);
-
- WSRPPortletURL.setStrict(false);
- String validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080%2Fhelloworld&wsrp-requiresRewrite=true/wsrp_rewrite&foo=bar/helloworld.jar";
- url = WSRPPortletURL.create(validInRelaxedMode);
- assertEquals("http://localhost:8080/helloworld&foo=bar/helloworld.jar", url.toString());
- }*/
-
- public void testExtraParameters()
- {
- String validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=render&foo=bar/wsrp_rewrite";
- checkInvalidURL(validInRelaxedMode, "Should have detected invalid parameter: ", "foo");
-
- validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=render/wsrp_rewrite&foo=bar";
- checkInvalidURL(validInRelaxedMode, "Should have detected URL doesn't end with end token", WSRPRewritingConstants.END_WSRP_REWRITE);
- }
-
- public void testInvalidMode()
- {
- String message = "Should have detected invalid mode: ";
-
- String invalid = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=foo/wsrp_rewrite";
- checkInvalidURL(invalid, message, "foo");
- }
-
- public void testCustomModeAndWindowState()
- {
- Set<String> modes = new HashSet<String>();
- modes.add("urn:foo");
-
- Set<String> windowStates = new HashSet<String>();
- windowStates.add("urn:bar");
-
- String urlString = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=urn%3Afoo&wsrp-windowState=urn%3Abar/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(urlString, modes, windowStates);
- assertEquals("urn:foo", url.getMode().toString());
- assertEquals("urn:bar", url.getWindowState().toString());
- }
-
- public void testEncodedMode()
- {
- String encoded = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp%3Aview/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(encoded);
- assertEquals(Mode.VIEW, url.getMode());
-
- encoded = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp%3aedit/wsrp_rewrite";
- url = WSRPPortletURL.create(encoded);
- assertEquals(Mode.EDIT, url.getMode());
- }
-
- public void testEncodedWindowState()
- {
- String encoded = "wsrp_rewrite?wsrp-urlType=render&wsrp-windowState=wsrp%3Amaximized/wsrp_rewrite";
- WSRPPortletURL url = WSRPPortletURL.create(encoded);
- assertEquals(WindowState.MAXIMIZED, url.getWindowState());
-
- encoded = "wsrp_rewrite?wsrp-urlType=render&wsrp-windowState=wsrp%3aminimized/wsrp_rewrite";
- url = WSRPPortletURL.create(encoded);
- assertEquals(WindowState.MINIMIZED, url.getWindowState());
- }
-
- public void testInvalidResourceURLV1()
- {
- String message = "Should have detected missing parameter: ";
-
- /*
- // We now allow requiresRewrite to be missing and assume false instead... See GTNWSRP-103.
- String invalid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%2F/wsrp_rewrite";
- checkInvalidURL(invalid, message, WSRPRewritingConstants.RESOURCE_REQUIRES_REWRITE);
- */
-
- String invalid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-requiresRewrite=true/wsrp_rewrite";
- checkInvalidURL(invalid, message, WSRPRewritingConstants.RESOURCE_URL);
-
- invalid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=invalidURL&wsrp-requiresRewrite=true/wsrp_rewrite";
- checkInvalidURL(invalid, "Should have detected invalid URL: ", "invalidURL");
- }
-
- public void testNullURL()
- {
- try
- {
- WSRPPortletURL.create(null);
- fail("Should have detected null URL");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
- }
-
- public void testInvalidURLType()
- {
- String wrongURLType = "wsrp_rewrite?wsrp-urlType=pipo&wsrp-mode=help/wsrp_rewrite";
-
- try
- {
- WSRPPortletURL.create(wrongURLType);
- fail("Should have detected wrong URL type");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
- }
-
- public void testProperEndTokenInRelaxedMode()
- {
- WSRPPortletURL.setStrict(false);
-
- WSRPPortletURL url = new WSRPPortletURL()
- {
- @Override
- protected String getURLType()
- {
- return WSRPRewritingConstants.URL_TYPE_BLOCKING_ACTION;
- }
-
- @Override
- protected void appendEnd(StringBuffer sb)
- {
- }
- };
- assertTrue(url.toString().contains(WSRPRewritingConstants.END_WSRP_REWRITE));
- }
-
- private void checkInvalidURL(String invalid, String message, String mustBeInException)
- {
- try
- {
- WSRPPortletURL.create(invalid);
- fail(message + mustBeInException);
- }
- catch (IllegalArgumentException e)
- {
- assertTrue(e.getLocalizedMessage().contains(mustBeInException));
- }
- }
-
- private static class TestContainerURL implements ContainerURL
- {
- private Mode mode;
- private WindowState ws;
- private StateString ns;
- private Map<String, String> props;
-
- static final StateString DEFAULT_NS;
- static final Map<String, String[]> DEFAULT_PARAMS = new HashMap<String, String[]>(3);
- static final String PARAM = "param";
- static final String VALUE = "value";
-
- static
- {
- DEFAULT_PARAMS.put(PARAM, new String[]{VALUE});
- DEFAULT_NS = ParametersStateString.create(DEFAULT_PARAMS);
- }
-
- private TestContainerURL(Mode mode, WindowState ws, StateString ns, Map<String, String> props)
- {
- this.mode = mode;
- this.ws = ws;
- this.ns = ns;
- this.props = props;
- }
-
- public Mode getMode()
- {
- return mode;
- }
-
- public WindowState getWindowState()
- {
- return ws;
- }
-
- public StateString getNavigationalState()
- {
- return ns;
- }
-
- public Map<String, String> getProperties()
- {
- return props;
- }
- }
-
- private static class TestResourceURL extends TestContainerURL implements ResourceURL
- {
- private static final String RESID = "resid";
- private String id;
- private StateString state;
- private CacheLevel cache;
-
- private TestResourceURL(String id, StateString state, CacheLevel cache)
- {
- super(Mode.VIEW, WindowState.NORMAL, DEFAULT_NS, null);
- init(id, state, cache);
- }
-
- private void init(String id, StateString state, CacheLevel cache)
- {
- this.id = id;
- this.state = state;
- this.cache = cache;
- }
-
- private TestResourceURL(String param, String value)
- {
- super(Mode.VIEW, WindowState.NORMAL, DEFAULT_NS, null);
-
- HashMap<String, String[]> params = new HashMap<String, String[]>(3);
- params.put(param, new String[]{value});
-
- init(RESID, ParametersStateString.create(params), CacheLevel.FULL);
- }
-
- public String getResourceId()
- {
- return id;
- }
-
- public StateString getResourceState()
- {
- return state;
- }
-
- public CacheLevel getCacheability()
- {
- return cache;
- }
- }
-}
\ No newline at end of file
13 years, 9 months
gatein SVN: r6131 - in components/wsrp/trunk/admin-gui: src/main/webapp/WEB-INF and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-03-29 08:06:50 -0400 (Tue, 29 Mar 2011)
New Revision: 6131
Modified:
components/wsrp/trunk/admin-gui/pom.xml
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/web.xml
Log:
- GTNWSRP-218: Reverted changes for AS 6 since they don't work on AS 5.
Modified: components/wsrp/trunk/admin-gui/pom.xml
===================================================================
--- components/wsrp/trunk/admin-gui/pom.xml 2011-03-29 09:20:28 UTC (rev 6130)
+++ components/wsrp/trunk/admin-gui/pom.xml 2011-03-29 12:06:50 UTC (rev 6131)
@@ -83,11 +83,11 @@
</dependency>
<!-- To make JSF works on AS 6 -->
- <dependency>
+ <!--<dependency>
<groupId>org.jboss.el</groupId>
<artifactId>jboss-el</artifactId>
<version>1.0_02.CR5</version>
- </dependency>
+ </dependency>-->
<dependency>
<groupId>org.slf4j</groupId>
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/web.xml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/web.xml 2011-03-29 09:20:28 UTC (rev 6130)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/web.xml 2011-03-29 12:06:50 UTC (rev 6131)
@@ -44,10 +44,10 @@
</context-param>
<!-- Tell JBoss AS 6 to use JBoss EL engine instead of default -->
- <context-param>
+ <!--<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
- </context-param>
+ </context-param>-->
<!-- Facelet configuration -->
<context-param>
13 years, 9 months
gatein SVN: r6130 - in components/wsrp/trunk/admin-gui: src/main/webapp/WEB-INF and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-03-29 05:20:28 -0400 (Tue, 29 Mar 2011)
New Revision: 6130
Modified:
components/wsrp/trunk/admin-gui/pom.xml
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/web.xml
Log:
- GTNWSRP-218: Added dependency on JBoss EL engine and force its use in the admin portlet.
Modified: components/wsrp/trunk/admin-gui/pom.xml
===================================================================
--- components/wsrp/trunk/admin-gui/pom.xml 2011-03-25 16:33:00 UTC (rev 6129)
+++ components/wsrp/trunk/admin-gui/pom.xml 2011-03-29 09:20:28 UTC (rev 6130)
@@ -21,7 +21,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<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">
+<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>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
@@ -81,7 +82,14 @@
<version>1.1.15</version>
</dependency>
+ <!-- To make JSF works on AS 6 -->
<dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <version>1.0_02.CR5</version>
+ </dependency>
+
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/web.xml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/web.xml 2011-03-25 16:33:00 UTC (rev 6129)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/web.xml 2011-03-29 09:20:28 UTC (rev 6130)
@@ -43,6 +43,12 @@
<param-value>Mojarra-1.2</param-value>
</context-param>
+ <!-- Tell JBoss AS 6 to use JBoss EL engine instead of default -->
+ <context-param>
+ <param-name>com.sun.faces.expressionFactory</param-name>
+ <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
+ </context-param>
+
<!-- Facelet configuration -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
@@ -83,8 +89,6 @@
<exception-type>java.lang.Exception</exception-type>
<location>/faces/jsf/error.xhtml</location>
</error-page>
-
-
</web-app>
13 years, 9 months
gatein SVN: r6129 - in components/mop/trunk: api and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-03-25 12:33:00 -0400 (Fri, 25 Mar 2011)
New Revision: 6129
Modified:
components/mop/trunk/api/pom.xml
components/mop/trunk/core/pom.xml
components/mop/trunk/pom.xml
components/mop/trunk/spi/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: components/mop/trunk/api/pom.xml
===================================================================
--- components/mop/trunk/api/pom.xml 2011-03-25 16:32:49 UTC (rev 6128)
+++ components/mop/trunk/api/pom.xml 2011-03-25 16:33:00 UTC (rev 6129)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta01</version>
+ <version>1.1.0-Beta02-SNAPSHOT</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2011-03-25 16:32:49 UTC (rev 6128)
+++ components/mop/trunk/core/pom.xml 2011-03-25 16:33:00 UTC (rev 6129)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta01</version>
+ <version>1.1.0-Beta02-SNAPSHOT</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2011-03-25 16:32:49 UTC (rev 6128)
+++ components/mop/trunk/pom.xml 2011-03-25 16:33:00 UTC (rev 6129)
@@ -34,16 +34,16 @@
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta01</version>
+ <version>1.1.0-Beta02-SNAPSHOT</version>
<packaging>pom</packaging>
<name>GateIn - MOP</name>
<description>Model Object for Portal</description>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/tags/1.1.0-B...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/tags/1.1.0-Beta01</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/mop/tags/1.1.0-Beta01</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/trunk/</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/mop/trunk/</url>
</scm>
<dependencyManagement>
Modified: components/mop/trunk/spi/pom.xml
===================================================================
--- components/mop/trunk/spi/pom.xml 2011-03-25 16:32:49 UTC (rev 6128)
+++ components/mop/trunk/spi/pom.xml 2011-03-25 16:33:00 UTC (rev 6129)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta01</version>
+ <version>1.1.0-Beta02-SNAPSHOT</version>
</parent>
<!-- ****************** -->
13 years, 9 months
gatein SVN: r6128 - components/mop/tags.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-03-25 12:32:49 -0400 (Fri, 25 Mar 2011)
New Revision: 6128
Added:
components/mop/tags/1.1.0-Beta01/
Log:
[maven-scm] copy for tag 1.1.0-Beta01
13 years, 9 months