Author: julien(a)jboss.com
Date: 2007-02-12 11:34:52 -0500 (Mon, 12 Feb 2007)
New Revision: 6216
Modified:
trunk/core/build.xml
trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml
Log:
- handle the registration integration of the portlet state tests as a test parameter
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-02-12 15:43:00 UTC (rev 6215)
+++ trunk/core/build.xml 2007-02-12 16:34:52 UTC (rev 6216)
@@ -536,8 +536,10 @@
<execute-tests>
<x-sysproperty>
+<!--
<jvmarg value="-Xdebug"/>
<jvmarg
value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
+-->
<sysproperty
key="jboss.aop.path"
@@ -577,8 +579,13 @@
<parameter name="CacheNaturalId" value="true"/>
</zest>
<zest todir="${test.reports}"
name="org.jboss.portal.test.core.state.ProducerTestCase"
- outfile="TEST-ProducerTestCase">
+ outfile="TEST-ProducerTestCase-WithoutRegistration">
+ <parameter name="UseRegistration"
value="false"/>
</zest>
+ <zest todir="${test.reports}"
name="org.jboss.portal.test.core.state.ProducerTestCase"
+ outfile="TEST-ProducerTestCase-WithRegistration">
+ <parameter name="UseRegistration"
value="true"/>
+ </zest>
<zest todir="${test.reports}"
name="org.jboss.portal.test.core.state.RegistrationPersistenceManagerTestCase"
outfile="TEST-RegistrationPersistenceManagerTestCase">
</zest>
Modified: trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2007-02-12
15:43:00 UTC (rev 6215)
+++ trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2007-02-12
16:34:52 UTC (rev 6216)
@@ -109,7 +109,7 @@
}
/** Whether we test registration or not. */
- private boolean userRegistration;
+ private boolean useRegistration;
/** . */
private TestRuntimeContext runtimeContext;
@@ -123,20 +123,33 @@
/** . */
private PersistentPortletStatePersistenceManager persistenceManager;
- /** . */
+ /** The producer. */
private ProducerPortletInvoker producer;
- /** . */
+ /** The portlet container. */
private PortletInvokerSupport portletContainer;
- /** . */
- private PortletInvoker portletInvoker;
+ /** The consumer portlet invoker. */
+ private PortletInvoker consumer;
+ /** The registration id created during the setup. */
+ private String registrationId;
+
public String getName()
{
return super.getName() + ",ds=" + dataSourceConfigParameter.getName();
}
+ public String getUseRegistrationParameter()
+ {
+ return Boolean.toString(useRegistration);
+ }
+
+ public void setUseRegistrationParameter(String useRegistrationParameter)
+ {
+ this.useRegistration = Boolean.valueOf(useRegistrationParameter).booleanValue();
+ }
+
public HibernateSupport getHibernateSupport()
{
return hibernateSupport;
@@ -187,14 +200,14 @@
this.dataSourceConfigParameter = dataSourceConfigParameter;
}
- public PortletInvoker getPortletInvoker()
+ public PortletInvoker getConsumer()
{
- return portletInvoker;
+ return consumer;
}
- public void setPortletInvoker(PortletInvoker portletInvoker)
+ public void setConsumer(PortletInvoker consumer)
{
- this.portletInvoker = portletInvoker;
+ this.consumer = consumer;
}
public void setUp() throws Exception
@@ -271,6 +284,21 @@
throw new RuntimeException("custom_message");
}
});
+
+ // Create registration
+ if (useRegistration)
+ {
+ beginTX();
+ ConsumerGroup cg = persistenceManager.createConsumerGroup("CG");
+ Consumer consumer = persistenceManager.createConsumer("fooConsumer",
"fooConsumer");
+ cg.addConsumer(consumer);
+ Map registrationProperties = new HashMap();
+ registrationProperties.put(new QName("prop1"), "value1");
+ registrationProperties.put(new QName("prop2"), "value2");
+ Registration reg =
persistenceManager.addRegistrationFor("fooConsumer", registrationProperties);
+ registrationId = reg.getId();
+ commitTX();
+ }
}
public void tearDown() throws Exception
@@ -284,9 +312,9 @@
private PortletContext clonePortlet(PortletContext context) throws
PortletInvokerException
{
- TransactionAssert.beginTransaction();
- PortletContext cloneCtx = portletInvoker.createClone(context);
- TransactionAssert.commitTransaction();
+ beginTX();
+ PortletContext cloneCtx = consumer.createClone(context);
+ commitTX();
return cloneCtx;
}
@@ -294,13 +322,13 @@
{
try
{
- TransactionAssert.beginTransaction();
-
portletInvoker.createClone(PortletContext.createPortletContext("UnknownPortlet"));
+ beginTX();
+
consumer.createClone(PortletContext.createPortletContext("UnknownPortlet"));
fail("Was expecting no such portlet exception");
}
catch (NoSuchPortletException e)
{
- TransactionAssert.rollbackTransaction(true);
+ rollbackTX();
}
// todo check state
@@ -319,99 +347,56 @@
// todo check state
}
- public void testABC()
+ public void beginTX()
{
TransactionAssert.beginTransaction();
- Session session = hibernateSupport.getCurrentSession();
- PersistentConsumer consumer = new PersistentConsumer("myconsumer",
"myconsumer");
- session.persist(consumer);
- Long consumerPK = consumer.getKey();
- TransactionAssert.commitTransaction();
-
- TransactionAssert.beginTransaction();
- session = hibernateSupport.getCurrentSession();
- consumer = (PersistentConsumer)session.get(PersistentConsumer.class, consumerPK);
- HashMap properties = new HashMap();
- properties.put(new QName("a", "b"), "abc");
- properties.put(new QName("b"), "def");
- PersistentRegistration reg = new PersistentRegistration(properties,
RegistrationStatus.PENDING);
- reg.setPersistentHandle("handle");
- reg.setRelatedConsumer(consumer);
- consumer.getRelatedRegistrations().add(reg);
- session.persist(reg);
- session.flush();
- TransactionAssert.commitTransaction();
}
- private String createrRegistration() throws Exception
+ public void beginRegistrationScopedTX()
{
- Map registrationProperties = new HashMap();
- registrationProperties.put(new QName("prop1"), "value1");
- registrationProperties.put(new QName("prop2"), "value2");
+ TransactionAssert.beginTransaction();
- TransactionAssert.beginTransaction();
- ConsumerGroup cg = persistenceManager.createConsumerGroup("CG");
- Consumer consumer = persistenceManager.createConsumer("fooConsumer",
"fooConsumer");
- cg.addConsumer(consumer);
- Registration reg = persistenceManager.addRegistrationFor("fooConsumer",
registrationProperties);
- String regId = reg.getId();
- TransactionAssert.commitTransaction();
- return regId;
+ //
+ if (useRegistration)
+ {
+ Registration reg = persistenceManager.getRegistration(registrationId);
+ RegistrationLocal.setRegistration(reg);
+ }
}
- public void testCloneExistingPortletWithinTxWithRegistration() throws Exception
+ private void rollbackTX()
{
- String regId = createrRegistration();
+ TransactionAssert.rollbackTransaction(true);
- // Clone a POP
- PortletContext cloneCtx = null;
- try
+ //
+ if (useRegistration)
{
- TransactionAssert.beginTransaction();
- Registration reg = persistenceManager.getRegistration(regId);
- assertNotNull(reg);
- RegistrationLocal.setRegistration(reg);
- cloneCtx =
portletInvoker.createClone(PortletContext.createPortletContext("SimplePortlet"));
- TransactionAssert.commitTransaction();
- }
- finally
- {
RegistrationLocal.setRegistration(null);
}
+ }
- // Lookup
- TransactionAssert.beginTransaction();
- PersistentPortletState state =
(PersistentPortletState)persistenceManager.loadState(cloneCtx.getId().substring(1));
- PersistentRegistration registration = state.getRelatedRegistration();
- assertNotNull(registration);
- assertNotNull(state);
- assertEquals(regId, state.getId());
+ public void commitTX()
+ {
TransactionAssert.commitTransaction();
- }
- public void testCloneNullPortletWithinTx() throws Exception
- {
- try
+ //
+ if (useRegistration)
{
- TransactionAssert.beginTransaction();
- portletInvoker.createClone(null);
- fail("Was expecting an IllegalArgumentException");
+ RegistrationLocal.setRegistration(null);
}
- catch (IllegalArgumentException expected)
- {
- TransactionAssert.rollbackTransaction(true);
- }
}
- public void testCloneExistingPortletWithinTx() throws Exception
+ public void testCloneExistingPOPWithinTx() throws Exception
{
// Clone a POP
- PortletContext cloneCtx =
clonePortlet(PortletContext.createPortletContext("SimplePortlet"));
+ beginRegistrationScopedTX();
+ PortletContext cloneCtx =
consumer.createClone(PortletContext.createPortletContext("SimplePortlet"));
+ commitTX();
// Check the clone state
- TransactionAssert.beginTransaction();
+ beginTX();
assertTrue(cloneCtx.getId().startsWith("_"));
- PortletStateContext cloneState =
persistenceManager.loadState(cloneCtx.getId().substring(1));
+ PersistentPortletState cloneState =
(PersistentPortletState)persistenceManager.loadState(cloneCtx.getId().substring(1));
assertNotNull(cloneState);
assertEquals(cloneCtx.getId(), "_" + cloneState.getId());
assertEquals("SimplePortlet", cloneState.getState().getPortletId());
@@ -420,20 +405,33 @@
assertNotNull(cloneValues.keySet());
assertEquals(1, cloneValues.keySet().size());
assertEquals(new StringValue("def"),
cloneValues.getProperty("abc"));
- TransactionAssert.commitTransaction();
+ if (useRegistration)
+ {
+ PersistentRegistration registration = cloneState.getRelatedRegistration();
+ assertNotNull(registration);
+ assertEquals(registrationId, registration.getId());
+ }
+ commitTX();
+ }
+ public void testCloneExistingCCPWithinTx() throws Exception
+ {
+ // Clone a POP
+ PortletContext cloneCtx =
clonePortlet(PortletContext.createPortletContext("SimplePortlet"));
+
// Update CCP state directly
- TransactionAssert.beginTransaction();
+ beginTX();
+ PropertyMap cloneValues = consumer.getProperties(cloneCtx);
PropertyMap newCloneValues = new SimplePropertyMap(cloneValues);
newCloneValues.setProperty("abc", new StringValue("fed"));
persistenceManager.updateState(cloneCtx.getId().substring(1), newCloneValues);
- TransactionAssert.commitTransaction();
+ commitTX();
// Clone the modified CCP
PortletContext cloneCloneCtx = clonePortlet(cloneCtx);
// Check the clone clone state
- TransactionAssert.beginTransaction();
+ beginTX();
assertTrue(cloneCloneCtx.getId().startsWith("_"));
PortletStateContext cloneCloneState =
persistenceManager.loadState(cloneCloneCtx.getId().substring(1));
assertNotNull(cloneCloneState);
@@ -444,28 +442,66 @@
assertNotNull(cloneCloneValues.keySet());
assertEquals(1, cloneCloneValues.keySet().size());
assertEquals(new StringValue("fed"),
cloneCloneValues.getProperty("abc"));
- TransactionAssert.commitTransaction();
+ commitTX();
}
+ public void testABC()
+ {
+ beginTX();
+ Session session = hibernateSupport.getCurrentSession();
+ PersistentConsumer consumer = new PersistentConsumer("myconsumer",
"myconsumer");
+ session.persist(consumer);
+ Long consumerPK = consumer.getKey();
+ commitTX();
+
+ beginTX();
+ session = hibernateSupport.getCurrentSession();
+ consumer = (PersistentConsumer)session.get(PersistentConsumer.class, consumerPK);
+ HashMap properties = new HashMap();
+ properties.put(new QName("a", "b"), "abc");
+ properties.put(new QName("b"), "def");
+ PersistentRegistration reg = new PersistentRegistration(properties,
RegistrationStatus.PENDING);
+ reg.setPersistentHandle("handle");
+ reg.setRelatedConsumer(consumer);
+ consumer.getRelatedRegistrations().add(reg);
+ session.persist(reg);
+ session.flush();
+ commitTX();
+ }
+
+ public void testCloneNullPortletWithinTx() throws Exception
+ {
+ try
+ {
+ beginTX();
+ consumer.createClone(null);
+ fail("Was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ rollbackTX();
+ }
+ }
+
public void testDestroyNonExistingPortletWithinTx() throws Exception
{
- TransactionAssert.beginTransaction();
- List failures =
portletInvoker.destroyClones(Collections.singletonList(PortletContext.createPortletContext("_1")));
+ beginTX();
+ List failures =
consumer.destroyClones(Collections.singletonList(PortletContext.createPortletContext("_1")));
assertEquals(Collections.singletonList(new DestroyCloneFailure("_1")),
failures);
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void testDestroyNullPortletWithinTx() throws Exception
{
try
{
- TransactionAssert.beginTransaction();
- portletInvoker.destroyClones(null);
+ beginTX();
+ consumer.destroyClones(null);
fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException expected)
{
- TransactionAssert.rollbackTransaction(true);
+ rollbackTX();
}
}
@@ -496,43 +532,43 @@
PortletContext cloneCloneId2 = clonePortlet(cloneId1);
// Destroy the clone 2
- TransactionAssert.beginTransaction();
- List failures = portletInvoker.destroyClones(Collections.singletonList(cloneId2));
+ beginTX();
+ List failures = consumer.destroyClones(Collections.singletonList(cloneId2));
assertEquals(Collections.EMPTY_LIST, failures);
- TransactionAssert.commitTransaction();
+ commitTX();
// Destroy the clone of the clone 2
- TransactionAssert.beginTransaction();
- failures = portletInvoker.destroyClones(Collections.singletonList(cloneCloneId2));
+ beginTX();
+ failures = consumer.destroyClones(Collections.singletonList(cloneCloneId2));
assertEquals(Collections.EMPTY_LIST, failures);
- TransactionAssert.commitTransaction();
+ commitTX();
// Destroy the clone 1
- TransactionAssert.beginTransaction();
- failures = portletInvoker.destroyClones(Collections.singletonList(cloneId1));
+ beginTX();
+ failures = consumer.destroyClones(Collections.singletonList(cloneId1));
assertEquals(Collections.EMPTY_LIST, failures);
- TransactionAssert.commitTransaction();
+ commitTX();
// Destroy the clone of the clone 1
- TransactionAssert.beginTransaction();
- failures = portletInvoker.destroyClones(Collections.singletonList(cloneCloneId1));
+ beginTX();
+ failures = consumer.destroyClones(Collections.singletonList(cloneCloneId1));
assertEquals(Collections.EMPTY_LIST, failures);
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void testInvokeCloneBeforeWritePOPWithinTx() throws Exception
{
- TransactionAssert.beginTransaction();
+ beginTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
PortletContext.createPortletContext("CloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.CLONE_BEFORE_WRITE);
action.setInstanceContext(instanceContext);
- portletInvoker.invoke(action);
- TransactionAssert.commitTransaction();
+ consumer.invoke(action);
+ commitTX();
// Check state
- TransactionAssert.beginTransaction();
+ beginTX();
PortletContext cloneId = instanceContext.getClonedContext();
assertNotNull(cloneId);
PortletStateContext state =
persistenceManager.loadState(cloneId.getId().substring(1));
@@ -543,43 +579,43 @@
expectedValue.setProperty("abc", new StringValue("def"));
expectedValue.setProperty("_abc", new StringValue("_def"));
ValueMapAssert.assertEquals(expectedValue, state.getState().getProperties());
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void testInvokeReadWritePOPWithinTx() throws Exception
{
- TransactionAssert.beginTransaction();
+ beginTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
PortletContext.createPortletContext("CloneFailedCloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.READ_WRITE);
action.setInstanceContext(instanceContext);
- portletInvoker.invoke(action);
- TransactionAssert.commitTransaction();
+ consumer.invoke(action);
+ commitTX();
// Check state
- TransactionAssert.beginTransaction();
+ beginTX();
assertNull(instanceContext.getClonedContext());
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void testInvokeReadOnlyPOPWithinTx() throws Exception
{
- TransactionAssert.beginTransaction();
+ beginTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
PortletContext.createPortletContext("CloneFailedCloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.READ_ONLY);
action.setInstanceContext(instanceContext);
- portletInvoker.invoke(action);
- TransactionAssert.commitTransaction();
+ consumer.invoke(action);
+ commitTX();
// Check state
- TransactionAssert.beginTransaction();
+ beginTX();
assertNull(instanceContext.getClonedContext());
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void testInvokeCloneBeforeWriteCCPWithinTx() throws Exception
@@ -587,25 +623,25 @@
PortletContext cloningPortletId =
clonePortlet(PortletContext.createPortletContext("CloningPortlet"));
// Modify the state of the CCP
- TransactionAssert.beginTransaction();
+ beginTX();
PortletState cloningPortletState =
persistenceManager.loadState(cloningPortletId.getId().substring(1)).getState();
SimplePropertyMap newCloningPortletStateValue = new
SimplePropertyMap(cloningPortletState.getProperties());
newCloningPortletStateValue.setProperty("abc", new
StringValue("deff"));
persistenceManager.updateState(cloningPortletId.getId().substring(1),
newCloningPortletStateValue);
- TransactionAssert.commitTransaction();
+ commitTX();
//
- TransactionAssert.beginTransaction();
+ beginTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.CLONE_BEFORE_WRITE);
action.setInstanceContext(instanceContext);
- portletInvoker.invoke(action);
- TransactionAssert.commitTransaction();
+ consumer.invoke(action);
+ commitTX();
// Check state
- TransactionAssert.beginTransaction();
+ beginTX();
PortletContext cloneId = instanceContext.getClonedContext();
assertNotNull(cloneId);
PortletStateContext state =
persistenceManager.loadState(cloneId.getId().substring(1));
@@ -616,7 +652,7 @@
expectedValue.setProperty("abc", new StringValue("deff"));
expectedValue.setProperty("_abc", new StringValue("_def"));
ValueMapAssert.assertEquals(expectedValue, state.getState().getProperties());
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void testInvokeReadWriteCCPWithinTx() throws Exception
@@ -624,17 +660,17 @@
PortletContext cloningPortletId =
clonePortlet(PortletContext.createPortletContext("CloningPortlet"));
//
- TransactionAssert.beginTransaction();
+ beginTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.READ_WRITE);
action.setInstanceContext(instanceContext);
- portletInvoker.invoke(action);
- TransactionAssert.commitTransaction();
+ consumer.invoke(action);
+ commitTX();
// Check state
- TransactionAssert.beginTransaction();
+ beginTX();
assertNull(instanceContext.getClonedContext());
PortletStateContext state =
persistenceManager.loadState(cloningPortletId.getId().substring(1));
assertNotNull(state);
@@ -644,7 +680,7 @@
expectedValue.setProperty("abc", new StringValue("def"));
expectedValue.setProperty("_abc", new StringValue("_def"));
ValueMapAssert.assertEquals(expectedValue, state.getState().getProperties());
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void testInvokeReadOnlyCCPWithinTx() throws Exception
@@ -652,24 +688,24 @@
PortletContext cloneFailedCloningPortletId =
clonePortlet(PortletContext.createPortletContext("CloneFailedCloningPortlet"));
//
- TransactionAssert.beginTransaction();
+ beginTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloneFailedCloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.READ_ONLY);
action.setInstanceContext(instanceContext);
- portletInvoker.invoke(action);
- TransactionAssert.commitTransaction();
+ consumer.invoke(action);
+ commitTX();
// Check state
- TransactionAssert.beginTransaction();
+ beginTX();
assertNull(instanceContext.getClonedContext());
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void testInvokeCloneBeforeWritePOPWithinTxThrowsException() throws Exception
{
- TransactionAssert.beginTransaction();
+ beginTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
PortletContext.createPortletContext("CloningPortletThrowingRuntimeException"));
@@ -678,19 +714,19 @@
action.setInstanceContext(instanceContext);
try
{
- portletInvoker.invoke(action);
+ consumer.invoke(action);
fail("Was expecting RuntimeException");
}
catch (RuntimeException expected)
{
assertEquals("custom_message", expected.getMessage());
- TransactionAssert.rollbackTransaction(true);
+ rollbackTX();
}
// Check state
- TransactionAssert.beginTransaction();
+ beginTX();
assertNull(instanceContext.getClonedContext());
- TransactionAssert.commitTransaction();
+ commitTX();
}
public void _testGetProperties()
@@ -705,21 +741,21 @@
PortletContext cloneContext =
clonePortlet(PortletContext.createPortletContext("SimplePortlet"));
//
- TransactionAssert.beginTransaction();
- Portlet portlet = portletInvoker.getPortlet(cloneContext);
+ beginTX();
+ Portlet portlet = consumer.getPortlet(cloneContext);
assertEquals(cloneContext, portlet.getContext());
assertEquals("SimplePortlet",
portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME).getDefaultString());
- TransactionAssert.commitTransaction();
+ commitTX();
// Clone the modified CCP
PortletContext cloneCloneContext = clonePortlet(cloneContext);
//
- TransactionAssert.beginTransaction();
- portlet = portletInvoker.getPortlet(cloneCloneContext);
+ beginTX();
+ portlet = consumer.getPortlet(cloneCloneContext);
assertEquals(cloneCloneContext, portlet.getContext());
assertEquals("SimplePortlet",
portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME).getDefaultString());
- TransactionAssert.commitTransaction();
+ commitTX();
}
}
Modified:
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml
===================================================================
---
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml 2007-02-12
15:43:00 UTC (rev 6215)
+++
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml 2007-02-12
16:34:52 UTC (rev 6216)
@@ -87,26 +87,7 @@
<property name="stateConverter"><inject
bean="StateConverter"/></property>
</bean>
-<!--
- <bean name="LocalInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.LocalInterceptor">
- </bean>
-
- <bean name="InterceptorStack"
class="org.jboss.portal.server.impl.invocation.JBossInterceptorStack">
- <constructor>
- <parameter><array
class="[Lorg.jboss.portal.common.invocation.Interceptor;"
elementClass="org.jboss.portal.common.invocation.Interceptor">
- <inject bean="LocalInterceptor"/>
- </array></parameter>
- </constructor>
- </bean>
-
- <bean name="InterceptorStackFactory"
class="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory">
- <constructor>
- <parameter><inject
bean="InterceptorStack"/></parameter>
- </constructor>
- </bean>
--->
-
- <bean name="PortletInvoker"
class="org.jboss.portal.core.impl.portlet.state.LocalPortletInvoker">
+ <bean name="Consumer"
class="org.jboss.portal.core.impl.portlet.state.LocalPortletInvoker">
<property name="portletInvoker"><inject
bean="Producer"/></property>
</bean>
@@ -117,8 +98,8 @@
</constructor>
<property name="hibernateSupport"><inject
bean="HibernateSupport"/></property>
<property name="persistenceManager"><inject
bean="PersistenceManager"/></property>
+ <property name="consumer"><inject
bean="Consumer"/></property>
<property name="producer"><inject
bean="Producer"/></property>
<property name="portletContainer"><inject
bean="PortletContainer"/></property>
- <property name="portletInvoker"><inject
bean="PortletInvoker"/></property>
</bean>
</deployment>