[jboss-cvs] jboss-portal/core/src/main/org/jboss/portal/test/core/state ...
Julien Viet
julien at jboss.com
Thu Aug 24 09:21:37 EDT 2006
User: julien
Date: 06/08/24 09:21:37
Modified: core/src/main/org/jboss/portal/test/core/state
StatefulPortletInvokerTestCase.java
Log:
updated the implementation of destroyClone to now destroy a list of ids and return the list of non destroyed ids. updated the InstanceContainer accordingly
Revision Changes Path
1.5 +17 -16 jboss-portal/core/src/main/org/jboss/portal/test/core/state/StatefulPortletInvokerTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: StatefulPortletInvokerTestCase.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/core/src/main/org/jboss/portal/test/core/state/StatefulPortletInvokerTestCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- StatefulPortletInvokerTestCase.java 22 Aug 2006 14:08:53 -0000 1.4
+++ StatefulPortletInvokerTestCase.java 24 Aug 2006 13:21:37 -0000 1.5
@@ -49,16 +49,19 @@
import org.jboss.portal.portlet.state.AccessMode;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import org.jboss.portal.portlet.test.support.info.PreferencesInfoSupport;
import org.jboss.portal.portlet.test.support.PortletInvokerSupport;
import org.jboss.portal.portlet.test.support.PortletSupport;
import org.jboss.portal.common.value.StringValue;
import java.net.URL;
+import java.util.Collections;
+import java.util.List;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class StatefulPortletInvokerTestCase extends TestCase
{
@@ -312,16 +315,10 @@
public void testDestroyNonExistingPortletWithinTx() throws Exception
{
- try
- {
TransactionAssert.beginTransaction();
- statefulPortletInvoker.destroyClone("_1");
- fail("Was expecting NoSuchPortletException");
- }
- catch (NoSuchPortletException e)
- {
- TransactionAssert.rollbackTransaction(true);
- }
+ List failures = statefulPortletInvoker.destroyClones(Collections.singletonList("_1"));
+ assertEquals(Collections.singletonList(new DestroyCloneFailure("_1")), failures);
+ TransactionAssert.commitTransaction();
}
public void testDestroyNullPortletWithinTx() throws Exception
@@ -329,7 +326,7 @@
try
{
TransactionAssert.beginTransaction();
- statefulPortletInvoker.destroyClone(null);
+ statefulPortletInvoker.destroyClones(null);
fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException expected)
@@ -370,22 +367,26 @@
// Destroy the clone 2
TransactionAssert.beginTransaction();
- statefulPortletInvoker.destroyClone(cloneId2);
+ List failures = statefulPortletInvoker.destroyClones(Collections.singletonList(cloneId2));
+ assertEquals(Collections.EMPTY_LIST, failures);
TransactionAssert.commitTransaction();
// Destroy the clone of the clone 2
TransactionAssert.beginTransaction();
- statefulPortletInvoker.destroyClone(cloneCloneId2);
+ failures = statefulPortletInvoker.destroyClones(Collections.singletonList(cloneCloneId2));
+ assertEquals(Collections.EMPTY_LIST, failures);
TransactionAssert.commitTransaction();
// Destroy the clone 1
TransactionAssert.beginTransaction();
- statefulPortletInvoker.destroyClone(cloneId1);
+ failures = statefulPortletInvoker.destroyClones(Collections.singletonList(cloneId1));
+ assertEquals(Collections.EMPTY_LIST, failures);
TransactionAssert.commitTransaction();
// Destroy the clone of the clone 1
TransactionAssert.beginTransaction();
- statefulPortletInvoker.destroyClone(cloneCloneId1);
+ failures = statefulPortletInvoker.destroyClones(Collections.singletonList(cloneCloneId1));
+ assertEquals(Collections.EMPTY_LIST, failures);
TransactionAssert.commitTransaction();
}
More information about the jboss-cvs-commits
mailing list