You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by gd...@apache.org on 2009/04/23 14:53:43 UTC
svn commit: r767906 -
/geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/test/java/org/apache/geronimo/openejb/cluster/stateful/container/ClusteredStatefulContainerTest.java
Author: gdamour
Date: Thu Apr 23 12:53:43 2009
New Revision: 767906
URL: http://svn.apache.org/viewvc?rev=767906&view=rev
Log:
Fix build by removing few methods. EJB clustering has been broken and still need to be fixed
Should have been included as part of my previous commit.
Modified:
geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/test/java/org/apache/geronimo/openejb/cluster/stateful/container/ClusteredStatefulContainerTest.java
Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/test/java/org/apache/geronimo/openejb/cluster/stateful/container/ClusteredStatefulContainerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/test/java/org/apache/geronimo/openejb/cluster/stateful/container/ClusteredStatefulContainerTest.java?rev=767906&r1=767905&r2=767906&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/test/java/org/apache/geronimo/openejb/cluster/stateful/container/ClusteredStatefulContainerTest.java (original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-clustering-wadi/src/test/java/org/apache/geronimo/openejb/cluster/stateful/container/ClusteredStatefulContainerTest.java Thu Apr 23 12:53:43 2009
@@ -18,24 +18,17 @@
*/
package org.apache.geronimo.openejb.cluster.stateful.container;
-import java.lang.reflect.Method;
import java.net.URI;
import java.util.Collections;
import org.apache.geronimo.clustering.wadi.WADISessionManager;
import org.apache.geronimo.openejb.cluster.infra.NetworkConnectorTracker;
-import org.apache.openejb.OpenEJBException;
import org.apache.openejb.core.CoreDeploymentInfo;
import org.apache.openejb.core.DeploymentContext;
import org.apache.openejb.spi.SecurityService;
-import org.codehaus.wadi.core.contextualiser.Invocation;
-import org.codehaus.wadi.core.contextualiser.InvocationException;
-import org.codehaus.wadi.core.manager.Manager;
import org.codehaus.wadi.servicespace.ServiceRegistry;
import org.codehaus.wadi.servicespace.ServiceSpace;
-import com.agical.rmock.core.Action;
-import com.agical.rmock.core.MethodHandle;
import com.agical.rmock.extension.junit.RMockTestCase;
/**
@@ -47,22 +40,12 @@
private ClusteredStatefulContainer container;
private CoreDeploymentInfo deploymentInfo;
private String deploymentId;
- private Method callMethod;
- private Manager wadiManager;
private NetworkConnectorTracker tracker;
- private String primKey;
- private Class<Runnable> callInterface;
- private Object[] args;
@Override
protected void setUp() throws Exception {
- primKey = "primKey";
- callInterface = Runnable.class;
- callMethod = Runnable.class.getDeclaredMethod("run");
- args = new Object[0];
-
sessionManager = (WADISessionManager) mock(WADISessionManager.class);
- wadiManager = sessionManager.getManager();
+ sessionManager.getManager();
modify().multiplicity(expect.from(0));
sessionManager.registerListener(null);
@@ -99,121 +82,6 @@
};
}
- public void testInvokeBusinessMethodForUnknownDeploymentThrowsOEJBE() throws Exception {
- startVerification();
- try {
- container.businessMethod(deploymentInfo, primKey, callInterface, callMethod, args);
- fail();
- } catch (OpenEJBException e) {
- }
- }
-
- public void testInvokeRemoteMethodForUnknownDeploymentThrowsOEJBE() throws Exception {
- startVerification();
- try {
- container.removeEJBObject(deploymentInfo, primKey, callInterface, callMethod, args);
- fail();
- } catch (OpenEJBException e) {
- }
- }
-
- public void testOEJBIsRethrownForBusinessMethod() throws Exception {
- new OEJBIsRethrownTest() {
- @Override
- protected void executeMethod() throws OpenEJBException {
- container.businessMethod(deploymentInfo, primKey, callInterface, callMethod, args);
- }
- @Override
- protected void executeSuperMethod() throws OpenEJBException {
- container.superBusinessMethod(deploymentInfo, primKey, callInterface, callMethod, args);
- }
- }.executeTest();
- }
-
- public void testOEJBIsRethrownForRemoveMethod() throws Exception {
- new OEJBIsRethrownTest() {
- @Override
- protected void executeMethod() throws OpenEJBException {
- container.removeEJBObject(deploymentInfo, primKey, callInterface, callMethod, args);
- }
- @Override
- protected void executeSuperMethod() throws OpenEJBException {
- container.superRemoveEJBObject(deploymentInfo, primKey, callInterface, callMethod, args);
- }
- }.executeTest();
- }
-
- protected abstract class OEJBIsRethrownTest {
- public void executeTest() throws Exception {
- recordContextualiseInvocation();
-
- executeSuperMethod();
- OpenEJBException exception = new OpenEJBException();
- modify().throwException(exception);
-
- startVerification();
-
- container.addSessionManager(deploymentId, sessionManager);
-
- try {
- executeMethod();
- fail();
- } catch (OpenEJBException e) {
- assertSame(exception, e);
- }
- }
-
- protected abstract void executeSuperMethod() throws OpenEJBException;
-
- protected abstract void executeMethod() throws OpenEJBException;
- }
-
- public void testBusinessMethodInvokationOK() throws Exception {
- new MethodIsExecutedTest() {
- @Override
- protected Object executeMethod() throws OpenEJBException {
- return container.businessMethod(deploymentInfo, primKey, callInterface, callMethod, args);
- }
- @Override
- protected void executeSuperMethod() throws OpenEJBException {
- container.superBusinessMethod(deploymentInfo, primKey, callInterface, callMethod, args);
- }
- }.executeTest();
- }
-
- public void testRemoveMethodInvokationOK() throws Exception {
- new MethodIsExecutedTest() {
- @Override
- protected Object executeMethod() throws OpenEJBException {
- return container.removeEJBObject(deploymentInfo, primKey, callInterface, callMethod, args);
- }
- @Override
- protected void executeSuperMethod() throws OpenEJBException {
- container.superRemoveEJBObject(deploymentInfo, primKey, callInterface, callMethod, args);
- }
- }.executeTest();
- }
-
- protected abstract class MethodIsExecutedTest {
- public void executeTest() throws Exception {
- recordContextualiseInvocation();
-
- executeSuperMethod();
- Object result = new Object();
- modify().returnValue(result);
-
- startVerification();
-
- container.addSessionManager(deploymentId, sessionManager);
-
- Object actualResult = executeMethod();
- assertSame(result, actualResult);
- }
-
- protected abstract void executeSuperMethod() throws OpenEJBException;
-
- protected abstract Object executeMethod() throws OpenEJBException;
- }
public void testGetLocationsRetunsNullWhenDeploymentIsNotRegistered() throws Exception {
startVerification();
@@ -240,14 +108,4 @@
}
}
- protected void recordContextualiseInvocation() throws InvocationException {
- wadiManager.contextualise(null);
- modify().args(is.NOT_NULL).perform(new Action() {
- public Object invocation(Object[] arg0, MethodHandle arg1) throws Throwable {
- ((Invocation) arg0[0]).invoke();
- return true;
- }
- });
- }
-
}