ARTEMIS-3340 Removing not needed TemporaryFolder usages on tests
This commit is contained in:
parent
ca7a100de0
commit
56299433c3
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue