gatein SVN: r4524 - in components/wsrp/trunk: consumer/src/test/java/org/gatein/wsrp/consumer/handlers and 7 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-06 05:47:42 -0400 (Wed, 06 Oct 2010)
New Revision: 4524
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ProducerHelper.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/WSRPWindowContext.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/handlers/
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/handlers/processors/
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessorTestCase.java
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/InvocationHandler.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/MimeResponseHandler.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/handlers/RenderHandlerTestCase.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ActionRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ProcessorFactory.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RenderRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ResourceRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/UpdateNavigationalStateResponseProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/WSRPInstanceContext.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/NeedPortletHandleTest.java
Log:
- GTNWSRP-87: work on namespace being doubly encoded.
+ CFixed MimeResponseHandler.processMarkup as it wasn't properly working for WSRP 1. Will probably need TextTools support from new version of common to avoid double parsing of markup.
+ Properly use the WSRP-provided namespace using a custom WindowContext implementation: WSRPWindowContext.
+ Moved namespace initialization to MimeResponseProcessor on producer since the behavior is the same in all subclasses and deactivated it for now as it's not needed anymore in WSRP 2. Need to check that it works properly with WSRP 1.
+ Introduced ProducerHelper interface to decouple processors from WSRPProducerImpl so that they're easier to test.
+ Adapted test cases.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/InvocationHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/InvocationHandler.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/InvocationHandler.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -34,7 +34,6 @@
import org.gatein.pc.api.spi.PortletInvocationContext;
import org.gatein.pc.api.spi.SecurityContext;
import org.gatein.pc.api.spi.WindowContext;
-import org.gatein.pc.portlet.impl.jsr168.PortletUtils;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
@@ -199,8 +198,7 @@
{
if (windowContext != null)
{
- // MUST match namespace generation used in PortletResponseImpl.getNamespace in portlet module...
- return PortletUtils.generateNamespaceFrom(windowContext.getId());
+ return windowContext.getNamespace();
}
return null;
@@ -334,15 +332,15 @@
SecurityContext securityContext = invocation.getSecurityContext();
ParameterValidation.throwIllegalArgExceptionIfNull(securityContext, SECURITY_CONTEXT);
String authType = WSRPUtils.convertRequestAuthTypeToWSRPAuthType(securityContext.getAuthType());
-
+
String portletInstanceKey = invocation.getInstanceContext().getId();
String namespacePrefix = getNamespaceFrom(invocation.getWindowContext());
-
+
if (namespacePrefix == null)
{
namespacePrefix = getPortletHandle();
}
-
+
runtimeContext = WSRPTypeFactory.createRuntimeContext(authType, portletInstanceKey, namespacePrefix);
// user context
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/MimeResponseHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/MimeResponseHandler.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/MimeResponseHandler.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -136,14 +136,18 @@
markup = TextTools.replaceBoundedString(
markup,
- WSRPRewritingConstants.WSRP_REWRITE,
+ WSRPRewritingConstants.BEGIN_WSRP_REWRITE,
WSRPRewritingConstants.END_WSRP_REWRITE,
new MarkupProcessor(namespace, context, target, format, consumer.getProducerInfo()),
true,
- false,
- true
+ false
);
+ if (!consumer.isUsingWSRP2())
+ {
+ markup = markup.replaceAll(WSRPRewritingConstants.WSRP_REWRITE_TOKEN, namespace);
+ }
+
return markup;
}
@@ -209,23 +213,8 @@
public String getReplacementFor(String match, String prefix, String suffix)
{
- if (prefix.equals(match))
- {
- return namespace;
- }
- else if (match.startsWith(WSRPRewritingConstants.BEGIN_WSRP_REWRITE_END))
- {
- // remove end of rewrite token
- match = match.substring(WSRPRewritingConstants.BEGIN_WSRP_REWRITE_END.length());
-
- WSRPPortletURL portletURL = WSRPPortletURL.create(match, supportedCustomModes, supportedCustomWindowStates, true);
- return context.renderURL(portletURL, format);
- }
- else
- {
- // match is not something we know how to process
- return match;
- }
+ WSRPPortletURL portletURL = WSRPPortletURL.create(match, supportedCustomModes, supportedCustomWindowStates, true);
+ return context.renderURL(portletURL, format);
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/handlers/RenderHandlerTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/handlers/RenderHandlerTestCase.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/handlers/RenderHandlerTestCase.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -44,8 +44,17 @@
public static final TestPortletInvocationContext CONTEXT = new TestPortletInvocationContext();
public static final URLFormat FORMAT = new URLFormat(false, false, true, true);
- public void testProcessMarkup()
+ @Override
+ protected void setUp() throws Exception
{
+ CONSUMER.setUsingWSRP2(true);
+ }
+
+ public void testProcessMarkupV1()
+ {
+ // fake using WSRP 1
+ CONSUMER.setUsingWSRP2(false);
+
String markup;
String expected;
markup = "khlaksdhjflkjhsadljkwsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=JBPNS_/wsrp_rewrite" +
@@ -58,11 +67,31 @@
"-interactionState=JBPNS_/wsrp_rewrite' id='wsrp_rewrite_portfolioManager'><table><tr><td>Stock symbol</t" +
"d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>";
expected = "<form method='post' action='Action is=JBPNS_ ns=null ws=null m=null' id='" + NAMESPACE
- + "_portfolioManager'><table><tr><td>Stock symbol</t" +
+ + "portfolioManager'><table><tr><td>Stock symbol</t" +
"d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>";
processMarkupAndCheck(markup, expected);
}
+ public void testProcessMarkupV2()
+ {
+ String markup;
+ String expected;
+ markup = "khlaksdhjflkjhsadljkwsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=JBPNS_/wsrp_rewrite" +
+ "fadsfadswsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=JBPNS_/wsrp_rewritefajdshfkjdshgfgrept";
+ expected = "khlaksdhjflkjhsadljkAction is=JBPNS_ ns=null ws=null m=null" +
+ "fadsfadsRender ns=JBPNS_ ws=null m=nullfajdshfkjdshgfgrept";
+ processMarkupAndCheck(markup, expected);
+
+ // in WSRP 2, we don't process wsrp_rewrite_ tokens anymore as the consumer MUST to provide a namespace
+ // so the producer can generate the proper markup directly
+ markup = "<form method='post' action='wsrp_rewrite?wsrp-urlType=blockingAction&wsrp" +
+ "-interactionState=JBPNS_/wsrp_rewrite' id='wsrp_rewrite_portfolioManager'><table><tr><td>Stock symbol</t" +
+ "d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>";
+ expected = "<form method='post' action='Action is=JBPNS_ ns=null ws=null m=null' id='wsrp_rewrite_portfolioManager'><table><tr><td>Stock symbol</t" +
+ "d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>";
+ processMarkupAndCheck(markup, expected);
+ }
+
/*public void testResourceURLs()
{
String markup;
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -43,6 +43,7 @@
import org.gatein.wsrp.producer.handlers.PortletManagementHandler;
import org.gatein.wsrp.producer.handlers.RegistrationHandler;
import org.gatein.wsrp.producer.handlers.ServiceDescriptionHandler;
+import org.gatein.wsrp.producer.handlers.processors.ProducerHelper;
import org.gatein.wsrp.producer.v2.WSRP2Producer;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.AccessDenied;
@@ -123,7 +124,7 @@
* @version $Revision: 12286 $
* @since 2.4
*/
-public class WSRPProducerImpl implements WSRP2Producer
+public class WSRPProducerImpl implements WSRP2Producer, ProducerHelper
{
/** logger used for logging ;) */
private static final Logger log = LoggerFactory.getLogger(WSRPProducerImpl.class);
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ActionRequestProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ActionRequestProcessor.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ActionRequestProcessor.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -32,7 +32,6 @@
import org.gatein.pc.api.state.AccessMode;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
-import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.gatein.wsrp.producer.handlers.MarkupHandler;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.BlockingInteractionResponse;
@@ -61,7 +60,7 @@
{
private final PerformBlockingInteraction performBlockingInteraction;
- ActionRequestProcessor(WSRPProducerImpl producer, PerformBlockingInteraction performBlockingInteraction)
+ ActionRequestProcessor(ProducerHelper producer, PerformBlockingInteraction performBlockingInteraction)
throws UnsupportedMimeType, UnsupportedWindowState, InvalidHandle, UnsupportedMode, MissingParameters,
InvalidRegistration, OperationFailed
{
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -33,7 +33,6 @@
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.payload.PayloadUtils;
-import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.gatein.wsrp.producer.handlers.MarkupHandler;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.Event;
@@ -67,7 +66,7 @@
{
private HandleEvents handleEvents;
- public EventRequestProcessor(WSRPProducerImpl producer, HandleEvents handleEvents) throws OperationFailed, UnsupportedMode, InvalidHandle, MissingParameters, UnsupportedMimeType, UnsupportedWindowState, InvalidRegistration, OperationNotSupported
+ public EventRequestProcessor(ProducerHelper producer, HandleEvents handleEvents) throws OperationFailed, UnsupportedMode, InvalidHandle, MissingParameters, UnsupportedMimeType, UnsupportedWindowState, InvalidRegistration, OperationNotSupported
{
super(producer);
this.handleEvents = handleEvents;
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessor.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessor.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -24,13 +24,12 @@
package org.gatein.wsrp.producer.handlers.processors;
import org.gatein.common.net.URLTools;
+import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.ContentResponse;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
import org.gatein.wsrp.WSRPConstants;
-import org.gatein.wsrp.WSRPRewritingConstants;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
-import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.gatein.wsrp.servlet.ServletAccess;
import org.oasis.wsrp.v2.MimeResponse;
@@ -40,14 +39,22 @@
*/
abstract class MimeResponseProcessor<LocalMimeResponse extends MimeResponse, Response> extends RequestProcessor<Response>
{
- protected String namespace;
+// private String namespace;
private static final String EMPTY = "";
- protected MimeResponseProcessor(WSRPProducerImpl producer)
+ protected MimeResponseProcessor(ProducerHelper producer)
{
super(producer);
}
+ @Override
+ PortletInvocation initInvocation(WSRPPortletInvocationContext context)
+ {
+// namespace = getRuntimeContext().getNamespacePrefix();
+
+ return internalInitInvocation(context);
+ }
+
/**
* Process String returned from RenderResult to add rewriting token if necessary, replacing namespaces by the WSRP
* rewrite token. fix-me: need to check for producer rewriting
@@ -57,10 +64,9 @@
*/
protected String processFragmentString(String renderString)
{
- String result = renderString.replaceAll(namespace, WSRPRewritingConstants.WSRP_REWRITE);
+// String result = renderString.replaceAll(namespace, WSRPRewritingConstants.WSRP_REWRITE);
- result = URLTools.replaceURLsBy(result, new WSRPUtils.AbsoluteURLReplacementGenerator(ServletAccess.getRequest()));
- return result;
+ return URLTools.replaceURLsBy(renderString, new WSRPUtils.AbsoluteURLReplacementGenerator(ServletAccess.getRequest()));
}
public Response processResponse(PortletInvocationResponse response)
@@ -125,4 +131,6 @@
{
// default implementation does nothing
}
+
+ protected abstract PortletInvocation internalInitInvocation(WSRPPortletInvocationContext context);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ProcessorFactory.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ProcessorFactory.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ProcessorFactory.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.producer.handlers.processors;
-import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.GetMarkup;
import org.oasis.wsrp.v2.GetResource;
@@ -44,7 +43,7 @@
*/
public class ProcessorFactory
{
- public static RequestProcessor getProcessorFor(WSRPProducerImpl producer, Object request)
+ public static RequestProcessor getProcessorFor(ProducerHelper producer, Object request)
throws OperationFailed, UnsupportedMode, InvalidHandle, MissingParameters, UnsupportedMimeType,
UnsupportedWindowState, InvalidRegistration
{
Added: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ProducerHelper.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ProducerHelper.java (rev 0)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ProducerHelper.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -0,0 +1,51 @@
+/*
+ * 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.producer.handlers.processors;
+
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.registration.Registration;
+import org.oasis.wsrp.v2.InvalidHandle;
+import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.PortletContext;
+import org.oasis.wsrp.v2.PortletDescription;
+import org.oasis.wsrp.v2.RegistrationContext;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface ProducerHelper
+{
+ Portlet getPortletWith(org.gatein.pc.api.PortletContext portletContext, Registration registration) throws InvalidHandle, PortletInvokerException;
+
+ PortletDescription getPortletDescription(PortletContext portletContext, List<String> locales, Registration registration) throws InvalidHandle, OperationFailed;
+
+ PortletDescription getPortletDescription(Portlet portlet, List<String> locales);
+
+ Registration getRegistrationOrFailIfInvalid(RegistrationContext registrationContext) throws InvalidRegistration, OperationFailed;
+}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RenderRequestProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RenderRequestProcessor.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RenderRequestProcessor.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -27,9 +27,7 @@
import org.gatein.pc.api.invocation.RenderInvocation;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
import org.gatein.pc.api.state.AccessMode;
-import org.gatein.pc.portlet.impl.jsr168.PortletUtils;
import org.gatein.wsrp.WSRPTypeFactory;
-import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.gatein.wsrp.producer.handlers.MarkupHandler;
import org.oasis.wsrp.v2.GetMarkup;
import org.oasis.wsrp.v2.InvalidHandle;
@@ -55,7 +53,7 @@
{
private final GetMarkup getMarkup;
- public RenderRequestProcessor(WSRPProducerImpl producer, GetMarkup getMarkup) throws UnsupportedMimeType,
+ public RenderRequestProcessor(ProducerHelper producer, GetMarkup getMarkup) throws UnsupportedMimeType,
UnsupportedWindowState, InvalidHandle, UnsupportedMode, MissingParameters, InvalidRegistration, OperationFailed
{
super(producer);
@@ -98,12 +96,8 @@
return AccessMode.READ_ONLY;
}
- @Override
- PortletInvocation initInvocation(WSRPPortletInvocationContext context)
+ protected PortletInvocation internalInitInvocation(WSRPPortletInvocationContext context)
{
- // MUST match namespace generation used in PortletResponseImpl.getNamespace in portlet module...
- namespace = PortletUtils.generateNamespaceFrom(context.getWindowContext().getId());
-
return new RenderInvocation(context);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RequestProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RequestProcessor.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RequestProcessor.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -38,12 +38,12 @@
import org.gatein.pc.api.spi.UserContext;
import org.gatein.pc.api.spi.WindowContext;
import org.gatein.pc.api.state.AccessMode;
+import org.gatein.pc.portlet.impl.jsr168.PortletUtils;
import org.gatein.registration.Registration;
import org.gatein.wsrp.UserContextConverter;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.producer.Utils;
-import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
@@ -85,10 +85,10 @@
protected PortletDescription portletDescription;
protected Portlet portlet;
protected WSRPInstanceContext instanceContext;
- protected WSRPProducerImpl producer;
+ protected ProducerHelper producer;
- protected RequestProcessor(WSRPProducerImpl producer)
+ protected RequestProcessor(ProducerHelper producer)
{
this.producer = producer;
}
@@ -145,7 +145,8 @@
MarkupInfo streamInfo = createStreamInfo(markupRequest);
PortalContext portalContext = createPortalContext(params, markupRequest);
UserContext userContext = createUserContext(wsrpUserContext, markupRequest.getLocale(), desiredLocales);
- instanceContext = createInstanceContext(portletContext, getAccessMode(), runtimeContext.getPortletInstanceKey());
+ String portletInstanceKey = runtimeContext.getPortletInstanceKey();
+ instanceContext = createInstanceContext(portletContext, getAccessMode(), portletInstanceKey);
WindowContext windowContext = createWindowContext(portletContext.getId(), runtimeContext);
// prepare the invocation
@@ -376,22 +377,19 @@
private WindowContext createWindowContext(final String portletHandle, final RuntimeContext runtimeContext)
{
- return new WindowContext()
+ String id = runtimeContext.getPortletInstanceKey();
+ if (ParameterValidation.isNullOrEmpty(id))
{
- public String getId()
- {
- String prefix = runtimeContext.getNamespacePrefix();
- if (prefix != null && prefix.length() > 0)
- {
- return prefix;
- }
- else
- {
- // No provided namespace prefix for portlet, using portlet handle instead
- return portletHandle;
- }
- }
- };
+ id = portletHandle;
+ }
+
+ String namespacePrefix = runtimeContext.getNamespacePrefix();
+ if (ParameterValidation.isNullOrEmpty(namespacePrefix))
+ {
+ namespacePrefix = PortletUtils.generateNamespaceFrom(portletHandle);
+ }
+
+ return new WSRPWindowContext(id, namespacePrefix);
}
private UserContext createUserContext(final org.oasis.wsrp.v2.UserContext userContext,
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ResourceRequestProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ResourceRequestProcessor.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ResourceRequestProcessor.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -26,11 +26,9 @@
import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.ResourceInvocation;
import org.gatein.pc.api.state.AccessMode;
-import org.gatein.pc.portlet.impl.jsr168.PortletUtils;
import org.gatein.wsrp.WSRPResourceURL;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
-import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.gatein.wsrp.producer.handlers.MarkupHandler;
import org.oasis.wsrp.v2.GetResource;
import org.oasis.wsrp.v2.InvalidHandle;
@@ -57,7 +55,7 @@
{
private final GetResource getResource;
- public ResourceRequestProcessor(WSRPProducerImpl producer, GetResource getResource) throws InvalidRegistration, OperationFailed, MissingParameters, InvalidHandle, UnsupportedMimeType, UnsupportedWindowState, UnsupportedMode
+ public ResourceRequestProcessor(ProducerHelper producer, GetResource getResource) throws InvalidRegistration, OperationFailed, MissingParameters, InvalidHandle, UnsupportedMimeType, UnsupportedWindowState, UnsupportedMode
{
super(producer);
this.getResource = getResource;
@@ -105,11 +103,8 @@
return getResource.getUserContext();
}
- @Override
- PortletInvocation initInvocation(WSRPPortletInvocationContext context)
+ protected PortletInvocation internalInitInvocation(WSRPPortletInvocationContext context)
{
- // MUST match namespace generation used in PortletResponseImpl.getNamespace in portlet module...
- namespace = PortletUtils.generateNamespaceFrom(context.getWindowContext().getId());
ResourceInvocation resourceInvocation = new ResourceInvocation(context);
ResourceParams resourceParams = this.getResource.getResourceParams();
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/UpdateNavigationalStateResponseProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/UpdateNavigationalStateResponseProcessor.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/UpdateNavigationalStateResponseProcessor.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -27,7 +27,6 @@
import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
-import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.oasis.wsrp.v2.NavigationalContext;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.UpdateResponse;
@@ -40,7 +39,7 @@
*/
abstract class UpdateNavigationalStateResponseProcessor<Response> extends RequestProcessor<Response>
{
- public UpdateNavigationalStateResponseProcessor(WSRPProducerImpl producer)
+ public UpdateNavigationalStateResponseProcessor(ProducerHelper producer)
{
super(producer);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/WSRPInstanceContext.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/WSRPInstanceContext.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/WSRPInstanceContext.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -51,7 +51,7 @@
this.context = portletContext;
this.accessMode = accessMode;
- if (instanceId != null && instanceId.length() > 0)
+ if (!ParameterValidation.isNullOrEmpty(instanceId))
{
this.instanceId = instanceId;
}
Added: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/WSRPWindowContext.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/WSRPWindowContext.java (rev 0)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/WSRPWindowContext.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -0,0 +1,55 @@
+/*
+ * 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.producer.handlers.processors;
+
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.spi.WindowContext;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class WSRPWindowContext implements WindowContext
+{
+ private final String id;
+ private final String ns;
+
+ public WSRPWindowContext(String id, String namespacePrefix)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "id", "WSRPWindowContext");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(namespacePrefix, "namespace", "WSRPWindowContext");
+ this.id = id;
+ this.ns = namespacePrefix;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public String getNamespace()
+ {
+ return ns;
+ }
+}
Added: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessorTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessorTestCase.java (rev 0)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessorTestCase.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -0,0 +1,121 @@
+/*
+ * 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.producer.handlers.processors;
+
+import junit.framework.TestCase;
+import org.gatein.common.net.media.MediaType;
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.pc.api.info.PortletInfo;
+import org.gatein.registration.Registration;
+import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.servlet.ServletAccess;
+import org.gatein.wsrp.test.support.MockHttpServletRequest;
+import org.gatein.wsrp.test.support.MockHttpServletResponse;
+import org.gatein.wsrp.test.support.MockHttpSession;
+import org.oasis.wsrp.v2.InvalidHandle;
+import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.MarkupType;
+import org.oasis.wsrp.v2.MissingParameters;
+import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.PortletDescription;
+import org.oasis.wsrp.v2.RegistrationContext;
+import org.oasis.wsrp.v2.UnsupportedMimeType;
+import org.oasis.wsrp.v2.UnsupportedMode;
+import org.oasis.wsrp.v2.UnsupportedWindowState;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MimeResponseProcessorTestCase extends TestCase
+{
+ private static final String PORTLET_HANDLE = "portletHandle";
+
+ public void testShouldUseProvidedNamespace() throws OperationFailed, UnsupportedMode, InvalidHandle, MissingParameters, UnsupportedMimeType, UnsupportedWindowState, InvalidRegistration
+ {
+ String namespace = "namespace";
+ ServletAccess.setRequestAndResponse(MockHttpServletRequest.createMockRequest(MockHttpSession.createMockSession()), MockHttpServletResponse.createMockResponse());
+
+ MimeResponseProcessor processor = new RenderRequestProcessor(new TestProducerHelper(), WSRPTypeFactory.createGetMarkup(null,
+ WSRPTypeFactory.createPortletContext(PORTLET_HANDLE),
+ WSRPTypeFactory.createRuntimeContext(WSRPConstants.NONE_USER_AUTHENTICATION, "foo", namespace), null,
+ WSRPTypeFactory.createMarkupParams(false, WSRPConstants.getDefaultLocales(), WSRPConstants.getDefaultMimeTypes(), WSRPConstants.VIEW_MODE, WSRPConstants.NORMAL_WINDOW_STATE)));
+
+ assertEquals("namespace", processor.invocation.getWindowContext().getNamespace());
+ }
+
+ private static class TestProducerHelper implements ProducerHelper
+ {
+ public Portlet getPortletWith(PortletContext portletContext, Registration registration) throws InvalidHandle, PortletInvokerException
+ {
+ return new Portlet()
+ {
+ public PortletContext getContext()
+ {
+ return PortletContext.createPortletContext(PORTLET_HANDLE);
+ }
+
+ public PortletInfo getInfo()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isRemote()
+ {
+ return false;
+ }
+ };
+ }
+
+ public PortletDescription getPortletDescription(org.oasis.wsrp.v2.PortletContext portletContext, List<String> locales, Registration registration) throws InvalidHandle, OperationFailed
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public PortletDescription getPortletDescription(Portlet portlet, List<String> locales)
+ {
+ List<String> modeNames = new ArrayList<String>(1);
+ modeNames.add(WSRPConstants.VIEW_MODE);
+
+ List<String> windowStateNames = new ArrayList<String>(1);
+ windowStateNames.add(WSRPConstants.NORMAL_WINDOW_STATE);
+
+ List<MarkupType> markupTypes = new ArrayList<MarkupType>(1);
+ markupTypes.add(WSRPTypeFactory.createMarkupType(MediaType.TEXT_HTML.getValue(), modeNames, windowStateNames, locales));
+
+ return WSRPTypeFactory.createPortletDescription(PORTLET_HANDLE, markupTypes);
+ }
+
+ public Registration getRegistrationOrFailIfInvalid(RegistrationContext registrationContext) throws InvalidRegistration, OperationFailed
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+ }
+}
Modified: components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -167,8 +167,9 @@
V1MarkupResponse response = producer.getMarkup(getMarkup);
+ String namespacePrefix = getMarkup.getRuntimeContext().getNamespacePrefix();
checkMarkupResponse(response, "<form method='post' action='wsrp_rewrite?wsrp-urlType=blockingAction&wsrp" +
- "-interactionState=JBPNS_/wsrp_rewrite' id='wsrp_rewriteportfolioManager'><table><tr><td>Stock symbol</t" +
+ "-interactionState=JBPNS_/wsrp_rewrite' id='" + namespacePrefix + "portfolioManager'><table><tr><td>Stock symbol</t" +
"d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>");
}
@@ -230,6 +231,7 @@
}
// fix-me: add more tests
+
@Test
public void testGetMarkupSession() throws Exception
{
Modified: components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -183,8 +183,9 @@
MarkupResponse response = producer.getMarkup(getMarkup);
+ String namespacePrefix = getMarkup.getRuntimeContext().getNamespacePrefix();
checkMarkupResponse(response, "<form method='post' action='wsrp_rewrite?wsrp-urlType=blockingAction&wsrp" +
- "-interactionState=JBPNS_/wsrp_rewrite' id='wsrp_rewriteportfolioManager'><table><tr><td>Stock symbol</t" +
+ "-interactionState=JBPNS_/wsrp_rewrite' id='" + namespacePrefix + "portfolioManager'><table><tr><td>Stock symbol</t" +
"d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>");
}
@@ -246,6 +247,7 @@
}
// fix-me: add more tests
+
@Test
public void testGetMarkupSession() throws Exception
{
@@ -655,7 +657,7 @@
{
System.out.println("ERROR during " + this.getClass() + " testImplicitCloning");
e.printStackTrace();
- throw new Exception (e);
+ throw new Exception(e);
}
}
@@ -845,7 +847,7 @@
// send event
HandleEvents handleEvents = WSRPTypeFactory.createHandleEvents(null,
- WSRPTypeFactory.createPortletContext(consumerHandle), createDefaultRuntimeContext(consumerHandle), null,
+ WSRPTypeFactory.createPortletContext(consumerHandle), createDefaultRuntimeContext(), null,
createDefaultMarkupParams(), WSRPTypeFactory.createEventParams(events, StateChange.READ_ONLY));
HandleEventsResponse handleEventsResponse = producer.handleEvents(handleEvents);
Modified: components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/NeedPortletHandleTest.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/NeedPortletHandleTest.java 2010-10-06 09:28:23 UTC (rev 4523)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/NeedPortletHandleTest.java 2010-10-06 09:47:42 UTC (rev 4524)
@@ -202,8 +202,8 @@
* @param handle
* @return
* @throws RemoteException
- * @throws V1InvalidRegistrationFault
- * @throws V1OperationFailedFault
+ * @throws InvalidRegistration
+ * @throws OperationFailed
* @since 2.6.3
*/
protected GetMarkup createMarkupRequest(String handle) throws RemoteException, InvalidRegistration, OperationFailed
@@ -213,40 +213,37 @@
return getMarkup;
}
-
+
protected GetMarkup createDefaultGetMarkup(String handle)
{
PortletContext portletContext = WSRPTypeFactory.createPortletContext(handle);
- RuntimeContext runtimeContext = createDefaultRuntimeContext(handle);
- MarkupParams runtimeParams = createDefaultMarkupParams();
+ RuntimeContext runtimeContext = createDefaultRuntimeContext();
return WSRPTypeFactory.createGetMarkup(null, portletContext, runtimeContext, null, createDefaultMarkupParams());
}
-
+
protected PerformBlockingInteraction createDefaultPerformBlockingInteraction(String handle)
{
PortletContext portletContext = WSRPTypeFactory.createPortletContext(handle);
- return WSRPTypeFactory.createPerformBlockingInteraction(null, portletContext, createDefaultRuntimeContext(handle), null, createDefaultMarkupParams(),
- createDefaultInteractionParams());
+ return WSRPTypeFactory.createPerformBlockingInteraction(null, portletContext, createDefaultRuntimeContext(), null, createDefaultMarkupParams(),
+ createDefaultInteractionParams());
}
-
+
protected InteractionParams createDefaultInteractionParams()
{
return WSRPTypeFactory.createInteractionParams(StateChange.READ_ONLY);
}
-
- protected RuntimeContext createDefaultRuntimeContext(String handle)
+
+ protected RuntimeContext createDefaultRuntimeContext()
{
- String portletInstanceKey = "foo";
- String namespacePrefix = handle;
- return WSRPTypeFactory.createRuntimeContext(WSRPConstants.NONE_USER_AUTHENTICATION, portletInstanceKey, namespacePrefix);
+ return WSRPTypeFactory.createRuntimeContext(WSRPConstants.NONE_USER_AUTHENTICATION, "foo", "ns");
}
protected MarkupParams createDefaultMarkupParams()
{
return WSRPTypeFactory.createMarkupParams(false, WSRPConstants.getDefaultLocales(), WSRPConstants.getDefaultMimeTypes(),
- WSRPConstants.VIEW_MODE, WSRPConstants.NORMAL_WINDOW_STATE);
+ WSRPConstants.VIEW_MODE, WSRPConstants.NORMAL_WINDOW_STATE);
}
-
+
protected String getPortletHandleFrom(String partialHandle)
{
List<String> handles = getHandlesForCurrentlyDeployedArchive();
14 years, 2 months
gatein SVN: r4522 - components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-06 05:12:22 -0400 (Wed, 06 Oct 2010)
New Revision: 4522
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
Log:
- Forgot to commit this in my last commit.
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2010-10-06 08:41:31 UTC (rev 4521)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2010-10-06 09:12:22 UTC (rev 4522)
@@ -54,6 +54,7 @@
public class MockWSRPConsumer implements WSRPConsumer
{
private ProducerInfo producerInfo;
+ private boolean useWSRP2 = true;
public MockWSRPConsumer(String id)
{
@@ -185,6 +186,16 @@
throw new NotYetImplemented();
}
+ public boolean isUsingWSRP2()
+ {
+ return useWSRP2;
+ }
+
+ public void setUsingWSRP2(boolean useWSRP2)
+ {
+ this.useWSRP2 = useWSRP2;
+ }
+
public void destroy()
{
}
14 years, 2 months
gatein SVN: r4521 - portal/branches.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-10-06 04:41:31 -0400 (Wed, 06 Oct 2010)
New Revision: 4521
Removed:
portal/branches/branch-GTNPORTAL-1493/
Log:
GTNPORTAL-1493: Delete the commit branch branch-GTNPORTAL-1493
14 years, 2 months
gatein SVN: r4520 - in components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp: consumer and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-06 04:39:44 -0400 (Wed, 06 Oct 2010)
New Revision: 4520
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
Log:
- Added isUsingWSRP2 method and make isSupportsExport use it (for now).
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java 2010-10-06 08:33:09 UTC (rev 4519)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java 2010-10-06 08:39:44 UTC (rev 4520)
@@ -135,4 +135,6 @@
boolean isSupportsExport();
ImportInfo importPortlets(ExportInfo exportInfo, List<String> portlets) throws PortletInvokerException;
+
+ boolean isUsingWSRP2();
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-10-06 08:33:09 UTC (rev 4519)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-10-06 08:39:44 UTC (rev 4520)
@@ -518,15 +518,7 @@
public boolean isSupportsExport()
{
- try
- {
- return getMarkupService().getVersion() > 1;
- }
- catch (PortletInvokerException e)
- {
- log.debug("Couldn't determine if Consumer supports export operation", e);
- return false;
- }
+ return isUsingWSRP2(); // todo: fix-me, using WSRP 2 doesn't necessarily equals supporting export...
}
// Registration *****************************************************************************************************
@@ -995,6 +987,19 @@
}
}
+ public boolean isUsingWSRP2()
+ {
+ try
+ {
+ return getMarkupService().getVersion() > 1;
+ }
+ catch (PortletInvokerException e)
+ {
+ log.debug("Couldn't determine WSRP version supported by this Consumer", e);
+ return false;
+ }
+ }
+
public MigrationService getMigrationService()
{
return migrationService;
14 years, 2 months
gatein SVN: r4519 - portal/branches.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-10-06 04:33:09 -0400 (Wed, 06 Oct 2010)
New Revision: 4519
Added:
portal/branches/branch-GTNPORTAL-1537/
Log:
GTNPORTAL-1537: Create commit branch for Sprint 39 activity
Copied: portal/branches/branch-GTNPORTAL-1537 (from rev 4518, portal/trunk)
14 years, 2 months
gatein SVN: r4518 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-10-06 04:19:08 -0400 (Wed, 06 Oct 2010)
New Revision: 4518
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_09_002_CreateNewPortalWithValidValue.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_09_012_CheckDisplayingLanguageAndSkinAfterCreatingNewPortal.html
Log:
TestVN-356:Clean and Improve existing Selenium for GateIn
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_09_002_CreateNewPortalWithValidValue.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_09_002_CreateNewPortalWithValidValue.html 2010-10-06 07:01:13 UTC (rev 4517)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_09_002_CreateNewPortalWithValidValue.html 2010-10-06 08:19:08 UTC (rev 4518)
@@ -78,11 +78,36 @@
</tr>
<tr>
<td>echo</td>
+ <td>-- Choose Portal Template --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[1]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[1]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
<td>--Choose Portal Setting--</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
<td>name</td>
<td></td>
</tr>
@@ -103,21 +128,6 @@
</tr>
<tr>
<td>echo</td>
- <td>-- Choose Portal Template --</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[5]/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[1]/div/div/div/div</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[5]/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[1]/div/div/div/div</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
<td>-- Choose Properties --</td>
<td></td>
</tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_09_012_CheckDisplayingLanguageAndSkinAfterCreatingNewPortal.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_09_012_CheckDisplayingLanguageAndSkinAfterCreatingNewPortal.html 2010-10-06 07:01:13 UTC (rev 4517)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_09_012_CheckDisplayingLanguageAndSkinAfterCreatingNewPortal.html 2010-10-06 08:19:08 UTC (rev 4518)
@@ -34,6 +34,11 @@
<tr>
<td>type</td>
<td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
<td>root</td>
</tr>
<tr>
@@ -67,7 +72,37 @@
<td></td>
</tr>
<tr>
+ <td>echo</td>
+ <td>-- Choose Portal Template --</td>
+ <td></td>
+</tr>
+<tr>
<td>waitForElementPresent</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[1]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[1]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Portal Setting --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
<td>name</td>
<td></td>
</tr>
@@ -103,12 +138,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[2]/div/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[3]/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[2]/div/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[3]/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -118,12 +153,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[2]/div/div/div/div/div/div/div/div/div/div/div/div[3]/div/div/div/div</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[4]/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[2]/div/div/div/div/div/div/div/div/div/div/div/div[3]/div/div/div/div</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[4]/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -247,16 +282,21 @@
<td></td>
</tr>
<tr>
- <td>clickAndWait</td>
+ <td>click</td>
<td>link=Test_POR_09_012</td>
<td></td>
</tr>
<tr>
- <td>assertLocation</td>
- <td>http://localhost:8080/portal/private/Test_POR_09_012/</td>
+ <td>echo</td>
+ <td>-- Return to default portal --</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>link=classic</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAndWait</td>
<td>link=classic</td>
<td></td>
14 years, 2 months
gatein SVN: r4517 - in portal/branches/navcontroller: web/portal/src/main/webapp and 3 other directories.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-10-06 03:01:13 -0400 (Wed, 06 Oct 2010)
New Revision: 4517
Added:
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLProvider.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLProviderFilter.java
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/ControllerContext.java
portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/web.xml
portal/branches/navcontroller/web/portal/src/main/webapp/index.jsp
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java
Log:
Implement a PortalURLProvider to create the Portal URL from outside of portal context
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/ControllerContext.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/ControllerContext.java 2010-10-06 04:46:50 UTC (rev 4516)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/ControllerContext.java 2010-10-06 07:01:13 UTC (rev 4517)
@@ -49,7 +49,7 @@
/** . */
private SimpleRenderContext renderContext;
- ControllerContext(
+ public ControllerContext(
WebAppController controller,
HttpServletRequest request,
HttpServletResponse response,
Modified: portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/web.xml 2010-10-06 04:46:50 UTC (rev 4516)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/web.xml 2010-10-06 07:01:13 UTC (rev 4517)
@@ -69,8 +69,6 @@
<filter-class>org.exoplatform.services.security.web.SetCurrentIdentityFilter</filter-class>
</filter>
-
-
<filter>
<filter-name>RestEncodingFilter</filter-name>
<filter-class>org.exoplatform.services.rest.servlet.RestEncodingFilter</filter-class>
@@ -94,7 +92,12 @@
<filter-name>ClusteredSSOFilter</filter-name>
<filter-class>org.exoplatform.web.login.ClusteredSSOFilter</filter-class>
</filter>
-
+
+ <filter>
+ <filter-name>PortalURLProviderFilter</filter-name>
+ <filter-class>org.exoplatform.portal.url.PortalURLProviderFilter</filter-class>
+ </filter>
+
<filter-mapping>
<filter-name>RememberMeFilter</filter-name>
<servlet-name>portal</servlet-name>
@@ -163,6 +166,11 @@
<filter-name>RestEncodingFilter</filter-name>
<url-pattern>/rest/*</url-pattern>
</filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PortalURLProviderFilter</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ </filter-mapping>
<!-- ================================================================== -->
<!-- LISTENER -->
Modified: portal/branches/navcontroller/web/portal/src/main/webapp/index.jsp
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/index.jsp 2010-10-06 04:46:50 UTC (rev 4516)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/index.jsp 2010-10-06 07:01:13 UTC (rev 4517)
@@ -21,9 +21,16 @@
<%@ page import="org.exoplatform.container.PortalContainer"%>
<%@ page import="org.exoplatform.portal.config.UserPortalConfigService"%>
+<%@ page import="org.exoplatform.portal.url.PortalURLProvider"%>
+<%@ page import="org.exoplatform.portal.url.navigation.NavigationResource"%>
+<%@ page import="org.exoplatform.web.url.ControllerURL"%>
+
<%
PortalContainer manager = PortalContainer.getCurrentInstance(session.getServletContext()) ;
UserPortalConfigService userPortalConfigService = (UserPortalConfigService) manager.getComponentInstanceOfType(UserPortalConfigService.class) ;
- response.sendRedirect(request.getContextPath() + "/public/"+userPortalConfigService.getDefaultPortal()+"/");
+ PortalURLProvider provider = PortalURLProvider.getCurrentPortalURLProvider();
+ ControllerURL portalURL = provider.createPortalURL("public", userPortalConfigService.getDefaultPortal(), org.exoplatform.portal.url.navigation.NavigationLocator.TYPE);
+
+ response.sendRedirect(portalURL.setResource(new NavigationResource(null, null)).toString());
%>
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-10-06 04:46:50 UTC (rev 4516)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-10-06 07:01:13 UTC (rev 4517)
@@ -267,7 +267,7 @@
@Override
public <R, L extends ResourceLocator<R>> ControllerURL<R, L> newURL(ResourceType<R, L> resourceType, L locator)
{
- return new PortalURL<R, L>(this, locator, false, portalOwner_, access);
+ return new PortalURL<R, L>(controllerContext, locator, false, portalOwner_, access);
}
public ControllerContext getControllerContext()
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java 2010-10-06 04:46:50 UTC (rev 4516)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java 2010-10-06 07:01:13 UTC (rev 4517)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.url;
-import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.application.PortalRequestHandler;
+import org.exoplatform.web.ControllerContext;
import org.exoplatform.web.WebAppController;
import org.exoplatform.web.controller.QualifiedName;
import org.exoplatform.web.controller.router.SimpleRenderContext;
@@ -38,7 +38,7 @@
{
/** . */
- private final PortalRequestContext requestContext;
+ private final ControllerContext controllerContext;
/** . */
private final String access;
@@ -52,7 +52,7 @@
/** . */
private SimpleRenderContext renderContext;
- public PortalURL(PortalRequestContext requestContext, L locator, Boolean ajax, String siteName, String access)
+ public PortalURL(ControllerContext requestContext, L locator, Boolean ajax, String siteName, String access)
{
super(locator, ajax);
@@ -64,7 +64,7 @@
//
this.siteName = siteName;
- this.requestContext = requestContext;
+ this.controllerContext = requestContext;
this.access = access;
}
@@ -128,7 +128,7 @@
}
//
- requestContext.getControllerContext().renderURL(parameters, renderContext);
+ controllerContext.renderURL(parameters, renderContext);
//
boolean questionMarkDone = false;
Added: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLProvider.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLProvider.java (rev 0)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLProvider.java 2010-10-06 07:01:13 UTC (rev 4517)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.exoplatform.portal.url;
+
+import org.exoplatform.web.ControllerContext;
+import org.exoplatform.web.url.LocatorProvider;
+import org.exoplatform.web.url.ResourceLocator;
+import org.exoplatform.web.url.ResourceType;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class PortalURLProvider
+{
+ private static ThreadLocal<PortalURLProvider> currentProvider = new ThreadLocal<PortalURLProvider>();
+
+ private ControllerContext controllerContext;
+
+ private LocatorProvider locatorProvider;
+
+ public PortalURLProvider(ControllerContext controllerCtx, LocatorProvider locatorService)
+ {
+ this.controllerContext = controllerCtx;
+ this.locatorProvider = locatorService;
+ }
+
+ public static void setCurrentPortalURLProvider(PortalURLProvider provider)
+ {
+ currentProvider.set(provider);
+ }
+
+ public static PortalURLProvider getCurrentPortalURLProvider()
+ {
+ return currentProvider.get();
+ }
+
+ public final <R, L extends ResourceLocator<R>> PortalURL<R, L> createPortalURL(String access, String siteName, ResourceType<R, L> resourceType)
+ {
+ PortalURLProvider portalURLProvider = currentProvider.get();
+ if (portalURLProvider != null)
+ {
+ L newLocator = locatorProvider.newLocator(resourceType);
+ return new PortalURL<R, L>(controllerContext, newLocator, false, siteName, access);
+ }
+ return null;
+ }
+}
Added: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLProviderFilter.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLProviderFilter.java (rev 0)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLProviderFilter.java 2010-10-06 07:01:13 UTC (rev 4517)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.portal.url;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.web.AbstractFilter;
+import org.exoplatform.web.ControllerContext;
+import org.exoplatform.web.WebAppController;
+import org.exoplatform.web.url.LocatorProvider;
+
+import java.io.IOException;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class PortalURLProviderFilter extends AbstractFilter
+{
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
+ ServletException
+ {
+
+ ExoContainer container = getContainer();
+
+ WebAppController webAppController = (WebAppController)container.getComponentInstanceOfType(WebAppController.class);
+
+ LocatorProvider locatorProvider = (LocatorProvider)container.getComponentInstanceOfType(LocatorProvider.class);
+
+ HttpServletRequest httpRequest = (HttpServletRequest)request;
+
+ HttpServletResponse httpResponse = (HttpServletResponse)response;
+ try
+ {
+ ControllerContext controllerCtx = new ControllerContext(webAppController, httpRequest, httpResponse, null);
+ PortalURLProvider urlProvider = new PortalURLProvider(controllerCtx, locatorProvider);
+ PortalURLProvider.setCurrentPortalURLProvider(urlProvider);
+ chain.doFilter(httpRequest, httpResponse);
+ }
+ finally
+ {
+ PortalURLProvider.setCurrentPortalURLProvider(null);
+ }
+
+ }
+
+ @Override
+ public void destroy()
+ {
+ }
+}
14 years, 2 months
gatein SVN: r4516 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-10-06 00:46:50 -0400 (Wed, 06 Oct 2010)
New Revision: 4516
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_Smoke_PRL_BasicFunctionOnGateIn.html
Log:
TESTVN-1684 - Selenium scripts for smoke tests on GateIn
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_Smoke_PRL_BasicFunctionOnGateIn.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_Smoke_PRL_BasicFunctionOnGateIn.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_Smoke_PRL_BasicFunctionOnGateIn.html 2010-10-06 04:46:50 UTC (rev 4516)
@@ -0,0 +1,852 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_Smoke_PRL_BasicFunctionOnGateIn</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_Smoke_PRL_BasicFunctionOnGateIn</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new user --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=New Staff</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>Confirmpassword</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>firstName</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>lastName</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>email</td>
+ <td>Smoke_GateIn_01(a)gmail.com</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose User Profile --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIAccountPortlet']/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIAccountPortlet']/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>user.language</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>user.language</td>
+ <td>label=English</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>You have registered a new account.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>You have registered a new account.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Users and group management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Group Management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[1]/div/div/div/div/div/div/a[2]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[1]/div/div/div/div/div/div/a[2]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>groupName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>groupName</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Smoke_GateIn_01<br /></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add user into group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>membership</td>
+ <td>label=manager</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new group navigation --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIAddGroupNavigationGrid']/table[10]/tbody/tr/td[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIAddGroupNavigationGrid']/table[10]/tbody/tr/td[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Smoke_GateIn_01</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Smoke_GateIn_01</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Manage Page --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Page Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new page for group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageBrowser']/div[2]/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIPageBrowser']/div[2]/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>ownerType</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>ownerType</td>
+ <td>label=group</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>title</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Page Layout --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Permission Setting --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[3]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIMaskWorkspace']/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[3]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Access Permission Setting --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Access Permission Setting</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Access Permission Setting</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit Permission Setting --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Edit Permission Setting</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Edit Permission Setting</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Edit Permission Setting</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Edit Permission Setting</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new node link to new page --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Edit Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Edit Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Page Selector --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Search and Select Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Search and Select Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//img[@title='Select Page']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//img[@title='Select Page']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- View new node --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Smoke_GateIn_01</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Smoke_GateIn_01</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Login by new user --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Edit Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Edit Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete node --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UINavigationNodeSelector']/div/div/div/div[2]/div/div/div[2]/div[1]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UINavigationNodeSelector']/div/div/div/div[2]/div/div/div[2]/div[1]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//a[@class='NodeIcon DefaultPageIcon NodeSelected' and @title='Smoke_GateIn_01']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseDownRight</td>
+ <td>//a[@class='NodeIcon DefaultPageIcon NodeSelected' and @title='Smoke_GateIn_01']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Delete Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Delete Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForConfirmationPresent</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete this node?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Login by new user --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Users and group management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Search new user --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>searchTerm</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>searchTerm</td>
+ <td>Smoke_GateIn_01</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//form[@id='UISearchForm']/div[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//form[@id='UISearchForm']/div[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete new user --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//img[@alt='DeleteUser']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//img[@alt='DeleteUser']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete Smoke_GateIn_01 user?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>No result found.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>No result found.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[5]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[5]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Group Management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[1]/div/div/div/div/div/div/a[2]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[1]/div/div/div/div/div/div/a[2]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete new group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Smoke_GateIn_01</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Smoke_GateIn_01</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForConfirmationPresent</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete this group?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Check group navigation after delete group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextNotPresent</td>
+ <td>Smoke_GateIn_01</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Smoke_GateIn_01</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 2 months
gatein SVN: r4515 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-10-06 00:45:51 -0400 (Wed, 06 Oct 2010)
New Revision: 4515
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_26_001_CheckAndUnCheckUseCapcharInAccountRegister.html
Log:
TestVN-356:Clean and Improve existing Selenium for GateIn
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_26_001_CheckAndUnCheckUseCapcharInAccountRegister.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_26_001_CheckAndUnCheckUseCapcharInAccountRegister.html 2010-10-06 04:20:33 UTC (rev 4514)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_26_001_CheckAndUnCheckUseCapcharInAccountRegister.html 2010-10-06 04:45:51 UTC (rev 4515)
@@ -4,12 +4,12 @@
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
-<title>Test_PRL_26_001_CreateNewAccountWhenCheckAndUnCheckUseCapchar</title>
+<title>Test_PRL_26_001_CheckAndUnCheckUseCapcharInAccountRegister</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
-<tr><td rowspan="1" colspan="3">Test_PRL_26_001_CreateNewAccountWhenCheckAndUnCheckUseCapchar</td></tr>
+<tr><td rowspan="1" colspan="3">Test_PRL_26_001_CheckAndUnCheckUseCapcharInAccountRegister</td></tr>
</thead><tbody>
<tr>
<td>open</td>
14 years, 2 months