JBoss Portal SVN: r6004 - in trunk/wsrp/src/main/org/jboss/portal/test/wsrp: framework and 3 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-01-12 20:42:19 -0500 (Fri, 12 Jan 2007)
New Revision: 6004
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java
Removed:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/ListBehaviorSequence.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/SingleBehaviorSequence.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestBehaviorSequence.java
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/MarkupBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/ServiceDescriptionBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducer.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/V1ConsumerBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicMarkupBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/EmptyMarkupBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/InitCookieMarkupBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/NullMarkupBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/SessionMarkupBehavior.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
Log:
- Refactored handling of behaviors. Should now be simpler and easier to work with.
- Introduced concept of BehaviorRegistry.
- Removed dependency of TestWSRPProducerImpl on test behaviors.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -55,7 +55,6 @@
public void setUp() throws Exception
{
consumer.getProducerInfo().setId(TEST_PRODUCER_ID);
- producer.reset();
}
public TestWSRPProducer getProducer()
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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.jboss.portal.test.wsrp.framework;
+
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class BehaviorRegistry
+{
+ private final Map behaviors = new HashMap();
+ private PortletManagementBehavior portletManagementBehavior;
+ private ServiceDescriptionBehavior serviceDescriptionBehavior;
+ private RegistrationBehavior registrationBehavior;
+
+ public ServiceDescriptionBehavior getServiceDescriptionBehavior()
+ {
+ // this is required since the consumer will try to access the producer as soon as it's started and the test
+ // producer will not be properly setup at that time since it's set up in the test's setUp method...
+ if (serviceDescriptionBehavior == null)
+ {
+ return ServiceDescriptionBehavior.DEFAULT;
+ }
+
+ return serviceDescriptionBehavior;
+ }
+
+ public void clear()
+ {
+ behaviors.clear();
+ }
+
+ public MarkupBehavior getMarkupBehaviorFor(String handle) throws InvalidHandleFault
+ {
+ if (behaviors.containsKey(handle))
+ {
+ return (MarkupBehavior)behaviors.get(handle);
+ }
+ System.out.println("There is no registered MarkupBehavior for handle '" + handle + "'");
+ throw new InvalidHandleFault();
+ }
+
+ public void registerMarkupBehavior(MarkupBehavior behavior)
+ {
+ for (Iterator handles = behavior.getSupportedHandles().iterator(); handles.hasNext();)
+ {
+ String handle = (String)handles.next();
+ MarkupBehavior existing = (MarkupBehavior)behaviors.get(handle);
+ if (existing != null)
+ {
+ throw new IllegalArgumentException("Cannot register behavior " + behavior.getClass().getName()
+ + " because it uses a handle '" + handle + "' that's already associated with behavior "
+ + existing.getClass().getName());
+ }
+ behaviors.put(handle, behavior);
+ }
+ }
+
+ public PortletManagementBehavior getPortletManagementBehavior()
+ {
+ return portletManagementBehavior;
+ }
+
+ public void setPortletManagementBehavior(PortletManagementBehavior portletManagementBehavior)
+ {
+ this.portletManagementBehavior = portletManagementBehavior;
+ }
+
+ public void setServiceDescriptionBehavior(ServiceDescriptionBehavior serviceDescriptionBehavior)
+ {
+ this.serviceDescriptionBehavior = serviceDescriptionBehavior;
+ }
+
+ public RegistrationBehavior getRegistrationBehavior()
+ {
+ return registrationBehavior;
+ }
+
+ public void setRegistrationBehavior(RegistrationBehavior registrationBehavior)
+ {
+ this.registrationBehavior = registrationBehavior;
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/ListBehaviorSequence.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/ListBehaviorSequence.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/ListBehaviorSequence.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -1,55 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.jboss.portal.test.wsrp.framework;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.ListBehaviorSequence">Chris
- * Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public class ListBehaviorSequence extends TestBehaviorSequence
-{
- private List sequence;
-
- public ListBehaviorSequence(TestBehaviorSet behaviorSet)
- {
- super(behaviorSet);
- sequence = new ArrayList(3);
- sequence.add(behaviorSet);
- }
-
- public void setBehaviorSetAt(TestBehaviorSet behaviorSet, int sequenceOrder)
- {
- sequence.set(sequenceOrder, behaviorSet);
- }
-
- protected TestBehaviorSet getBehaviorSetFor(int sequenceOrder)
- {
- return (TestBehaviorSet)sequence.get(sequenceOrder);
- }
-}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/MarkupBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/MarkupBehavior.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/MarkupBehavior.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -43,6 +43,7 @@
import org.jboss.portal.wsrp.core.MissingParametersFault;
import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PerformBlockingInteraction;
+import org.jboss.portal.wsrp.core.PortletDescription;
import org.jboss.portal.wsrp.core.PortletStateChangeRequiredFault;
import org.jboss.portal.wsrp.core.ReleaseSessions;
import org.jboss.portal.wsrp.core.ReturnAny;
@@ -53,6 +54,8 @@
import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.List;
/**
* Behavior delivering Markup services.
@@ -64,20 +67,8 @@
*/
public abstract class MarkupBehavior extends TestProducerBehavior implements WSRP_v1_Markup_PortType
{
- protected String portletHandle;
+ protected List handles = new ArrayList(3);
- /**
- * The portlet handle associated with this behavior for the behaviors that react to a specific portlet handle. Used
- * essentially for markup/interaction requests.
- *
- * @return
- */
- public String getPortletHandle()
- {
- return portletHandle;
- }
-
-
public MarkupResponse getMarkup(GetMarkup getMarkup) throws UnsupportedWindowStateFault, InvalidCookieFault,
InvalidSessionFault, AccessDeniedFault, InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault,
UnsupportedModeFault, OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
@@ -153,4 +144,24 @@
{
// default implementation does not nothing
}
+
+ public List getSupportedHandles()
+ {
+ return handles;
+ }
+
+ public PortletDescription getPortletDescriptionFor(String handle)
+ {
+ if (handles.contains(handle))
+ {
+ return createPortletDescription(handle, getSuffixFor(handle));
+ }
+ throw new IllegalArgumentException("MarkupBehavior " + getClass().getName() + " is not associated with handle '"
+ + handle + "'");
+ }
+
+ protected String getSuffixFor(String handle)
+ {
+ return "";
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/ServiceDescriptionBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/ServiceDescriptionBehavior.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/ServiceDescriptionBehavior.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -39,9 +39,11 @@
* @version $Revision$
* @since 2.6
*/
-public abstract class ServiceDescriptionBehavior extends TestProducerBehavior implements WSRP_v1_ServiceDescription_PortType
+public class ServiceDescriptionBehavior extends TestProducerBehavior implements WSRP_v1_ServiceDescription_PortType
{
protected ServiceDescription serviceDescription;
+ private static final ServiceDescription DEFAULT_SERVICE_DESCRIPTION = WSRPTypeFactory.createServiceDescription(false);
+ public static final ServiceDescriptionBehavior DEFAULT = new ServiceDescriptionBehavior();
protected ServiceDescriptionBehavior()
{
@@ -52,7 +54,7 @@
public ServiceDescription getServiceDescription(GetServiceDescription getServiceDescription) throws
OperationFailedFault, InvalidRegistrationFault, RemoteException
{
- return null;
+ return DEFAULT_SERVICE_DESCRIPTION;
}
public void setRequiresRegistration(boolean requiresRegistration)
@@ -64,4 +66,9 @@
{
serviceDescription.setRequiresInitCookie(requiresInitCookie);
}
+
+ public static ServiceDescription getDefaultServiceDescription()
+ {
+ return DEFAULT_SERVICE_DESCRIPTION;
+ }
}
Deleted: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/SingleBehaviorSequence.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/SingleBehaviorSequence.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/SingleBehaviorSequence.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.jboss.portal.test.wsrp.framework;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.SingleBehaviorSequence">Chris
- * Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public class SingleBehaviorSequence extends TestBehaviorSequence
-{
- private TestBehaviorSet behaviorSet;
-
- public SingleBehaviorSequence(TestBehaviorSet behaviorSet)
- {
- super(behaviorSet);
- setBehaviorSetAt(behaviorSet, 0);
- }
-
- public void setBehaviorSetAt(TestBehaviorSet behaviorSet, int sequenceOrder)
- {
- if (sequenceOrder != 0)
- {
- throw new IllegalArgumentException("SingleBehaviorSequence only accepts a single BehaviorSet.");
- }
- this.behaviorSet = behaviorSet;
- }
-
- protected TestBehaviorSet getBehaviorSetFor(int sequenceOrder)
- {
- return behaviorSet;
- }
-
-
- public String toString()
- {
- return "SingleBehaviorSequence{" +
- "behaviorSet=" + behaviorSet +
- '}';
- }
-}
Deleted: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestBehaviorSequence.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestBehaviorSequence.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestBehaviorSequence.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -1,130 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.jboss.portal.test.wsrp.framework;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.TestBehaviorSequence">Chris
- * Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public abstract class TestBehaviorSequence
-{
-
- public TestBehaviorSequence(TestBehaviorSet behaviorSet)
- {
- }
-
- public abstract void setBehaviorSetAt(TestBehaviorSet behaviorSet, int sequenceOrder);
-
- protected abstract TestBehaviorSet getBehaviorSetFor(int sequenceOrder);
-
- public void setBehaviorAt(TestProducerBehavior behavior, int sequenceOrder)
- {
- getBehaviorSetFor(sequenceOrder).setBehavior(behavior);
- }
-
- public ServiceDescriptionBehavior getServiceDescriptionBehaviorFor(int sequenceOrder)
- {
- return getBehaviorSetFor(sequenceOrder).descriptionBehavior;
- }
-
- public MarkupBehavior getMarkupBehaviorFor(int sequenceOrder)
- {
- return getBehaviorSetFor(sequenceOrder).markupBehavior;
- }
-
- public PortletManagementBehavior getPortletManagementBehaviorFor(int sequenceOrder)
- {
- return getBehaviorSetFor(sequenceOrder).managementBehavior;
- }
-
- public RegistrationBehavior getRegistrationBehaviorFor(int sequenceOrder)
- {
- return getBehaviorSetFor(sequenceOrder).registrationBehavior;
- }
-
- public static class TestBehaviorSet
- {
-
- public TestBehaviorSet(ServiceDescriptionBehavior descriptionBehavior, MarkupBehavior markupBehavior,
- PortletManagementBehavior managementBehavior, RegistrationBehavior registrationBehavior)
- {
- this.descriptionBehavior = descriptionBehavior;
- this.markupBehavior = markupBehavior;
- this.managementBehavior = managementBehavior;
- this.registrationBehavior = registrationBehavior;
- }
-
- /**
- * Constructs a set containing only one behavior. Used for simple tests.
- *
- * @param behavior
- */
- public TestBehaviorSet(TestProducerBehavior behavior)
- {
- setBehavior(behavior);
- }
-
-
- public String toString()
- {
- return "TestBehaviorSet{" +
- "descriptionBehavior=" + descriptionBehavior +
- ", markupBehavior=" + markupBehavior +
- ", managementBehavior=" + managementBehavior +
- ", registrationBehavior=" + registrationBehavior +
- '}';
- }
-
- private ServiceDescriptionBehavior descriptionBehavior;
- private MarkupBehavior markupBehavior;
- private PortletManagementBehavior managementBehavior;
- private RegistrationBehavior registrationBehavior;
-
- public void setBehavior(TestProducerBehavior behavior)
- {
- if (behavior instanceof ServiceDescriptionBehavior)
- {
- descriptionBehavior = (ServiceDescriptionBehavior)behavior;
- }
- else if (behavior instanceof MarkupBehavior)
- {
- markupBehavior = (MarkupBehavior)behavior;
- }
- else if (behavior instanceof PortletManagementBehavior)
- {
- managementBehavior = (PortletManagementBehavior)behavior;
- }
- else if (behavior instanceof RegistrationBehavior)
- {
- registrationBehavior = (RegistrationBehavior)behavior;
- }
- else
- {
- throw new IllegalArgumentException("Invalid behavior: " + behavior);
- }
- }
- }
-}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducer.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducer.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -40,4 +40,5 @@
void setResponse(HttpServletResponse response);
+ BehaviorRegistry getBehaviorRegistry();
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -25,14 +25,6 @@
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.registration.RegistrationManager;
-import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicMarkupBehavior;
-import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicPortletManagementBehavior;
-import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicServiceDescriptionBehavior;
-import org.jboss.portal.test.wsrp.v1.consumer.behaviors.EmptyMarkupBehavior;
-import org.jboss.portal.test.wsrp.v1.consumer.behaviors.InitCookieMarkupBehavior;
-import org.jboss.portal.test.wsrp.v1.consumer.behaviors.NullMarkupBehavior;
-import org.jboss.portal.test.wsrp.v1.consumer.behaviors.SessionMarkupBehavior;
-import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
@@ -54,7 +46,6 @@
import org.jboss.portal.wsrp.core.InvalidUserCategoryFault;
import org.jboss.portal.wsrp.core.MarkupResponse;
import org.jboss.portal.wsrp.core.MissingParametersFault;
-import org.jboss.portal.wsrp.core.ModelDescription;
import org.jboss.portal.wsrp.core.ModifyRegistration;
import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PerformBlockingInteraction;
@@ -80,54 +71,27 @@
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.rmi.RemoteException;
-import java.util.HashMap;
-import java.util.Map;
/**
* This is dummy clone of org.jboss.portal.wsrp.producer.WSRPProducerImpl customizable from client side. Just for
* consumer implementation testing purposes.
*
* @author <a href="mailto:Boleslaw.Dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
* @since 2.4
*/
public class TestWSRPProducerImpl extends AbstractJBossService implements TestWSRPProducer
{
- //injected objects to return by WS methods (for tests)
-
- /**
- * The ServiceDescription that is returned to an unregistred Consumer when registration is required: no information
- * is provided apart from the fact that registration is required and what information is required to sucessfully
- * register.
- *
- * @see TestWSRPProducerImpl#requiredRegistrationInfo
- */
- private ServiceDescription requiredRegistrationNotProvidedSD;
-
- /**
- * <code>true</code> if registration is required to access this Producer's information and services,
- * <code>false</code> otherwise. Note: server-side registration is not supported in 2.4
- */
- private boolean requiresRegistration;
-
private int sessionExpirationTime = DEFAULT_SESSION_EXPIRATION_TIME;
private CookieProtocol requiresInitCookie = CookieProtocol.none;
- /** Required registration information to be provided by consumers to access this Producer's information and services. */
- private ModelDescription requiredRegistrationInfo;
-
/** Used to set the cookie in initCookie */
private HttpServletResponse response;
- /** The behavior sequence that will be used for the current test. */
- private TestBehaviorSequence sequence;
+ private BehaviorRegistry behaviorRegistry = new BehaviorRegistry();
- /** The current order in the sequence (number of times the methods have been called) */
- private int sequenceOrder;
-
- private PortletManagementBehavior portletManagementBehavior;
-
public static final String USER_COOKIE = "cookie";
public TestWSRPProducerImpl()
@@ -135,13 +99,13 @@
reset();
}
- public void reset()
+ public BehaviorRegistry getBehaviorRegistry()
{
- requiresRegistration = false;
- requiredRegistrationInfo = new ModelDescription();
- requiredRegistrationNotProvidedSD = new ServiceDescription(true, null, null, null, null, null, requiresInitCookie,
- requiredRegistrationInfo, WSRPConstants.DEFAULT_LOCALES, null, null);
+ return behaviorRegistry;
+ }
+ public void reset()
+ {
if (response != null)
{
response.reset();
@@ -149,82 +113,24 @@
response = null;
requiresInitCookie = null;
-
- registerMarkupBehavior(new BasicMarkupBehavior());
- registerMarkupBehavior(new SessionMarkupBehavior());
- registerMarkupBehavior(new NullMarkupBehavior());
- registerMarkupBehavior(new EmptyMarkupBehavior());
- registerMarkupBehavior(new InitCookieMarkupBehavior());
-
- sequence = new SingleBehaviorSequence(new TestBehaviorSequence.TestBehaviorSet(new BasicServiceDescriptionBehavior()));
- sequenceOrder = 0;
- portletManagementBehavior = new BasicPortletManagementBehavior();
+ behaviorRegistry.clear();
}
- // Behavior management **********************************************************************************************
- Map registeredBehaviors = new HashMap();
-
- private void useBehavior(TestProducerBehavior behavior)
+ private MarkupBehavior getMarkupBehaviorFor(String portletHandle) throws InvalidHandleFault
{
- sequence = new SingleBehaviorSequence(new TestBehaviorSequence.TestBehaviorSet(behavior));
+ return behaviorRegistry.getMarkupBehaviorFor(portletHandle);
}
- private void registerMarkupBehavior(MarkupBehavior behavior)
+ private ServiceDescriptionBehavior getServiceDescriptionBehavior()
{
- registeredBehaviors.put(behavior.getPortletHandle(), behavior);
+ return behaviorRegistry.getServiceDescriptionBehavior();
}
- private MarkupBehavior getMarkupBehaviorFor(String portletHandle)
+ public PortletManagementBehavior getPortletManagementBehavior()
{
- return (MarkupBehavior)registeredBehaviors.get(portletHandle);
+ return behaviorRegistry.getPortletManagementBehavior();
}
- private void updateCurrentMarkupBehaviorIfNeeded(String handle)
- {
- if (sequence == null)
- {
- if (handle != null)
- {
- useBehavior(getMarkupBehaviorFor(handle));
- }
- }
- else
- {
- MarkupBehavior markupBehavior = sequence.getMarkupBehaviorFor(sequenceOrder);
- if (markupBehavior == null || handle != null)
- {
- MarkupBehavior behavior = getMarkupBehaviorFor(handle);
- sequence.setBehaviorAt(behavior, sequenceOrder);
- }
- }
- }
-
- private void incrementBehaviorCallCount()
- {
- sequenceOrder++;
- }
-
- private MarkupBehavior getMarkupBehavior()
- {
- if (sequence != null)
- {
- MarkupBehavior markupBehavior = sequence.getMarkupBehaviorFor(sequenceOrder);
- System.out.println("Using markup behavior for " + markupBehavior.getPortletHandle() + " portlet handle.");
- return markupBehavior;
- }
- throw new IllegalStateException("Don't have a MarkupBehavior to return!");
- }
-
- private ServiceDescriptionBehavior getServiceDescriptionBehavior()
- {
- if (sequence != null)
- {
- ServiceDescriptionBehavior behavior = sequence.getServiceDescriptionBehaviorFor(sequenceOrder);
- return behavior;
- }
- throw new IllegalStateException("Don't have a ServiceDescriptionBehavior to return!");
- }
-
public void setResponse(HttpServletResponse response)
{
this.response = response;
@@ -236,7 +142,6 @@
throws InvalidRegistrationFault, OperationFailedFault, RemoteException
{
ServiceDescription response = getServiceDescriptionBehavior().getServiceDescription(gs);
- incrementBehaviorCallCount();
return response;
}
@@ -248,11 +153,9 @@
OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault, InvalidRegistrationFault,
UnsupportedMimeTypeFault, RemoteException
{
- updateCurrentMarkupBehaviorIfNeeded(getMarkup.getPortletContext().getPortletHandle());
+ MarkupResponse markupResponse = getMarkupBehaviorFor(getMarkup.getPortletContext().getPortletHandle())
+ .getMarkup(getMarkup);
- MarkupResponse markupResponse = getMarkupBehavior().getMarkup(getMarkup);
-
- incrementBehaviorCallCount();
return markupResponse;
}
@@ -262,18 +165,15 @@
InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault, InconsistentParametersFault,
InvalidHandleFault, InvalidCookieFault, RemoteException
{
- updateCurrentMarkupBehaviorIfNeeded(performBlockingInteraction.getPortletContext().getPortletHandle());
+ BlockingInteractionResponse res = getMarkupBehaviorFor(performBlockingInteraction.getPortletContext().getPortletHandle())
+ .performBlockingInteraction(performBlockingInteraction);
- BlockingInteractionResponse res = getMarkupBehavior().performBlockingInteraction(performBlockingInteraction);
-
- incrementBehaviorCallCount();
return res;
}
public ReturnAny releaseSessions(ReleaseSessions releaseSessions)
throws InvalidRegistrationFault, OperationFailedFault, MissingParametersFault, AccessDeniedFault, RemoteException
{
- incrementBehaviorCallCount();
return null;
}
@@ -288,7 +188,6 @@
response.addCookie(new Cookie("cookieName", USER_COOKIE));
- incrementBehaviorCallCount();
return null;
}
@@ -296,19 +195,16 @@
public RegistrationContext register(RegistrationData register) throws MissingParametersFault, OperationFailedFault, RemoteException
{
- incrementBehaviorCallCount();
return WSRPTypeFactory.createRegistrationContext("registration");
}
public ReturnAny deregister(RegistrationContext deregister) throws OperationFailedFault, InvalidRegistrationFault, RemoteException
{
- incrementBehaviorCallCount();
return null;
}
public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration) throws MissingParametersFault, OperationFailedFault, InvalidRegistrationFault, RemoteException
{
- incrementBehaviorCallCount();
return null;
}
@@ -318,44 +214,32 @@
throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault, InconsistentParametersFault,
MissingParametersFault, InvalidRegistrationFault, OperationFailedFault, RemoteException
{
- PortletDescriptionResponse response = portletManagementBehavior.getPortletDescription(getPortletDescription);
- incrementBehaviorCallCount();
- return response;
+ return getPortletManagementBehavior().getPortletDescription(getPortletDescription);
}
public PortletContext clonePortlet(ClonePortlet clonePortlet) throws InvalidUserCategoryFault, AccessDeniedFault, OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault, InconsistentParametersFault, MissingParametersFault, RemoteException
{
- PortletContext portletContext = portletManagementBehavior.clonePortlet(clonePortlet);
- incrementBehaviorCallCount();
- return portletContext;
+ return getPortletManagementBehavior().clonePortlet(clonePortlet);
}
public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws InconsistentParametersFault, MissingParametersFault, InvalidRegistrationFault, OperationFailedFault, RemoteException
{
- DestroyPortletsResponse response = portletManagementBehavior.destroyPortlets(destroyPortlets);
- incrementBehaviorCallCount();
- return response;
+ return getPortletManagementBehavior().destroyPortlets(destroyPortlets);
}
public PortletContext setPortletProperties(SetPortletProperties setPortletProperties) throws OperationFailedFault, InvalidHandleFault, MissingParametersFault, InconsistentParametersFault, InvalidUserCategoryFault, AccessDeniedFault, InvalidRegistrationFault, RemoteException
{
- PortletContext portletContext = portletManagementBehavior.setPortletProperties(setPortletProperties);
- incrementBehaviorCallCount();
- return portletContext;
+ return getPortletManagementBehavior().setPortletProperties(setPortletProperties);
}
public PropertyList getPortletProperties(GetPortletProperties getPortletProperties) throws InvalidHandleFault, MissingParametersFault, InvalidRegistrationFault, AccessDeniedFault, OperationFailedFault, InconsistentParametersFault, InvalidUserCategoryFault, RemoteException
{
- PropertyList list = portletManagementBehavior.getPortletProperties(getPortletProperties);
- incrementBehaviorCallCount();
- return list;
+ return getPortletManagementBehavior().getPortletProperties(getPortletProperties);
}
public PortletPropertyDescriptionResponse getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription) throws MissingParametersFault, InconsistentParametersFault, InvalidUserCategoryFault, InvalidRegistrationFault, AccessDeniedFault, InvalidHandleFault, OperationFailedFault, RemoteException
{
- PortletPropertyDescriptionResponse descriptionResponse = portletManagementBehavior.getPortletPropertyDescription(getPortletPropertyDescription);
- incrementBehaviorCallCount();
- return descriptionResponse;
+ return getPortletManagementBehavior().getPortletPropertyDescription(getPortletPropertyDescription);
}
// Producer implementation ******************************************************************************************
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/V1ConsumerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/V1ConsumerBaseTest.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/V1ConsumerBaseTest.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -26,7 +26,15 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.test.wsrp.WSRPConsumerBaseTest;
+import org.jboss.portal.test.wsrp.framework.BehaviorRegistry;
import org.jboss.portal.test.wsrp.framework.support.ServiceObjectFactory;
+import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicMarkupBehavior;
+import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicPortletManagementBehavior;
+import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicServiceDescriptionBehavior;
+import org.jboss.portal.test.wsrp.v1.consumer.behaviors.EmptyMarkupBehavior;
+import org.jboss.portal.test.wsrp.v1.consumer.behaviors.InitCookieMarkupBehavior;
+import org.jboss.portal.test.wsrp.v1.consumer.behaviors.NullMarkupBehavior;
+import org.jboss.portal.test.wsrp.v1.consumer.behaviors.SessionMarkupBehavior;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -54,6 +62,15 @@
{
super.setUp();
producer.reset();
+ // reset the behaviors
+ BehaviorRegistry registry = producer.getBehaviorRegistry();
+ registry.setPortletManagementBehavior(new BasicPortletManagementBehavior(registry));
+ registry.setServiceDescriptionBehavior(new BasicServiceDescriptionBehavior());
+ registry.registerMarkupBehavior(new BasicMarkupBehavior());
+ registry.registerMarkupBehavior(new EmptyMarkupBehavior());
+ registry.registerMarkupBehavior(new InitCookieMarkupBehavior());
+ registry.registerMarkupBehavior(new NullMarkupBehavior());
+ registry.registerMarkupBehavior(new SessionMarkupBehavior());
// make sure we use clean producer info for each test
consumer.refreshProducerInfo();
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicMarkupBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicMarkupBehavior.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicMarkupBehavior.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -48,7 +48,7 @@
public BasicMarkupBehavior()
{
- portletHandle = PORTLET_HANDLE;
+ handles.add(PORTLET_HANDLE);
}
public String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -23,6 +23,8 @@
package org.jboss.portal.test.wsrp.v1.consumer.behaviors;
+import org.jboss.portal.test.wsrp.framework.BehaviorRegistry;
+import org.jboss.portal.test.wsrp.framework.MarkupBehavior;
import org.jboss.portal.test.wsrp.framework.PortletManagementBehavior;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.WSRPUtils;
@@ -56,7 +58,14 @@
public static final String PROPERTY_VALUE = "value1";
public static final String PROPERTY_NEW_VALUE = "value2";
public static final String CLONED_HANDLE = BasicMarkupBehavior.PORTLET_HANDLE + CLONE_SUFFIX;
+ private BehaviorRegistry registry;
+ public BasicPortletManagementBehavior(BehaviorRegistry registry)
+ {
+ super();
+ this.registry = registry;
+ }
+
public PortletContext clonePortlet(ClonePortlet clonePortlet) throws InvalidUserCategoryFault, AccessDeniedFault,
OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault, InconsistentParametersFault,
MissingParametersFault, RemoteException
@@ -80,24 +89,8 @@
WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getPortletDescription, "GetPortletDescription");
String handle = getHandleFrom(getPortletDescription.getPortletContext(), "GetPortletDescription");
- String suffix;
- if (handle.startsWith(BasicMarkupBehavior.PORTLET_HANDLE)
- || NullMarkupBehavior.PORTLET_HANDLE.equals(handle)
- || EmptyMarkupBehavior.PORTLET_HANDLE.equals(handle)
- || InitCookieMarkupBehavior.PORTLET_HANDLE.equals(handle))
- {
- suffix = "";
- }
- else if (handle.startsWith(SessionMarkupBehavior.PORTLET_HANDLE))
- {
- suffix = "2";
- }
- else
- {
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
- new IllegalArgumentException("Unknown handle '" + handle + "'"));
- }
- return WSRPTypeFactory.createPortletDescriptionResponse(createPortletDescription(handle, suffix));
+ MarkupBehavior markupBehaviorFor = registry.getMarkupBehaviorFor(handle);
+ return WSRPTypeFactory.createPortletDescriptionResponse(markupBehaviorFor.getPortletDescriptionFor(handle));
}
public PropertyList getPortletProperties(GetPortletProperties getPortletProperties) throws InvalidHandleFault, MissingParametersFault, InvalidRegistrationFault, AccessDeniedFault, OperationFailedFault, InconsistentParametersFault, InvalidUserCategoryFault, RemoteException
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/EmptyMarkupBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/EmptyMarkupBehavior.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/EmptyMarkupBehavior.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -41,7 +41,7 @@
public EmptyMarkupBehavior()
{
- portletHandle = PORTLET_HANDLE;
+ handles.add(PORTLET_HANDLE);
}
public String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/InitCookieMarkupBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/InitCookieMarkupBehavior.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/InitCookieMarkupBehavior.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -42,7 +42,7 @@
public InitCookieMarkupBehavior()
{
- portletHandle = PORTLET_HANDLE;
+ handles.add(PORTLET_HANDLE);
}
protected String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup) throws InvalidCookieFault, OperationFailedFault
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/NullMarkupBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/NullMarkupBehavior.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/NullMarkupBehavior.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -41,7 +41,7 @@
public NullMarkupBehavior()
{
- portletHandle = PORTLET_HANDLE;
+ handles.add(PORTLET_HANDLE);
}
public String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/SessionMarkupBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/SessionMarkupBehavior.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/SessionMarkupBehavior.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -52,7 +52,7 @@
public SessionMarkupBehavior()
{
- portletHandle = PORTLET_HANDLE;
+ handles.add(PORTLET_HANDLE);
}
public String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
@@ -92,4 +92,10 @@
markupResponse.setSessionContext(sessionContext);
}
}
+
+
+ protected String getSuffixFor(String handle)
+ {
+ return "2";
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-01-12 23:32:39 UTC (rev 6003)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-01-13 01:42:19 UTC (rev 6004)
@@ -128,6 +128,10 @@
// Check offered portlets
PortletDescription[] offeredPortlets = sd.getOfferedPortlets();
ExtendedAssert.assertNotNull(offeredPortlets);
+ for (int i = 0; i < offeredPortlets.length; i++)
+ {
+ System.out.println("handle " + offeredPortlets[i].getPortletHandle());
+ }
ExtendedAssert.assertEquals(1, offeredPortlets.length);
// Check portlet description
19 years, 3 months
JBoss Portal SVN: r6003 - in trunk: portlet/src/main/org/jboss/portal/portlet/state/consumer and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-12 18:32:39 -0500 (Fri, 12 Jan 2007)
New Revision: 6003
Added:
trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortlet.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortlet.java
Modified:
trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreProducerStatefulPortletInvokerTestCase.java
Log:
-the Portlet returned by getPortlet was not returning the right PortletContext value but rather the one of the portlet originating from the delegate PortletInvoker
- udpated clone test case to test portlet context equality
Modified: trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -39,7 +39,7 @@
/** @see #assertEquals(Object[],Object[]) */
public static void assertEquals(Object[] expected, Object[] actual)
{
- assertEquals(null, (Object[])expected, (Object[])actual);
+ assertEquals(null, expected, actual);
}
/** Test equality as defined by java.util.Array#equals(Object[], Object[]). */
Added: trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortlet.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortlet.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.jboss.portal.portlet.state.consumer;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConsumerPortlet implements Portlet
+{
+
+ /** . */
+ private final PortletContext context;
+
+ /** . */
+ private final Portlet delegate;
+
+ public ConsumerPortlet(PortletContext context, Portlet delegate)
+ {
+ this.context = context;
+ this.delegate = delegate;
+ }
+
+ public PortletContext getContext()
+ {
+ return context;
+ }
+
+ public PortletInfo getInfo()
+ {
+ return delegate.getInfo();
+ }
+
+ public boolean isRemote()
+ {
+ return delegate.isRemote();
+ }
+}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -127,7 +127,8 @@
public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
{
ConsumerContext cpc = getConsumerContext(portletContext);
- return producer.getPortlet(cpc.portletContext);
+ Portlet delegate = producer.getPortlet(cpc.portletContext);
+ return new ConsumerPortlet(portletContext, delegate);
}
public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
Added: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortlet.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortlet.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortlet.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.jboss.portal.portlet.state.producer;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ProducerPortlet implements Portlet
+{
+
+ /** . */
+ private final PortletContext context;
+
+ /** . */
+ private final Portlet delegate;
+
+ public ProducerPortlet(PortletContext context, Portlet delegate)
+ {
+ this.context = context;
+ this.delegate = delegate;
+ }
+
+ public PortletContext getContext()
+ {
+ return context;
+ }
+
+ public PortletInfo getInfo()
+ {
+ return delegate.getInfo();
+ }
+
+ public boolean isRemote()
+ {
+ return delegate.isRemote();
+ }
+}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -142,7 +142,8 @@
try
{
PortletState portletState = stateConverter.unmarshall(state);
- return portletInvoker.getPortlet(PortletContext.createPortletContext(portletState.getPortletId()));
+ Portlet delegate = portletInvoker.getPortlet(PortletContext.createPortletContext(portletState.getPortletId()));
+ return new ProducerPortlet(portletContext, delegate);
}
catch (StateConversionException e)
{
@@ -161,7 +162,8 @@
String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
PortletStateContext stateContext = persistenceManager.loadState(stateId);
PortletState state = stateContext.getState();
- return portletInvoker.getPortlet(PortletContext.createPortletContext(state.getPortletId()));
+ Portlet delegate = portletInvoker.getPortlet(PortletContext.createPortletContext(state.getPortletId()));
+ return new ProducerPortlet(portletContext, delegate);
}
catch (NoSuchStateException e)
{
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -30,6 +30,7 @@
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.support.info.PortletInfoSupport;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -49,6 +50,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Set;
+import java.util.Arrays;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -60,57 +62,57 @@
/**
*
*/
- protected abstract Portlet getPortlet(Object portletRef) throws PortletInvokerException;
+ protected abstract Portlet getPortlet(PortletContext portletRef) throws PortletInvokerException;
/**
*
*/
- protected abstract String getPortletId(Object portletRef) throws PortletInvokerException;
+ protected abstract String getPortletId(PortletContext portletRef) throws PortletInvokerException;
/**
*
*/
- protected abstract Object createPOPRef(PortletSupport portletSupport) throws PortletInvokerException;
+ protected abstract PortletContext createPOPRef(PortletSupport portletSupport) throws PortletInvokerException;
/**
*
*/
- protected abstract Object createNonExistingPOPRef() throws PortletInvokerException;
+ protected abstract PortletContext createNonExistingPOPRef() throws PortletInvokerException;
/**
*
*/
- protected abstract Object createInvalidPOPRef() throws PortletInvokerException;
+ protected abstract PortletContext createInvalidPOPRef() throws PortletInvokerException;
/**
*
*/
- protected abstract Object createLocalClone(Object portletRef) throws Exception;
+ protected abstract PortletContext createLocalClone(PortletContext portletRef) throws Exception;
/**
*
*/
- protected abstract void destroyClone(Object portletRef) throws Exception;
+ protected abstract void destroyClone(PortletContext portletRef) throws Exception;
/**
*
*/
- protected abstract Object createClone(Object portletRef) throws PortletInvokerException;
+ protected abstract PortletContext createClone(PortletContext portletRef) throws PortletInvokerException;
/**
*
*/
- protected abstract Object setProperties(Object portletRef, PropertyChange[] changes) throws PortletInvokerException;
+ protected abstract PortletContext setProperties(PortletContext portletRef, PropertyChange[] changes) throws PortletInvokerException;
/**
*
*/
- protected abstract PropertyMap getProperties(Object portletRef) throws PortletInvokerException;
+ protected abstract PropertyMap getProperties(PortletContext portletRef) throws PortletInvokerException;
/**
*
*/
- protected abstract PropertyMap getProperties(Object portletRef, Set keys) throws PortletInvokerException;
+ protected abstract PropertyMap getProperties(PortletContext portletRef, Set keys) throws PortletInvokerException;
/**
*
@@ -130,22 +132,22 @@
/**
*
*/
- protected abstract ActionInvocation createAction(Object portletRef, AccessMode accessMode);
+ protected abstract ActionInvocation createAction(PortletContext portletRef, AccessMode accessMode);
/**
*
*/
- protected abstract Object getImplicitClonedRef(ActionInvocation action);
+ protected abstract PortletContext getImplicitClonedRef(ActionInvocation action);
/**
*
*/
- protected abstract Object getModifiedPortletRef(ActionInvocation action);
+ protected abstract PortletContext getModifiedPortletRef(ActionInvocation action);
/**
*
*/
- protected final Object createPOPRef(PortletInfoSupport portletInfo) throws PortletInvokerException
+ protected final PortletContext createPOPRef(PortletInfoSupport portletInfo) throws PortletInvokerException
{
PortletSupport portletSupport = new PortletSupport(portletInfo);
return createPOPRef(portletSupport);
@@ -154,19 +156,19 @@
/**
*
*/
- protected final Object createLocalCCPRef() throws Exception
+ protected final PortletContext createLocalCCPRef() throws Exception
{
- Object popCtx = createPOPRef();
+ PortletContext popCtx = createPOPRef();
return createLocalClone(popCtx);
}
/**
*
*/
- protected final Object createNonExistingLocalCCPRef() throws Exception
+ protected final PortletContext createNonExistingLocalCCPRef() throws Exception
{
- Object popRef = createPOPRef();
- Object ccpRef = createLocalClone(popRef);
+ PortletContext popRef = createPOPRef();
+ PortletContext ccpRef = createLocalClone(popRef);
destroyClone(ccpRef);
return ccpRef;
}
@@ -174,7 +176,7 @@
/**
*
*/
- protected final Object createPOPRef() throws PortletInvokerException
+ protected final PortletContext createPOPRef() throws PortletInvokerException
{
PortletInfoSupport info = new PortletInfoSupport();
return createPOPRef(info);
@@ -195,7 +197,7 @@
public void testCloneNonExistingPOP() throws Exception
{
- Object popCtx = createNonExistingPOPRef();
+ PortletContext popCtx = createNonExistingPOPRef();
try
{
createClone(popCtx);
@@ -209,7 +211,7 @@
public void testCloneNonExistingCCP() throws Exception
{
- Object ccpCtx = createNonExistingLocalCCPRef();
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
try
{
createClone(ccpCtx);
@@ -237,7 +239,7 @@
public void testCloneInvalidPOP() throws Exception
{
- Object popCtx = createInvalidPOPRef();
+ PortletContext popCtx = createInvalidPOPRef();
try
{
createClone(popCtx);
@@ -255,8 +257,8 @@
info.getMetaSupport().setDisplayName("MyPortlet");
info.getPreferencesSupport().addPreference("abc", new StringValue("def"));
- Object popCtx = createPOPRef(info);
- Object ccp1Ctx = createClone(popCtx);
+ PortletContext popCtx = createPOPRef(info);
+ PortletContext ccp1Ctx = createClone(popCtx);
// Check state
PropertyMap expected = new SimplePropertyMap();
@@ -268,13 +270,14 @@
Portlet ccp1 = getPortlet(ccp1Ctx);
LocalizedString abc = ccp1.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
assertEquals("MyPortlet", abc.getString(Locale.ENGLISH, true));
+ assertEquals(ccp1Ctx, ccp1.getContext());
// Update state
PropertyChange[] changes = new PropertyChange[]{PropertyChange.newUpdate("ghi", new StringValue("jkl"))};
ccp1Ctx = setProperties(ccp1Ctx, changes);
// Clone a CCP
- Object ccp2Ctx = createClone(ccp1Ctx);
+ PortletContext ccp2Ctx = createClone(ccp1Ctx);
// Check state
expected = new SimplePropertyMap();
@@ -303,7 +306,7 @@
public void testGetNonExistingPOP() throws Exception
{
- Object pop = createNonExistingPOPRef();
+ PortletContext pop = createNonExistingPOPRef();
try
{
getPortlet(pop);
@@ -316,7 +319,7 @@
public void testGetNonExistingCCP() throws Exception
{
- Object ccpCtx = createNonExistingLocalCCPRef();
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
try
{
getPortlet(ccpCtx);
@@ -329,7 +332,7 @@
public void testGetInvalidPOP() throws Exception
{
- Object popCtx = createInvalidPOPRef();
+ PortletContext popCtx = createInvalidPOPRef();
try
{
getPortlet(popCtx);
@@ -367,7 +370,7 @@
public void testDestroyPOP() throws Exception
{
- Object popCtx = createPOPRef();
+ PortletContext popCtx = createPOPRef();
List failures = destroyClones(Collections.singletonList(popCtx));
assertEquals(1, failures.size());
DestroyCloneFailure failure = (DestroyCloneFailure)failures.get(0);
@@ -376,8 +379,8 @@
public void testDestroyCCP() throws Exception
{
- Object popCtx = createPOPRef();
- Object ccpCtx = createClone(popCtx);
+ PortletContext popCtx = createPOPRef();
+ PortletContext ccpCtx = createClone(popCtx);
List failures = destroyClones(Collections.singletonList(ccpCtx));
assertEquals(0, failures.size());
assertNoExistingState();
@@ -394,7 +397,7 @@
public void testDestroyNonExistingCCP() throws Exception
{
- Object ccpCtx = createNonExistingLocalCCPRef();
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
List failures = destroyClones(Collections.singletonList(ccpCtx));
assertEquals(1, failures.size());
DestroyCloneFailure failure = (DestroyCloneFailure)failures.get(0);
@@ -423,7 +426,7 @@
public void testGetNonExistingPOPProperties() throws Exception
{
- Object popCtx = createNonExistingPOPRef();
+ PortletContext popCtx = createNonExistingPOPRef();
try
{
getProperties(popCtx);
@@ -444,7 +447,7 @@
public void testGetInvalidPOPProperties() throws Exception
{
- Object popCtx = createInvalidPOPRef();
+ PortletContext popCtx = createInvalidPOPRef();
try
{
getProperties(popCtx);
@@ -465,7 +468,7 @@
public void testGetNonExistingCCPProperties() throws Exception
{
- Object ccpCtx = createNonExistingLocalCCPRef();
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
try
{
getProperties(ccpCtx);
@@ -507,7 +510,7 @@
public void testGetPOPWithNullKeys() throws Exception
{
- Object popCtx = createPOPRef();
+ PortletContext popCtx = createPOPRef();
try
{
getProperties(popCtx, null);
@@ -520,7 +523,7 @@
public void testGetCCPWithNullKeys() throws Exception
{
- Object ccpCtx = createLocalCCPRef();
+ PortletContext ccpCtx = createLocalCCPRef();
try
{
getProperties(ccpCtx, null);
@@ -536,7 +539,7 @@
PortletInfoSupport info = new PortletInfoSupport();
info.getPreferencesSupport().addPreference("abc", new StringValue("def"));
info.getPreferencesSupport().addPreference("ghi", new StringValue("jkl"), Boolean.TRUE);
- Object popCtx = createPOPRef(info);
+ PortletContext popCtx = createPOPRef(info);
//
PropertyMap props = getProperties(popCtx);
@@ -559,10 +562,10 @@
info.getPreferencesSupport().addPreference("ghi", new StringValue("jkl"));
info.getPreferencesSupport().addPreference("mno", new StringValue("pqr"), Boolean.TRUE);
info.getPreferencesSupport().addPreference("stu", new StringValue("vwx"), Boolean.TRUE);
- Object popCtx = createPOPRef(info);
+ PortletContext popCtx = createPOPRef(info);
//
- Object ccpCtx = createClone(popCtx);
+ PortletContext ccpCtx = createClone(popCtx);
ccpCtx = setProperties(ccpCtx, new PropertyChange[]{
PropertyChange.newUpdate("abc", new StringValue("_def")),
PropertyChange.newReset("gho"),
@@ -600,7 +603,7 @@
public void testSetPropertiesWithNullProperties() throws Exception
{
- Object ccpCtx = createLocalCCPRef();
+ PortletContext ccpCtx = createLocalCCPRef();
try
{
setProperties(ccpCtx, null);
@@ -613,7 +616,7 @@
public void testSetPOPProperties() throws Exception
{
- Object popCtx = createPOPRef();
+ PortletContext popCtx = createPOPRef();
try
{
setProperties(popCtx, new PropertyChange[0]);
@@ -626,7 +629,7 @@
public void testSetNonExistingCCPProperties() throws Exception
{
- Object ccpCtx = createNonExistingLocalCCPRef();
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
try
{
setProperties(ccpCtx, new PropertyChange[0]);
@@ -644,10 +647,10 @@
info.getPreferencesSupport().addPreference("override_reset", new StringValue("override_reset_portlet_value"));
info.getPreferencesSupport().addPreference("override_create", new StringValue("override_create_portlet_value"));
info.getPreferencesSupport().addPreference("readonly_create", new StringValue("readonly_create_portlet_value"), Boolean.TRUE);
- Object popCtx = createPOPRef(info);
+ PortletContext popCtx = createPOPRef(info);
//
- Object ccpCtx = createClone(popCtx);
+ PortletContext ccpCtx = createClone(popCtx);
ccpCtx = setProperties(ccpCtx, new PropertyChange[]{
PropertyChange.newUpdate("override_update", new StringValue("override_update_clone_value")),
PropertyChange.newUpdate("override_reset", new StringValue("override_reset_clone_value")),
@@ -704,14 +707,14 @@
return null;
}
};
- Object popCtx = createPOPRef(portletSupport);
+ PortletContext popCtx = createPOPRef(portletSupport);
//
ActionInvocation invocation = createAction(popCtx, AccessMode.CLONE_BEFORE_WRITE);
invoke(invocation);
//
- Object cloneRef = getImplicitClonedRef(invocation);
+ PortletContext cloneRef = getImplicitClonedRef(invocation);
assertNotNull(cloneRef);
//
@@ -744,7 +747,7 @@
}
}
};
- Object popCtx = createPOPRef(portletSupport);
+ PortletContext popCtx = createPOPRef(portletSupport);
//
ActionInvocation invocation = createAction(popCtx, AccessMode.READ_ONLY);
@@ -769,8 +772,8 @@
return null;
}
};
- Object popCtx = createPOPRef(portletSupport);
- Object ccpCtx = createClone(popCtx);
+ PortletContext popCtx = createPOPRef(portletSupport);
+ PortletContext ccpCtx = createClone(popCtx);
//
ActionInvocation invocation = createAction(ccpCtx, AccessMode.READ_WRITE);
@@ -786,4 +789,32 @@
expectedProps.setProperty("abc", new StringValue("_def"));
ValueMapAssert.assertEquals(expectedProps, blah);
}
+
+ private void assertEquals(PortletContext expected, PortletContext actual)
+ {
+ if (expected == null)
+ {
+ assertNull("Portlet context should be null", actual);
+ }
+ else
+ {
+ assertNotNull("Portlet context should not be null but rather equals to " + expected, actual);
+
+ // Test handle first
+ assertEquals(expected.getId(), actual.getId());
+
+ // Compare bytes
+ byte[] expectedState = expected.getState();
+ byte[] actualState = actual.getState();
+ if (expectedState == null)
+ {
+ assertNull("Actual state should be null", actualState);
+ }
+ else
+ {
+ assertNotNull("Actual state should be not null", actualState);
+ assertTrue(Arrays.equals(expectedState, actualState));
+ }
+ }
+ }
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -106,19 +106,19 @@
consumer.setProducer(producer);
}
- protected Portlet getPortlet(Object portletRef) throws PortletInvokerException
+ protected Portlet getPortlet(PortletContext portletRef) throws PortletInvokerException
{
return consumer.getPortlet((PortletContext)portletRef);
}
- protected Object createPOPRef(PortletSupport portletSupport) throws PortletInvokerException
+ protected PortletContext createPOPRef(PortletSupport portletSupport) throws PortletInvokerException
{
container.addPortlet("PortletId", portletSupport);
Portlet portlet = getSinglePOP();
return portlet.getContext();
}
- protected Object createNonExistingPOPRef() throws PortletInvokerException
+ protected PortletContext createNonExistingPOPRef() throws PortletInvokerException
{
container.addPortlet("NonExistingPortletId", new PortletInfoSupport());
PortletContext popContext = getSinglePOP().getContext();
@@ -126,7 +126,7 @@
return popContext;
}
- protected Object createInvalidPOPRef() throws PortletInvokerException
+ protected PortletContext createInvalidPOPRef() throws PortletInvokerException
{
container.addPortlet("InvalidPortletId", new PortletInfoSupport());
PortletContext popContext = getSinglePOP().getContext();
@@ -134,7 +134,7 @@
return popContext;
}
- protected Object createLocalClone(Object portletRef) throws Exception
+ protected PortletContext createLocalClone(PortletContext portletRef) throws Exception
{
stateManagementPolicy.setPersistLocally(true);
PortletContext cloneRef = consumer.createClone((PortletContext)portletRef);
@@ -142,7 +142,7 @@
return cloneRef;
}
- protected void destroyClone(Object portletRef) throws Exception
+ protected void destroyClone(PortletContext portletRef) throws Exception
{
assertEquals(Collections.EMPTY_LIST, consumer.destroyClones(Collections.singletonList(portletRef)));
}
@@ -152,23 +152,23 @@
// todo
}
- protected Object createClone(Object portletRef) throws PortletInvokerException
+ protected PortletContext createClone(PortletContext portletRef) throws PortletInvokerException
{
return consumer.createClone((PortletContext)portletRef);
}
- protected Object setProperties(Object portletRef, PropertyChange[] changes) throws PortletInvokerException
+ protected PortletContext setProperties(PortletContext portletRef, PropertyChange[] changes) throws PortletInvokerException
{
consumer.setProperties((PortletContext)portletRef, changes);
return portletRef;
}
- protected PropertyMap getProperties(Object portletRef) throws PortletInvokerException
+ protected PropertyMap getProperties(PortletContext portletRef) throws PortletInvokerException
{
return consumer.getProperties((PortletContext)portletRef);
}
- protected PropertyMap getProperties(Object portletRef, Set keys) throws PortletInvokerException
+ protected PropertyMap getProperties(PortletContext portletRef, Set keys) throws PortletInvokerException
{
return consumer.getProperties((PortletContext)portletRef, keys);
}
@@ -178,7 +178,7 @@
return consumer.destroyClones(portletRefs);
}
- protected String getPortletId(Object portletRef) throws PortletInvokerException
+ protected String getPortletId(PortletContext portletRef) throws PortletInvokerException
{
return ((PortletContext)portletRef).getId();
}
@@ -188,7 +188,7 @@
consumer.invoke(invocation);
}
- protected ActionInvocation createAction(Object portletRef, AccessMode accessMode)
+ protected ActionInvocation createAction(PortletContext portletRef, AccessMode accessMode)
{
ActionContextImpl actionCtx = new ActionContextImpl();
InstanceContextImpl instanceCtx = new InstanceContextImpl("blah", accessMode);
@@ -200,15 +200,15 @@
return action;
}
- protected Object getImplicitClonedRef(ActionInvocation action)
+ protected PortletContext getImplicitClonedRef(ActionInvocation action)
{
InstanceContextImpl instanceCtx = (InstanceContextImpl)action.getInstanceContext();
return instanceCtx.getClonedContext();
}
- protected Object getModifiedPortletRef(ActionInvocation action)
+ protected PortletContext getModifiedPortletRef(ActionInvocation action)
{
- return action.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ return (PortletContext)action.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
}
private Portlet getSinglePOP() throws PortletInvokerException
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.PortletContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -36,8 +37,8 @@
super(true);
}
- protected Object getModifiedPortletRef(ActionInvocation action)
+ protected PortletContext getModifiedPortletRef(ActionInvocation action)
{
- return action.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ return (PortletContext)action.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -97,14 +97,14 @@
assertEquals(0, persistenceManager.getSize());
}
- protected Object createPOPRef(PortletSupport portletSupport) throws PortletInvokerException
+ protected PortletContext createPOPRef(PortletSupport portletSupport) throws PortletInvokerException
{
container.addPortlet("PortletId", portletSupport);
Portlet portlet = getSinglePOP();
return portlet.getContext();
}
- protected Object createNonExistingPOPRef()
+ protected PortletContext createNonExistingPOPRef()
{
container.addPortlet("NonExistingPortletId", new PortletInfoSupport());
PortletContext popCtx = getSinglePOP().getContext();
@@ -112,7 +112,7 @@
return popCtx;
}
- protected Object createInvalidPOPRef()
+ protected PortletContext createInvalidPOPRef()
{
container.addPortlet("InvalidPortletId", new PortletInfoSupport());
PortletContext popCtx = getSinglePOP().getContext();
@@ -120,7 +120,7 @@
return popCtx;
}
- protected Object createLocalClone(Object portletRef) throws Exception
+ protected PortletContext createLocalClone(PortletContext portletRef) throws Exception
{
stateManagementPolicy.setPersistLocally(true);
PortletContext cloneContext = producer.createClone((PortletContext)portletRef);
@@ -128,27 +128,27 @@
return cloneContext;
}
- protected void destroyClone(Object portletRef) throws Exception
+ protected void destroyClone(PortletContext portletRef) throws Exception
{
assertEquals(Collections.EMPTY_LIST, producer.destroyClones(Collections.singletonList(portletRef)));
}
- protected Object createClone(Object portletRef) throws PortletInvokerException
+ protected PortletContext createClone(PortletContext portletRef) throws PortletInvokerException
{
return producer.createClone((PortletContext)portletRef);
}
- protected Object setProperties(Object portletRef, PropertyChange[] changes) throws PortletInvokerException
+ protected PortletContext setProperties(PortletContext portletRef, PropertyChange[] changes) throws PortletInvokerException
{
return producer.setProperties((PortletContext)portletRef, changes);
}
- protected PropertyMap getProperties(Object portletRef) throws PortletInvokerException
+ protected PropertyMap getProperties(PortletContext portletRef) throws PortletInvokerException
{
return producer.getProperties((PortletContext)portletRef);
}
- protected PropertyMap getProperties(Object portletRef, Set keys) throws PortletInvokerException
+ protected PropertyMap getProperties(PortletContext portletRef, Set keys) throws PortletInvokerException
{
return producer.getProperties((PortletContext)portletRef, keys);
}
@@ -158,7 +158,7 @@
return producer.destroyClones(portletRefs);
}
- protected Portlet getPortlet(Object portletRef) throws PortletInvokerException
+ protected Portlet getPortlet(PortletContext portletRef) throws PortletInvokerException
{
if (portletRef == null)
{
@@ -170,7 +170,7 @@
}
}
- protected String getPortletId(Object portletRef) throws PortletInvokerException
+ protected String getPortletId(PortletContext portletRef) throws PortletInvokerException
{
return ((PortletContext)portletRef).getId();
}
@@ -180,7 +180,7 @@
producer.invoke(invocation);
}
- protected ActionInvocation createAction(Object portletRef, AccessMode accessMode)
+ protected ActionInvocation createAction(PortletContext portletRef, AccessMode accessMode)
{
ActionContextImpl actionCtx = new ActionContextImpl();
InstanceContextImpl instanceCtx = new InstanceContextImpl("blah", accessMode);
@@ -192,7 +192,7 @@
return action;
}
- protected Object getImplicitClonedRef(ActionInvocation action)
+ protected PortletContext getImplicitClonedRef(ActionInvocation action)
{
InstanceContextImpl instanceCtx = (InstanceContextImpl)action.getInstanceContext();
return instanceCtx.getClonedContext();
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreProducerStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreProducerStatefulPortletInvokerTestCase.java 2007-01-11 15:40:53 UTC (rev 6002)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreProducerStatefulPortletInvokerTestCase.java 2007-01-12 23:32:39 UTC (rev 6003)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.test.InstanceContextImpl;
+import org.jboss.portal.portlet.PortletContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -36,7 +37,7 @@
super(false);
}
- protected Object getModifiedPortletRef(ActionInvocation action)
+ protected PortletContext getModifiedPortletRef(ActionInvocation action)
{
InstanceContextImpl instanceCtx = (InstanceContextImpl)action.getInstanceContext();
return instanceCtx.getModifiedContext();
19 years, 3 months
JBoss Portal SVN: r6002 - tags.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-11 10:40:53 -0500 (Thu, 11 Jan 2007)
New Revision: 6002
Added:
tags/JBoss_Portal_2_6_0_ALPHA1/
Log:
tagging 2.6 alpha
Copied: tags/JBoss_Portal_2_6_0_ALPHA1 (from rev 6001, trunk)
19 years, 3 months
JBoss Portal SVN: r6001 - tags.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-11 10:40:24 -0500 (Thu, 11 Jan 2007)
New Revision: 6001
Removed:
tags/JBoss_Portal_2_6_0_ALPHA1/
Log:
tagging 2.6 alpha
19 years, 3 months
JBoss Portal SVN: r6000 - in trunk/workflow/src/resources/portal-workflow-sar/conf: hibernate and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-11 10:35:54 -0500 (Thu, 11 Jan 2007)
New Revision: 6000
Added:
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/ehcache.xml
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml
Removed:
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate.cfg.xml
Log:
moving hibernate config to proper location
Added: trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/ehcache.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/ehcache.xml 2007-01-11 15:34:39 UTC (rev 5999)
+++ trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/ehcache.xml 2007-01-11 15:35:54 UTC (rev 6000)
@@ -0,0 +1,61 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<ehcache>
+
+ <!-- Sets the path to the directory where cache .data files are created.
+
+ If the path is a Java System Property it is replaced by
+ its value in the running VM.
+
+ The following properties are translated:
+ user.home - User's home directory
+ user.dir - User's current working directory
+ java.io.tmpdir - Default temp file path -->
+ <diskStore path="java.io.tmpdir/workflow"/>
+
+
+ <!--Default Cache configuration. These will applied to caches programmatically created through
+ the CacheManager.
+
+ The following attributes are required for defaultCache:
+
+ maxInMemory - Sets the maximum number of objects that will be created in memory
+ eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
+ is never expired.
+ timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
+ if the element is not eternal. Idle time is now - last accessed time
+ timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
+ if the element is not eternal. TTL is now - creation time
+ overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
+ has reached the maxInMemory limit.
+
+ -->
+ <defaultCache
+ maxElementsInMemory="10000"
+ eternal="false"
+ timeToIdleSeconds="120"
+ timeToLiveSeconds="120"
+ overflowToDisk="false"
+ />
+</ehcache>
Added: trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-01-11 15:34:39 UTC (rev 5999)
+++ trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-01-11 15:35:54 UTC (rev 6000)
@@ -0,0 +1,170 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <!-- jdbc connection properties -->
+ <property name="connection.datasource">java:@portal.datasource.name@</property>
+
+ <!-- other hibernate properties -->
+ <property name="show_sql">@portal.sql.show@</property>
+ <property name="hibernate.format_sql">true</property>
+ <property name="hibernate.use_sql_comments">true</property>
+
+ <!-- caching properties -->
+ <property name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">true</property>
+ <property name="cache.provider_configuration_file_resource_path">conf/hibernate/cms/ehcache.xml</property>
+ <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+
+ <!-- managed environment transaction configuration -->
+ <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
+ <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
+
+ <!-- ############################################ -->
+ <!-- # mapping files with external dependencies # -->
+ <!-- ############################################ -->
+
+ <!-- following mapping file has a dependendy on -->
+ <!-- 'bsh-{version}.jar'. -->
+ <!-- uncomment this if you don't have bsh on your -->
+ <!-- classpath. you won't be able to use the -->
+ <!-- script element in process definition files -->
+ <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+ <!-- following mapping files have a dependendy on -->
+ <!-- 'jbpm-identity-{version}.jar', mapping files -->
+ <!-- of the pluggable jbpm identity component. -->
+ <!-- comment out the following 3 lines if you don't-->
+ <!-- want to use the default jBPM identity mgmgt -->
+ <!-- component -->
+ <mapping resource="org/jbpm/identity/User.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
+
+ <!-- ###################### -->
+ <!-- # jbpm mapping files # -->
+ <!-- ###################### -->
+
+ <!-- hql queries and type defs -->
+ <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
+
+ <!-- graph.def mapping files -->
+ <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+ <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+ <!-- graph.node mapping files -->
+ <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+ <!-- context.def mapping files -->
+ <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+ <!-- taskmgmt.def mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+ <!-- module.def mapping files -->
+ <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+ <!-- bytes mapping files -->
+ <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+ <!-- file.def mapping files -->
+ <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+ <!-- scheduler.def mapping files -->
+ <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+ <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+ <!-- graph.exe mapping files -->
+ <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+ <!-- module.exe mapping files -->
+ <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+ <!-- context.exe mapping files -->
+ <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+ <!-- msg.db mapping files -->
+ <mapping resource="org/jbpm/msg/Message.hbm.xml"/>
+ <mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteActionCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/SignalCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml"/>
+
+ <!-- taskmgmt.exe mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+ <!-- scheduler.exe mapping files -->
+ <mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml"/>
+
+ <!-- logging mapping files -->
+ <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
+
+ </session-factory>
+</hibernate-configuration>
Deleted: trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate.cfg.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate.cfg.xml 2007-01-11 15:34:39 UTC (rev 5999)
+++ trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate.cfg.xml 2007-01-11 15:35:54 UTC (rev 6000)
@@ -1,166 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
- <!-- jdbc connection properties -->
- <property name="connection.datasource">java:@portal.datasource.name@</property>
-
- <!-- other hibernate properties -->
- <property name="show_sql">@portal.sql.show@</property>
- <property name="hibernate.format_sql">true</property>
- <property name="hibernate.use_sql_comments">true</property>
-
- <!-- managed environment transaction configuration -->
- <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
- <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
-
- <!--property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property-->
-
- <!-- ############################################ -->
- <!-- # mapping files with external dependencies # -->
- <!-- ############################################ -->
-
- <!-- following mapping file has a dependendy on -->
- <!-- 'bsh-{version}.jar'. -->
- <!-- uncomment this if you don't have bsh on your -->
- <!-- classpath. you won't be able to use the -->
- <!-- script element in process definition files -->
- <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
-
- <!-- following mapping files have a dependendy on -->
- <!-- 'jbpm-identity-{version}.jar', mapping files -->
- <!-- of the pluggable jbpm identity component. -->
- <!-- comment out the following 3 lines if you don't-->
- <!-- want to use the default jBPM identity mgmgt -->
- <!-- component -->
- <mapping resource="org/jbpm/identity/User.hbm.xml"/>
- <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
- <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
-
- <!-- ###################### -->
- <!-- # jbpm mapping files # -->
- <!-- ###################### -->
-
- <!-- hql queries and type defs -->
- <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
-
- <!-- graph.def mapping files -->
- <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
- <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
-
- <!-- graph.node mapping files -->
- <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
-
- <!-- context.def mapping files -->
- <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
- <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
-
- <!-- taskmgmt.def mapping files -->
- <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
-
- <!-- module.def mapping files -->
- <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
-
- <!-- bytes mapping files -->
- <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
-
- <!-- file.def mapping files -->
- <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
-
- <!-- scheduler.def mapping files -->
- <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
- <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
-
- <!-- graph.exe mapping files -->
- <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
- <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
- <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
- <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
-
- <!-- module.exe mapping files -->
- <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
-
- <!-- context.exe mapping files -->
- <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
-
- <!-- msg.db mapping files -->
- <mapping resource="org/jbpm/msg/Message.hbm.xml"/>
- <mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml"/>
- <mapping resource="org/jbpm/command/ExecuteActionCommand.hbm.xml"/>
- <mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml"/>
- <mapping resource="org/jbpm/command/SignalCommand.hbm.xml"/>
- <mapping resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml"/>
-
- <!-- taskmgmt.exe mapping files -->
- <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
-
- <!-- scheduler.exe mapping files -->
- <mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml"/>
-
- <!-- logging mapping files -->
- <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
- <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
- <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
-
- </session-factory>
-</hibernate-configuration>
19 years, 3 months
JBoss Portal SVN: r5999 - in trunk/build/ide/intellij/idea60/modules: workflow and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-11 10:34:39 -0500 (Thu, 11 Jan 2007)
New Revision: 5999
Added:
trunk/build/ide/intellij/idea60/modules/workflow/
trunk/build/ide/intellij/idea60/modules/workflow/workflow.iml
Log:
adding workflow module
Added: trunk/build/ide/intellij/idea60/modules/workflow/workflow.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/workflow/workflow.iml 2007-01-11 14:28:05 UTC (rev 5998)
+++ trunk/build/ide/intellij/idea60/modules/workflow/workflow.iml 2007-01-11 15:34:39 UTC (rev 5999)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../workflow">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../workflow/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="common" />
+ <orderEntry type="module-library" exported="">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbpm/lib/jbpm-3.1.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="jems" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/servlet-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/junit/lib/junit.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
19 years, 3 months
JBoss Portal SVN: r5998 - tags.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-11 09:28:05 -0500 (Thu, 11 Jan 2007)
New Revision: 5998
Added:
tags/JBoss_Portal_2_6_0_ALPHA1/
Log:
tagging 2.6 alpha
Copied: tags/JBoss_Portal_2_6_0_ALPHA1 (from rev 5997, trunk)
19 years, 3 months
JBoss Portal SVN: r5997 - docs/tags/JBoss_Portal_2_6_0_ALPHA1.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-11 08:58:08 -0500 (Thu, 11 Jan 2007)
New Revision: 5997
Added:
docs/tags/JBoss_Portal_2_6_0_ALPHA1/trunk/
Log:
tagging 2.6 alpha
Copied: docs/tags/JBoss_Portal_2_6_0_ALPHA1/trunk (from rev 5996, docs/trunk)
19 years, 3 months
JBoss Portal SVN: r5996 - trunk/build.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-11 08:23:40 -0500 (Thu, 11 Jan 2007)
New Revision: 5996
Modified:
trunk/build/distrib.xml
Log:
updating output dir for the build
Modified: trunk/build/distrib.xml
===================================================================
--- trunk/build/distrib.xml 2007-01-11 13:21:36 UTC (rev 5995)
+++ trunk/build/distrib.xml 2007-01-11 13:23:40 UTC (rev 5996)
@@ -1,7 +1,7 @@
<project default="main" name="JBoss Portal">
<property name="source.dir" value="../../jboss-portal-2.6"/>
- <property name="release.version" value="2.6-DR1"/>
+ <property name="release.version" value="2.6-ALPHA1"/>
<!-- -->
<property name="portal.release.normal.name" value="jboss-portal-${release.version}"/>
19 years, 3 months
JBoss Portal SVN: r5995 - tags.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-11 08:21:36 -0500 (Thu, 11 Jan 2007)
New Revision: 5995
Removed:
tags/JBoss_Portal_2_6_0_ALPHA1/
Log:
tagging 2.6 alpha
19 years, 3 months