Fixing byteman tests after the rename

This commit is contained in:
Clebert Suconic 2015-04-28 11:37:15 -04:00 committed by jbertram
parent 63152b1d4b
commit 70a6e43075
15 changed files with 45 additions and 45 deletions

View File

@ -16,6 +16,18 @@
*/ */
package org.apache.activemq.artemis.tests.extras.byteman; package org.apache.activemq.artemis.tests.extras.byteman;
import javax.jms.Message;
import javax.resource.ResourceException;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
import java.lang.reflect.Method;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import com.arjuna.ats.arjuna.coordinator.TransactionReaper; import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
import com.arjuna.ats.arjuna.coordinator.TxControl; import com.arjuna.ats.arjuna.coordinator.TxControl;
import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple; import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple;
@ -38,18 +50,6 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import javax.jms.Message;
import javax.resource.ResourceException;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
import java.lang.reflect.Method;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@RunWith(BMUnitRunner.class) @RunWith(BMUnitRunner.class)
public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
{ {
@ -77,7 +77,7 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext", targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext",
targetMethod = "xaEnd", targetMethod = "xaEnd",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ActiveMQMessageHandlerTest.interrupt();" action = "org.apache.activemq.artemis.tests.extras.byteman.ActiveMQMessageHandlerTest.interrupt();"
) )
} }
) )
@ -154,7 +154,7 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase
targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext", targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext",
targetMethod = "xaEnd", targetMethod = "xaEnd",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ActiveMQMessageHandlerTest.interrupt();" action = "org.apache.activemq.artemis.tests.extras.byteman.ActiveMQMessageHandlerTest.interrupt();"
) )
} }
) )

View File

@ -111,7 +111,7 @@ public class BMFailoverTest extends FailoverTestBase
targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext", targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext",
targetMethod = "xaEnd", targetMethod = "xaEnd",
targetLocation = "AT EXIT", targetLocation = "AT EXIT",
action = "org.apache.activemq.tests.extras.byteman.BMFailoverTest.stopAndThrow()" action = "org.apache.activemq.artemis.tests.extras.byteman.BMFailoverTest.stopAndThrow()"
) )
} }
) )
@ -202,7 +202,7 @@ public class BMFailoverTest extends FailoverTestBase
targetClass = "org.apache.activemq.artemis.core.client.impl.ClientSessionImpl", targetClass = "org.apache.activemq.artemis.core.client.impl.ClientSessionImpl",
targetMethod = "start(javax.transaction.xa.Xid, int)", targetMethod = "start(javax.transaction.xa.Xid, int)",
targetLocation = "AT EXIT", targetLocation = "AT EXIT",
action = "org.apache.activemq.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)" action = "org.apache.activemq.artemis.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)"
) )
} }
) )
@ -305,7 +305,7 @@ public class BMFailoverTest extends FailoverTestBase
targetClass = "org.apache.activemq.artemis.core.client.impl.ClientSessionImpl", targetClass = "org.apache.activemq.artemis.core.client.impl.ClientSessionImpl",
targetMethod = "commit", targetMethod = "commit",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)" action = "org.apache.activemq.artemis.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)"
) )
} }
) )
@ -346,7 +346,7 @@ public class BMFailoverTest extends FailoverTestBase
targetClass = "org.apache.activemq.artemis.core.client.impl.ClientSessionImpl", targetClass = "org.apache.activemq.artemis.core.client.impl.ClientSessionImpl",
targetMethod = "commit", targetMethod = "commit",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)" action = "org.apache.activemq.artemis.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)"
) )
} }
) )

View File

