From do-not-reply at jboss.org Sat Nov 12 05:11:02 2011
Content-Type: multipart/mixed; boundary="===============2434296988945493236=="
MIME-Version: 1.0
From: do-not-reply at jboss.org
To: hornetq-commits at lists.jboss.org
Subject: [hornetq-commits] JBoss hornetq SVN: r11690 -
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra.
Date: Sat, 12 Nov 2011 05:10:55 -0500
Message-ID: <201111121010.pACAAtSl029657@svn01.web.mwc.hst.phx2.redhat.com>
--===============2434296988945493236==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: ataylor
Date: 2011-11-12 05:10:54 -0500 (Sat, 12 Nov 2011)
New Revision: 11690
Modified:
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra/Horne=
tQRATestBase.java
Log:
test fix for resource adapter
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/r=
a/HornetQRATestBase.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra/Horn=
etQRATestBase.java 2011-11-11 10:13:15 UTC (rev 11689)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra/Horn=
etQRATestBase.java 2011-11-12 10:10:54 UTC (rev 11690)
@@ -16,8 +16,13 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.integration.jboss.recovery.AS7RecoveryRegistry;
import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.tests.util.ServiceTestBase;
+import org.jboss.msc.service.*;
+import org.jboss.msc.value.Value;
+import org.jboss.tm.XAResourceRecovery;
+import org.jboss.tm.XAResourceRecoveryRegistry;
=
import javax.jms.Message;
import javax.jms.MessageListener;
@@ -29,9 +34,14 @@
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.*;
import javax.transaction.xa.XAResource;
+import java.io.PrintStream;
import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
import java.util.Timer;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
=
/**
* @author Andy Taylor
@@ -60,6 +70,7 @@
server =3D createServer(true, configuration);
server.start();
server.createQueue(MDBQUEUEPREFIXEDSIMPLE, MDBQUEUEPREFIXEDSIMPLE, n=
ull, true, false);
+ AS7RecoveryRegistry.container =3D new DummyServiceContainer();
}
=
@Override
@@ -84,6 +95,7 @@
}
public abstract boolean isSecure();
=
+
class DummyMessageEndpointFactory implements MessageEndpointFactory
{
private DummyMessageEndpoint endpoint;
@@ -211,4 +223,247 @@
}
}
}
+
+
+ private static class DummyServiceContainer implements ServiceContainer
+ {
+ public void shutdown()
+ {
+ //To change body of implemented methods use File | Settings | Fil=
e Templates.
+ }
+
+ public boolean isShutdownComplete()
+ {
+ return false; //To change body of implemented methods use File |=
Settings | File Templates.
+ }
+
+ public void addTerminateListener(TerminateListener terminateListener)
+ {
+ //To change body of implemented methods use File | Settings | Fil=
e Templates.
+ }
+
+ public void awaitTermination() throws InterruptedException
+ {
+ //To change body of implemented methods use File | Settings | Fil=
e Templates.
+ }
+
+ public void awaitTermination(long l, TimeUnit timeUnit) throws Inter=
ruptedException
+ {
+ //To change body of implemented methods use File | Settings | Fil=
e Templates.
+ }
+
+ public void dumpServices()
+ {
+ //To change body of implemented methods use File | Settings | Fil=
e Templates.
+ }
+
+ public void dumpServices(PrintStream printStream)
+ {
+ //To change body of implemented methods use File | Settings | Fil=
e Templates.
+ }
+
+ public String getName()
+ {
+ return null; //To change body of implemented methods use File | =
Settings | File Templates.
+ }
+
+ public ServiceController> getRequiredService(ServiceName serviceNa=
me) throws ServiceNotFoundException
+ {
+ return null; //To change body of implemented methods use File | =
Settings | File Templates.
+ }
+
+ public ServiceController> getService(ServiceName serviceName)
+ {
+ ServiceController controller =3D new =
ServiceController()
+ {
+ public ServiceController> getParent()
+ {
+ return null; //To change body of implemented methods use F=
ile | Settings | File Templates.
+ }
+
+ public ServiceContainer getServiceContainer()
+ {
+ return null; //To change body of implemented methods use F=
ile | Settings | File Templates.
+ }
+
+ public Mode getMode()
+ {
+ return null; //To change body of implemented methods use F=
ile | Settings | File Templates.
+ }
+
+ public boolean compareAndSetMode(Mode mode, Mode mode1)
+ {
+ return false; //To change body of implemented methods use =
File | Settings | File Templates.
+ }
+
+ public void setMode(Mode mode)
+ {
+ //To change body of implemented methods use File | Settings=
| File Templates.
+ }
+
+ public State getState()
+ {
+ return null; //To change body of implemented methods use F=
ile | Settings | File Templates.
+ }
+
+ public Substate getSubstate()
+ {
+ return null; //To change body of implemented methods use F=
ile | Settings | File Templates.
+ }
+
+ public XAResourceRecoveryRegistry getValue() throws IllegalSta=
teException
+ {
+ XAResourceRecoveryRegistry registry =3D new XAResourceRecov=
eryRegistry()
+ {
+ public void addXAResourceRecovery(XAResourceRecovery xaR=
esourceRecovery)
+ {
+ //To change body of implemented methods use File | Se=
ttings | File Templates.
+ }
+
+ public void removeXAResourceRecovery(XAResourceRecovery =
xaResourceRecovery)
+ {
+ //To change body of implemented methods use File | Se=
ttings | File Templates.
+ }
+ };
+ return registry; //To change body of implemented methods u=
se File | Settings | File Templates.
+ }
+
+ public Service getService() throws=
IllegalStateException
+ {
+ return null; //To change body of implemented methods use F=
ile | Settings | File Templates.
+ }
+
+ public ServiceName getName()
+ {
+ return null; //To change body of implemented methods use F=
ile | Settings | File Templates.
+ }
+
+ public ServiceName[] getAliases()
+ {
+ return new ServiceName[0]; //To change body of implemented=
methods use File | Settings | File Templates.
+ }
+
+ public void addListener(ServiceListener super XAResourceReco=
veryRegistry> serviceListener)
+ {
+ //To change body of implemented methods use File | Settings=
| File Templates.
+ }
+
+ public void addListener(ServiceListener.Inheritance inheritanc=
e, ServiceListener