diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PluggableQuorumInfiniteRedeliveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PluggableQuorumInfiniteRedeliveryTest.java index 2fbacac267..9b4d154e9b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PluggableQuorumInfiniteRedeliveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PluggableQuorumInfiniteRedeliveryTest.java @@ -24,14 +24,9 @@ import org.apache.activemq.artemis.core.config.ha.ReplicationBackupPolicyConfigu import org.apache.activemq.artemis.quorum.file.FileBasedPrimitiveManager; import org.apache.activemq.artemis.tests.util.ReplicatedBackupUtils; import org.junit.Before; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; public class PluggableQuorumInfiniteRedeliveryTest extends InfiniteRedeliveryTest { - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); - private DistributedPrimitiveManagerConfiguration managerConfiguration; public PluggableQuorumInfiniteRedeliveryTest(String protocol, boolean useCLI) { @@ -43,7 +38,7 @@ public class PluggableQuorumInfiniteRedeliveryTest extends InfiniteRedeliveryTes public void setUp() throws Exception { super.setUp(); this.managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), - Collections.singletonMap("locks-folder", tmpFolder.newFolder("manager").toString())); + Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString())); } @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java index b364ad09eb..3c380b9655 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java @@ -97,14 +97,9 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; public abstract class ClusterTestBase extends ActiveMQTestBase { - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); - private static final Logger log = Logger.getLogger(ClusterTestBase.class); private static final int[] PORTS = {TransportConstants.DEFAULT_PORT, TransportConstants.DEFAULT_PORT + 1, TransportConstants.DEFAULT_PORT + 2, TransportConstants.DEFAULT_PORT + 3, TransportConstants.DEFAULT_PORT + 4, TransportConstants.DEFAULT_PORT + 5, TransportConstants.DEFAULT_PORT + 6, TransportConstants.DEFAULT_PORT + 7, TransportConstants.DEFAULT_PORT + 8, TransportConstants.DEFAULT_PORT + 9,}; @@ -151,7 +146,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { return pluggableQuorumConfiguration; } try { - pluggableQuorumConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", tmpFolder.newFolder("manager").toString())); + pluggableQuorumConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString())); } catch (IOException ioException) { log.error(ioException); return null; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java index d863cf59fb..c1b949250d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java @@ -56,13 +56,9 @@ import org.apache.activemq.artemis.tests.util.ReplicatedBackupUtils; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; public abstract class FailoverTestBase extends ActiveMQTestBase { // Constants ----------------------------------------------------- - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); protected static final SimpleString ADDRESS = new SimpleString("FailoverTestAddress"); @@ -243,7 +239,7 @@ public abstract class FailoverTestBase extends ActiveMQTestBase { managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), - Collections.singletonMap("locks-folder", tmpFolder.newFolder("manager").toString())); + Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString())); ReplicatedBackupUtils.configurePluggableQuorumReplicationPair(backupConfig, backupConnector, backupAcceptor, liveConfig, liveConnector, null, managerConfiguration, managerConfiguration); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java index 49bd396b05..75570c220f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java @@ -48,14 +48,9 @@ import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; import org.junit.Before; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; public abstract class MultipleServerFailoverTestBase extends ActiveMQTestBase { - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); - private DistributedPrimitiveManagerConfiguration pluggableQuorumConfiguration = null; private DistributedPrimitiveManagerConfiguration getOrCreatePluggableQuorumConfiguration() { @@ -63,7 +58,7 @@ public abstract class MultipleServerFailoverTestBase extends ActiveMQTestBase { return pluggableQuorumConfiguration; } try { - pluggableQuorumConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", tmpFolder.newFolder("manager").toString())); + pluggableQuorumConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString())); } catch (IOException ioException) { return null; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumReplicaTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumReplicaTimeoutTest.java index 0718962e10..d3a150e2a7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumReplicaTimeoutTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumReplicaTimeoutTest.java @@ -27,21 +27,16 @@ import org.apache.activemq.artemis.core.config.ha.ReplicationPrimaryPolicyConfig import org.apache.activemq.artemis.quorum.file.FileBasedPrimitiveManager; import org.apache.activemq.artemis.tests.integration.cluster.failover.ReplicaTimeoutTest; import org.apache.activemq.artemis.tests.util.ReplicatedBackupUtils; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; public class PluggableQuorumReplicaTimeoutTest extends ReplicaTimeoutTest { - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); - @Override protected void configureReplicationPair(Configuration backupConfig, Configuration liveConfig, TransportConfiguration backupConnector, TransportConfiguration backupAcceptor, TransportConfiguration liveConnector) throws IOException { - DistributedPrimitiveManagerConfiguration managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", tmpFolder.newFolder("manager").toString())); + DistributedPrimitiveManagerConfiguration managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString())); ReplicatedBackupUtils.configurePluggableQuorumReplicationPair(backupConfig, backupConnector, backupAcceptor, liveConfig, liveConnector, null, diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/PluggableQuorumReplicationFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/PluggableQuorumReplicationFlowControlTest.java index 1a84de67f5..c10029cb70 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/PluggableQuorumReplicationFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/PluggableQuorumReplicationFlowControlTest.java @@ -26,18 +26,14 @@ import org.apache.activemq.artemis.core.config.ha.ReplicationBackupPolicyConfigu import org.apache.activemq.artemis.core.config.ha.ReplicationPrimaryPolicyConfiguration; import org.apache.activemq.artemis.quorum.file.FileBasedPrimitiveManager; import org.junit.Before; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; public class PluggableQuorumReplicationFlowControlTest extends SharedNothingReplicationFlowControlTest { private DistributedPrimitiveManagerConfiguration managerConfiguration; - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); @Before public void init() throws IOException { - managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", tmpFolder.newFolder("manager").toString())); + managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString())); } @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/PluggableQuorumReplicationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/PluggableQuorumReplicationTest.java index 714b2982db..69eadfd539 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/PluggableQuorumReplicationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/PluggableQuorumReplicationTest.java @@ -47,19 +47,15 @@ import org.apache.activemq.artemis.quorum.file.FileBasedPrimitiveManager; import org.apache.activemq.artemis.tests.util.Wait; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.TemporaryFolder; public class PluggableQuorumReplicationTest extends SharedNothingReplicationTest { private DistributedPrimitiveManagerConfiguration managerConfiguration; - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); @Before public void init() throws IOException { - managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", tmpFolder.newFolder("manager").toString())); + managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString())); } @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java index 88da15e93d..ce873c5d8c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java @@ -100,18 +100,13 @@ import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public final class ReplicationTest extends ActiveMQTestBase { - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); - @Parameterized.Parameter public boolean pluggableQuorum; @@ -168,7 +163,7 @@ public final class ReplicationTest extends ActiveMQTestBase { } else { DistributedPrimitiveManagerConfiguration managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), - Collections.singletonMap("locks-folder", tmpFolder.newFolder("manager").toString())); + Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString())); ReplicatedBackupUtils.configurePluggableQuorumReplicationPair(backupConfig, backupConnector, backupAcceptor, liveConfig, liveConnector, liveAcceptor, managerConfiguration, managerConfiguration); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/PluggableQuorumBasicSecurityManagerFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/PluggableQuorumBasicSecurityManagerFailoverTest.java index 267f553211..2a6259c60d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/PluggableQuorumBasicSecurityManagerFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/PluggableQuorumBasicSecurityManagerFailoverTest.java @@ -51,7 +51,7 @@ public class PluggableQuorumBasicSecurityManagerFailoverTest extends FailoverTes DistributedPrimitiveManagerConfiguration managerConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", - tmpFolder.newFolder("manager").toString())); + temporaryFolder.newFolder("manager").toString())); ReplicatedBackupUtils.configurePluggableQuorumReplicationPair(backupConfig, backupConnector, backupAcceptor, liveConfig, liveConnector, null, diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumSinglePairTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumSinglePairTest.java index 57f1cce866..b284541708 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumSinglePairTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumSinglePairTest.java @@ -28,8 +28,6 @@ import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; public class ZookeeperPluggableQuorumSinglePairTest extends PluggableQuorumSinglePairTest { @@ -38,9 +36,7 @@ public class ZookeeperPluggableQuorumSinglePairTest extends PluggableQuorumSingl // Beware: the server tick must be small enough that to let the session to be correctly expired private static final int SERVER_TICK_MS = 100; - @Rule - public TemporaryFolder tmpFolder = new TemporaryFolder(); - protected TestingCluster testingServer; + private TestingCluster testingServer; private InstanceSpec[] clusterSpecs; private int nodes; @@ -51,7 +47,7 @@ public class ZookeeperPluggableQuorumSinglePairTest extends PluggableQuorumSingl nodes = 3; clusterSpecs = new InstanceSpec[nodes]; for (int i = 0; i < nodes; i++) { - clusterSpecs[i] = new InstanceSpec(tmpFolder.newFolder(), BASE_SERVER_PORT + i, -1, -1, true, -1, SERVER_TICK_MS, -1); + clusterSpecs[i] = new InstanceSpec(temporaryFolder.newFolder(), BASE_SERVER_PORT + i, -1, -1, true, -1, SERVER_TICK_MS, -1); } testingServer = new TestingCluster(clusterSpecs); testingServer.start();