@ -57,7 +57,7 @@ public class BridgeServerLocatorConfigurationTest extends ServiceTestBase
@Test @Test
@BMRule(name = "check connection ttl", @BMRule(name = "check connection ttl",
targetClass = "org.apache.activemq.tests.extras.byteman.BridgeServerLocatorConfigurationTest", targetClass = "org.apache.activemq.artemis.tests.extras.byteman.BridgeServerLocatorConfigurationTest",
targetMethod = "getBridgeTTL(ActiveMQServer, String)", targetLocation = "EXIT", targetMethod = "getBridgeTTL(ActiveMQServer, String)", targetLocation = "EXIT",
action = "$! = $0.getConfiguredBridge($1).serverLocator.getConnectionTTL();") action = "$! = $0.getConfiguredBridge($1).serverLocator.getConnectionTTL();")
/** /**

View File

@ -128,7 +128,7 @@ public class ClosingConnectionTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.journal.impl.NIOSequentialFile", targetClass = "org.apache.activemq.artemis.core.journal.impl.NIOSequentialFile",
targetMethod = "open(int, boolean)", targetMethod = "open(int, boolean)",
targetLocation = "AT INVOKE java.nio.channels.FileChannel.size()", targetLocation = "AT INVOKE java.nio.channels.FileChannel.size()",
action = "org.apache.activemq.tests.extras.byteman.ClosingConnectionTest.killConnection();" action = "org.apache.activemq.artemis.tests.extras.byteman.ClosingConnectionTest.killConnection();"
) )
} }

View File

@ -51,7 +51,7 @@ public class ClusteredGroupingTest extends ClusterTestBase
targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler", targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler",
targetMethod = "removeGrouping", targetMethod = "removeGrouping",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ClusteredGroupingTest.pause($1);" action = "org.apache.activemq.artemis.tests.extras.byteman.ClusteredGroupingTest.pause($1);"
), ),
@BMRule @BMRule
( (
@ -59,7 +59,7 @@ public class ClusteredGroupingTest extends ClusterTestBase
targetClass = "org.apache.activemq.artemis.core.server.group.impl.GroupHandlingAbstract", targetClass = "org.apache.activemq.artemis.core.server.group.impl.GroupHandlingAbstract",
targetMethod = "forceRemove", targetMethod = "forceRemove",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ClusteredGroupingTest.restart2();" action = "org.apache.activemq.artemis.tests.extras.byteman.ClusteredGroupingTest.restart2();"
) )
} }
) )
@ -128,13 +128,13 @@ public class ClusteredGroupingTest extends ClusterTestBase
targetClass = "org.apache.activemq.artemis.core.server.group.impl.RemoteGroupingHandler", targetClass = "org.apache.activemq.artemis.core.server.group.impl.RemoteGroupingHandler",
targetMethod = "onNotification", targetMethod = "onNotification",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ClusteredGroupingTest.pause2($1);" action = "org.apache.activemq.artemis.tests.extras.byteman.ClusteredGroupingTest.pause2($1);"
), ),
@BMRule(name = "blow-up2", @BMRule(name = "blow-up2",
targetClass = "org.apache.activemq.artemis.core.server.group.impl.RemoteGroupingHandler", targetClass = "org.apache.activemq.artemis.core.server.group.impl.RemoteGroupingHandler",
targetMethod = "remove", targetMethod = "remove",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ClusteredGroupingTest.restart2();") action = "org.apache.activemq.artemis.tests.extras.byteman.ClusteredGroupingTest.restart2();")
} }
) )
public void test3serversLocalGoesDown() throws Exception public void test3serversLocalGoesDown() throws Exception
@ -213,13 +213,13 @@ public class ClusteredGroupingTest extends ClusterTestBase
targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler", targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler",
targetMethod = "onNotification", targetMethod = "onNotification",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ClusteredGroupingTest.pause2($1);" action = "org.apache.activemq.artemis.tests.extras.byteman.ClusteredGroupingTest.pause2($1);"
), ),
@BMRule(name = "blow-up2", @BMRule(name = "blow-up2",
targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler", targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler",
targetMethod = "remove", targetMethod = "remove",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ClusteredGroupingTest.restart2();") action = "org.apache.activemq.artemis.tests.extras.byteman.ClusteredGroupingTest.restart2();")
} }
) )
public void testLocal3serversLocalGoesDown() throws Exception public void testLocal3serversLocalGoesDown() throws Exception
@ -298,13 +298,13 @@ public class ClusteredGroupingTest extends ClusterTestBase
targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler", targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler",
targetMethod = "onNotification", targetMethod = "onNotification",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ClusteredGroupingTest.pause2($1);" action = "org.apache.activemq.artemis.tests.extras.byteman.ClusteredGroupingTest.pause2($1);"
), ),
@BMRule(name = "blow-up2", @BMRule(name = "blow-up2",
targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler", targetClass = "org.apache.activemq.artemis.core.server.group.impl.LocalGroupingHandler",
targetMethod = "remove", targetMethod = "remove",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ClusteredGroupingTest.restart2();") action = "org.apache.activemq.artemis.tests.extras.byteman.ClusteredGroupingTest.restart2();")
} }
) )
public void testLocal4serversLocalGoesDown() throws Exception public void testLocal4serversLocalGoesDown() throws Exception

View File

@ -79,7 +79,7 @@ public class GroupingTest extends JMSTestBase
targetClass = "org.apache.activemq.artemis.core.server.impl.ServerSessionImpl", targetClass = "org.apache.activemq.artemis.core.server.impl.ServerSessionImpl",
targetMethod = "rollback", targetMethod = "rollback",
targetLocation = "EXIT", targetLocation = "EXIT",
action = "org.apache.activemq.tests.extras.byteman.GroupingTest.pause();" action = "org.apache.activemq.artemis.tests.extras.byteman.GroupingTest.pause();"
) )
} }
) )

View File

@ -35,7 +35,7 @@ import org.junit.runner.RunWith;
@BMRules(rules = { @BMRule(name = "modify map during iteration", @BMRules(rules = { @BMRule(name = "modify map during iteration",
targetClass = "org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository", targetClass = "org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository",
targetMethod = "getPossibleMatches(String)", targetLocation = "AT INVOKE java.util.HashMap.put", targetMethod = "getPossibleMatches(String)", targetLocation = "AT INVOKE java.util.HashMap.put",
action = "org.apache.activemq.tests.extras.byteman.HierarchicalObjectRepositoryTest.bum()"), }) action = "org.apache.activemq.artemis.tests.extras.byteman.HierarchicalObjectRepositoryTest.bum()"), })
public class HierarchicalObjectRepositoryTest public class HierarchicalObjectRepositoryTest
{ {
private static final String A = "a."; private static final String A = "a.";

View File

@ -49,7 +49,7 @@ public class JMSBridgeReconnectionTest extends BridgeTestBase
targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl", targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl",
targetMethod = "send", targetMethod = "send",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.JMSBridgeReconnectionTest.pause($1);" action = "org.apache.activemq.artemis.tests.extras.byteman.JMSBridgeReconnectionTest.pause($1);"
), ),
@BMRule @BMRule
( (
@ -57,7 +57,7 @@ public class JMSBridgeReconnectionTest extends BridgeTestBase
targetClass = "org.apache.activemq.artemis.core.client.impl.ClientProducerImpl", targetClass = "org.apache.activemq.artemis.core.client.impl.ClientProducerImpl",
targetMethod = "sendRegularMessage", targetMethod = "sendRegularMessage",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.JMSBridgeReconnectionTest.pause2($1,$2,$3);" action = "org.apache.activemq.artemis.tests.extras.byteman.JMSBridgeReconnectionTest.pause2($1,$2,$3);"
) )
} }
) )

View File

@ -68,7 +68,7 @@ public class MessageCopyTest
), ),
@BMRule( @BMRule(
name = "JMSServer.stop wait-init", name = "JMSServer.stop wait-init",
targetClass = "org.apache.activemq.tests.extras.byteman.MessageCopyTest", targetClass = "org.apache.activemq.artemis.tests.extras.byteman.MessageCopyTest",
targetMethod = "simulateRead", targetMethod = "simulateRead",
targetLocation = "EXIT", targetLocation = "EXIT",
action = "signalWake(\"finish-read\", true)" action = "signalWake(\"finish-read\", true)"

View File

@ -129,7 +129,7 @@ public class OrphanedConsumerTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl", targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl",
targetMethod = "close", targetMethod = "close",
targetLocation = "AT EXIT", targetLocation = "AT EXIT",
condition = "org.apache.activemq.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()", condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()",
action = "System.out.println(\"throwing stuff\");throw new InterruptedException()" action = "System.out.println(\"throwing stuff\");throw new InterruptedException()"
), ),
@BMRule @BMRule
@ -138,8 +138,8 @@ public class OrphanedConsumerTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl", targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl",
targetMethod = "close", targetMethod = "close",
targetLocation = "ENTRY", targetLocation = "ENTRY",
condition = "org.apache.activemq.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()", condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()",
action = "org.apache.activemq.tests.extras.byteman.OrphanedConsumerTest.leavingCloseOnTestCountersWhileClosing()" action = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.leavingCloseOnTestCountersWhileClosing()"
) )
} }
@ -168,7 +168,7 @@ public class OrphanedConsumerTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl", targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl",
targetMethod = "close", targetMethod = "close",
targetLocation = "AT EXIT", targetLocation = "AT EXIT",
condition = "org.apache.activemq.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()", condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()",
action = "System.out.println(\"throwing stuff\");throw new InterruptedException()" action = "System.out.println(\"throwing stuff\");throw new InterruptedException()"
), ),
@BMRule @BMRule
@ -177,8 +177,8 @@ public class OrphanedConsumerTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl", targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl",
targetMethod = "close", targetMethod = "close",
targetLocation = "ENTRY", targetLocation = "ENTRY",
condition = "org.apache.activemq.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()", condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()",
action = "org.apache.activemq.tests.extras.byteman.OrphanedConsumerTest.leavingCloseOnTestCountersWhileClosing()" action = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.leavingCloseOnTestCountersWhileClosing()"
) )
} }

View File

@ -76,7 +76,7 @@ public class PagingLeakTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.paging.cursor.impl.PagePositionImpl", targetClass = "org.apache.activemq.artemis.core.paging.cursor.impl.PagePositionImpl",
targetMethod = "<init>()", targetMethod = "<init>()",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.PagingLeakTest.newPosition()" action = "org.apache.activemq.artemis.tests.extras.byteman.PagingLeakTest.newPosition()"
), ),
@BMRule @BMRule
( (
@ -84,7 +84,7 @@ public class PagingLeakTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.paging.cursor.impl.PagePositionImpl", targetClass = "org.apache.activemq.artemis.core.paging.cursor.impl.PagePositionImpl",
targetMethod = "finalize", targetMethod = "finalize",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.PagingLeakTest.deletePosition()" action = "org.apache.activemq.artemis.tests.extras.byteman.PagingLeakTest.deletePosition()"
) )
} }
) )

View File

@ -53,7 +53,7 @@ public class ReplicationBackupTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.server.impl.SharedNothingLiveActivation", targetClass = "org.apache.activemq.artemis.core.server.impl.SharedNothingLiveActivation",
targetMethod = "run", targetMethod = "run",
targetLocation = "AT EXIT", targetLocation = "AT EXIT",
action = "org.apache.activemq.tests.extras.byteman.ReplicationBackupTest.breakIt();" action = "org.apache.activemq.artemis.tests.extras.byteman.ReplicationBackupTest.breakIt();"
) )
} }
) )

View File

@ -104,7 +104,7 @@ public class ScaleDownFailoverTest extends ClusterTestBase
targetMethod = "createSessionFactory(org.apache.activemq.artemis.api.core.TransportConfiguration, int, boolean)", targetMethod = "createSessionFactory(org.apache.activemq.artemis.api.core.TransportConfiguration, int, boolean)",
isInterface = true, isInterface = true,
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "org.apache.activemq.tests.extras.byteman.ScaleDownFailoverTest.fail($1);" action = "org.apache.activemq.artemis.tests.extras.byteman.ScaleDownFailoverTest.fail($1);"
) )
public void testScaleDownWhenFirstServerFails() throws Exception public void testScaleDownWhenFirstServerFails() throws Exception
{ {

View File

@ -69,7 +69,7 @@ public class StartStopDeadlockTest extends ServiceTestBase
), ),
@BMRule( @BMRule(
name = "StartStopDeadlockTest tearDown", name = "StartStopDeadlockTest tearDown",
targetClass = "org.apache.activemq.tests.extras.byteman.StartStopDeadlockTest", targetClass = "org.apache.activemq.artemis.tests.extras.byteman.StartStopDeadlockTest",
targetMethod = "tearDown", targetMethod = "tearDown",
targetLocation = "ENTRY", targetLocation = "ENTRY",
action = "deleteCounter(\"server-Init\")" action = "deleteCounter(\"server-Init\")"

View File

@ -61,7 +61,7 @@ public class StompInternalStateTest extends ServiceTestBase
targetClass = "org.apache.activemq.artemis.core.protocol.stomp.StompProtocolManager", targetClass = "org.apache.activemq.artemis.core.protocol.stomp.StompProtocolManager",
targetMethod = "onNotification(org.apache.activemq.artemis.core.server.management.Notification)", targetMethod = "onNotification(org.apache.activemq.artemis.core.server.management.Notification)",
targetLocation = "EXIT", targetLocation = "EXIT",
helper = "org.apache.activemq.tests.extras.byteman.StompInternalStateTest", helper = "org.apache.activemq.artemis.tests.extras.byteman.StompInternalStateTest",
action = "verifyBindingAddRemove($1, $0.destinations)" action = "verifyBindingAddRemove($1, $0.destinations)"
) )
} }