diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java index f977bb6d1d..305ce977a2 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java @@ -50,7 +50,6 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; import org.apache.activemq.artemis.json.JsonArray; @@ -147,13 +146,13 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void invalidCliDoesntThrowException() { testCli("--silent", "create"); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void invalidPathDoesntThrowException() { if (isWindows()) { testCli("create", "zzzzz:/rawr", "--silent"); @@ -163,7 +162,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSupportsLibaio() throws Exception { Create x = new Create(); x.setInstance(new File("/tmp/foo")); @@ -171,7 +170,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSync() throws Exception { int writes = 2; int tries = 5; @@ -184,7 +183,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSimpleCreate() throws Exception { //instance1: default using http File instance1 = new File(temporaryFolder, "instance1"); @@ -193,7 +192,7 @@ public class ArtemisTest extends CliTestBase { @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDB() throws Exception { File instance1 = new File(temporaryFolder, "instance1"); Artemis.internalExecute("create", instance1.getAbsolutePath(), "--silent", "--jdbc"); @@ -201,7 +200,7 @@ public class ArtemisTest extends CliTestBase { @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSimpleCreateMapped() throws Throwable { try { //instance1: default using http @@ -214,7 +213,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOpenwireSupportAdvisoryDisabledByDefault() throws Exception { FileConfiguration configuration = createFileConfiguration("supportAdvisory", "--force", "--silent", "--no-web", "--no-autotune"); @@ -225,7 +224,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOpenwireEnabledSupportAdvisory() throws Exception { FileConfiguration configuration = createFileConfiguration("supportAdvisory", "--force", "--silent", "--no-web", "--no-autotune", @@ -261,7 +260,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWebConfig() throws Exception { setupAuth(); Run.setEmbedded(true); @@ -339,7 +338,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSecurityManagerConfiguration() throws Exception { setupAuth(); Run.setEmbedded(true); @@ -417,7 +416,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testStopManagementContext() throws Exception { Run.setEmbedded(true); File instance1 = new File(temporaryFolder, "instance_user"); @@ -433,13 +432,13 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandJAAS() throws Exception { testUserCommand(false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandBasic() throws Exception { testUserCommand(true); } @@ -609,25 +608,25 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandViaManagementPlaintextJAAS() throws Exception { internalTestUserCommandViaManagement(true, false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandViaManagementHashedJAAS() throws Exception { internalTestUserCommandViaManagement(false, false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandViaManagementPlaintextBasic() throws Exception { internalTestUserCommandViaManagement(true, true); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandViaManagementHashedBasic() throws Exception { internalTestUserCommandViaManagement(false, true); } @@ -734,7 +733,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testListUserWithMultipleRolesWithSpaces() throws Exception { try { Run.setEmbedded(true); @@ -775,13 +774,13 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testProperReloadWhenAddingUserViaManagementJAAS() throws Exception { testProperReloadWhenAddingUserViaManagement(false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testProperReloadWhenAddingUserViaManagementBasic() throws Exception { testProperReloadWhenAddingUserViaManagement(true); } @@ -826,7 +825,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMissingUserFileViaManagement() throws Exception { Run.setEmbedded(true); File instance1 = new File(temporaryFolder, "instance_user"); @@ -850,7 +849,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMissingRoleFileViaManagement() throws Exception { Run.setEmbedded(true); File instance1 = new File(temporaryFolder, "instance_user"); @@ -874,13 +873,13 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandResetJAAS() throws Exception { testUserCommandReset(false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandResetBasic() throws Exception { testUserCommandReset(true); } @@ -1007,13 +1006,13 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConcurrentUserAdministrationJAAS() throws Exception { testConcurrentUserAdministration(false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConcurrentUserAdministrationBasic() throws Exception { testConcurrentUserAdministration(true); } @@ -1121,7 +1120,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRoleWithSpaces() throws Exception { String roleWithSpaces = "amq with spaces"; Run.setEmbedded(true); @@ -1152,13 +1151,13 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandResetViaManagementPlaintext() throws Exception { internalTestUserCommandResetViaManagement(true); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUserCommandResetViaManagementHashed() throws Exception { internalTestUserCommandResetViaManagement(false); } @@ -1233,7 +1232,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMaskCommand() throws Exception { String password1 = "password"; @@ -1270,7 +1269,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMaskCommandWithPasswordCodec() throws Exception { File instanceWithPasswordCodec = new File(temporaryFolder, "instance_with_password_codec"); Files.createDirectories(Paths.get(instanceWithPasswordCodec.getAbsolutePath(), "etc")); @@ -1300,13 +1299,13 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSimpleRun() throws Exception { testSimpleRun("server"); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testProducerRetry() throws Exception { File instanceFolder = newFolder(temporaryFolder, "server"); setupAuth(instanceFolder); @@ -1338,27 +1337,27 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWeirdCharacter() throws Exception { testSimpleRun("test%26%26x86_6"); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSpaces() throws Exception { testSimpleRun("with space"); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCustomPort() throws Exception { testSimpleRun("server", 61696); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPerfJournal() throws Exception { File instanceFolder = newFolder(temporaryFolder, "server1"); setupAuth(instanceFolder); @@ -1487,13 +1486,13 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAutoDeleteTrue() throws Exception { testAutoDelete(true); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAutoDeleteFalse() throws Exception { testAutoDelete(false); } @@ -1546,7 +1545,7 @@ public class ArtemisTest extends CliTestBase { @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPing() throws Exception { File instanceFolder = newFolder(temporaryFolder, "pingTest"); @@ -1569,7 +1568,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAutoTune() throws Exception { File instanceFolder = newFolder(temporaryFolder, "autoTuneTest"); @@ -1591,7 +1590,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQstat() throws Exception { File instanceQstat = new File(temporaryFolder, "instanceQStat"); @@ -1842,7 +1841,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testHugeQstat() throws Exception { File instanceQstat = new File(temporaryFolder, "instanceQStat"); @@ -1870,7 +1869,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQstatColumnWidth() throws Exception { File instanceQstat = new File(temporaryFolder, "instanceQStat"); @@ -1943,7 +1942,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQstatErrors() throws Exception { File instanceQstat = new File(temporaryFolder, "instanceQStatErrors"); @@ -2047,7 +2046,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQstatWarnings() throws Exception { File instanceQstat = new File(temporaryFolder, "instanceQStat"); @@ -2130,7 +2129,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRunPropertiesArgumentSetsAcceptorPort() throws Exception { File instanceFile = new File(temporaryFolder, "testRunPropertiesArgumentSetsAcceptorPort"); setupAuth(instanceFile); @@ -2152,7 +2151,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRunPropertiesDudArgument() throws Exception { File instanceFile = new File(temporaryFolder, "testRunPropertiesDudArgument"); setupAuth(instanceFile); @@ -2166,7 +2165,7 @@ public class ArtemisTest extends CliTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testVersionCommand() throws Exception { TestActionContext context = new TestActionContext(); PrintVersion printVersion = new PrintVersion(); diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java index dcd315a840..b12e2fd5b7 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java @@ -329,7 +329,7 @@ public class NetworkHealthTest { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPurePingTimeout() throws Exception { NetworkHealthCheck check = new NetworkHealthCheck(null, 100, 2000); diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImplTest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImplTest.java index a465b6868e..8c0f0019eb 100644 --- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImplTest.java +++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImplTest.java @@ -24,7 +24,6 @@ import java.io.IOException; import java.io.OutputStream; import java.lang.invoke.MethodHandles; import java.util.Arrays; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.apache.activemq.artemis.api.core.ActiveMQException; @@ -39,7 +38,7 @@ public class LargeMessageControllerImplTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 10_000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testControllerTimeout() throws Exception { ClientConsumerInternal consumerMock = Mockito.mock(ClientConsumerInternal.class); diff --git a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/StateSerDeTest.java b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/StateSerDeTest.java index 2f3fee14f3..fe1ad10bed 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/StateSerDeTest.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/StateSerDeTest.java @@ -20,8 +20,6 @@ package org.apache.activemq.artemis.core.protocol.mqtt; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import java.util.concurrent.TimeUnit; - import io.netty.handler.codec.mqtt.MqttQoS; import io.netty.handler.codec.mqtt.MqttSubscriptionOption; import io.netty.handler.codec.mqtt.MqttTopicSubscription; @@ -34,7 +32,7 @@ import org.junit.jupiter.api.Timeout; public class StateSerDeTest { @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSerDe() throws Exception { for (int i = 0; i < 500; i++) { String clientId = RandomUtil.randomString(); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java index a209e5c478..3358d477b5 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java @@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -34,7 +33,7 @@ public class MainTest { /* Tests what happens when no workdir arg is given and the default can't * be accessed as not in container env, expect to throw IOE. */ @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testNull() throws Exception { try { Main.main(new String[] {""}); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/BackupActivationNoReconnectTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/BackupActivationNoReconnectTest.java index 4baabf2553..456273a2e7 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/BackupActivationNoReconnectTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/BackupActivationNoReconnectTest.java @@ -81,7 +81,7 @@ import org.mockito.stubbing.Answer; public class BackupActivationNoReconnectTest { @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void verifyReplicationBackupActivation() throws Exception { ReplicationBackupPolicy policy = Mockito.mock(ReplicationBackupPolicy.class); ReplicationPrimaryPolicy replicationPrimaryPolicy = Mockito.mock(ReplicationPrimaryPolicy.class); @@ -95,7 +95,7 @@ public class BackupActivationNoReconnectTest { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void verifySharedNothingBackupActivation() throws Exception { ActiveMQServerImpl server = Mockito.mock(ActiveMQServerImpl.class); when(server.isStarted()).thenReturn(true); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcSharedStateManagerTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcSharedStateManagerTest.java index f017082289..edf269d5a9 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcSharedStateManagerTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcSharedStateManagerTest.java @@ -17,7 +17,6 @@ package org.apache.activemq.artemis.core.server.impl.jdbc; import java.util.UUID; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.core.config.storage.DatabaseStorageConfiguration; import org.apache.activemq.artemis.jdbc.store.drivers.JDBCUtils; @@ -58,7 +57,7 @@ public class JdbcSharedStateManagerTest extends ServerTestBase { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void shouldStartIfTableNotExist() throws Exception { final JdbcSharedStateManager sharedStateManager = createSharedStateManager(); try { @@ -69,7 +68,7 @@ public class JdbcSharedStateManagerTest extends ServerTestBase { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void shouldStartIfTableExistEmpty() throws Exception { final TestJDBCDriver fakeDriver = createFakeDriver(false); fakeDriver.start(); @@ -83,7 +82,7 @@ public class JdbcSharedStateManagerTest extends ServerTestBase { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void shouldStartIfTableExistInitialized() throws Exception { final TestJDBCDriver fakeDriver = createFakeDriver(true); fakeDriver.start(); @@ -97,7 +96,7 @@ public class JdbcSharedStateManagerTest extends ServerTestBase { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void shouldStartTwoIfTableNotExist() throws Exception { final JdbcSharedStateManager liveSharedStateManager = createSharedStateManager(); final JdbcSharedStateManager backupSharedStateManager = createSharedStateManager(); diff --git a/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/client/ConnectionDroppedTest.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/client/ConnectionDroppedTest.java index 8e31764129..fc0f6f34b5 100644 --- a/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/client/ConnectionDroppedTest.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/client/ConnectionDroppedTest.java @@ -74,7 +74,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testConsumerDroppedWithProtonTestClient() throws Exception { int NUMBER_OF_CONNECTIONS = 100; ActiveMQServer server = createServer(true, createDefaultConfig(true)); @@ -118,7 +118,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRegularClose() throws Exception { int NUMBER_OF_CONNECTIONS = 100; int REPEATS = 10; @@ -509,7 +509,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase { @Test - @Timeout(value = 10_000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testForceDropOpenWire() throws Throwable { ActiveMQServer server = createServer(true, createDefaultConfig(true)); server.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/SendDLQNoRouteTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/SendDLQNoRouteTest.java index 7b538e3cc9..71ed2e59d1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/SendDLQNoRouteTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/SendDLQNoRouteTest.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.tests.integration.addressing; -import java.util.concurrent.TimeUnit; - import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.client.ClientProducer; @@ -46,7 +44,7 @@ public class SendDLQNoRouteTest extends ActiveMQTestBase { @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testDLQNoRoute() throws Exception { AddressSettings addressSettings = new AddressSettings().setSendToDLAOnNoRoute(true); addressSettings.setDeadLetterAddress(SimpleString.toSimpleString("DLA")); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/TwoWaysRemoveAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/TwoWaysRemoveAddressTest.java index 6595046722..c7627b4377 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/TwoWaysRemoveAddressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/TwoWaysRemoveAddressTest.java @@ -43,7 +43,7 @@ public class TwoWaysRemoveAddressTest extends ActiveMQTestBase { private static Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDeadLock() throws Throwable { ActiveMQServer server = addServer(createServer(false)); server.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpAnonymousRelayTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpAnonymousRelayTest.java index 1cd6eecf60..228378bca5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpAnonymousRelayTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpAnonymousRelayTest.java @@ -78,7 +78,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageOnAnonymousProducerCausesQueueAutoCreation() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -120,7 +120,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageOnAnonymousProducerCausesTopicAutoCreation() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -179,7 +179,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageOnAnonymousProducerWithDestinationTypeAnnotationCausesQueueAutoCreation() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -225,7 +225,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageOnAnonymousProducerWithDestinationTypeAnnotationCausesTopicAutoCreation() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -286,7 +286,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageOnAnonymousRelayLinkUsingMessageTo() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -318,7 +318,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageFailsOnAnonymousRelayLinkWhenNoToValueSet() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -346,7 +346,7 @@ public class AmqpAnonymousRelayTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageFailsOnAnonymousRelayWhenToFieldHasNonExistingAddress() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpAnyCastDistinctQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpAnyCastDistinctQueueTest.java index 87d05790bc..b5bd2b2983 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpAnyCastDistinctQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpAnyCastDistinctQueueTest.java @@ -30,7 +30,6 @@ import javax.jms.TextMessage; import org.apache.activemq.artemis.api.core.QueueConfiguration; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.impl.AddressInfo; @@ -49,7 +48,7 @@ public class AmqpAnyCastDistinctQueueTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDistinctQueueAddressAnyCast() throws Exception { String ADDRESS_NAME = "DISTINCT_ADDRESS_testDistinctAddressAnyCast"; String QUEUE_NAME = "DISTINCT_QUEUE_testDistinctQUEUE_AnyCast"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpBrokerRequestedHearbeatsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpBrokerRequestedHearbeatsTest.java index 3e0fc3c47d..259e3b06f6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpBrokerRequestedHearbeatsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpBrokerRequestedHearbeatsTest.java @@ -76,7 +76,7 @@ public class AmqpBrokerRequestedHearbeatsTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrokerSendsHalfConfiguredIdleTimeout() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); @@ -97,7 +97,7 @@ public class AmqpBrokerRequestedHearbeatsTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrokerSendsHalfConfiguredIdleTimeoutWhenClientSendsTimeout() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); @@ -120,7 +120,7 @@ public class AmqpBrokerRequestedHearbeatsTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClientWithoutHeartbeatsGetsDropped() throws Exception { final CountDownLatch disconnected = new CountDownLatch(1); @@ -151,7 +151,7 @@ public class AmqpBrokerRequestedHearbeatsTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClientWithHeartbeatsStaysAlive() throws Exception { final CountDownLatch disconnected = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDLQReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDLQReceiverTest.java index b0200b9d46..83c1b85492 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDLQReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDLQReceiverTest.java @@ -41,7 +41,7 @@ public class AmqpDLQReceiverTest extends AmqpClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDurableReceiver() throws Exception { AmqpClient client = createAmqpClient(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDeliveryAnnotationsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDeliveryAnnotationsTest.java index 0ecd11f0bb..acb8a2b179 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDeliveryAnnotationsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDeliveryAnnotationsTest.java @@ -40,7 +40,7 @@ public class AmqpDeliveryAnnotationsTest extends AmqpClientTestSupport { private final String DELIVERY_ANNOTATION_NAME = "TEST-DELIVERY-ANNOTATION"; @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDeliveryAnnotationsStrippedFromIncoming() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDescribedTypePayloadTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDescribedTypePayloadTest.java index 4ff863d029..ee4a3b9383 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDescribedTypePayloadTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDescribedTypePayloadTest.java @@ -51,7 +51,7 @@ import org.junit.jupiter.api.Timeout; public class AmqpDescribedTypePayloadTest extends JMSClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageWithDescribedTypeInBody() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -77,7 +77,7 @@ public class AmqpDescribedTypePayloadTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageWithDescribedTypeInBodyReceiveOverOpenWire() throws Exception { AmqpClient client = createAmqpClient(); @@ -111,7 +111,7 @@ public class AmqpDescribedTypePayloadTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDescribedTypeMessageRoundTrips() throws Exception { AmqpClient client = createAmqpClient(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverReconnectWithMulticastPrefixTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverReconnectWithMulticastPrefixTest.java index 451f56ee46..b1ab8daaaa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverReconnectWithMulticastPrefixTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverReconnectWithMulticastPrefixTest.java @@ -100,7 +100,7 @@ public class AmqpDurableReceiverReconnectWithMulticastPrefixTest extends JMSClie } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReattachToDurableNodeAndTryAndReceiveNewlySentMessage() throws Exception { final String addressName = "test-address"; final String prefixedName = MULTICAST_PREFIX + addressName; @@ -148,7 +148,7 @@ public class AmqpDurableReceiverReconnectWithMulticastPrefixTest extends JMSClie } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReattachToDurableNodeAndTryAndReceivePreviouslySentMessage() throws Exception { final String addressName = "test-address"; final String prefixedName = MULTICAST_PREFIX + addressName; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java index bd0dfd04bd..1dcade2b1b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java @@ -60,7 +60,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { private final String SELECTOR_STRING = "color = red"; @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDurableReceiver() throws Exception { AmqpClient client = createAmqpClient(); @@ -89,7 +89,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDetachedDurableReceiverRemainsActive() throws Exception { AmqpClient client = createAmqpClient(); @@ -133,7 +133,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCloseDurableReceiverRemovesSubscription() throws Exception { AmqpClient client = createAmqpClient(); @@ -154,7 +154,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReattachToDurableNode() throws Exception { AmqpClient client = createAmqpClient(); @@ -175,7 +175,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLookupExistingSubscription() throws Exception { AmqpClient client = createAmqpClient(); @@ -217,7 +217,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLookupExistingSubscriptionWithSelector() throws Exception { AmqpClient client = createAmqpClient(); @@ -260,7 +260,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLookupExistingSubscriptionWithNoLocal() throws Exception { AmqpClient client = createAmqpClient(); @@ -301,7 +301,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLookupExistingSubscriptionWithSelectorAndNoLocal() throws Exception { AmqpClient client = createAmqpClient(); @@ -344,7 +344,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLookupNonExistingSubscription() throws Exception { AmqpClient client = createAmqpClient(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java index 0df62a268e..2472f57cc6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java @@ -63,7 +63,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageThatIsAlreadyExpiredUsingAbsoluteTime() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -94,7 +94,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExpiryThroughTTL() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -153,7 +153,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRetryExpiry() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -202,7 +202,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { /** This test is validating a broker feature where the message copy through the DLQ will receive an annotation. * It is also testing filter on that annotation. */ @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExpiryThroughTTLValidateAnnotation() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -275,7 +275,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { /** This test is validating a broker feature where the message copy through the DLQ will receive an annotation. * It is also testing filter on that annotation. */ @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExpiryQpidJMS() throws Exception { ConnectionFactory factory = CFUtil.createConnectionFactory("AMQP", getBrokerAmqpConnectionURI().toString()); Connection connection = factory.createConnection(); @@ -312,7 +312,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageThatIsNotExpiredUsingAbsoluteTime() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -344,7 +344,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageThatIsExiredUsingAbsoluteTimeWithLongTTL() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -378,7 +378,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageThatIsExpiredUsingTTLWhenAbsoluteIsZero() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -412,7 +412,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageThatIsNotExpiredUsingAbsoluteTimeWithElspsedTTL() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -446,7 +446,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageThatIsNotExpiredUsingTimeToLive() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -478,7 +478,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageThenAllowToExpiredUsingTimeToLive() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -512,13 +512,13 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExpiredMessageLandsInDLQ() throws Throwable { internalSendExpiry(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExpiredMessageLandsInDLQAndExistsAfterRestart() throws Throwable { internalSendExpiry(true); } @@ -568,7 +568,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExpirationAfterDivert() throws Throwable { final String FORWARDING_ADDRESS = RandomUtil.randomString(); server.createQueue(new QueueConfiguration(FORWARDING_ADDRESS).setRoutingType(RoutingType.ANYCAST)); @@ -634,7 +634,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDLQdMessageCanBeRedeliveredMultipleTimes() throws Throwable { AmqpClient client = createAmqpClient(); AmqpConnection connection = client.connect(); @@ -686,13 +686,13 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExpireThorughAddressSettings() throws Exception { testExpireThorughAddressSettings(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExpireThorughAddressSettingsRebootServer() throws Exception { testExpireThorughAddressSettings(true); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFailoverEndpointDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFailoverEndpointDiscoveryTest.java index 64b890a029..f27caa8ced 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFailoverEndpointDiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFailoverEndpointDiscoveryTest.java @@ -28,7 +28,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.core.config.ha.SharedStoreBackupPolicyConfiguration; @@ -90,7 +89,7 @@ public class AmqpFailoverEndpointDiscoveryTest extends FailoverTestBase { } @TestTemplate - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailoverListWithAMQP() throws Exception { JmsConnectionFactory factory = getJmsConnectionFactory(); try (Connection connection = factory.createConnection()) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlFailDispositionTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlFailDispositionTests.java index cb4eadca00..b06dd1e4b4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlFailDispositionTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlFailDispositionTests.java @@ -41,7 +41,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.Map; -import java.util.concurrent.TimeUnit; @ExtendWith(ParameterizedTestExtension.class) public class AmqpFlowControlFailDispositionTests extends JMSClientTestSupport { @@ -79,7 +78,7 @@ public class AmqpFlowControlFailDispositionTests extends JMSClientTestSupport { } @TestTemplate - @Timeout(value = 10_000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testAddressFullDisposition() throws Exception { AmqpClient client = createAmqpClient(getBrokerAmqpConnectionURI()); AmqpConnection connection = client.connect(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java index 3489544b82..6e36163fbc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java @@ -83,7 +83,7 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreditsAreAllocatedOnceOnLinkCreated() throws Exception { AmqpClient client = createAmqpClient(new URI(singleCreditAcceptorURI)); AmqpConnection connection = addConnection(client.connect()); @@ -98,7 +98,7 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreditIsNotGivenOnLinkCreationWhileBlockedAndIsGivenOnceThenUnblocked() throws Exception { AmqpClient client = createAmqpClient(new URI(singleCreditAcceptorURI)); AmqpConnection connection = addConnection(client.connect()); @@ -132,7 +132,7 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreditsAreNotAllocatedWhenAddressIsFull() throws Exception { AmqpClient client = createAmqpClient(new URI(singleCreditAcceptorURI)); AmqpConnection connection = addConnection(client.connect()); @@ -156,7 +156,7 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAddressIsBlockedForOtherProducersWhenFull() throws Exception { Connection connection = createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -179,7 +179,7 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendBlocksWhenAddressBlockedAndCompletesAfterUnblocked() throws Exception { Connection connection = createConnection(new URI(singleCreditAcceptorURI.replace("tcp", "amqp")), null, null, null, true); final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -225,7 +225,7 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreditsAreRefreshedWhenAddressIsUnblocked() throws Exception { fillAddress(getQueueName()); @@ -260,7 +260,7 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testNewLinkAttachAreNotAllocatedCreditsWhenAddressIsBlocked() throws Exception { fillAddress(getQueueName()); @@ -280,7 +280,7 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTxIsRolledBackOnRejectedPreSettledMessage() throws Throwable { // Create the link attach before filling the address to ensure the link is allocated credit. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java index 0124c08acf..f302095419 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java @@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.lang.invoke.MethodHandles; import java.util.HashMap; -import java.util.concurrent.TimeUnit; import javax.jms.Connection; import javax.jms.InvalidDestinationException; @@ -207,7 +206,7 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) //there isn't much use of FQQN for topics //however we can test query functionality public void testTopic() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java index ecbba6518a..26f6636924 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java @@ -31,7 +31,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; @@ -61,7 +60,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { private static final String PRODUCT_NAME = "apache-activemq-artemis"; @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCloseIsSentOnConnectionClose() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection amqpConnection = client.connect(); @@ -80,7 +79,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrokerContainerId() throws Exception { final String containerId = server.getNodeID().toString(); @@ -107,7 +106,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDefaultMaxFrameSize() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); @@ -133,7 +132,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrokerConnectionProperties() throws Exception { AmqpClient client = createAmqpClient(); @@ -176,7 +175,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConnectionCarriesExpectedCapabilities() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); @@ -210,7 +209,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCanConnectWithDifferentContainerIds() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); @@ -235,7 +234,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCannotConnectWithSameContainerId() throws Exception { AmqpClient client = createAmqpClient(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpIngressTimestampTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpIngressTimestampTest.java index c1fc281ec4..78aa3b9672 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpIngressTimestampTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpIngressTimestampTest.java @@ -72,19 +72,19 @@ public class AmqpIngressTimestampTest extends AmqpClientTestSupport { public boolean large; @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testIngressTimestampSendCore() throws Exception { internalTestIngressTimestamp(Protocol.CORE); } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testIngressTimestampSendAMQP() throws Exception { internalTestIngressTimestamp(Protocol.AMQP); } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testIngressTimestampSendOpenWire() throws Exception { internalTestIngressTimestamp(Protocol.OPENWIRE); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java index 2cecceecb2..ebee476e5b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java @@ -137,7 +137,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAMQPReceiveCore() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -159,7 +159,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndGetData() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -201,7 +201,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAMQPMessageWithComplexAnnotationsReceiveCore() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -248,7 +248,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAMQPReceiveOpenWire() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -301,7 +301,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAMQPReceiveAMQP() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -340,7 +340,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAMQPMessageWithComplexAnnotationsReceiveAMQP() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -397,7 +397,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testHugeString() throws Exception { ConnectionFactory factory = CFUtil.createConnectionFactory("AMQP", "tcp://localhost:5672"); Connection connection = factory.createConnection(); @@ -430,7 +430,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAMQPReceiveAMQPViaJMSObjectMessage() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -448,7 +448,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAMQPReceiveAMQPViaJMSText() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -466,7 +466,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAMQPReceiveAMQPViaJMSBytes() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -494,14 +494,14 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendHugeHeader() throws Exception { assumeFalse(jdbc); // the checked rule with the property size will not be applied to JDBC, hence we skip the test doTestSendHugeHeader(payload); } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendLargeMessageWithHugeHeader() throws Exception { assumeFalse(jdbc); // the checked rule with the property size will not be applied to JDBC, hence we skip the test doTestSendHugeHeader(1024 * 1024); @@ -618,7 +618,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendSmallerMessages() throws Exception { for (int i = 512; i <= (8 * 1024); i += 512) { doTestSendLargeMessage(i); @@ -626,7 +626,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 120_000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSendFixedSizedMessages() throws Exception { doTestSendLargeMessage(65536); doTestSendLargeMessage(65536 * 2); @@ -634,21 +634,21 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 120_000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSend1MBMessage() throws Exception { doTestSendLargeMessage(1024 * 1024); } @Disabled("Useful for performance testing") @TestTemplate - @Timeout(value = 120_000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSend10MBMessage() throws Exception { doTestSendLargeMessage(1024 * 1024 * 10); } @Disabled("Useful for performance testing") @TestTemplate - @Timeout(value = 120_000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSend100MBMessage() throws Exception { doTestSendLargeMessage(1024 * 1024 * 100); } @@ -696,7 +696,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveRedeliveredLargeMessagesWithSessionFlowControl() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -764,7 +764,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveLargeMessagesMultiplexedOnSameSession() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -895,7 +895,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithAmqpValueAndEmptyBinaryPreservesBody() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -933,7 +933,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithDataAndEmptyBinaryPreservesBody() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -971,7 +971,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithDataAndContentTypeOfTextPreservesBodyType() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -1017,7 +1017,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { @SuppressWarnings({ "unchecked", "rawtypes" }) @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithAmqpValueListPreservesBodyType() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); @@ -1061,7 +1061,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { @SuppressWarnings({ "unchecked", "rawtypes" }) @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithAmqpSequencePreservesBodyType() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpManagementTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpManagementTest.java index 833790cc06..4099b366b3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpManagementTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpManagementTest.java @@ -49,7 +49,7 @@ public class AmqpManagementTest extends AmqpClientTestSupport { private static final Binary BINARY_CORRELATION_ID = new Binary("mystring".getBytes(StandardCharsets.UTF_8)); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testManagementQueryOverAMQP() throws Throwable { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -89,7 +89,7 @@ public class AmqpManagementTest extends AmqpClientTestSupport { * @throws Exception */ @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUnsignedValues() throws Exception { int sequence = 42; LinkedHashMap map = new LinkedHashMap<>(); @@ -114,37 +114,37 @@ public class AmqpManagementTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationByMessageIDUUID() throws Throwable { doTestReplyCorrelation(UUID.randomUUID(), false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationByMessageIDString() throws Throwable { doTestReplyCorrelation("mystring", false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationByMessageIDBinary() throws Throwable { doTestReplyCorrelation(BINARY_CORRELATION_ID, false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationByCorrelationIDUUID() throws Throwable { doTestReplyCorrelation(UUID.randomUUID(), true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationByCorrelationIDString() throws Throwable { doTestReplyCorrelation("mystring", true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationByCorrelationIDBinary() throws Throwable { doTestReplyCorrelation(BINARY_CORRELATION_ID, true); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMaxFrameSizeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMaxFrameSizeTest.java index 8a47aa9b96..3dd922b3c3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMaxFrameSizeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMaxFrameSizeTest.java @@ -69,7 +69,7 @@ public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrokerAdvertisedDefaultMaxFrameSize() throws Exception { assertFalse(maxFrameSizeConfigSet, "maxFrameSize should not be explicitly configured"); @@ -97,7 +97,7 @@ public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrokerAdvertisedConfiguredMaxFrameSize() throws Exception { assertTrue(maxFrameSizeConfigSet, "maxFrameSize should be explicitly configured"); @@ -125,7 +125,7 @@ public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testManyMultiFrameTransfersWithClientMaxFrameSizeSmallerThanBrokers() throws Exception { final int clientMaxFrameSize = 1024; final int brokerMaxFrameSize = AmqpSupport.MAX_FRAME_SIZE_DEFAULT; @@ -137,7 +137,7 @@ public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testManyMultiFrameTransfersWithClientMaxFrameSizeLargerThanBrokers() throws Exception { final int clientMaxFrameSize = 2 * AmqpSupport.MAX_FRAME_SIZE_DEFAULT; final int brokerMaxFrameSize = AmqpSupport.MAX_FRAME_SIZE_DEFAULT; @@ -202,7 +202,7 @@ public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSingleAndMultiFrameTransferClientMaxFrameSizeSmallerThanBrokers() throws Exception { final int clientMaxFrameSize = 1024; final int brokerMaxFrameSize = AmqpSupport.MAX_FRAME_SIZE_DEFAULT; @@ -213,7 +213,7 @@ public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSingleAndMultiFrameTransferWithClientMaxFrameSizeLargerThanBrokers() throws Exception { final int clientMaxFrameSize = 2 * AmqpSupport.MAX_FRAME_SIZE_DEFAULT; final int brokerMaxFrameSize = AmqpSupport.MAX_FRAME_SIZE_DEFAULT; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageDivertsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageDivertsTest.java index 629ece3c9e..b76a17733a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageDivertsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageDivertsTest.java @@ -57,13 +57,13 @@ public class AmqpMessageDivertsTest extends AmqpClientTestSupport implements Tra @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQueueReceiverReadMessageWithDivert() throws Exception { runQueueReceiverReadMessageWithDivert(ComponentConfigurationRoutingType.ANYCAST.toString()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQueueReceiverReadMessageWithDivertDefaultRouting() throws Exception { runQueueReceiverReadMessageWithDivert(ActiveMQDefaultConfiguration.getDefaultDivertRoutingType()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessagePriorityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessagePriorityTest.java index 66d26609fd..bf7b4b9f9e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessagePriorityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessagePriorityTest.java @@ -43,7 +43,7 @@ public class AmqpMessagePriorityTest extends AmqpClientTestSupport { protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageDefaultPriority() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -75,7 +75,7 @@ public class AmqpMessagePriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessagePriorityPreservedAfterServerRestart() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -116,7 +116,7 @@ public class AmqpMessagePriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageNonDefaultPriority() throws Exception { AmqpClient client = createAmqpClient(); @@ -149,7 +149,7 @@ public class AmqpMessagePriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithVeryHighPriority() throws Exception { AmqpClient client = createAmqpClient(); @@ -181,7 +181,7 @@ public class AmqpMessagePriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageNoPriority() throws Exception { AmqpClient client = createAmqpClient(); @@ -213,7 +213,7 @@ public class AmqpMessagePriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessagePriorityOrdering() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java index 09939eb8f4..3b7079bd93 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java @@ -29,7 +29,6 @@ import javax.jms.Topic; import org.apache.activemq.artemis.api.core.QueueConfiguration; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl; @@ -57,7 +56,7 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAnycastMessageRoutingExclusivityUsingPrefix() throws Exception { final String addressA = "addressA"; final String queueA = "queueA"; @@ -77,7 +76,7 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAnycastMessageRoutingExclusivityUsingProperty() throws Exception { final String addressA = "addressA"; final String queueA = "queueA"; @@ -97,7 +96,7 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMulticastMessageRoutingExclusivityUsingPrefix() throws Exception { final String addressA = "addressA"; final String queueA = "queueA"; @@ -117,7 +116,7 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMulticastMessageRoutingExclusivityUsingProperty() throws Exception { final String addressA = "addressA"; final String queueA = "queueA"; @@ -144,7 +143,7 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport { * @throws Exception */ @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRoutingExclusivity() throws Exception { // Create Address with both ANYCAST and MULTICAST enabled @@ -182,19 +181,19 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAMQPRouteMessageToJMSOpenWire() throws Throwable { testAMQPRouteMessageToJMS(createOpenWireConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAMQPRouteMessageToJMSAMQP() throws Throwable { testAMQPRouteMessageToJMS(createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAMQPRouteMessageToJMSCore() throws Throwable { testAMQPRouteMessageToJMS(createCoreConnection()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpNoHearbeatsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpNoHearbeatsTest.java index a12c09dbe0..8b3d5a5495 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpNoHearbeatsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpNoHearbeatsTest.java @@ -77,7 +77,7 @@ public class AmqpNoHearbeatsTest extends AmqpClientTestSupport { @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testHeartless() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); @@ -101,7 +101,7 @@ public class AmqpNoHearbeatsTest extends AmqpClientTestSupport { // This is done by setting soLinger=0 on the socket, which will make the system to issue a connection.reset instead of sending a // disconnect. @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCloseConsumerOnConnectionReset() throws Exception { AmqpClient client = createAmqpClient(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpNonDurableReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpNonDurableReceiverTest.java index c2888fa943..ba9ddfd9dc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpNonDurableReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpNonDurableReceiverTest.java @@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.activemq.artemis.api.core.SimpleString; @@ -38,7 +37,7 @@ import org.junit.jupiter.api.Timeout; public class AmqpNonDurableReceiverTest extends AmqpClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLinkDetachReleasesResources() throws Exception { AmqpClient client = createAmqpClient(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpOutboundConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpOutboundConnectionTest.java index 9d7398bd94..8a62d2e09b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpOutboundConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpOutboundConnectionTest.java @@ -26,7 +26,6 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; @@ -55,19 +54,19 @@ public class AmqpOutboundConnectionTest extends AmqpClientTestSupport { private boolean securityEnabled; @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOutboundConnection() throws Throwable { runOutboundConnectionTest(false, true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOutboundConnectionServerClose() throws Throwable { runOutboundConnectionTest(false, false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOutboundConnectionWithSecurity() throws Throwable { runOutboundConnectionTest(true, true); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPipelinedConnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPipelinedConnectTest.java index 926d7a8d48..97431c672b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPipelinedConnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPipelinedConnectTest.java @@ -25,7 +25,6 @@ import java.io.OutputStream; import java.lang.invoke.MethodHandles; import java.net.Socket; import java.nio.ByteBuffer; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; @@ -55,7 +54,7 @@ public class AmqpPipelinedConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPipelinedOpenWhenAnonymousWillFail() throws Exception { // Frame data for: SaslInit diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPresettledReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPresettledReceiverTest.java index ffc5a2c06c..27fbbddf16 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPresettledReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPresettledReceiverTest.java @@ -45,7 +45,7 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPresettledReceiverAndNonPresettledReceiverOnSameQueue() throws Exception { final int MSG_COUNT = 2; sendMessages(getQueueName(), MSG_COUNT); @@ -96,7 +96,7 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPresettledReceiverReadsAllMessages() throws Exception { final int MSG_COUNT = 100; sendMessages(getQueueName(), MSG_COUNT); @@ -133,7 +133,7 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPresettledReceiverReadsAllMessagesInWhenReadInBatches() throws Exception { final int MSG_COUNT = 100; sendMessages(getQueueName(), MSG_COUNT); @@ -186,13 +186,13 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPresettledReceiverWithinBoundsOfActiveTXWithCommit() throws Exception { doTestPresettledReceiverWithinBoundsOfActiveTX(true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPresettledReceiverWithinBoundsOfActiveTXWithRollback() throws Exception { doTestPresettledReceiverWithinBoundsOfActiveTX(false); } @@ -233,7 +233,7 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPresettledReceiverWithinBoundsOfActiveTXWithSendAndRollback() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpProtocolHeaderHandlingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpProtocolHeaderHandlingTest.java index 574c315e45..ee57f5b332 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpProtocolHeaderHandlingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpProtocolHeaderHandlingTest.java @@ -39,7 +39,7 @@ public class AmqpProtocolHeaderHandlingTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testNonSaslHeaderRejectedOnConnect() throws Exception { final AmqpHeader header = new AmqpHeader(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPurgeOnNoConsumersTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPurgeOnNoConsumersTest.java index 80fef96425..fcad7f3ccb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPurgeOnNoConsumersTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPurgeOnNoConsumersTest.java @@ -51,7 +51,7 @@ public class AmqpPurgeOnNoConsumersTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQueueReceiverReadMessage() throws Exception { AmqpConnection connection = null; String queue = "purgeQueue"; @@ -109,7 +109,7 @@ public class AmqpPurgeOnNoConsumersTest extends AmqpClientTestSupport { // I'm adding the core test here to compare semantics between AMQP and core on this test. @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPurgeQueueCoreRollback() throws Exception { String queue = "purgeQueue"; SimpleString ssQueue = new SimpleString(queue); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionRejectAsUnmodifiedModeTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionRejectAsUnmodifiedModeTests.java index ae4ffb6e02..3939bb3b1f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionRejectAsUnmodifiedModeTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionRejectAsUnmodifiedModeTests.java @@ -39,7 +39,7 @@ public class AmqpReceiverDispositionRejectAsUnmodifiedModeTests extends AmqpClie } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testRejectedDisposition() throws Exception { sendMessages(getQueueName(), 1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionTest.java index 12169cac6f..5a04044e22 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionTest.java @@ -41,7 +41,7 @@ import org.junit.jupiter.api.Timeout; public class AmqpReceiverDispositionTest extends AmqpClientTestSupport { @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testReleasedDisposition() throws Exception { sendMessages(getQueueName(), 1); @@ -81,7 +81,7 @@ public class AmqpReceiverDispositionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testRejectedDisposition() throws Exception { sendMessages(getQueueName(), 1); @@ -117,25 +117,25 @@ public class AmqpReceiverDispositionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testModifiedDispositionWithDeliveryFailedWithoutUndeliverableHereFieldsSet() throws Exception { doModifiedDispositionTestImpl(Boolean.TRUE, null); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testModifiedDispositionWithoutDeliveryFailedWithoutUndeliverableHereFieldsSet() throws Exception { doModifiedDispositionTestImpl(null, null); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testModifiedDispositionWithoutDeliveryFailedWithUndeliverableHereFieldsSet() throws Exception { doModifiedDispositionTestImpl(null, Boolean.TRUE); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testModifiedDispositionWithDeliveryFailedWithUndeliverableHereFieldsSet() throws Exception { doModifiedDispositionTestImpl(Boolean.TRUE, Boolean.TRUE); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDrainTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDrainTest.java index 8783ecc434..c0c9ad51c8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDrainTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDrainTest.java @@ -43,13 +43,13 @@ public class AmqpReceiverDrainTest extends AmqpClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiverCanDrainMessagesQueue() throws Exception { doTestReceiverCanDrainMessages(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiverCanDrainMessagesTopic() throws Exception { doTestReceiverCanDrainMessages(true); } @@ -90,13 +90,13 @@ public class AmqpReceiverDrainTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPullWithNoMessageGetDrainedQueue() throws Exception { doTestPullWithNoMessageGetDrained(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPullWithNoMessageGetDrainedTopic() throws Exception { doTestPullWithNoMessageGetDrained(true); } @@ -133,13 +133,13 @@ public class AmqpReceiverDrainTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPullOneFromRemoteQueue() throws Exception { doTestPullOneFromRemote(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPullOneFromRemoteTopic() throws Exception { doTestPullOneFromRemote(true); } @@ -180,13 +180,13 @@ public class AmqpReceiverDrainTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMultipleZeroResultPullsQueue() throws Exception { doTestMultipleZeroResultPulls(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMultipleZeroResultPullsTopic() throws Exception { doTestMultipleZeroResultPulls(true); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverPriorityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverPriorityTest.java index 86f9e59f87..f215ec4a7d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverPriorityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverPriorityTest.java @@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit; public class AmqpReceiverPriorityTest extends AmqpClientTestSupport { @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPriority() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -99,7 +99,7 @@ public class AmqpReceiverPriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPrioritySetOnAddress() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -154,7 +154,7 @@ public class AmqpReceiverPriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testAttachPropertiesPriorityTakesPrecedenceOverAddress() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -215,7 +215,7 @@ public class AmqpReceiverPriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testBadValueInPriorityPropertyOnAddress() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -240,13 +240,13 @@ public class AmqpReceiverPriorityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPriorityProvidedAsByte() throws Exception { testPriorityNumber((byte) 5); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPriorityProvidedAsUnsignedInteger() throws Exception { testPriorityNumber(UnsignedInteger.valueOf(5)); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverTest.java index afd24b0c37..ca71f8a754 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverTest.java @@ -26,7 +26,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import javax.jms.JMSException; @@ -61,7 +60,7 @@ import org.junit.jupiter.api.Timeout; public class AmqpReceiverTest extends AmqpClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateQueueReceiver() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -77,7 +76,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateTopicReceiver() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -94,7 +93,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateQueueReceiverWithNoLocalSet() throws Exception { AmqpClient client = createAmqpClient(); @@ -128,7 +127,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateQueueReceiverWithJMSSelector() throws Exception { AmqpClient client = createAmqpClient(); @@ -161,7 +160,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testInvalidFilter() throws Exception { AmqpClient client = createAmqpClient(); @@ -179,19 +178,19 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSenderSettlementModeSettledIsHonored() throws Exception { doTestSenderSettlementModeIsHonored(SenderSettleMode.SETTLED); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSenderSettlementModeUnsettledIsHonored() throws Exception { doTestSenderSettlementModeIsHonored(SenderSettleMode.UNSETTLED); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSenderSettlementModeMixedIsHonored() throws Exception { doTestSenderSettlementModeIsHonored(SenderSettleMode.MIXED); } @@ -216,13 +215,13 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiverSettlementModeSetToFirst() throws Exception { doTestReceiverSettlementModeForcedToFirst(ReceiverSettleMode.FIRST); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiverSettlementModeSetToSecond() throws Exception { doTestReceiverSettlementModeForcedToFirst(ReceiverSettleMode.SECOND); } @@ -251,7 +250,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClientIdIsSetInSubscriptionList() throws Exception { server.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("mytopic"), RoutingType.ANYCAST)); @@ -280,7 +279,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLinkDetachSentWhenQueueDeleted() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -298,7 +297,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLinkDetatchErrorIsCorrectWhenQueueDoesNotExists() throws Exception { AddressSettings value = new AddressSettings(); value.setAutoCreateQueues(false); @@ -328,7 +327,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUnsupportedFiltersAreNotListedAsSupported() throws Exception { AmqpClient client = createAmqpClient(); @@ -374,7 +373,7 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiverCloseSendsRemoteClose() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverWithFiltersTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverWithFiltersTest.java index 499879c63c..ebe3401585 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverWithFiltersTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverWithFiltersTest.java @@ -56,7 +56,7 @@ public class AmqpReceiverWithFiltersTest extends AmqpClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUnsupportedFiltersAreNotListedAsSupported() throws Exception { AmqpClient client = createAmqpClient(); @@ -100,7 +100,7 @@ public class AmqpReceiverWithFiltersTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSupportedFiltersAreListedAsSupported() throws Exception { AmqpClient client = createAmqpClient(); @@ -133,7 +133,7 @@ public class AmqpReceiverWithFiltersTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceivedUnsignedFilter() throws Exception { final int NUM_MESSAGES = 100; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpScheduledMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpScheduledMessageTest.java index cc1ec8ac92..055fdad6d1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpScheduledMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpScheduledMessageTest.java @@ -45,7 +45,7 @@ import org.junit.jupiter.api.Timeout; public class AmqpScheduledMessageTest extends AmqpClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendWithDeliveryTimeIsScheduled() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -79,7 +79,7 @@ public class AmqpScheduledMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendRecvWithDeliveryTime() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -132,7 +132,7 @@ public class AmqpScheduledMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testScheduleWithDelay() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -172,7 +172,7 @@ public class AmqpScheduledMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendWithDeliveryTimeHoldsMessage() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); @@ -201,7 +201,7 @@ public class AmqpScheduledMessageTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendWithDeliveryTimeDeliversMessageAfterDelay() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSecurityTest.java index d29655b8ba..489607712b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSecurityTest.java @@ -51,7 +51,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSaslAuthWithInvalidCredentials() throws Exception { AmqpConnection connection = null; AmqpClient client = createAmqpClient(guestUser, fullUser); @@ -69,7 +69,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSaslAuthWithAuthzid() throws Exception { AmqpConnection connection = null; AmqpClient client = createAmqpClient(guestPass, guestUser); @@ -87,7 +87,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSaslAuthWithoutAuthzid() throws Exception { AmqpConnection connection = null; AmqpClient client = createAmqpClient(guestPass, guestUser); @@ -104,7 +104,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndRejected() throws Exception { AmqpClient client = createAmqpClient(guestPass, guestUser); client.setValidator(new AmqpValidator() { @@ -141,7 +141,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageFailsOnAnonymousRelayWhenNotAuthorizedToSendToAddress() throws Exception { CountDownLatch latch = new CountDownLatch(1); @@ -203,7 +203,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testReceiverNotAuthorized() throws Exception { AmqpClient client = createAmqpClient(noprivPass, noprivUser); client.setValidator(new AmqpValidator() { @@ -241,7 +241,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConsumerNotAuthorizedToCreateQueues() throws Exception { AmqpClient client = createAmqpClient(noprivPass, noprivUser); client.setValidator(new AmqpValidator() { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java index e2bb2b0afe..04563d00d6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveInterceptorTest.java @@ -48,7 +48,7 @@ import java.util.concurrent.TimeUnit; public class AmqpSendReceiveInterceptorTest extends AmqpClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateQueueReceiver() throws Exception { final CountDownLatch latch = new CountDownLatch(1); server.getRemotingService().addIncomingInterceptor(new AmqpInterceptor() { @@ -89,7 +89,7 @@ public class AmqpSendReceiveInterceptorTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRejectMessageWithIncomingInterceptor() throws Exception { final CountDownLatch latch = new CountDownLatch(1); server.getRemotingService().addIncomingInterceptor(new AmqpInterceptor() { @@ -126,7 +126,7 @@ public class AmqpSendReceiveInterceptorTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRejectMessageWithOutgoingInterceptor() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -188,7 +188,7 @@ public class AmqpSendReceiveInterceptorTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCheckInterceptedMessageProperties() throws Exception { final CountDownLatch latch = new CountDownLatch(1); @@ -256,7 +256,7 @@ public class AmqpSendReceiveInterceptorTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCheckRemotingConnection() throws Exception { final CountDownLatch latch = new CountDownLatch(1); final boolean[] passed = {false}; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java index 477567fe2b..67f42b5878 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java @@ -82,7 +82,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAcceptWithoutSettling() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -108,7 +108,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQueueReceiverReadMessage() throws Exception { sendMessages(getQueueName(), 1); @@ -131,7 +131,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCoreBridge() throws Exception { server.getRemotingService().createAcceptor("acceptor", "vm://0").start(); server.getConfiguration().addConnectorConfiguration("connector", "vm://0"); @@ -169,7 +169,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageDurableFalse() throws Exception { sendMessages(getQueueName(), 1, false); @@ -194,7 +194,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageDurableTrue() throws Exception { assertNotNull(server.locateQueue(getQueueName())); sendMessages(getQueueName(), 1, true); @@ -220,7 +220,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTwoQueueReceiversOnSameConnectionReadMessagesNoDispositions() throws Exception { int MSG_COUNT = 4; sendMessages(getQueueName(), MSG_COUNT); @@ -257,7 +257,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTwoQueueReceiversOnSameConnectionReadMessagesAcceptOnEach() throws Exception { int MSG_COUNT = 4; sendMessages(getQueueName(), MSG_COUNT); @@ -316,7 +316,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSecondReceiverOnQueueGetsAllUnconsumedMessages() throws Exception { int MSG_COUNT = 20; sendMessages(getQueueName(), MSG_COUNT); @@ -370,7 +370,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSimpleSendOneReceiveOne() throws Exception { AmqpClient client = createAmqpClient(); @@ -402,7 +402,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendFilterAnnotation() throws Exception { AmqpClient client = createAmqpClient(); @@ -442,7 +442,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCloseBusyReceiver() throws Exception { final int MSG_COUNT = 20; @@ -489,7 +489,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveWithJMSSelectorFilter() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -523,7 +523,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveWithJMSSelectorFilterOnJMSType() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -555,7 +555,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAdvancedLinkFlowControl() throws Exception { final int MSG_COUNT = 20; @@ -617,7 +617,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDispatchOrderWithPrefetchOfOne() throws Exception { final int MSG_COUNT = 20; @@ -693,7 +693,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveMessageAndRefillCreditBeforeAccept() throws Exception { AmqpClient client = createAmqpClient(); @@ -728,7 +728,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveMessageAndRefillCreditBeforeAcceptOnQueueAsync() throws Exception { final AmqpClient client = createAmqpClient(); final LinkedList errors = new LinkedList<>(); @@ -795,7 +795,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageDurabliltyFollowsSpec() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -839,25 +839,25 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithHeaderMarkedDurableIsPersisted() throws Exception { doTestBrokerRestartAndDurability(true, true, false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithHeaderMarkedNonDurableIsNotPersisted() throws Exception { doTestBrokerRestartAndDurability(false, true, true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithHeaderDefaultedNonDurableIsNotPersisted() throws Exception { doTestBrokerRestartAndDurability(false, true, false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithNoHeaderIsNotPersisted() throws Exception { doTestBrokerRestartAndDurability(false, false, false); } @@ -930,7 +930,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveMessageBeyondAckedAmountQueue() throws Exception { final int MSG_COUNT = 50; @@ -979,7 +979,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTwoPresettledReceiversReceiveAllMessages() throws Exception { final int MSG_COUNT = 100; @@ -1049,7 +1049,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDeliveryDelayOfferedWhenRequested() throws Exception { AmqpClient client = createAmqpClient(); client.setValidator(new AmqpValidator() { @@ -1077,31 +1077,31 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithToFieldSetToSenderAddress() throws Exception { doTestMessageWithToFieldSet(false, getQueueName()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithToFieldSetToRandomAddress() throws Exception { doTestMessageWithToFieldSet(false, UUID.randomUUID().toString()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithToFieldSetToEmpty() throws Exception { doTestMessageWithToFieldSet(false, ""); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithToFieldSetToNull() throws Exception { doTestMessageWithToFieldSet(false, null); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageWithToFieldSetWithAnonymousSender() throws Exception { doTestMessageWithToFieldSet(true, getQueueName()); } @@ -1137,7 +1137,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLinkDetatchErrorIsCorrectWhenQueueDoesNotExists() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -1159,7 +1159,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendingAndReceivingToQueueWithDifferentAddressAndQueueName() throws Exception { String queueName = "TestQueueName"; String address = "TestAddress"; @@ -1187,13 +1187,13 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendReceiveLotsOfDurableMessagesOnQueue() throws Exception { doTestSendReceiveLotsOfDurableMessages(Queue.class); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendReceiveLotsOfDurableMessagesOnTopic() throws Exception { doTestSendReceiveLotsOfDurableMessages(Topic.class); } @@ -1258,7 +1258,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveRejecting() throws Exception { final int MSG_COUNT = 1000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSenderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSenderTest.java index 527d634325..10f54b293c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSenderTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSenderTest.java @@ -84,19 +84,19 @@ public class AmqpSenderTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSenderSettlementModeSettledIsHonored() throws Exception { doTestSenderSettlementModeIsHonored(SenderSettleMode.SETTLED); } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSenderSettlementModeUnsettledIsHonored() throws Exception { doTestSenderSettlementModeIsHonored(SenderSettleMode.UNSETTLED); } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSenderSettlementModeMixedIsHonored() throws Exception { doTestSenderSettlementModeIsHonored(SenderSettleMode.MIXED); } @@ -125,13 +125,13 @@ public class AmqpSenderTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiverSettlementModeSetToFirst() throws Exception { doTestReceiverSettlementModeForcedToFirst(ReceiverSettleMode.FIRST); } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiverSettlementModeSetToSecond() throws Exception { doTestReceiverSettlementModeForcedToFirst(ReceiverSettleMode.SECOND); } @@ -160,7 +160,7 @@ public class AmqpSenderTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUnsettledSender() throws Exception { final int MSG_COUNT = 1000; @@ -201,7 +201,7 @@ public class AmqpSenderTest extends AmqpClientTestSupport { @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMixDurableAndNonDurable() throws Exception { final int MSG_COUNT = 2000; @@ -236,7 +236,7 @@ public class AmqpSenderTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPresettledSender() throws Exception { final int MSG_COUNT = 1000; @@ -261,7 +261,7 @@ public class AmqpSenderTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDuplicateDetection() throws Exception { final int MSG_COUNT = 10; @@ -290,7 +290,7 @@ public class AmqpSenderTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDuplicateDetectionRollback() throws Exception { ConnectionFactory factory = CFUtil.createConnectionFactory("AMQP", "tcp://localhost:5672"); @@ -333,7 +333,7 @@ public class AmqpSenderTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSenderCreditReplenishment() throws Exception { AtomicInteger counter = new AtomicInteger(); CountDownLatch initialCredit = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSessionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSessionTest.java index 3225ae228b..f7b941cf64 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSessionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSessionTest.java @@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNotNull; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.core.server.ServerSession; import org.apache.activemq.artemis.core.server.impl.ServerSessionImpl; @@ -42,7 +41,7 @@ public class AmqpSessionTest extends AmqpClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateSession() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -52,7 +51,7 @@ public class AmqpSessionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSessionClosedDoesNotGetReceiverDetachFromRemote() throws Exception { AmqpClient client = createAmqpClient(); assertNotNull(client); @@ -90,7 +89,7 @@ public class AmqpSessionTest extends AmqpClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateSessionProducerConsumerDoesNotLeakClosable() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java index 61518c0d84..59215250f2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java @@ -52,13 +52,13 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport { protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDynamicSenderToTopic() throws Exception { doTestCreateDynamicSender(true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDynamicSenderToQueue() throws Exception { doTestCreateDynamicSender(false); } @@ -91,13 +91,13 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDynamicSenderLifetimeBoundToLinkTopic() throws Exception { doTestDynamicSenderLifetimeBoundToLinkQueue(true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDynamicSenderLifetimeBoundToLinkQueue() throws Exception { doTestDynamicSenderLifetimeBoundToLinkQueue(false); } @@ -125,13 +125,13 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDynamicReceiverToTopic() throws Exception { doTestCreateDynamicSender(true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDynamicReceiverToQueue() throws Exception { doTestCreateDynamicSender(false); } @@ -164,13 +164,13 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDynamicReceiverLifetimeBoundToLinkTopic() throws Exception { doTestDynamicReceiverLifetimeBoundToLinkQueue(true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDynamicReceiverLifetimeBoundToLinkQueue() throws Exception { doTestDynamicReceiverLifetimeBoundToLinkQueue(false); } @@ -198,13 +198,13 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void TestCreateDynamicQueueSenderAndPublish() throws Exception { doTestCreateDynamicSenderAndPublish(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void TestCreateDynamicTopicSenderAndPublish() throws Exception { doTestCreateDynamicSenderAndPublish(true); } @@ -249,13 +249,13 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDynamicReceiverToTopicAndSend() throws Exception { doTestCreateDynamicSender(true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateDynamicReceiverToQueueAndSend() throws Exception { doTestCreateDynamicSender(false); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java index 72eb7a4ef7..12cd3b6299 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java @@ -65,7 +65,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testBeginAndCommitTransaction() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -80,7 +80,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCoordinatorReplenishesCredit() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -97,7 +97,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSentTransactionalMessageIsSettleWithTransactionalDisposition() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -137,7 +137,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testBeginAndRollbackTransaction() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -154,7 +154,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageToQueueWithCommit() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -180,7 +180,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMessageToQueueWithRollback() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -206,7 +206,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveMessageWithCommit() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -239,7 +239,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveAfterConnectionClose() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -284,7 +284,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveMessageWithRollback() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -317,7 +317,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMultipleSessionReceiversInSingleTXNWithCommit() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -375,7 +375,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMultipleSessionReceiversInSingleTXNWithRollback() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -433,7 +433,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMultipleSessionSendersInSingleTXNWithCommit() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -474,7 +474,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMultipleSessionSendersInSingleTXNWithRollback() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -517,7 +517,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { //----- Tests Ported from AmqpNetLite client -----------------------------// @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendersCommitAndRollbackWithMultipleSessionsInSingleTX() throws Exception { final int NUM_MESSAGES = 5; @@ -571,7 +571,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiversCommitAndRollbackWithMultipleSessionsInSingleTX() throws Exception { final int NUM_MESSAGES = 10; @@ -640,7 +640,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCommitAndRollbackWithMultipleSessionsInSingleTX() throws Exception { final int NUM_MESSAGES = 10; @@ -710,7 +710,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiversCommitAndRollbackWithMultipleSessionsInSingleTXNoSettlement() throws Exception { final int NUM_MESSAGES = 10; @@ -800,7 +800,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCommitAndRollbackWithMultipleSessionsInSingleTXNoSettlement() throws Exception { final int NUM_MESSAGES = 10; @@ -877,7 +877,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSendPersistentTX() throws Exception { int MESSAGE_COUNT = 2000; AtomicInteger errors = new AtomicInteger(0); @@ -950,7 +950,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testUnsettledTXMessageGetTransactedDispostion() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AutoCreateWithDefaultRoutingTypesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AutoCreateWithDefaultRoutingTypesTest.java index 63fddcfabe..8886d84b13 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AutoCreateWithDefaultRoutingTypesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AutoCreateWithDefaultRoutingTypesTest.java @@ -101,7 +101,7 @@ public class AutoCreateWithDefaultRoutingTypesTest extends JMSClientTestSupport } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateSender() throws Exception { final String addressName = getTestName(); @@ -133,7 +133,7 @@ public class AutoCreateWithDefaultRoutingTypesTest extends JMSClientTestSupport } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateReceiver() throws Exception { final String addressName = getTestName(); @@ -165,13 +165,13 @@ public class AutoCreateWithDefaultRoutingTypesTest extends JMSClientTestSupport } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateSenderThatRequestsMultiCast() throws Exception { dotestCreateSenderThatRequestsSpecificRoutingType(RoutingType.MULTICAST); } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateSenderThatRequestsAnyCast() throws Exception { dotestCreateSenderThatRequestsSpecificRoutingType(RoutingType.ANYCAST); } @@ -215,13 +215,13 @@ public class AutoCreateWithDefaultRoutingTypesTest extends JMSClientTestSupport } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateReceiverThatRequestsMultiCast() throws Exception { dotestCreateReceiverThatRequestsSpecificRoutingType(RoutingType.MULTICAST); } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateReceiverThatRequestsAnyCast() throws Exception { dotestCreateReceiverThatRequestsSpecificRoutingType(RoutingType.ANYCAST); } @@ -265,13 +265,13 @@ public class AutoCreateWithDefaultRoutingTypesTest extends JMSClientTestSupport } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateSenderThatRequestsMultiCastViaPrefix() throws Exception { dotestCreateSenderThatRequestsSpecificRoutingTypeViaPrefix(RoutingType.MULTICAST); } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateSenderThatRequestsAnyCastViaPrefix() throws Exception { dotestCreateSenderThatRequestsSpecificRoutingTypeViaPrefix(RoutingType.ANYCAST); } @@ -315,13 +315,13 @@ public class AutoCreateWithDefaultRoutingTypesTest extends JMSClientTestSupport } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateReceiverThatRequestsMultiCastViaPrefix() throws Exception { dotestCreateReceiverThatRequestsSpecificRoutingTypeViaPrefix(RoutingType.MULTICAST); } @TestTemplate - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateReceiverThatRequestsAnyCastViaPrefix() throws Exception { dotestCreateReceiverThatRequestsSpecificRoutingTypeViaPrefix(RoutingType.ANYCAST); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java index 2a45f97bb4..13aff6df8f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java @@ -51,7 +51,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeFromSingleQueueOnAddressSameName() throws Exception { server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST)); server.createQueue(new QueueConfiguration(address).setRoutingType(RoutingType.ANYCAST)); @@ -73,7 +73,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeFromSingleQueueOnAddressSameNameMultipleQueues() throws Exception { server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST)); server.createQueue(new QueueConfiguration(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST)); @@ -96,7 +96,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeFromSingleQueueOnAddressDifferentName() throws Exception { server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST)); server.createQueue(new QueueConfiguration(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST)); @@ -118,7 +118,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeFromSingleQueueOnAddressDifferentNameMultipleQueues() throws Exception { server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST)); server.createQueue(new QueueConfiguration(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST)); @@ -141,7 +141,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeFromSingleQualifiedQueueOnAddressSameName() throws Exception { server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST)); server.createQueue(new QueueConfiguration(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST)); @@ -163,7 +163,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeWhenOnlyMulticast() throws Exception { server.addAddressInfo(new AddressInfo(address, RoutingType.MULTICAST)); @@ -185,7 +185,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeWhenNoAddressCreatedNoAutoCreate() throws Exception { AddressSettings settings = new AddressSettings(); settings.setAutoCreateAddresses(false); @@ -203,7 +203,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeWhenNoAddressCreatedAutoCreate() throws Exception { // This test needs auto-create.. for that just clear the settings and use defaults server.getAddressSettingsRepository().clear(); @@ -224,7 +224,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeWhenNoAddressHasBothRoutingTypesButDefaultQueueIsMultiCast() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.ANYCAST); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedMulticastConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedMulticastConsumerTest.java index 7d767f3824..ef6082eff1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedMulticastConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedMulticastConsumerTest.java @@ -55,7 +55,7 @@ public class BrokerDefinedMulticastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeFromSingleQueueOnAddressSameName() throws Exception { server.addAddressInfo(new AddressInfo(address, RoutingType.MULTICAST)); server.createQueue(new QueueConfiguration(address)); @@ -77,7 +77,7 @@ public class BrokerDefinedMulticastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeWhenOnlyAnycast() throws Exception { server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST)); server.createQueue(new QueueConfiguration(address).setAddress(address).setRoutingType(RoutingType.ANYCAST)); @@ -100,7 +100,7 @@ public class BrokerDefinedMulticastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeWhenNoAddressHasBothRoutingTypesButDefaultQueueIsAnyCast() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedAnycastConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedAnycastConsumerTest.java index 2fecbb7e51..e7d24328ba 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedAnycastConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedAnycastConsumerTest.java @@ -43,7 +43,7 @@ public class ClientDefinedAnycastConsumerTest extends AmqpClientTestSupport { SimpleString address = new SimpleString("testAddress"); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeFromSingleQueueOnAddressSameName() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); @@ -65,7 +65,7 @@ public class ClientDefinedAnycastConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeFromSingleQueueOnAddressSameNameNegativeValidation() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java index 44c759f7c2..26c783207d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java @@ -45,7 +45,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { SimpleString address = new SimpleString("testAddress"); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnSharedVolatileAddress() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -79,7 +79,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnSharedVolatileAddressBrokerDefined() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -109,7 +109,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnSharedVolatileAddressNoReceiverClose() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -141,7 +141,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnSharedVolatileAddressGlobal() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -175,7 +175,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnSharedDurableAddress() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -204,7 +204,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnSharedDurableAddressReconnect() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -243,7 +243,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnSharedDurableAddressReconnectwithNull() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -282,7 +282,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnSharedDurableAddressGlobal() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -311,7 +311,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void test2ConsumersOnNonSharedDurableAddress() throws Exception { AddressInfo addressInfo = new AddressInfo(address); addressInfo.getRoutingTypes().add(RoutingType.MULTICAST); @@ -336,7 +336,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAddressDoesntExist() throws Exception { AmqpClient client = createAmqpClient(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/DrainTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/DrainTimeoutTest.java index 708e6360f4..0f3d337e94 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/DrainTimeoutTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/DrainTimeoutTest.java @@ -26,7 +26,6 @@ import javax.jms.Message; import javax.jms.Queue; import javax.jms.Session; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.LongAdder; @@ -39,7 +38,7 @@ public class DrainTimeoutTest extends AmqpClientTestSupport { final int NUMBER_OF_MESSAGES = 1000; @Test - @Timeout(value = 300_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testFlowControl() throws Exception { final AtomicInteger errors = new AtomicInteger(0); final String queueName = getQueueName(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ExtremeCancelsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ExtremeCancelsTest.java index f8769b325d..b556fff67d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ExtremeCancelsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ExtremeCancelsTest.java @@ -28,7 +28,6 @@ import javax.jms.Session; import javax.jms.TextMessage; import java.util.Arrays; import java.util.Collection; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -70,7 +69,7 @@ public class ExtremeCancelsTest extends JMSClientTestSupport { @TestTemplate - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testLotsOfCloseOpenConsumer() throws Exception { server.createQueue(new QueueConfiguration(anycastAddress).setRoutingType(RoutingType.ANYCAST)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSAcknowledgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSAcknowledgeTest.java index c17ba39639..2567a2bb22 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSAcknowledgeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSAcknowledgeTest.java @@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import java.util.ArrayList; import java.util.List; import java.util.Random; -import java.util.concurrent.TimeUnit; import javax.jms.Connection; import javax.jms.Message; @@ -42,7 +41,7 @@ public class JMSAcknowledgeTest extends JMSClientTestSupport { private static final int INDIVIDUAL_ACK = 101; @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeIndividualMessagesOutOfOrder() throws Throwable { Connection connection = createConnection(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionTest.java index b0226311a0..994f01381a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionTest.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Timeout; public class JMSConnectionTest extends JMSClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConnection() throws Exception { Connection connection = createConnection(); @@ -63,7 +63,7 @@ public class JMSConnectionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClientIDsAreExclusive() throws Exception { Connection testConn1 = createConnection(false); Connection testConn2 = createConnection(false); @@ -100,7 +100,7 @@ public class JMSConnectionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testParallelConnections() throws Exception { final int numThreads = 40; ExecutorService executorService = Executors.newFixedThreadPool(numThreads); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionWithSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionWithSecurityTest.java index cf25ec1842..8b17f45dc1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionWithSecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionWithSecurityTest.java @@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; import java.net.URI; -import java.util.concurrent.TimeUnit; public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { @@ -56,7 +55,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testNoUserOrPassword() throws Exception { Connection connection = null; try { @@ -74,7 +73,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testNoUserOrPasswordWithoutSaslRestrictions() throws Exception { Connection connection = null; JmsConnectionFactory factory = new JmsConnectionFactory(new URI("amqp://localhost:" + AMQP_PORT)); @@ -94,7 +93,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testUnknownUser() throws Exception { Connection connection = null; try { @@ -111,7 +110,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testKnownUserWrongPassword() throws Exception { Connection connection = null; try { @@ -128,7 +127,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testRepeatedWrongPasswordAttempts() throws Exception { for (int i = 0; i < 25; ++i) { Connection connection = null; @@ -147,7 +146,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSendReceive() throws Exception { Connection connection = createConnection(fullUser, fullPass); @@ -175,7 +174,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConsumerNotAuthorized() throws Exception { Connection connection = createConnection(noprivUser, noprivPass); @@ -194,7 +193,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testBrowserNotAuthorized() throws Exception { Connection connection = createConnection(noprivUser, noprivPass); @@ -215,7 +214,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConsumerNotAuthorizedToCreateQueues() throws Exception { Connection connection = createConnection(noprivUser, noprivPass); @@ -234,7 +233,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testProducerNotAuthorized() throws Exception { Connection connection = createConnection(guestUser, guestPass); @@ -253,7 +252,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testAnonymousProducerNotAuthorized() throws Exception { Connection connection = createConnection(guestUser, guestPass); @@ -274,7 +273,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateTemporaryQueueNotAuthorized() throws JMSException { Connection connection = createConnection(guestUser, guestPass); @@ -295,7 +294,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateTemporaryTopicNotAuthorized() throws JMSException { Connection connection = createConnection(guestUser, guestPass); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSDurableConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSDurableConsumerTest.java index c59e7cf436..d0ea8c032a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSDurableConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSDurableConsumerTest.java @@ -72,7 +72,7 @@ public class JMSDurableConsumerTest extends JMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDurableConsumerAsync() throws Exception { final CountDownLatch latch = new CountDownLatch(1); final AtomicReference received = new AtomicReference<>(); @@ -110,7 +110,7 @@ public class JMSDurableConsumerTest extends JMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDurableConsumerSync() throws Exception { String durableClientId = getTopicName() + "-ClientId"; @@ -145,7 +145,7 @@ public class JMSDurableConsumerTest extends JMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDurableConsumerUnsubscribe() throws Exception { String durableClientId = getTopicName() + "-ClientId"; @@ -187,7 +187,7 @@ public class JMSDurableConsumerTest extends JMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDurableConsumerUnsubscribeWhileNoSubscription() throws Exception { Connection connection = createConnection(); @@ -215,7 +215,7 @@ public class JMSDurableConsumerTest extends JMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDurableConsumerUnsubscribeWhileActive() throws Exception { String durableClientId = getTopicName() + "-ClientId"; @@ -241,7 +241,7 @@ public class JMSDurableConsumerTest extends JMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDurableConsumerLarge() throws Exception { String durableClientId = getTopicName() + "-ClientId"; @@ -285,7 +285,7 @@ public class JMSDurableConsumerTest extends JMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDurableConsumerWithSelectorChange() throws Exception { SimpleString qName = new SimpleString("foo.SharedConsumer"); Connection connection = createConnection("foo", true); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java index 8e629eccbc..69cf73373f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java @@ -61,13 +61,13 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSelectorOnTopic() throws Exception { doTestSelector(true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSelectorOnQueue() throws Exception { doTestSelector(false); } @@ -107,13 +107,13 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSTypeOnTopic() throws Exception { doTestSelectorsWithJMSType(true); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSTypeOnQueue() throws Exception { doTestSelectorsWithJMSType(false); } @@ -156,7 +156,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSCorrelationID() throws Exception { Connection connection = createConnection(); @@ -199,7 +199,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSPriority() throws Exception { Connection connection = createConnection(); @@ -238,13 +238,13 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSXGroupIDOnTopic() throws Exception { doTestSelectorsWithJMSXGroupID(true); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSXGroupIDOnQueue() throws Exception { doTestSelectorsWithJMSXGroupID(false); } @@ -298,7 +298,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSDeliveryOnQueue() throws Exception { final Connection connection = createConnection(); @@ -332,7 +332,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSTimestampOnQueue() throws Exception { final Connection connection = createConnection(); @@ -368,7 +368,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSelectorsWithJMSExpirationOnQueue() throws Exception { final Connection connection = createConnection(); @@ -401,7 +401,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testJMSSelectorFiltersJMSMessageIDOnTopic() throws Exception { Connection connection = createConnection(); @@ -433,7 +433,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testZeroPrefetchWithTwoConsumers() throws Exception { JmsConnection connection = (JmsConnection) createConnection(); ((JmsDefaultPrefetchPolicy) connection.getPrefetchPolicy()).setAll(0); @@ -461,25 +461,25 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testProduceAndConsumeLargeNumbersOfTopicMessagesClientAck() throws Exception { doTestProduceAndConsumeLargeNumbersOfMessages(true, Session.CLIENT_ACKNOWLEDGE); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testProduceAndConsumeLargeNumbersOfQueueMessagesClientAck() throws Exception { doTestProduceAndConsumeLargeNumbersOfMessages(false, Session.CLIENT_ACKNOWLEDGE); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testProduceAndConsumeLargeNumbersOfTopicMessagesAutoAck() throws Exception { doTestProduceAndConsumeLargeNumbersOfMessages(true, Session.AUTO_ACKNOWLEDGE); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testProduceAndConsumeLargeNumbersOfQueueMessagesAutoAck() throws Exception { doTestProduceAndConsumeLargeNumbersOfMessages(false, Session.AUTO_ACKNOWLEDGE); } @@ -528,7 +528,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPrefetchedMessagesAreNotConsumedOnConsumerClose() throws Exception { final int NUM_MESSAGES = 10; @@ -569,7 +569,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessagesReceivedInParallel() throws Throwable { final int numMessages = 50000; long time = System.currentTimeMillis(); @@ -652,7 +652,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClientAckMessages() throws Exception { final int numMessages = 10; @@ -701,7 +701,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testTimedOutWaitingForWriteLogOnConsumer() throws Throwable { String name = "exampleQueue1"; // disable auto-delete as it causes thrashing during the test @@ -771,7 +771,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testBrokerRestartAMQPProducerAMQPConsumer() throws Exception { Connection connection = createFailoverConnection(); //AMQP Connection connection2 = createFailoverConnection(); //AMQP diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java index 02901142f5..42a8127d97 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java @@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Random; import java.util.UUID; -import java.util.concurrent.TimeUnit; import javax.jms.Connection; import javax.jms.Destination; @@ -43,7 +42,7 @@ import org.junit.jupiter.api.Timeout; public class JMSMessageProducerTest extends JMSClientTestSupport { @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testAnonymousProducerWithQueueAutoCreation() throws Exception { Connection connection = createConnection(); @@ -73,7 +72,7 @@ public class JMSMessageProducerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testAnonymousProducer() throws Exception { Connection connection = createConnection(); @@ -108,7 +107,7 @@ public class JMSMessageProducerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testAnonymousProducerWithTopicAutoCreation() throws Exception { Connection connection = createConnection(); @@ -143,7 +142,7 @@ public class JMSMessageProducerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDuplicateDetection() throws Exception { final int MSG_COUNT = 10; Connection connection = createConnection(); @@ -167,7 +166,7 @@ public class JMSMessageProducerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAnonymousProducerAcrossManyDestinations() throws Exception { Connection connection = createConnection(); @@ -201,7 +200,7 @@ public class JMSMessageProducerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendingBigMessage() throws Exception { Connection connection = createConnection(); @@ -226,7 +225,7 @@ public class JMSMessageProducerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendWithTimeToLiveExpiresToDLQ() throws Exception { Connection connection = createConnection(); @@ -258,7 +257,7 @@ public class JMSMessageProducerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReplyToUsingQueue() throws Throwable { Connection connection = createConnection(); @@ -286,7 +285,7 @@ public class JMSMessageProducerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReplyToUsingTempQueue() throws Throwable { Connection connection = createConnection(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSQueueBrowserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSQueueBrowserTest.java index a6569bea6a..af9125ed81 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSQueueBrowserTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSQueueBrowserTest.java @@ -50,7 +50,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrowseAllInQueueZeroPrefetch() throws Exception { final int MSG_COUNT = 5; @@ -85,7 +85,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { } @Test - @Timeout(value = 40000, unit = TimeUnit.MILLISECONDS) + @Timeout(40) public void testCreateQueueBrowser() throws Exception { Connection connection = createConnection(); connection.start(); @@ -103,7 +103,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { } @Test - @Timeout(value = 40000, unit = TimeUnit.MILLISECONDS) + @Timeout(40) public void testNoMessagesBrowserHasNoElements() throws Exception { Connection connection = createConnection(); connection.start(); @@ -124,7 +124,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testBroseOneInQueue() throws Exception { Connection connection = createConnection(); connection.start(); @@ -152,7 +152,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrowseAllInQueue() throws Exception { Connection connection = createConnection(); connection.start(); @@ -181,7 +181,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrowseAllInQueuePrefetchOne() throws Exception { Connection connection = createConnection(); connection.start(); @@ -209,7 +209,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { } @Test - @Timeout(value = 40000, unit = TimeUnit.MILLISECONDS) + @Timeout(40) public void testBrowseAllInQueueTxSession() throws Exception { Connection connection = createConnection(); connection.start(); @@ -237,7 +237,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { } @Test - @Timeout(value = 40000, unit = TimeUnit.MILLISECONDS) + @Timeout(40) public void testQueueBrowserInTxSessionLeavesOtherWorkUnaffected() throws Exception { Connection connection = createConnection(); connection.start(); @@ -281,7 +281,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrowseAllInQueueSmallPrefetch() throws Exception { Connection connection = createConnection(); connection.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslExternalTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslExternalTest.java index 6ac6463941..55f918ad70 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslExternalTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslExternalTest.java @@ -34,7 +34,6 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; import java.util.Set; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.activemq.artemis.api.core.TransportConfiguration; @@ -137,7 +136,7 @@ public class JMSSaslExternalTest extends ActiveMQTestBase { } @Test - @Timeout(value = 600000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConnection() throws Exception { final String keystore = this.getClass().getClassLoader().getResource("other-client-keystore.jks").getFile(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslGssapiTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslGssapiTest.java index f616f03fa0..bbecc330c7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslGssapiTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslGssapiTest.java @@ -208,7 +208,7 @@ public class JMSSaslGssapiTest extends JMSClientTestSupport { } @Test - @Timeout(value = 600000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConnection() throws Exception { Connection connection = createConnection("client", null); connection.start(); @@ -231,7 +231,7 @@ public class JMSSaslGssapiTest extends JMSClientTestSupport { } @Test - @Timeout(value = 600000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSaslPlainConnectionDenied() throws Exception { JmsConnectionFactory factory = new JmsConnectionFactory(new URI("amqp://localhost:" + AMQP_PORT + "?amqp.saslMechanisms=PLAIN")); try { @@ -243,7 +243,7 @@ public class JMSSaslGssapiTest extends JMSClientTestSupport { } @Test - @Timeout(value = 900000, unit = TimeUnit.MILLISECONDS) + @Timeout(90) public void testOutboundWithSlowMech() throws Exception { final Map config = new LinkedHashMap<>(); config.put(TransportConstants.HOST_PROP_NAME, "localhost"); config.put(TransportConstants.PORT_PROP_NAME, String.valueOf(AMQP_PORT)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java index 9f94356943..bc5ee7353d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java @@ -42,7 +42,7 @@ public class JMSTemporaryDestinationTest extends JMSClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateTemporaryQueue() throws Throwable { Connection connection = createConnection(); @@ -68,7 +68,7 @@ public class JMSTemporaryDestinationTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDeleteTemporaryQueue() throws Exception { Connection connection = createConnection(); @@ -97,7 +97,7 @@ public class JMSTemporaryDestinationTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCreateTemporaryTopic() throws Throwable { Connection connection = createConnection(); @@ -120,7 +120,7 @@ public class JMSTemporaryDestinationTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDeleteTemporaryTopic() throws Exception { Connection connection = createConnection(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTopicConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTopicConsumerTest.java index 3a8f762923..239b87f14c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTopicConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTopicConsumerTest.java @@ -54,7 +54,7 @@ import org.junit.jupiter.api.Timeout; public class JMSTopicConsumerTest extends JMSClientTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveOnTopic() throws Exception { Connection connection = createConnection("myClientId"); @@ -81,7 +81,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveOnAutoCreatedTopic() throws Exception { Connection connection = createConnection("myClientId"); String topicName = UUID.randomUUID().toString(); @@ -122,7 +122,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveOnAutoCreatedTopicJMS2() throws Exception { ConnectionFactory cf = new JmsConnectionFactory(getBrokerQpidJMSConnectionURI()); JMSContext context = cf.createContext(); @@ -162,7 +162,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendWithMultipleReceiversOnTopic() throws Exception { Connection connection = createConnection(); @@ -196,7 +196,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableSubscriptionUnsubscribe() throws Exception { Connection connection = createConnection("myClientId"); @@ -223,7 +223,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableSharedSubscriptionUnsubscribe() throws Exception { Connection connection = createConnection("myClientId"); @@ -243,7 +243,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableMultipleSharedSubscriptionUnsubscribe() throws Exception { Connection connection = createConnection("myClientId"); @@ -272,7 +272,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableSharedGlobalSubscriptionUnsubscribe() throws Exception { Connection connection = createConnection(); @@ -292,7 +292,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableMultipleSharedGlobalSubscriptionUnsubscribe() throws Exception { Connection connection = createConnection(); Connection connection2 = createConnection(); @@ -320,7 +320,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTemporarySubscriptionDeleted() throws Exception { Connection connection = createConnection(); @@ -352,7 +352,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMultipleDurableConsumersSendAndReceive() throws Exception { Connection connection = createConnection("myClientId"); @@ -389,7 +389,7 @@ public class JMSTopicConsumerTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableSubscriptionReconnection() throws Exception { Connection connection = createConnection("myClientId"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTransactionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTransactionTest.java index 74896dc7b5..a8d97554af 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTransactionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTransactionTest.java @@ -24,7 +24,6 @@ import java.lang.invoke.MethodHandles; import java.util.HashSet; import java.util.Random; import java.util.Set; -import java.util.concurrent.TimeUnit; import javax.jms.Connection; import javax.jms.Message; @@ -45,7 +44,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testProduceMessageAndCommit() throws Throwable { Connection connection = createConnection(); Session session = connection.createSession(true, Session.SESSION_TRANSACTED); @@ -68,7 +67,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testProduceMessageAndRollback() throws Throwable { Connection connection = createConnection(); Session session = connection.createSession(true, Session.SESSION_TRANSACTED); @@ -90,7 +89,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testProducedMessageAreRolledBackOnSessionClose() throws Exception { int numMessages = 10; @@ -114,7 +113,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeMessagesAndCommit() throws Throwable { Connection connection = createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -146,7 +145,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumeMessagesAndRollback() throws Throwable { Connection connection = createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -177,7 +176,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRollbackSomeThenReceiveAndCommit() throws Exception { final int MSG_COUNT = 5; final int consumeBeforeRollback = 2; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSWebSocketConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSWebSocketConnectionTest.java index a27504af5e..9961ad98ad 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSWebSocketConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSWebSocketConnectionTest.java @@ -29,7 +29,6 @@ import javax.jms.Session; import org.apache.activemq.ActiveMQConnectionFactory; -import java.util.concurrent.TimeUnit; import org.apache.qpid.jms.JmsConnection; import org.apache.qpid.jms.JmsConnectionFactory; import org.junit.jupiter.api.Disabled; @@ -47,7 +46,7 @@ public class JMSWebSocketConnectionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCreateConnectionAndStart() throws Exception { JmsConnectionFactory factory = new JmsConnectionFactory(getBrokerQpidJMSConnectionURI()); JmsConnection connection = (JmsConnection) factory.createConnection(); @@ -57,7 +56,7 @@ public class JMSWebSocketConnectionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSendReceiveOverWS() throws Exception { JmsConnectionFactory factory = new JmsConnectionFactory(getBrokerQpidJMSConnectionURI()); JmsConnection connection = (JmsConnection) factory.createConnection(); @@ -82,7 +81,7 @@ public class JMSWebSocketConnectionTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSendLargeMessageToClientFromOpenWire() throws Exception { JmsConnectionFactory factory = new JmsConnectionFactory(getBrokerQpidJMSConnectionURI()); JmsConnection connection = (JmsConnection) factory.createConnection(); @@ -106,7 +105,7 @@ public class JMSWebSocketConnectionTest extends JMSClientTestSupport { @Disabled("Broker can't accept messages over 65535 right now") @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSendLargeMessageToClientFromAMQP() throws Exception { JmsConnectionFactory factory = new JmsConnectionFactory(getBrokerQpidJMSConnectionURI()); JmsConnection connection = (JmsConnection) factory.createConnection(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/PropertyParseOptimizationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/PropertyParseOptimizationTest.java index 5c2efc4764..f2fdccdab9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/PropertyParseOptimizationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/PropertyParseOptimizationTest.java @@ -55,7 +55,7 @@ public class PropertyParseOptimizationTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendWithPropertiesAndFilter() throws Exception { int size = 10 * 1024; AmqpClient client = createAmqpClient(new URI(noDuplicateAcceptor)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/QueueAutoCreationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/QueueAutoCreationTest.java index 2ec1fff8da..10332b83e6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/QueueAutoCreationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/QueueAutoCreationTest.java @@ -55,7 +55,6 @@ import java.lang.invoke.MethodHandles; import java.math.BigInteger; import java.util.Map; import java.util.Random; -import java.util.concurrent.TimeUnit; //adapted from https://issues.apache.org/jira/browse/ARTEMIS-1416 public class QueueAutoCreationTest extends JMSClientTestSupport { @@ -112,20 +111,20 @@ public class QueueAutoCreationTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSmallString() throws Exception { sendStringOfSize(1024, false); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testHugeString() throws Exception { sendStringOfSize(1024 * 1024, false); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) // QueueAutoCreationTest was created to validate auto-creation of queues // and this test was added to validate a regression: https://issues.apache.org/jira/browse/ARTEMIS-2238 public void testAutoCreateOnTopic() throws Exception { @@ -145,7 +144,7 @@ public class QueueAutoCreationTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) // QueueAutoCreationTest was created to validate auto-creation of queues // and this test was added to validate a regression: https://issues.apache.org/jira/browse/ARTEMIS-2238 public void testAutoCreateOnTopicManySends() throws Exception { @@ -167,7 +166,7 @@ public class QueueAutoCreationTest extends JMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) // QueueAutoCreationTest was created to validate auto-creation of queues // and this test was added to validate a regression: https://issues.apache.org/jira/browse/ARTEMIS-2238 public void testAutoCreateOnTopicAndConsume() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPConnectSaslTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPConnectSaslTest.java index e1a10214ca..0e24e93b19 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPConnectSaslTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPConnectSaslTest.java @@ -66,7 +66,7 @@ public class AMQPConnectSaslTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testConnectsWithAnonymous() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(PLAIN, ANONYMOUS); @@ -90,7 +90,7 @@ public class AMQPConnectSaslTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testConnectsWithPlain() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLPlainConnect(USER, PASSWD, PLAIN, ANONYMOUS); @@ -116,13 +116,13 @@ public class AMQPConnectSaslTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAnonymousSelectedWhenNoCredentialsSupplied() throws Exception { doMechanismSelectedTestImpl(null, null, ANONYMOUS, new String[]{SCRAM_SHA_512, PLAIN, ANONYMOUS}); } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testSelectsSCRAMWhenCredentialsPresent() throws Exception { doMechanismSelectedTestImpl(USER, PASSWD, SCRAM_SHA_512, new String[]{SCRAM_SHA_512, PLAIN, ANONYMOUS}); } @@ -154,13 +154,13 @@ public class AMQPConnectSaslTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testConnectsWithExternal() throws Exception { doConnectWithExternalTestImpl(true); } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testExternalIgnoredWhenNoClientCertSupplied() throws Exception { doConnectWithExternalTestImpl(false); } @@ -225,7 +225,7 @@ public class AMQPConnectSaslTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testReconnectConnectsWithVerifyHostOffOnSecondURI() throws Exception { final String keyStorePath = this.getClass().getClassLoader().getResource(UNKNOWN_SERVER_KEYSTORE_NAME).getFile(); @@ -287,7 +287,7 @@ public class AMQPConnectSaslTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testReconnectionUsesConfigurationToReconnectToSecondHostAfterFirstFails() throws Exception { final String keyStore1Path = this.getClass().getClassLoader().getResource(UNKNOWN_SERVER_KEYSTORE_NAME).getFile(); final String keyStore2Path = this.getClass().getClassLoader().getResource(SERVER_KEYSTORE_NAME).getFile(); @@ -348,7 +348,7 @@ public class AMQPConnectSaslTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20_000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testReconnectionUsesHostSpecificConfigurationToReconnectToSecondHostAfterFirstFails() throws Exception { final String keyStore1Path = this.getClass().getClassLoader().getResource(UNKNOWN_SERVER_KEYSTORE_NAME).getFile(); final String keyStore2Path = this.getClass().getClassLoader().getResource(SERVER_KEYSTORE_NAME).getFile(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java index b9b54894a8..5dbd608731 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java @@ -155,7 +155,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesAddressReceiverWhenLocalQueueIsStaticlyDefined() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -252,7 +252,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesAddressReceiverLinkForAddressMatch() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -326,7 +326,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesAddressReceiverLinkForAddressMatchUsingPolicyCredit() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -402,13 +402,13 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesAddressReceiverLinkForAddressMatchWithMaxHopsFilter() throws Exception { doTestFederationCreatesAddressReceiverLinkForAddressWithCorrectFilters(true); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesAddressReceiverLinkForAddressMatchWithoutMaxHopsFilter() throws Exception { doTestFederationCreatesAddressReceiverLinkForAddressWithCorrectFilters(false); } @@ -567,7 +567,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationClosesAddressReceiverLinkWhenDemandRemoved() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -647,7 +647,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationRetainsAddressReceiverLinkWhenDurableSubscriberIsOffline() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -734,7 +734,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationClosesAddressReceiverLinkWaitsForAllDemandToRemoved() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -816,7 +816,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationHandlesAddressDeletedAndConsumerRecreates() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -903,7 +903,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationConsumerCreatedWhenDemandAddedToDivertAddress() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -986,7 +986,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationConsumerCreatedWhenDemandAddedToCompositeDivertAddress() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1077,7 +1077,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationConsumerRemovesDemandFromDivertConsumersOnlyWhenAllDemandIsRemoved() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1162,7 +1162,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationConsumerRetainsDemandForDivertBindingWithoutActiveAnycastSubscriptions() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1252,7 +1252,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationConsumerRemovesDemandForDivertBindingWithoutActiveMulticastSubscriptions() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1344,7 +1344,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationRemovesRemoteDemandIfDivertIsRemoved() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1427,7 +1427,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testDivertBindingsDoNotCreateAdditionalDemandIfDemandOnForwardingAddressAlreadyExists() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1521,7 +1521,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testInboundMessageRoutedToReceiverOnLocalAddress() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1594,7 +1594,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerAcceptsAddressPolicyFromControlLink() throws Exception { server.start(); @@ -1632,7 +1632,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerAcceptsAddressPolicyFromControlLinkWithTransformerConfiguration() throws Exception { server.start(); @@ -1678,7 +1678,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteFederatesAddressWhenDemandIsApplied() throws Exception { server.start(); @@ -1742,7 +1742,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteFederatesAddressWhenDemandIsAppliedUsingControllerDefinedLinkCredit() throws Exception { server.start(); @@ -1807,7 +1807,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteFederatesAddressWhenDemandIsAppliedUsingPolicyDefinedLinkCredit() throws Exception { server.start(); @@ -1877,7 +1877,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteFederatesAddressAndAppliesTransformerWhenDemandIsApplied() throws Exception { server.start(); @@ -1951,7 +1951,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerAnswersAttachOfFederationReceiverProperly() throws Exception { server.start(); @@ -1998,7 +1998,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testReceiverWithMaxHopsFilterAppliesFilterCorrectly() throws Exception { server.start(); @@ -2116,7 +2116,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteConnectionCannotAttachAddressFederationLinkWithoutControlLink() throws Exception { server.start(); @@ -2162,7 +2162,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testTransformInboundFederatedMessageBeforeDispatch() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -2246,7 +2246,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationDoesNotCreateAddressReceiverLinkForAddressMatchWhenLinkCreditIsSetToZero() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -2309,13 +2309,13 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreMessageConvertedToAMQPWhenTunnelingDisabled() throws Exception { doTestCoreMessageHandlingBasedOnTunnelingState(false); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreMessageNotConvertedToAMQPWhenTunnelingEnabled() throws Exception { doTestCoreMessageHandlingBasedOnTunnelingState(true); } @@ -2388,13 +2388,13 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreLargeMessageConvertedToAMQPWhenTunnelingDisabled() throws Exception { doTestCoreLargeMessageHandlingBasedOnTunnelingState(false); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreLargeMessageNotConvertedToAMQPWhenTunnelingEnabled() throws Exception { doTestCoreLargeMessageHandlingBasedOnTunnelingState(true); } @@ -2474,7 +2474,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationStartedTriggersRemoteDemandWithExistingAddressBindings() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.start(); @@ -2580,7 +2580,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationStartedTriggersRemoteDemandWithExistingAddressAndDivertBindings() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.start(); @@ -2689,7 +2689,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationStartTriggersFederationWithMultipleDivertsAndRemainsActiveAfterOneRemoved() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.start(); @@ -2810,7 +2810,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationPluginCanLimitDemandToOnlyTheConfiguredDivert() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -2908,7 +2908,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesEventSenderAndReceiverWhenLocalAndRemotePoliciesAdded() throws Exception { final MessageAnnotationsMatcher maMatcher = new MessageAnnotationsMatcher(true); maMatcher.withEntry(OPERATION_TYPE.toString(), Matchers.is(ADD_ADDRESS_POLICY)); @@ -2994,7 +2994,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationSendsRemotePolicyIfEventsSenderLinkRejected() throws Exception { final MessageAnnotationsMatcher maMatcher = new MessageAnnotationsMatcher(true); maMatcher.withEntry(OPERATION_TYPE.toString(), Matchers.is(ADD_ADDRESS_POLICY)); @@ -3064,7 +3064,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerSendsAddressAddedEventForInterestedPeer() throws Exception { final AddressSettings addressSettings = new AddressSettings(); addressSettings.setAutoCreateQueues(false); @@ -3135,7 +3135,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesAddressReceiverInResponseToAddressAddedEvent() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -3233,7 +3233,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddressAddedEventIgnoredIfFederationConsumerAlreadyCreated() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -3313,7 +3313,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerClosesFederationReceiverAfterAddressRemoved() throws Exception { server.start(); server.addAddressInfo(new AddressInfo(SimpleString.toSimpleString("test"), RoutingType.MULTICAST)); @@ -3384,7 +3384,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationAddressDemandTrackedWhenRemoteRejectsInitialAttempts() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -3486,7 +3486,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationAddressDemandTrackedWhenPluginBlocksInitialAttempts() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationBrokerPliuginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationBrokerPliuginTest.java index 16b9d43055..0132f1558f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationBrokerPliuginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationBrokerPliuginTest.java @@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; @@ -104,7 +103,7 @@ public class AMQPFederationBrokerPliuginTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationBrokerPluginWithAddressPolicyConfigured() throws Exception { logger.info("Test started: {}", getTestName()); @@ -191,7 +190,7 @@ public class AMQPFederationBrokerPliuginTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationBrokerPluginWithQueuePolicyConfigured() throws Exception { logger.info("Test started: {}", getTestName()); @@ -277,7 +276,7 @@ public class AMQPFederationBrokerPliuginTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testPluginCanBlockAddressFederationConsumerCreate() throws Exception { logger.info("Test started: {}", getTestName()); @@ -349,7 +348,7 @@ public class AMQPFederationBrokerPliuginTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testPluginCanBlockQueueFederationConsumerCreate() throws Exception { logger.info("Test started: {}", getTestName()); @@ -421,7 +420,7 @@ public class AMQPFederationBrokerPliuginTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testPluginCanBlockAddressFederationWhenDemandOnDivertIsAdded() throws Exception { logger.info("Test started: {}", getTestName()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConfigurationReloadTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConfigurationReloadTest.java index 5f0b3e99fa..5600b683b3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConfigurationReloadTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConfigurationReloadTest.java @@ -94,7 +94,7 @@ public class AMQPFederationConfigurationReloadTest extends AmqpClientTestSupport } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationConfigurationWithoutChangesIsIgnoredOnUpdate() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -193,7 +193,7 @@ public class AMQPFederationConfigurationReloadTest extends AmqpClientTestSupport } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationConnectsToSecondPeerWhenConfigurationUpdatedWithNewConnection() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { @@ -320,7 +320,7 @@ public class AMQPFederationConfigurationReloadTest extends AmqpClientTestSupport } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationDisconnectsFromExistingPeerIfConfigurationRemoved() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { @@ -410,7 +410,7 @@ public class AMQPFederationConfigurationReloadTest extends AmqpClientTestSupport } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationUpdatesPolicyAndFederatesQueueInsteadOfAddress() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { @@ -538,7 +538,7 @@ public class AMQPFederationConfigurationReloadTest extends AmqpClientTestSupport } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testReloadAmqpConnectionAddressPolicyMatches() throws Exception { server.start(); @@ -614,7 +614,7 @@ public class AMQPFederationConfigurationReloadTest extends AmqpClientTestSupport } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testReloadAmqpConnectionQueuePolicyMatches() throws Exception { server.start(); server.createQueue(new QueueConfiguration("queue1").setRoutingType(RoutingType.ANYCAST) @@ -704,7 +704,7 @@ public class AMQPFederationConfigurationReloadTest extends AmqpClientTestSupport } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testReloadAmqpConnectionAddressPolicyReplacedWithQueuePolicy() throws Exception { server.start(); server.createQueue(new QueueConfiguration("queue1").setRoutingType(RoutingType.ANYCAST) @@ -778,7 +778,7 @@ public class AMQPFederationConfigurationReloadTest extends AmqpClientTestSupport } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testReloadAmqpConnectionQueuePolicyMatchesFromBrokerProperties() throws Exception { server.start(); server.createQueue(new QueueConfiguration("queue1").setRoutingType(RoutingType.ANYCAST) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConnectTest.java index 42496783ca..f2b2c61ef4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConnectTest.java @@ -105,7 +105,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerConnectsWithAnonymous() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect("PLAIN", "ANONYMOUS"); @@ -128,7 +128,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederatedBrokerConnectsWithPlain() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLPlainConnect("user", "pass", "PLAIN", "ANONYMOUS"); @@ -152,7 +152,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationConfiguredCreatesControlLink() throws Exception { final int AMQP_MIN_LARGE_MESSAGE_SIZE = 10_000; final int AMQP_CREDITS = 100; @@ -217,7 +217,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesControlLinkAndClosesConnectionIfCapabilityIsAbsent() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect("PLAIN", "ANONYMOUS"); @@ -243,7 +243,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesControlLinkAndClosesConnectionDetachIndicatesNotAuthorized() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect("PLAIN", "ANONYMOUS"); @@ -288,7 +288,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationSendsReceiveFromQueuePolicyToRemoteWhenSendToIsConfigured() throws Exception { final MessageAnnotationsMatcher maMatcher = new MessageAnnotationsMatcher(true); maMatcher.withEntry(OPERATION_TYPE.toString(), Matchers.is(ADD_QUEUE_POLICY)); @@ -363,7 +363,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationSendsReceiveFromQueuePolicyToRemoteWhenSendToIsConfiguredAndEventSenderRejected() throws Exception { final MessageAnnotationsMatcher maMatcher = new MessageAnnotationsMatcher(true); maMatcher.withEntry(OPERATION_TYPE.toString(), Matchers.is(ADD_QUEUE_POLICY)); @@ -439,7 +439,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationSendsReceiveFromAddressPolicyToRemoteWhenSendToIsConfigured() throws Exception { final MessageAnnotationsMatcher maMatcher = new MessageAnnotationsMatcher(true); maMatcher.withEntry(OPERATION_TYPE.toString(), Matchers.is(ADD_ADDRESS_POLICY)); @@ -512,7 +512,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationSendsReceiveFromAddressPolicyToRemoteWhenSendToIsConfiguredAndEventSenderRejected() throws Exception { final MessageAnnotationsMatcher maMatcher = new MessageAnnotationsMatcher(true); maMatcher.withEntry(OPERATION_TYPE.toString(), Matchers.is(ADD_ADDRESS_POLICY)); @@ -586,7 +586,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testConnectToBrokerFromRemoteAsFederatedSourceAndCreateControlLink() throws Exception { server.start(); @@ -608,7 +608,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testConnectToBrokerFromRemoteAsFederatedSourceAndCreateEventsSenderLink() throws Exception { server.start(); @@ -630,7 +630,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testConnectToBrokerFromRemoteAsFederatedSourceAndCreateEventsReceiverLink() throws Exception { server.start(); @@ -652,7 +652,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testConnectToBrokerFromRemoteAsFederatedSourceAndCreateEventsLinks() throws Exception { server.start(); @@ -674,7 +674,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testControlLinkPassesConnectAttemptWhenUserHasPrivledges() throws Exception { enableSecurity(server, FEDERATION_BASE_VALIDATION_ADDRESS); server.start(); @@ -697,7 +697,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testControlAndEventsLinksPassesConnectAttemptWhenUserHasPrivledges() throws Exception { enableSecurity(server, FEDERATION_BASE_VALIDATION_ADDRESS + ".#"); server.start(); @@ -720,7 +720,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testControlLinkRefusesConnectAttemptWhenUseDoesNotHavePrivledgesForControlAddress() throws Exception { enableSecurity(server, FEDERATION_BASE_VALIDATION_ADDRESS); server.start(); @@ -739,7 +739,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteConnectionCannotAttachEventReceiverLinkWithoutControlLink() throws Exception { server.start(); @@ -785,7 +785,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteConnectionCannotAttachEventSenderLinkWithoutControlLink() throws Exception { server.start(); @@ -831,7 +831,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testControlLinkSenderQueueCreatedWithMaxConsumersOfOne() throws Exception { final String controlLinkAddress = "test-control-address"; final String federationControlSenderAddress = FEDERATION_BASE_VALIDATION_ADDRESS + @@ -891,7 +891,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testEventSenderLinkFromTargetUsesNamespacedDynamicQueue() throws Exception { final String federationControlLinkName = "federation-test"; @@ -961,7 +961,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testEventsLinkAtTargetIsCreatedWithMaxConsumersOfOne() throws Exception { final String federationControlLinkName = "federation-test"; @@ -1050,7 +1050,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testFederationDemandAddedAndImmediateBrokerShutdownOverlaps() throws Exception { // Testing for a race on broker shutdown if demand was added at the same time and the // broker is creating an outbound consumer to match that demand. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java index f7d1f5ab39..95da3bbe06 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java @@ -149,13 +149,13 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkForQueueMatchAnycast() throws Exception { doTestFederationCreatesQueueReceiverLinkForQueueMatch(RoutingType.ANYCAST); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkForQueueMatchMulticast() throws Exception { doTestFederationCreatesQueueReceiverLinkForQueueMatch(RoutingType.MULTICAST); } @@ -230,7 +230,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationQueueReceiverCarriesConfiguredQueueFilter() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -297,7 +297,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationQueueReceiverCarriesConsumerQueueFilter() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -401,7 +401,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationQueueReceiverCanIgnoreConsumerQueueFilter() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -473,7 +473,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkForQueueMatchUsingPolicyCredit() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -542,7 +542,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationClosesQueueReceiverWhenDemandIsRemovedFromQueue() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -607,7 +607,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationHandlesQueueDeletedAndConsumerRecreates() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -696,7 +696,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testSecondQueueConsumerDoesNotGenerateAdditionalFederationReceiver() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -762,7 +762,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testLinkCreatedForEachDistinctQueueMatchInSameConfiguredPolicy() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -844,7 +844,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationReceiverCreatedWhenWildcardPolicyMatchesConsumerQueue() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -909,7 +909,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteCloseOfQueueReceiverRespondsToDetach() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -977,7 +977,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRejectedQueueReceiverAttachWhenLocalMatchingQueueNotFoundIsHandled() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1062,13 +1062,13 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteCloseQueueReceiverWhenRemoteResourceIsDeletedIsHandled() throws Exception { doTestRemoteCloseQueueReceiverForExpectedConditionsIsHandled("amqp:resource-deleted"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteCloseQueueReceiverWhenRemoteReceiverIsForcedToDetachIsHandled() throws Exception { doTestRemoteCloseQueueReceiverForExpectedConditionsIsHandled("amqp:link:detach-forced"); } @@ -1155,7 +1155,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testUnhandledRemoteReceiverCloseConditionCausesConnectionRebuild() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1251,7 +1251,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testInboundMessageRoutedToReceiverOnLocalQueue() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1328,19 +1328,19 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkWithDefaultPrioirty() throws Exception { doTestFederationCreatesQueueReceiverLinkWithAdjustedPriority(0); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkWithIncreasedPriority() throws Exception { doTestFederationCreatesQueueReceiverLinkWithAdjustedPriority(5); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkWithDecreasedPriority() throws Exception { doTestFederationCreatesQueueReceiverLinkWithAdjustedPriority(-5); } @@ -1411,13 +1411,13 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkConsumerPriorityOffset() throws Exception { doTestFederationCreatesQueueReceiverWithCorrectPriorityOffset(false); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkIngoringConsumerPriorityOffset() throws Exception { doTestFederationCreatesQueueReceiverWithCorrectPriorityOffset(true); } @@ -1497,7 +1497,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testLinkCreatedForEachDistinctQueueMatchInSameConfiguredPolicyWithSameAddressMatch() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -1597,7 +1597,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerAcceptsQueuePolicyFromControlLink() throws Exception { server.start(); @@ -1633,7 +1633,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerAcceptsQueuePolicyFromControlLinkWithTransformerConfiguration() throws Exception { server.start(); @@ -1678,7 +1678,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteFederatesQueueWhenDemandIsApplied() throws Exception { server.start(); @@ -1741,7 +1741,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteFederatesQueueWhenDemandIsAppliedUsingControllerDefinedLinkCredit() throws Exception { server.start(); @@ -1805,7 +1805,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteFederatesQueueWhenDemandIsAppliedUsingPolicyDefinedLinkCredit() throws Exception { server.start(); @@ -1874,7 +1874,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteFederatesQueueAndAppliesTransformerWhenDemandIsApplied() throws Exception { server.start(); @@ -1948,7 +1948,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerAnswersAttachOfFederationReceiverProperly() throws Exception { server.start(); server.createQueue(new QueueConfiguration("test").setRoutingType(RoutingType.ANYCAST) @@ -1992,7 +1992,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerRoutesInboundMessageToFederatedReceiver() throws Exception { server.start(); server.createQueue(new QueueConfiguration("test").setRoutingType(RoutingType.ANYCAST) @@ -2060,7 +2060,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerCanFailLinkAttachIfQueueDoesNotExistWithoutClosingTheConnection() throws Exception { server.start(); @@ -2124,7 +2124,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerCanFailLinkAttachIfQueueDoesNotMatchFullExpectationWithoutClosingTheConnection() throws Exception { server.start(); @@ -2188,7 +2188,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteConnectionCannotAttachQueueFederationLinkWithoutControlLink() throws Exception { server.start(); @@ -2234,7 +2234,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerRoutesInboundMessageToFederatedReceiverWithFilterApplied() throws Exception { server.start(); server.createQueue(new QueueConfiguration("test").setRoutingType(RoutingType.ANYCAST) @@ -2314,7 +2314,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerDoesNotFederateQueueIfOnlyDemandIsFromAnotherBrokerFederationSubscription() throws Exception { try (ProtonTestServer target = new ProtonTestServer()) { target.expectSASLAnonymousConnect(); @@ -2424,7 +2424,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerCanFederateQueueIfOnlyDemandIsFromAnotherBrokerFederationSubscription() throws Exception { try (ProtonTestServer target = new ProtonTestServer()) { target.expectSASLAnonymousConnect(); @@ -2523,7 +2523,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testTransformInboundFederatedMessageBeforeDispatch() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -2609,25 +2609,25 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testPullQueueConsumerGrantsDefaultCreditOnEmptyQueue() throws Exception { doTestPullConsumerGrantsConfiguredCreditOnEmptyQueue(0, false, 0, false, DEFAULT_PULL_CREDIT_BATCH_SIZE); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testPullQueueConsumerGrantsReceiverConfiguredCreditOnEmptyQueue() throws Exception { doTestPullConsumerGrantsConfiguredCreditOnEmptyQueue(0, false, 10, true, 10); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testPullQueueConsumerGrantsFederationConfiguredCreditOnEmptyQueue() throws Exception { doTestPullConsumerGrantsConfiguredCreditOnEmptyQueue(20, true, 0, false, 20); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testPullQueueConsumerGrantsReceiverConfiguredCreditOverFederationConfiguredOnEmptyQueue() throws Exception { doTestPullConsumerGrantsConfiguredCreditOnEmptyQueue(20, true, 10, true, 10); } @@ -2704,7 +2704,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPullQueueConsumerGrantsCreditOnlyWhenPendingMessageIsConsumed() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -2781,25 +2781,25 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPullQueueConsumerBatchCreditTopUpAfterEachBacklogDrain() throws Exception { doTestPullConsumerCreditTopUpAfterEachBacklogDrain(0, false, 0, false, DEFAULT_PULL_CREDIT_BATCH_SIZE); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPullQueueConsumerBatchCreditTopUpAfterEachBacklogDrainFederationConfigured() throws Exception { doTestPullConsumerCreditTopUpAfterEachBacklogDrain(10, true, 0, false, 10); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPullQueueConsumerBatchCreditTopUpAfterEachBacklogDrainPolicyConfigured() throws Exception { doTestPullConsumerCreditTopUpAfterEachBacklogDrain(0, false, 20, true, 20); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPullQueueConsumerBatchCreditTopUpAfterEachBacklogDrainBothConfigured() throws Exception { doTestPullConsumerCreditTopUpAfterEachBacklogDrain(100, true, 20, true, 20); } @@ -2921,13 +2921,13 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreMessageConvertedToAMQPWhenTunnelingDisabled() throws Exception { doTestCoreMessageHandlingBasedOnTunnelingState(false); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreMessageNotConvertedToAMQPWhenTunnelingEnabled() throws Exception { doTestCoreMessageHandlingBasedOnTunnelingState(true); } @@ -3002,13 +3002,13 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreLargeMessageConvertedToAMQPWhenTunnelingDisabled() throws Exception { doTestCoreLargeMessageHandlingBasedOnTunnelingState(false); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreLargeMessageNotConvertedToAMQPWhenTunnelingEnabled() throws Exception { doTestCoreLargeMessageHandlingBasedOnTunnelingState(true); } @@ -3090,7 +3090,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesQueueReceiverLinkForQueueAfterBrokerConnectionStarted() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.start(); @@ -3182,7 +3182,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesEventSenderAndReceiverWhenLocalAndRemotePoliciesAdded() throws Exception { final MessageAnnotationsMatcher maMatcher = new MessageAnnotationsMatcher(true); maMatcher.withEntry(OPERATION_TYPE.toString(), Matchers.is(ADD_QUEUE_POLICY)); @@ -3263,7 +3263,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationSendsRemotePolicyIfEventsSenderLinkRejected() throws Exception { final MessageAnnotationsMatcher maMatcher = new MessageAnnotationsMatcher(true); maMatcher.withEntry(OPERATION_TYPE.toString(), Matchers.is(ADD_QUEUE_POLICY)); @@ -3329,7 +3329,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerSendsQueueAddedEventForInterestedPeer() throws Exception { final AddressSettings addressSettings = new AddressSettings(); addressSettings.setAutoCreateQueues(false); @@ -3396,7 +3396,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationCreatesAddressReceiverInResponseToAddressAddedEvent() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -3488,7 +3488,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddressAddedEventIgnoredIfFederationConsumerAlreadyCreated() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -3567,7 +3567,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteBrokerClosesFederationReceiverAfterQueueRemoved() throws Exception { server.start(); server.createQueue(new QueueConfiguration("test").setRoutingType(RoutingType.ANYCAST) @@ -3646,7 +3646,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationQueueDemandTrackedWhenRemoteRejectsInitialAttempts() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); @@ -3751,7 +3751,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testFederationQueueDemandTrackedWhenPluginBlocksInitialAttempts() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationServerToServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationServerToServerTest.java index 457f5f88c2..e76a5f90c1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationServerToServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationServerToServerTest.java @@ -26,7 +26,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.lang.invoke.MethodHandles; import java.util.Arrays; import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.jms.BytesMessage; import javax.jms.Connection; @@ -117,13 +116,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddresDemandOnLocalBrokerFederatesMessagesFromRemoteAMQP() throws Exception { testAddresDemandOnLocalBrokerFederatesMessagesFromRemote("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddresDemandOnLocalBrokerFederatesMessagesFromRemoteCORE() throws Exception { testAddresDemandOnLocalBrokerFederatesMessagesFromRemote("CORE"); } @@ -192,13 +191,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testDivertAddressDemandOnLocalBrokerFederatesMessagesFromRemoteAMQP() throws Exception { testDivertAddresDemandOnLocalBrokerFederatesMessagesFromRemote("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testDivertAddresDemandOnLocalBrokerFederatesMessagesFromRemoteCORE() throws Exception { testDivertAddresDemandOnLocalBrokerFederatesMessagesFromRemote("CORE"); } @@ -277,13 +276,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueueDemandOnLocalBrokerFederatesMessagesFromRemoteAMQP() throws Exception { testQueueDemandOnLocalBrokerFederatesMessagesFromRemote("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueueDemandOnLocalBrokerFederatesMessagesFromRemoteCORE() throws Exception { testQueueDemandOnLocalBrokerFederatesMessagesFromRemote("CORE"); } @@ -347,13 +346,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddresDemandOnRemoteBrokerFederatesMessagesFromLocalAMQP() throws Exception { testAddresDemandOnRemoteBrokerFederatesMessagesFromLocal("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddresDemandOnRemoteBrokerFederatesMessagesFromLocalCORE() throws Exception { testAddresDemandOnRemoteBrokerFederatesMessagesFromLocal("CORE"); } @@ -422,13 +421,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueueDemandOnRemoteWithRemoteConfigrationLeadsToMessageBeingFederatedAMQP() throws Exception { testQueueDemandOnRemoteWithRemoteConfigrationLeadsToMessageBeingFederated("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueueDemandOnRemoteWithRemoteConfigrationLeadsToMessageBeingFederatedCORE() throws Exception { testQueueDemandOnRemoteWithRemoteConfigrationLeadsToMessageBeingFederated("CORE"); } @@ -492,13 +491,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testDivertAddresDemandOnRemoteBrokerFederatesMessagesFromLocalAMQP() throws Exception { testDivertAddresDemandOnRemoteBrokerFederatesMessagesFromLocal("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testDivertAddresDemandOnRemoteBrokerFederatesMessagesFromLocalCORE() throws Exception { testDivertAddresDemandOnRemoteBrokerFederatesMessagesFromLocal("CORE"); } @@ -578,21 +577,21 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddresDemandOnLocalBrokerFederatesLargeMessagesFromRemoteAMQP() throws Exception { // core tunneling shouldn't affect the AMQP message that cross testAddresDemandOnLocalBrokerFederatesLargeMessagesFromRemote("AMQP", true); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddresDemandOnLocalBrokerFederatesLargeMessagesFromRemoteCORENoTunneling() throws Exception { // core message should be converted to AMQP and back. testAddresDemandOnLocalBrokerFederatesLargeMessagesFromRemote("CORE", false); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddresDemandOnLocalBrokerFederatesLargeMessagesFromRemoteCOREWithTunneling() throws Exception { // core messages should be tunneled in an AMQP message an then read back testAddresDemandOnLocalBrokerFederatesLargeMessagesFromRemote("CORE", true); @@ -679,14 +678,14 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueueDemandOnLocalBrokerFederatesLargeMessagesFromRemoteAMQP() throws Exception { // core tunneling shouldn't affect the AMQP message that cross testQueueDemandOnLocalBrokerFederatesLargeMessagesFromRemote("AMQP", true); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueueDemandOnLocalBrokerFederatesLargeMessagesFromRemoteCORENoTunneling() throws Exception { // core message should be converted to AMQP and back. testQueueDemandOnLocalBrokerFederatesLargeMessagesFromRemote("CORE", false); @@ -775,13 +774,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreMessageCrossingAddressWithThreeBrokersWithoutTunneling() throws Exception { doTestCoreMessageCrossingAddressWithThreeBrokers(false); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreMessageCrossingAddressWithThreeBrokersWithTunneling() throws Exception { doTestCoreMessageCrossingAddressWithThreeBrokers(true); } @@ -953,31 +952,31 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreConsumerDemandOnLocalBrokerFederatesMessageFromAMQPClient() throws Exception { testCoreConsumerDemandOnLocalBrokerFederatesMessageFromAMQPClient("CORE", "AMQP", false); // Tunneling doesn't matter here } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreConsumerDemandOnLocalBrokerFederatesMessageFromCoreClientTunneled() throws Exception { testCoreConsumerDemandOnLocalBrokerFederatesMessageFromAMQPClient("CORE", "CORE", true); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreConsumerDemandOnLocalBrokerFederatesMessageFromCoreClientUnTunneled() throws Exception { testCoreConsumerDemandOnLocalBrokerFederatesMessageFromAMQPClient("CORE", "CORE", false); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAMQPConsumerDemandOnLocalBrokerFederatesMessageFromCoreClientTunneled() throws Exception { testCoreConsumerDemandOnLocalBrokerFederatesMessageFromAMQPClient("AMQP", "CORE", true); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAMQPConsumerDemandOnLocalBrokerFederatesMessageFromCoreClientNotTunneled() throws Exception { testCoreConsumerDemandOnLocalBrokerFederatesMessageFromAMQPClient("AMQP", "CORE", false); } @@ -1061,13 +1060,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueueDemandOnLocalBrokerFederatesMatchingFilteredMessagesFromRemoteAMQP() throws Exception { testQueueDemandOnLocalBrokerFederatesMatchingFilteredMessagesFromRemote("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueueDemandOnLocalBrokerFederatesMatchingFilteredMessagesFromRemoteCORE() throws Exception { testQueueDemandOnLocalBrokerFederatesMatchingFilteredMessagesFromRemote("CORE"); } @@ -1157,13 +1156,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddressFederatedOverSingleConnectionNotReflectedBackToSendingNodeAMQP() throws Exception { doTestAddressFederatedOverSingleConnectionNotReflectedBackToSendingNode("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddressFederatedOverSingleConnectionNotReflectedBackToSendingNodeCore() throws Exception { doTestAddressFederatedOverSingleConnectionNotReflectedBackToSendingNode("CORE"); } @@ -1267,13 +1266,13 @@ public class AMQPFederationServerToServerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddressFederatedOnTwoConnectionsNotReflectedBackToSendingNodeAMQP() throws Exception { doTestAddressFederatedOverTwoConnectionNotReflectedBackToSendingNode("AMQP"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAddressFederatedOnTwoConnectionsNotReflectedBackToSendingNodeCore() throws Exception { doTestAddressFederatedOverTwoConnectionNotReflectedBackToSendingNode("CORE"); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPMirrorConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPMirrorConnectionTest.java index 85f4fd2cf4..94204d692f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPMirrorConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPMirrorConnectionTest.java @@ -78,7 +78,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerMirrorConnectsWithAnonymous() throws Exception { final Map brokerProperties = new HashMap<>(); brokerProperties.put(AMQPMirrorControllerSource.BROKER_ID.toString(), "Test-Broker"); @@ -113,7 +113,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerMirrorConnectsWithPlain() throws Exception { final Map brokerProperties = new HashMap<>(); brokerProperties.put(AMQPMirrorControllerSource.BROKER_ID.toString(), "Test-Broker"); @@ -149,7 +149,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerHandlesSenderLinkOmitsMirrorCapability() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { peer.expectSASLAnonymousConnect("PLAIN", "ANONYMOUS"); @@ -181,7 +181,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerAddsAddressAndQueue() throws Exception { final Map brokerProperties = new HashMap<>(); brokerProperties.put(AMQPMirrorControllerSource.BROKER_ID.toString(), "Test-Broker"); @@ -224,7 +224,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCreateDurableConsumerReplicatesAddressAndQueue() throws Exception { final Map brokerProperties = new HashMap<>(); brokerProperties.put(AMQPMirrorControllerSource.BROKER_ID.toString(), "Test-Broker"); @@ -275,13 +275,13 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerMirrorHonorsCoreTunnelingEnable() throws Exception { testBrokerMirrorHonorsCoreTunnelingEnableOrDisable(true); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testBrokerMirrorHonorsCoreTunnelingDisable() throws Exception { testBrokerMirrorHonorsCoreTunnelingEnableOrDisable(false); } @@ -332,13 +332,13 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testProducerMessageIsMirroredWithCoreTunnelingUsesCoreMessageFormat() throws Exception { doTestProducerMessageIsMirroredWithCorrectMessageFormat(true); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testProducerMessageIsMirroredWithoutCoreTunnelingUsesDefaultMessageFormat() throws Exception { doTestProducerMessageIsMirroredWithCorrectMessageFormat(false); } @@ -417,7 +417,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testRemoteDoesNotOfferTunnelingResultsInDefaultAMQPFormattedMessages() throws Exception { final Map brokerProperties = new HashMap<>(); brokerProperties.put(AMQPMirrorControllerSource.BROKER_ID.toString(), "Test-Broker"); @@ -481,7 +481,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testTunnelingDisabledButRemoteOffersDoesNotUseTunneling() throws Exception { final Map brokerProperties = new HashMap<>(); brokerProperties.put(AMQPMirrorControllerSource.BROKER_ID.toString(), "Test-Broker"); @@ -545,7 +545,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testMirrorConnectionRemainsUnchangedAfterConfigurationUpdate() throws Exception { final Map brokerProperties = new HashMap<>(); brokerProperties.put(AMQPMirrorControllerSource.BROKER_ID.toString(), "Test-Broker"); @@ -634,7 +634,7 @@ public class AMQPMirrorConnectionTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testMirrorConnectionRemainsUnchangedAfterConfigurationRemoved() throws Exception { final Map brokerProperties = new HashMap<>(); brokerProperties.put(AMQPMirrorControllerSource.BROKER_ID.toString(), "Test-Broker"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/QpidDispatchPeerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/QpidDispatchPeerTest.java index 50d1ea404a..660e732f10 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/QpidDispatchPeerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/QpidDispatchPeerTest.java @@ -30,7 +30,6 @@ import javax.jms.Queue; import javax.jms.Session; import javax.jms.TextMessage; import java.net.URL; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.QueueConfiguration; import org.apache.activemq.artemis.api.core.RoutingType; @@ -102,7 +101,7 @@ public class QpidDispatchPeerTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWithMatchingDifferentNamesOnQueueKill() throws Exception { internalMultipleQueues(true, true, true, false, false); } @@ -111,43 +110,43 @@ public class QpidDispatchPeerTest extends AmqpClientTestSupport { /** On this test the max reconnect attemps is reached. after a reconnect I will force a stop on the broker connection and retry it. * The reconnection should succeed. */ @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWithMatchingDifferentNamesOnQueueKillMaxAttempts() throws Exception { internalMultipleQueues(true, true, true, false, true); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWithMatchingDifferentNamesOnQueuePauseMaxAttempts() throws Exception { internalMultipleQueues(true, true, false, true, false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWithMatchingDifferentNamesOnQueuePause() throws Exception { internalMultipleQueues(true, true, false, true, false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWithMatchingDifferentNamesOnQueue() throws Exception { internalMultipleQueues(true, true, false, false, false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWithMatching() throws Exception { internalMultipleQueues(true, false, false, false, false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testwithQueueName() throws Exception { internalMultipleQueues(false, false, false, false, false); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testwithQueueNameDistinctName() throws Exception { internalMultipleQueues(false, true, false, false, false); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/ValidateAMQPErrorsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/ValidateAMQPErrorsTest.java index 0d484d03bc..b63b70f414 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/ValidateAMQPErrorsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/ValidateAMQPErrorsTest.java @@ -87,7 +87,7 @@ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { * and the max retry should still be counted, not just keep connecting forever. */ @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConnectItself() throws Exception { try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler()) { @@ -111,7 +111,7 @@ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCloseLinkOnMirror() throws Exception { try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler()) { @@ -176,13 +176,13 @@ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCloseLinkOnSender() throws Exception { doCloseLinkTestImpl(true); } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCloseLinkOnReceiver() throws Exception { doCloseLinkTestImpl(false); } @@ -276,7 +276,7 @@ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testTimeoutOnSenderOpen() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { // Initial attempt @@ -308,7 +308,7 @@ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testReconnectAfterSenderOpenTimeout() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { // Initial attempt, times out @@ -359,7 +359,7 @@ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testNoServerOfferedMirrorCapability() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { for (int i = 0; i < 3; ++i) { @@ -397,7 +397,7 @@ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { * @throws Exception */ @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testReconnectAfterMirrorLinkRefusal() throws Exception { try (ProtonTestServer peer = new ProtonTestServer()) { // First attempt, refuse @@ -447,7 +447,7 @@ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testNoClientDesiredMirrorCapability() throws Exception { try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler()) { server.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/interop/AmqpCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/interop/AmqpCoreTest.java index c96e23134d..7c0036a4a9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/interop/AmqpCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/interop/AmqpCoreTest.java @@ -26,7 +26,6 @@ import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -66,7 +65,7 @@ public class AmqpCoreTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMultipleCoreReceiving() throws Exception { Connection coreJmsConn = this.createCoreConnection(); @@ -101,7 +100,7 @@ public class AmqpCoreTest extends JMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAmqpFailedConversionFromCore() throws Exception { final SimpleString message = RandomUtil.randomSimpleString(); Connection coreJmsConn = this.createCoreConnection(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AMQPLargeMessageOverCoreBridgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AMQPLargeMessageOverCoreBridgeTest.java index fef3da5404..0474e8eb98 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AMQPLargeMessageOverCoreBridgeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AMQPLargeMessageOverCoreBridgeTest.java @@ -103,13 +103,13 @@ public class AMQPLargeMessageOverCoreBridgeTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCoreBridgeDivert() throws Exception { internalTest(true); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCoreBridgeNoDivert() throws Exception { internalTest(false); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AmqpReplicatedLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AmqpReplicatedLargeMessageTest.java index 39b07d7818..3aee0efef1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AmqpReplicatedLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AmqpReplicatedLargeMessageTest.java @@ -84,7 +84,7 @@ public class AmqpReplicatedLargeMessageTest extends AmqpReplicatedTestSupport { @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSimpleSend() throws Exception { try { @@ -169,7 +169,7 @@ public class AmqpReplicatedLargeMessageTest extends AmqpReplicatedTestSupport { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCloseFilesOnTarget() throws Exception { try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/SimpleStreamingLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/SimpleStreamingLargeMessageTest.java index ab37a0e19a..491ee418d1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/SimpleStreamingLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/SimpleStreamingLargeMessageTest.java @@ -96,19 +96,19 @@ public class SimpleStreamingLargeMessageTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendNonPersistent() throws Exception { testSend(false, false); } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendPersistent() throws Exception { testSend(true, false); } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendPersistentRestartServer() throws Exception { testSend(true, true); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpMaxReadPagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpMaxReadPagingTest.java index 9de7afaf22..2dadd5a537 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpMaxReadPagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpMaxReadPagingTest.java @@ -61,7 +61,7 @@ public class AmqpMaxReadPagingTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMaxReadPage() throws Exception { final int MSG_SIZE = 1000; final StringBuilder builder = new StringBuilder(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpPagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpPagingTest.java index 10bece8f0f..89a8a6d07e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpPagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpPagingTest.java @@ -73,7 +73,7 @@ public class AmqpPagingTest extends AmqpClientTestSupport { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPaging() throws Exception { final int MSG_SIZE = 1000; final StringBuilder builder = new StringBuilder(); @@ -123,7 +123,7 @@ public class AmqpPagingTest extends AmqpClientTestSupport { @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSizeCalculationsForApplicationProperties() throws Exception { final int MSG_SIZE = 1000; final StringBuilder builder = new StringBuilder(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java index 36c65af956..e42dd7e7b4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java @@ -39,7 +39,6 @@ import java.lang.invoke.MethodHandles; import java.util.HashSet; import java.util.Set; import java.util.UUID; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; @@ -410,7 +409,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) // QueueAutoCreationTest was created to validate auto-creation of queues // and this test was added to validate a regression: https://issues.apache.org/jira/browse/ARTEMIS-2238 public void testAutoCreateOnAddressOnly() throws Exception { @@ -437,7 +436,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) // QueueAutoCreationTest was created to validate auto-creation of queues // and this test was added to validate a regression: https://issues.apache.org/jira/browse/ARTEMIS-2238 public void testAutoCreateOnAddressOnlyDuringProducerCreate() throws Exception { @@ -462,7 +461,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase { @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) // QueueAutoCreationTest was created to validate auto-creation of queues // and this test was added to validate a regression: https://issues.apache.org/jira/browse/ARTEMIS-2238 public void testAutoCreateOnAddressOnlyDuringProducerCreateQueueSucceed() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSOrderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSOrderTest.java index 869205be5b..de3aad0374 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSOrderTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSOrderTest.java @@ -35,7 +35,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -107,7 +106,7 @@ public class JMSOrderTest extends JMSTestBase { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveSomeThenRollback() throws Exception { Connection connection = protocolCF.createConnection(); try { @@ -153,7 +152,7 @@ public class JMSOrderTest extends JMSTestBase { } @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveSomeThenClose() throws Exception { Connection connection = protocolCF.createConnection(); try { @@ -236,7 +235,7 @@ public class JMSOrderTest extends JMSTestBase { @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testReceiveOutOfOrderProducers() throws Exception { Connection connection = protocolCF.createConnection(); try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSTransactionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSTransactionTest.java index 11926cac8f..966fc1c8cf 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSTransactionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSTransactionTest.java @@ -33,13 +33,12 @@ import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; public class JMSTransactionTest extends JMSTestBase { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAsyncProduceMessageAndCommit() throws Throwable { final String queueName = "TEST"; final int messages = 10; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java index bf9f32ef42..eadd5acd6e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java @@ -36,7 +36,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; import java.util.Map; -import java.util.concurrent.TimeUnit; public class TwoWayTwoNodeClusterTest extends ClusterTestBase { @@ -75,7 +74,7 @@ public class TwoWayTwoNodeClusterTest extends ClusterTestBase { * messages after restarting. */ @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClusterRestartWithConfigChanged() throws Exception { Configuration config0 = servers[0].getConfiguration(); Configuration config1 = servers[1].getConfiguration(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java index 33cb7bde40..cc4bc02bb0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java @@ -142,7 +142,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTimeoutOnFailover() throws Exception { locator.setCallTimeout(1000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(10); @@ -209,7 +209,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTimeoutOnFailoverConsume() throws Exception { locator.setCallTimeout(1000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setBlockOnAcknowledge(true).setReconnectAttempts(-1).setRetryInterval(10).setAckBatchSize(0); @@ -278,7 +278,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTimeoutOnFailoverConsumeBlocked() throws Exception { locator.setCallTimeout(1000).setBlockOnNonDurableSend(true).setConsumerWindowSize(0).setBlockOnDurableSend(true).setAckBatchSize(0).setBlockOnAcknowledge(true).setReconnectAttempts(-1).setAckBatchSize(0).setRetryInterval(10); @@ -372,7 +372,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTimeoutOnFailoverTransactionCommit() throws Exception { locator.setCallTimeout(1000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(10); @@ -442,7 +442,7 @@ public class FailoverTest extends FailoverTestBase { * where the commit would leave the session dirty after a timeout. */ @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTimeoutOnFailoverTransactionCommitTimeoutCommunication() throws Exception { locator.setCallTimeout(1000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(50); @@ -521,7 +521,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTimeoutOnFailoverTransactionRollback() throws Exception { locator.setCallTimeout(2000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(10); @@ -577,7 +577,7 @@ public class FailoverTest extends FailoverTestBase { * @throws Exception */ @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testNonTransactedWithZeroConsumerWindowSize() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(10); @@ -625,7 +625,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testNonTransacted() throws Exception { createSessionFactory(); @@ -655,7 +655,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testFailBothRestartPrimary() throws Exception { ServerLocator locator = getServerLocator(); @@ -805,7 +805,7 @@ public class FailoverTest extends FailoverTestBase { * @throws Exception */ @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailBack() throws Exception { boolean doFailBack = true; HAPolicy haPolicy = backupServer.getServer().getHAPolicy(); @@ -817,7 +817,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailBackPrimaryRestartsBackupIsGone() throws Exception { createSessionFactory(); ClientSession session = createSessionAndQueue(); @@ -867,7 +867,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSimpleFailover() throws Exception { HAPolicy haPolicy = backupServer.getServer().getHAPolicy(); @@ -875,7 +875,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testWithoutUsingTheBackup() throws Exception { createSessionFactory(); ClientSession session = createSessionAndQueue(); @@ -1004,7 +1004,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testConsumeTransacted() throws Exception { createSessionFactory(); @@ -1077,7 +1077,7 @@ public class FailoverTest extends FailoverTestBase { // https://jira.jboss.org/jira/browse/HORNETQ-285 @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailoverOnInitialConnection() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100); @@ -1104,7 +1104,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTransactedMessagesSentSoRollback() throws Exception { createSessionFactory(); @@ -1144,7 +1144,7 @@ public class FailoverTest extends FailoverTestBase { * it can be reused again */ @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTransactedMessagesSentSoRollbackAndContinueWork() throws Exception { createSessionFactory(); @@ -1191,7 +1191,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTransactedMessagesNotSentSoNoRollback() throws Exception { try { createSessionFactory(); @@ -1236,7 +1236,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTransactedMessagesWithConsumerStartedBeforeFailover() throws Exception { createSessionFactory(); @@ -1276,7 +1276,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTransactedMessagesConsumedSoRollback() throws Exception { createSessionFactory(); @@ -1312,7 +1312,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testTransactedMessagesNotConsumedSoNoRollback() throws Exception { createSessionFactory(); @@ -1359,7 +1359,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testXAMessagesSentSoRollbackOnEnd() throws Exception { createSessionFactory(); @@ -1395,7 +1395,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) //start a tx but sending messages after crash public void testXAMessagesSentSoRollbackOnEnd2() throws Exception { createSessionFactory(); @@ -1434,7 +1434,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testXAMessagesSentSoRollbackOnPrepare() throws Exception { createSessionFactory(); @@ -1477,7 +1477,7 @@ public class FailoverTest extends FailoverTestBase { // This might happen if 1PC optimisation kicks in @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testXAMessagesSentSoRollbackOnCommit() throws Exception { createSessionFactory(); @@ -1515,7 +1515,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testXAMessagesNotSentSoNoRollbackOnCommit() throws Exception { createSessionFactory(); @@ -1557,7 +1557,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testXAMessagesConsumedSoRollbackOnEnd() throws Exception { createSessionFactory(); @@ -1593,7 +1593,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testXAMessagesConsumedSoRollbackOnEnd2() throws Exception { createSessionFactory(); @@ -1634,7 +1634,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testXAMessagesConsumedSoRollbackOnPrepare() throws Exception { createSessionFactory(); @@ -1673,7 +1673,7 @@ public class FailoverTest extends FailoverTestBase { // 1PC optimisation @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testXAMessagesConsumedSoRollbackOnCommit() throws Exception { createSessionFactory(); ClientSession session1 = createSessionAndQueue(); @@ -1717,7 +1717,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testCreateNewFactoryAfterFailover() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true); sf = createSessionFactoryAndWaitForTopology(locator, 2); @@ -1744,7 +1744,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailoverMultipleSessionsWithConsumers() throws Exception { createSessionFactory(); @@ -1798,7 +1798,7 @@ public class FailoverTest extends FailoverTestBase { * Browser will get reset to beginning after failover */ @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailWithBrowser() throws Exception { createSessionFactory(); ClientSession session = createSession(sf, true, true); @@ -1828,7 +1828,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailThenReceiveMoreMessagesAfterFailover() throws Exception { createSessionFactory(); @@ -1906,7 +1906,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailThenReceiveMoreMessagesAfterFailover2() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); @@ -1940,25 +1940,25 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSimpleSendAfterFailoverDurableTemporary() throws Exception { doSimpleSendAfterFailover(true, true); } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSimpleSendAfterFailoverNonDurableTemporary() throws Exception { doSimpleSendAfterFailover(false, true); } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSimpleSendAfterFailoverDurableNonTemporary() throws Exception { doSimpleSendAfterFailover(true, false); } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSimpleSendAfterFailoverNonDurableNonTemporary() throws Exception { doSimpleSendAfterFailover(false, false); } @@ -1986,7 +1986,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testMultipleSessionFailover() throws Exception { final String address = "TEST"; locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); @@ -2030,7 +2030,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testChannelStateDuringFailover() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); @@ -2065,7 +2065,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testForceBlockingReturn() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); @@ -2124,7 +2124,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testCommitOccurredUnblockedAndResendNoDuplicates() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100).setBlockOnAcknowledge(true); @@ -2256,7 +2256,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testCommitDidNotOccurUnblockedAndResend() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); @@ -2342,7 +2342,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testBackupServerNotRemoved() throws Exception { // HORNETQ-720 Disabling test for replicating backups. if (!(backupServer.getServer().getHAPolicy() instanceof SharedStoreBackupPolicy)) { @@ -2376,7 +2376,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testPrimaryAndBackupPrimaryComesBack() throws Exception { createSessionFactory(); final CountDownLatch latch = new CountDownLatch(1); @@ -2408,7 +2408,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testPrimaryAndBackupPrimaryComesBackNewFactory() throws Exception { createSessionFactory(); @@ -2457,7 +2457,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testPrimaryAndBackupBackupComesBackNewFactory() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100); @@ -2514,7 +2514,7 @@ public class FailoverTest extends FailoverTestBase { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testBackupConnections() throws Exception { assumeTrue(backupServer.getServer().getHAPolicy().isBackup()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FileLockNodeManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FileLockNodeManagerTest.java index c58ece5274..deb4dcf983 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FileLockNodeManagerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FileLockNodeManagerTest.java @@ -28,7 +28,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.QueueConfiguration; import org.apache.activemq.artemis.api.core.TransportConfiguration; @@ -190,7 +189,7 @@ public class FileLockNodeManagerTest extends FailoverTestBase { } @TestTemplate - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSimpleFailover() throws Exception { Map params = new HashMap<>(); params.put(TransportConstants.HOST_PROP_NAME, "127.0.0.1"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTestBase.java index 4f9e6164d3..2477fe9ee3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTestBase.java @@ -27,7 +27,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.QueueConfiguration; import org.apache.activemq.artemis.api.core.TransportConfiguration; @@ -141,7 +140,7 @@ public class NettyFailoverTestBase extends FailoverTest { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailoverWithHostAlias() throws Exception { Map params = new HashMap<>(); params.put(TransportConstants.HOST_PROP_NAME, "127.0.0.1"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PageCleanupWhileReplicaCatchupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PageCleanupWhileReplicaCatchupTest.java index 8f1bc51a60..f1f77b8ee4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PageCleanupWhileReplicaCatchupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PageCleanupWhileReplicaCatchupTest.java @@ -25,7 +25,6 @@ import javax.jms.MessageProducer; import javax.jms.Session; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.QueueConfiguration; import org.apache.activemq.artemis.api.core.RoutingType; @@ -89,7 +88,7 @@ public class PageCleanupWhileReplicaCatchupTest extends FailoverTestBase { } @Test - @Timeout(value = 160_000, unit = TimeUnit.MILLISECONDS) + @Timeout(160) public void testPageCleanup() throws Throwable { Worker[] workers = new Worker[NUMBER_OF_WORKERS]; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedFailoverTest.java index 27aaecfaa0..d231d5e36a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedFailoverTest.java @@ -61,7 +61,7 @@ public class ReplicatedFailoverTest extends FailoverTest { } @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) /* * default maxSavedReplicatedJournalsSize is 2, this means the backup will fall back to replicated only twice, after this * it is stopped permanently diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java index 01ef34fbdd..fcf837719a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java @@ -19,7 +19,6 @@ package org.apache.activemq.artemis.tests.integration.cluster.failover; import static org.junit.jupiter.api.Assertions.assertNotNull; import java.util.HashMap; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.QueueConfiguration; import org.apache.activemq.artemis.api.core.client.ClientConsumer; @@ -64,14 +63,14 @@ public class ReplicatedPagedFailoverTest extends ReplicatedFailoverTest { @Override @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testReplicatedFailback() throws Exception { super.testReplicatedFailback(); } @Override @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testFailoverOnInitialConnection() throws Exception { super.testFailoverOnInitialConnection(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerNettyNoGroupNameReplicatedFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerNettyNoGroupNameReplicatedFailoverTest.java index d0f7e4fbbf..6c1bd1bd57 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerNettyNoGroupNameReplicatedFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerNettyNoGroupNameReplicatedFailoverTest.java @@ -66,7 +66,7 @@ public class LockManagerNettyNoGroupNameReplicatedFailoverTest extends FailoverT * it is stopped permanently. */ @Test - @Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testReplicatedFailback() throws Exception { try { beforeWaitForRemoteBackupSynchronization(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java index 16a22c18fa..7260d2ad32 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java @@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.util.ArrayList; import java.util.Enumeration; -import java.util.concurrent.TimeUnit; import javax.jms.Connection; import javax.jms.MessageConsumer; @@ -85,7 +84,7 @@ public class OpenWireToAMQPTest extends ActiveMQTestBase { @SuppressWarnings("unchecked") @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testObjectMessage() throws Exception { Connection connection = null; try { @@ -130,7 +129,7 @@ public class OpenWireToAMQPTest extends ActiveMQTestBase { @SuppressWarnings("unchecked") @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testByteArrayProperties() throws Exception { Connection connection = null; try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenwireAmqpResenderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenwireAmqpResenderTest.java index 9f3060fd95..d9ffa7ef41 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenwireAmqpResenderTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenwireAmqpResenderTest.java @@ -18,8 +18,6 @@ package org.apache.activemq.artemis.tests.integration.crossprotocol; import static org.junit.jupiter.api.Assertions.assertNotNull; -import java.util.concurrent.TimeUnit; - import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.Message; @@ -83,7 +81,7 @@ public class OpenwireAmqpResenderTest extends ActiveMQTestBase { } @Test - @Timeout(value = 5_000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void internalOpenwireBinaryPropShouldBeConvertedAsByteArrays() throws Exception { openwireSender(factory); amqpResender(qpidFactory); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederationQueueMatchXMLConfigParsingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederationQueueMatchXMLConfigParsingTest.java index aff516231b..8e2df6959f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederationQueueMatchXMLConfigParsingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederationQueueMatchXMLConfigParsingTest.java @@ -48,19 +48,19 @@ public class FederationQueueMatchXMLConfigParsingTest extends ActiveMQTestBase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testOpenWireOverCoreFederationDownstream() throws Exception { doTestSimpleQueueFederationOverCoreFederationDoownstream("OPENWIRE"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testCoreOverCoreFederationDownstream() throws Exception { doTestSimpleQueueFederationOverCoreFederationDoownstream("CORE"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testAMQPOverCoreFederationDownstream() throws Exception { doTestSimpleQueueFederationOverCoreFederationDoownstream("AMQP"); } @@ -127,19 +127,19 @@ public class FederationQueueMatchXMLConfigParsingTest extends ActiveMQTestBase { } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueuePolicyMatchesOnlyIndicatedQueueOpenwire() throws Exception { doTestQueueMatchPolicyOnlyMatchesIndicatedQueue("OPENWIRE"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueuePolicyMatchesOnlyIndicatedQueueCore() throws Exception { doTestQueueMatchPolicyOnlyMatchesIndicatedQueue("CORE"); } @Test - @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) + @Timeout(20) public void testQueuePolicyMatchesOnlyIndicatedQueueAMQP() throws Exception { doTestQueueMatchPolicyOnlyMatchesIndicatedQueue("AMQP"); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java index a534b8826b..82e57d8b9e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java @@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.fail; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import javax.jms.Connection; @@ -80,7 +79,7 @@ public class SessionMetadataAddExceptionTest extends JMSTestBase { } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testInvalidClientIdSetConnection() throws Exception { assertThrows(JMSException.class, () -> { Connection con = cf.createConnection(); @@ -96,7 +95,7 @@ public class SessionMetadataAddExceptionTest extends JMSTestBase { } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testInvalidClientIdSetFactory() throws Exception { assertThrows(JMSException.class, () -> { ActiveMQConnectionFactory activeMQConnectionFactory = (ActiveMQConnectionFactory) cf; @@ -106,7 +105,7 @@ public class SessionMetadataAddExceptionTest extends JMSTestBase { } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testDuplicateClientIdSet() throws Exception { ActiveMQConnectionFactory activeMQConnectionFactory = (ActiveMQConnectionFactory) cf; Connection con = cf.createConnection(); @@ -123,7 +122,7 @@ public class SessionMetadataAddExceptionTest extends JMSTestBase { } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testDuplicateClientIdSetActiveMQException() throws Exception { assertThrows(JMSException.class, () -> { ActiveMQConnectionFactory activeMQConnectionFactory = (ActiveMQConnectionFactory) cf; @@ -140,7 +139,7 @@ public class SessionMetadataAddExceptionTest extends JMSTestBase { } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testValidIdSetConnection() throws Exception { Connection con = cf.createConnection(); try { @@ -152,7 +151,7 @@ public class SessionMetadataAddExceptionTest extends JMSTestBase { } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testValidClientIdSetFactory() throws Exception { ActiveMQConnectionFactory activeMQConnectionFactory = (ActiveMQConnectionFactory) cf; activeMQConnectionFactory.setClientID("valid"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerForConnectionTimedOutExceptionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerForConnectionTimedOutExceptionTest.java index bc32da076e..0730db356b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerForConnectionTimedOutExceptionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerForConnectionTimedOutExceptionTest.java @@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import javax.jms.Connection; @@ -56,13 +55,13 @@ public class ExceptionListenerForConnectionTimedOutExceptionTest extends JMSTest } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOnAcknowledge() throws Exception { testOnAcknowledge(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOnAcknowledgeBlockOnFailover() throws Exception { // this is validating a case where failover would block // and yet the exception should already happen asynchronously @@ -126,13 +125,13 @@ public class ExceptionListenerForConnectionTimedOutExceptionTest extends JMSTest } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOnSend() throws Exception { testOnSend(false); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testOnSendBlockOnFailover() throws Exception { testOnSend(true); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/ConnectionPeriodicExpiryPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/ConnectionPeriodicExpiryPluginTest.java index 35fd757303..b48db61ef9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/ConnectionPeriodicExpiryPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/ConnectionPeriodicExpiryPluginTest.java @@ -47,21 +47,21 @@ public class ConnectionPeriodicExpiryPluginTest extends MultiprotocolJMSClientTe } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testAMQP() throws Exception { Connection connection = createConnection(); //AMQP testExpiry(connection); } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testCore() throws Exception { Connection connection = createCoreConnection(); testExpiry(connection); } @Test - @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) + @Timeout(5) public void testOpenWire() throws Exception { Connection connection = createOpenWireConnection(); testExpiry(connection); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSCorrelationIDTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSCorrelationIDTest.java index c9ccf5be62..2c0e0b75a9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSCorrelationIDTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSCorrelationIDTest.java @@ -29,7 +29,6 @@ import javax.jms.Session; import org.apache.activemq.artemis.tests.util.RandomUtil; -import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -75,56 +74,56 @@ public class JMSCorrelationIDTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsBytesSendReceiveFromAMQPToAMQP() throws Throwable { testCorrelationIDAsBytesSendReceive(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsBytesSendReceiveFromAMQPToCore() throws Throwable { testCorrelationIDAsBytesSendReceive(createConnection(), createCoreConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsBytesSendReceiveFromAMQPToOpenWire() throws Throwable { testCorrelationIDAsBytesSendReceive(createConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsBytesSendReceiveFromCoreToCore() throws Throwable { testCorrelationIDAsBytesSendReceive(createCoreConnection(), createCoreConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsBytesSendReceiveFromCoreToAMQP() throws Throwable { testCorrelationIDAsBytesSendReceive(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsBytesSendReceiveFromCoreToOpenWire() throws Throwable { testCorrelationIDAsBytesSendReceive(createCoreConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsBytesSendReceiveFromOpenWireToOpenWire() throws Throwable { testCorrelationIDAsBytesSendReceive(createOpenWireConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) @Disabled public void testCorrelationIDAsBytesSendReceiveFromOpenWireToAMQP() throws Throwable { testCorrelationIDAsBytesSendReceive(createOpenWireConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) @Disabled public void testCorrelationIDAsBytesSendReceiveFromOpenWireToCore() throws Throwable { testCorrelationIDAsBytesSendReceive(createOpenWireConnection(), createCoreConnection()); @@ -153,55 +152,55 @@ public class JMSCorrelationIDTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromAMQPToAMQP() throws Throwable { testCorrelationIDAsStringSendReceive(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromAMQPToCore() throws Throwable { testCorrelationIDAsStringSendReceive(createConnection(), createCoreConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromAMQPToOpenWire() throws Throwable { testCorrelationIDAsStringSendReceive(createConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromCoreToCore() throws Throwable { testCorrelationIDAsStringSendReceive(createCoreConnection(), createCoreConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromCoreToAMQP() throws Throwable { testCorrelationIDAsStringSendReceive(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromCoreToOpenWire() throws Throwable { testCorrelationIDAsStringSendReceive(createCoreConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromOpenWireToOpenWire() throws Throwable { testCorrelationIDAsStringSendReceive(createOpenWireConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromOpenWireToAMQP() throws Throwable { testCorrelationIDAsStringSendReceive(createOpenWireConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCorrelationIDAsStringSendReceiveFromOpenWireToCore() throws Throwable { testCorrelationIDAsStringSendReceive(createOpenWireConnection(), createCoreConnection()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageConsumerTest.java index b3e8bd6ad9..4fc702aefe 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageConsumerTest.java @@ -32,7 +32,6 @@ import javax.jms.Session; import javax.jms.TextMessage; import javax.jms.Topic; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.QueueConfiguration; import org.apache.activemq.artemis.api.core.RoutingType; @@ -49,7 +48,7 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDeliveryModeAMQPProducerCoreConsumer() throws Exception { Connection connection = createConnection(); //AMQP Connection connection2 = createCoreConnection(); //CORE @@ -57,7 +56,7 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDeliveryModeAMQPProducerAMQPConsumer() throws Exception { Connection connection = createConnection(); //AMQP Connection connection2 = createConnection(); //AMQP @@ -65,7 +64,7 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDeliveryModeCoreProducerAMQPConsumer() throws Exception { Connection connection = createCoreConnection(); //CORE Connection connection2 = createConnection(); //AMQP @@ -73,7 +72,7 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDeliveryModeCoreProducerCoreConsumer() throws Exception { Connection connection = createCoreConnection(); //CORE Connection connection2 = createCoreConnection(); //CORE @@ -110,19 +109,19 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testQueueRoutingTypeMismatchCore() throws Exception { testQueueRoutingTypeMismatch(createCoreConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testQueueRoutingTypeMismatchOpenWire() throws Exception { testQueueRoutingTypeMismatch(createOpenWireConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testQueueRoutingTypeMismatchAMQP() throws Exception { testQueueRoutingTypeMismatch(createConnection()); } @@ -143,7 +142,7 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPriorityAMQPProducerCoreConsumer() throws Exception { Connection connection = createConnection(); //AMQP Connection connection2 = createCoreConnection(); //CORE @@ -151,7 +150,7 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPriorityAMQPProducerAMQPConsumer() throws Exception { Connection connection = createConnection(); //AMQP Connection connection2 = createConnection(); //AMQP @@ -159,7 +158,7 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPriorityModeCoreProducerAMQPConsumer() throws Exception { Connection connection = createCoreConnection(); //CORE Connection connection2 = createConnection(); //AMQP @@ -167,7 +166,7 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPriorityCoreProducerCoreConsumer() throws Exception { Connection connection = createCoreConnection(); //CORE Connection connection2 = createCoreConnection(); //CORE @@ -204,21 +203,21 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableSubscriptionWithConfigurationManagedQueueWithCore() throws Exception { testDurableSubscriptionWithConfigurationManagedQueue(() -> createCoreConnection(false)); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableSubscriptionWithConfigurationManagedQueueWithOpenWire() throws Exception { testDurableSubscriptionWithConfigurationManagedQueue(() -> createOpenWireConnection(false)); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDurableSubscriptionWithConfigurationManagedQueueWithAMQP() throws Exception { testDurableSubscriptionWithConfigurationManagedQueue(() -> JMSMessageConsumerTest.super.createConnection(false)); } @@ -248,37 +247,37 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testEmptyMapMessageConversionBetweenOpenWireAndAMQP() throws Exception { testEmptyMapMessageConversion(createOpenWireConnection(), createConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testEmptyMapMessageConversionBetweenAMQPAndOpenWire() throws Exception { testEmptyMapMessageConversion(createConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testEmptyMapMessageConversionBetweenCoreAndAMQP() throws Exception { testEmptyMapMessageConversion(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testEmptyMapMessageConversionBetweenAMQPAndCore() throws Exception { testEmptyMapMessageConversion(createConnection(), createCoreConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testEmptyMapMessageConversionBetweenCoreAndOpenWire() throws Exception { testEmptyMapMessageConversion(createCoreConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testEmptyMapMessageConversionBetweenOpenWireAndCore() throws Exception { testEmptyMapMessageConversion(createOpenWireConnection(), createCoreConnection()); } @@ -304,31 +303,31 @@ public class JMSMessageConsumerTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMapMessageConversionBetweenAMQPAndOpenWire() throws Exception { testMapMessageConversion(createConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMapMessageConversionBetweenCoreAndAMQP() throws Exception { testMapMessageConversion(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMapMessageConversionBetweenAMQPAndCore() throws Exception { testMapMessageConversion(createConnection(), createCoreConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMapMessageConversionBetweenCoreAndOpenWire() throws Exception { testMapMessageConversion(createCoreConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMapMessageConversionBetweenOpenWireAndCore() throws Exception { testMapMessageConversion(createOpenWireConnection(), createCoreConnection()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageGroupsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageGroupsTest.java index 127ece08f3..94512879c7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageGroupsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageGroupsTest.java @@ -24,7 +24,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiConsumer; @@ -77,55 +76,55 @@ public class JMSMessageGroupsTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsAMQPProducerAMQPConsumer() throws Exception { testMessageGroups(AMQPConnection, AMQPConnection); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsCoreProducerCoreConsumer() throws Exception { testMessageGroups(CoreConnection, CoreConnection); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsCoreProducerAMQPConsumer() throws Exception { testMessageGroups(CoreConnection, AMQPConnection); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsAMQPProducerCoreConsumer() throws Exception { testMessageGroups(AMQPConnection, CoreConnection); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsOpenWireProducerOpenWireConsumer() throws Exception { testMessageGroups(OpenWireConnection, OpenWireConnection); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsCoreProducerOpenWireConsumer() throws Exception { testMessageGroups(CoreConnection, OpenWireConnection); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsOpenWireProducerCoreConsumer() throws Exception { testMessageGroups(OpenWireConnection, CoreConnection); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsAMQPProducerOpenWireConsumer() throws Exception { testMessageGroups(AMQPConnection, OpenWireConnection); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageGroupsOpenWireProducerAMQPConsumer() throws Exception { testMessageGroups(OpenWireConnection, AMQPConnection); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessagePropertiesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessagePropertiesTest.java index 8593f19ef0..703804ef9e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessagePropertiesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessagePropertiesTest.java @@ -26,7 +26,6 @@ import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.utils.RandomUtil; import org.junit.jupiter.api.Test; @@ -39,55 +38,55 @@ public class JMSMessagePropertiesTest extends MultiprotocolJMSClientTestSupport protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesAMQPProducerCoreConsumer() throws Exception { testMessageProperties(createConnection(), createCoreConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesAMQPProducerAMQPConsumer() throws Exception { testMessageProperties(createConnection(), createConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesAMQPProducerOpenWireConsumer() throws Exception { testMessageProperties(createConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesCoreProducerAMQPConsumer() throws Exception { testMessageProperties(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesCoreProducerCoreConsumer() throws Exception { testMessageProperties(createCoreConnection(), createCoreConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesCoreProducerOpenWireConsumer() throws Exception { testMessageProperties(createCoreConnection(), createOpenWireConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesOpenWireProducerAMQPConsumer() throws Exception { testMessageProperties(createOpenWireConnection(), createConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesOpenWireProducerCoreConsumer() throws Exception { testMessageProperties(createOpenWireConnection(), createCoreConnection()); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testMessagePropertiesOpenWireProducerOpenWireConsumer() throws Exception { testMessageProperties(createOpenWireConnection(), createOpenWireConnection()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageTypesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageTypesTest.java index 1c06309dd9..2bb6acc74d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageTypesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSMessageTypesTest.java @@ -24,7 +24,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.Serializable; import java.lang.invoke.MethodHandles; import java.util.ArrayList; -import java.util.concurrent.TimeUnit; import javax.jms.BytesMessage; import javax.jms.Connection; @@ -62,7 +61,7 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { final int NUM_MESSAGES = 10; @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAddressControlSendMessage() throws Exception { SimpleString address = RandomUtil.randomSimpleString(); server.createQueue(new QueueConfiguration(address).setRoutingType(RoutingType.ANYCAST)); @@ -93,7 +92,7 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAddressControlSendMessageWithText() throws Exception { SimpleString address = RandomUtil.randomSimpleString(); server.createQueue(new QueueConfiguration(address).setRoutingType(RoutingType.ANYCAST)); @@ -171,19 +170,19 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBytesMessageSendReceiveFromAMQPToAMQP() throws Throwable { testBytesMessageSendReceive(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBytesMessageSendReceiveFromCoreToAMQP() throws Throwable { testBytesMessageSendReceive(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBytesMessageSendReceiveFromAMQPToCore() throws Throwable { testBytesMessageSendReceive(createConnection(), createCoreConnection()); } @@ -222,19 +221,19 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageSendReceiveFromAMQPToAMQP() throws Throwable { testMessageSendReceive(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageSendReceiveFromCoreToAMQP() throws Throwable { testMessageSendReceive(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessageSendReceiveFromAMQPToCore() throws Throwable { testMessageSendReceive(createConnection(), createCoreConnection()); } @@ -272,19 +271,19 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMapMessageSendReceiveFromAMQPToAMQP() throws Throwable { testMapMessageSendReceive(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMapMessageSendReceiveFromCoreToAMQP() throws Throwable { testMapMessageSendReceive(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMapMessageSendReceiveFromAMQPToCore() throws Throwable { testMapMessageSendReceive(createConnection(), createCoreConnection()); } @@ -318,19 +317,19 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTextMessageSendReceiveFromAMQPToAMQP() throws Throwable { testTextMessageSendReceive(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTextMessageSendReceiveFromCoreToAMQP() throws Throwable { testTextMessageSendReceive(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTextMessageSendReceiveFromAMQPToCore() throws Throwable { testTextMessageSendReceive(createConnection(), createCoreConnection()); } @@ -363,19 +362,19 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testStreamMessageSendReceiveFromAMQPToAMQP() throws Throwable { testStreamMessageSendReceive(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testStreamMessageSendReceiveFromCoreToAMQP() throws Throwable { testStreamMessageSendReceive(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testStreamMessageSendReceiveFromAMQPToCore() throws Throwable { testStreamMessageSendReceive(createConnection(), createCoreConnection()); } @@ -406,19 +405,19 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testObjectMessageWithArrayListPayloadFromAMQPToAMQP() throws Throwable { testObjectMessageWithArrayListPayload(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testObjectMessageWithArrayListPayloadFromCoreToAMQP() throws Throwable { testObjectMessageWithArrayListPayload(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testObjectMessageWithArrayListPayloadFromAMQPToCore() throws Throwable { testObjectMessageWithArrayListPayload(createConnection(), createCoreConnection()); } @@ -453,19 +452,19 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testObjectMessageUsingCustomTypeFromAMQPToAMQP() throws Throwable { testObjectMessageUsingCustomType(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testObjectMessageUsingCustomTypeFromCoreToAMQP() throws Throwable { testObjectMessageUsingCustomType(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testObjectMessageUsingCustomTypeFromAMQPToCore() throws Throwable { testObjectMessageUsingCustomType(createConnection(), createCoreConnection()); } @@ -524,19 +523,19 @@ public class JMSMessageTypesTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPropertiesArePreservedFromAMQPToAMQP() throws Throwable { testPropertiesArePreserved(createConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPropertiesArePreservedFromCoreToAMQP() throws Throwable { testPropertiesArePreserved(createCoreConnection(), createConnection()); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPropertiesArePreservedFromAMQPToCore() throws Throwable { testPropertiesArePreserved(createConnection(), createCoreConnection()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSNotificationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSNotificationTest.java index 86c49bf868..8bbf92315b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSNotificationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSNotificationTest.java @@ -22,8 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import java.util.concurrent.TimeUnit; - import javax.jms.Connection; import javax.jms.MessageConsumer; import javax.jms.Session; @@ -82,19 +80,19 @@ public class JMSNotificationTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConsumerNotificationAMQP() throws Exception { testConsumerNotifications(createConnection(getBrokerQpidJMSConnectionURI(), null, null, clientID, true)); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConsumerNotificationCore() throws Exception { testConsumerNotifications(createCoreConnection(getBrokerCoreJMSConnectionString(), null, null, clientID, true)); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConsumerNotificationOpenWire() throws Exception { testConsumerNotifications(createOpenWireConnection(getBrokerOpenWireJMSConnectionString(), null, null, clientID, true)); } @@ -134,19 +132,19 @@ public class JMSNotificationTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSessionNotificationAMQP() throws Exception { testSessionNotification(createConnection(getBrokerQpidJMSConnectionURI(), null, null, clientID, true)); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSessionNotificationCore() throws Exception { testSessionNotification(createCoreConnection(getBrokerCoreJMSConnectionString(), null, null, clientID, true)); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSessionNotificationOpenWire() throws Exception { testSessionNotification(createOpenWireConnection(getBrokerOpenWireJMSConnectionString(), null, null, clientID, true)); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSSharedConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSSharedConsumerTest.java index 1cb2e7b4da..5a8035609e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSSharedConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSSharedConsumerTest.java @@ -32,7 +32,6 @@ import javax.jms.Topic; import java.util.Arrays; import java.util.Collection; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.postoffice.QueueBinding; @@ -111,7 +110,7 @@ public class JMSSharedConsumerTest extends MultiprotocolJMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedConsumer() throws Exception { Connection connection = createConnection(); //AMQP Connection connection2 = createConnection(); //AMQP @@ -120,7 +119,7 @@ public class JMSSharedConsumerTest extends MultiprotocolJMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedConsumerWithArtemisClient() throws Exception { Connection connection = createCoreConnection(); //CORE @@ -131,7 +130,7 @@ public class JMSSharedConsumerTest extends MultiprotocolJMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedConsumerWithAMQPClientAndArtemisClient() throws Exception { assumeTrue(amqpUseCoreSubscriptionNaming); @@ -143,7 +142,7 @@ public class JMSSharedConsumerTest extends MultiprotocolJMSClientTestSupport { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedConsumerWithArtemisClientAndAMQPClient() throws Exception { assumeTrue(amqpUseCoreSubscriptionNaming); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSSharedDurableConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSSharedDurableConsumerTest.java index fa508c19d6..b9648bb4b2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSSharedDurableConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSSharedDurableConsumerTest.java @@ -34,7 +34,6 @@ import javax.jms.Topic; import java.util.Arrays; import java.util.Collection; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.ActiveMQServer; @@ -107,7 +106,7 @@ public class JMSSharedDurableConsumerTest extends MultiprotocolJMSClientTestSupp } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedDurableConsumer() throws Exception { Connection connection = createConnection(); //AMQP Connection connection2 = createConnection(); //AMQP @@ -116,7 +115,7 @@ public class JMSSharedDurableConsumerTest extends MultiprotocolJMSClientTestSupp } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedDurableConsumerWithArtemisClient() throws Exception { Connection connection = createCoreConnection(); //CORE @@ -127,7 +126,7 @@ public class JMSSharedDurableConsumerTest extends MultiprotocolJMSClientTestSupp } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedDurableConsumerWithAMQPClientAndArtemisClient() throws Exception { assumeTrue(amqpUseCoreSubscriptionNaming); @@ -139,7 +138,7 @@ public class JMSSharedDurableConsumerTest extends MultiprotocolJMSClientTestSupp } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedDurableConsumerWithArtemisClientAndAMQPClient() throws Exception { assumeTrue(amqpUseCoreSubscriptionNaming); @@ -151,7 +150,7 @@ public class JMSSharedDurableConsumerTest extends MultiprotocolJMSClientTestSupp } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSharedDurableConsumerWithSelectorChange() throws Exception { SimpleString qName = amqpUseCoreSubscriptionNaming ? new SimpleString("SharedConsumer") : new SimpleString("SharedConsumer:global"); Connection connection = createConnection(true); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSTopicSubscriberTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSTopicSubscriberTest.java index 8a86c7e9b4..2f087b5087 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSTopicSubscriberTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSTopicSubscriberTest.java @@ -19,7 +19,6 @@ package org.apache.activemq.artemis.tests.integration.jms.multiprotocol; import javax.jms.Connection; import javax.jms.Session; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.ActiveMQServer; @@ -41,21 +40,21 @@ public class JMSTopicSubscriberTest extends MultiprotocolJMSClientTestSupport { } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testCoreSubscriptionQueueCreatedWhenAutoCreateDisabled() throws Exception { Connection connection = createCoreConnection(); testSubscriptionQueueCreatedWhenAutoCreateDisabled(connection); } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testOpenWireSubscriptionQueueCreatedWhenAutoCreateDisabled() throws Exception { Connection connection = createOpenWireConnection(); testSubscriptionQueueCreatedWhenAutoCreateDisabled(connection); } @Test - @Timeout(value = 30_000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testAMQPSubscriptionQueueCreatedWhenAutoCreateDisabled() throws Exception { Connection connection = createConnection(); testSubscriptionQueueCreatedWhenAutoCreateDisabled(connection); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTConnnectionCleanupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTConnnectionCleanupTest.java index 1d1fb3802a..ee7cde46a4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTConnnectionCleanupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTConnnectionCleanupTest.java @@ -57,7 +57,7 @@ public class MQTTConnnectionCleanupTest extends MQTTTestSupport { } @Test - @Timeout(value = 30 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testBadClient() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId(""); @@ -93,7 +93,7 @@ public class MQTTConnnectionCleanupTest extends MQTTTestSupport { @Test - @Timeout(value = 30 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSlowSubscribeWontBlockKeepAlive() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId(""); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTDisabledLinkStealingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTDisabledLinkStealingTest.java index 3a7e402ec8..ca8b495a51 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTDisabledLinkStealingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTDisabledLinkStealingTest.java @@ -19,8 +19,6 @@ package org.apache.activemq.artemis.tests.integration.mqtt; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import java.util.concurrent.TimeUnit; - import org.apache.activemq.artemis.tests.util.RandomUtil; import org.apache.activemq.artemis.tests.util.Wait; import org.fusesource.mqtt.client.BlockingConnection; @@ -31,7 +29,7 @@ import org.junit.jupiter.api.Timeout; public class MQTTDisabledLinkStealingTest extends MQTTTestSupport { @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDisabledLinkStealing() throws Exception { final String clientId = RandomUtil.randomString(); MQTT mqtt = createMQTTConnection(clientId, false); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTFQQNTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTFQQNTest.java index ed621ab416..1633a5cc65 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTFQQNTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTFQQNTest.java @@ -61,7 +61,7 @@ public class MQTTFQQNTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveMQTTSpecial1() throws Exception { final MQTTClientProvider subscriptionProvider = getMQTTClientProvider(); initializeConnection(subscriptionProvider); @@ -103,7 +103,7 @@ public class MQTTFQQNTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveMQTTSpecial2() throws Exception { final MQTTClientProvider subscriptionProvider = getMQTTClientProvider(); initializeConnection(subscriptionProvider); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTInterceptorPropertiesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTInterceptorPropertiesTest.java index b63aa31a97..963b3e40f4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTInterceptorPropertiesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTInterceptorPropertiesTest.java @@ -56,7 +56,7 @@ public class MQTTInterceptorPropertiesTest extends MQTTTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCheckInterceptedMQTTMessageProperties() throws Exception { final String addressQueue = name; final String msgText = "Test intercepted message"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTRejectingInterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTRejectingInterceptorTest.java index db045bfb43..6662278311 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTRejectingInterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTRejectingInterceptorTest.java @@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.fail; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import io.netty.handler.codec.mqtt.MqttConnectMessage; import io.netty.handler.codec.mqtt.MqttMessage; @@ -34,7 +33,7 @@ import org.junit.jupiter.api.Timeout; public class MQTTRejectingInterceptorTest extends MQTTTestSupport { @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRejectedMQTTMessage() throws Exception { final String addressQueue = name; final String msgText = "Test rejected message"; @@ -66,7 +65,7 @@ public class MQTTRejectingInterceptorTest extends MQTTTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRejectedMqttConnectMessage() throws Exception { CountDownLatch publishThreadReady = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityManagerTest.java index 8c8ac12269..c258e5012b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityManagerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityManagerTest.java @@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.fail; import javax.security.auth.Subject; import java.util.Map; import java.util.Set; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolManager; import org.apache.activemq.artemis.core.protocol.mqtt.MQTTSessionState; @@ -93,7 +92,7 @@ public class MQTTSecurityManagerTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSecurityManagerModifyClientID() throws Exception { BlockingConnection connection = null; try { @@ -124,7 +123,7 @@ public class MQTTSecurityManagerTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSecurityManagerModifyClientIDAndStealConnection() throws Exception { BlockingConnection connection1 = null; BlockingConnection connection2 = null; @@ -168,7 +167,7 @@ public class MQTTSecurityManagerTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSecurityManagerRejectClientID() throws Exception { rejectClientId = true; BlockingConnection connection = null; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityPerAcceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityPerAcceptorTest.java index cb21aa1a3d..9a44e05cff 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityPerAcceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityPerAcceptorTest.java @@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.net.URL; import java.util.Arrays; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.tests.util.Wait; import org.fusesource.mqtt.client.BlockingConnection; @@ -54,13 +53,13 @@ public class MQTTSecurityPerAcceptorTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConnectionPositive() throws Exception { internalTestConnection("first", true); } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConnectionNegative() throws Exception { internalTestConnection("fail", false); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityTest.java index 63bed32a84..7fab65af5c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSecurityTest.java @@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.io.EOFException; import java.util.Arrays; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.tests.util.Wait; import org.fusesource.mqtt.client.BlockingConnection; @@ -43,7 +42,7 @@ public class MQTTSecurityTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConnection() throws Exception { for (String version : Arrays.asList("3.1", "3.1.1")) { @@ -65,7 +64,7 @@ public class MQTTSecurityTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testConnectionWithNullPassword() throws Exception { for (String version : Arrays.asList("3.1", "3.1.1")) { @@ -91,7 +90,7 @@ public class MQTTSecurityTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPublishAuthorizationFailOn311WithDisconnect() throws Exception { String version = "3.1.1"; @@ -118,7 +117,7 @@ public class MQTTSecurityTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPublishAuthorizationFailOn311WithoutDisconnect() throws Exception { setAcceptorProperty("closeMqttConnectionOnPublishAuthorizationFailure=false"); String version = "3.1.1"; @@ -144,7 +143,7 @@ public class MQTTSecurityTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testPublishAuthorizationFailOn31() throws Exception { String version = "3.1"; @@ -169,7 +168,7 @@ public class MQTTSecurityTest extends MQTTTestSupport { } @Test - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSubscribeAuthorizationFail() throws Exception { for (String version : Arrays.asList("3.1", "3.1.1")) { BlockingConnection connection = null; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSessionExpiryIntervalTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSessionExpiryIntervalTest.java index e32024575a..af32eb3fdc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSessionExpiryIntervalTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSessionExpiryIntervalTest.java @@ -28,14 +28,13 @@ import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; public class MQTTSessionExpiryIntervalTest extends MQTTTestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCustomSessionExpiryInterval() throws Exception { final MQTT mqttSub = createMQTTConnection("MQTT-Sub-Client", false); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTest.java index f20c1dc890..ee9d2071f9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTest.java @@ -129,13 +129,13 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveMQTT() throws Exception { testSendAndReceiveMQTT(""); } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveMQTTHugePayload() throws Exception { StringBuilder builder = new StringBuilder(); builder.append("/"); @@ -243,7 +243,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDirectDeliverFalse() throws Exception { final MQTTClientProvider subscriptionProvider = getMQTTClientProvider(); initializeConnection(subscriptionProvider); @@ -259,7 +259,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUnsubscribeMQTT() throws Exception { final MQTTClientProvider subscriptionProvider = getMQTTClientProvider(); initializeConnection(subscriptionProvider); @@ -306,7 +306,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAtMostOnceReceiveExactlyOnce() throws Exception { /** * Although subscribing with EXACTLY ONCE, the message gets published @@ -327,7 +327,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 2 * 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testManagementQueueMessagesAreAckd() throws Exception { String clientId = "test.client.id"; final MQTTClientProvider provider = getMQTTClientProvider(); @@ -351,7 +351,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 2 * 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSendAtLeastOnceReceiveExactlyOnce() throws Exception { final MQTTClientProvider provider = getMQTTClientProvider(); initializeConnection(provider); @@ -367,7 +367,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 2 * 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSendAtLeastOnceReceiveAtMostOnce() throws Exception { final MQTTClientProvider provider = getMQTTClientProvider(); initializeConnection(provider); @@ -383,7 +383,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveAtMostOnce() throws Exception { final MQTTClientProvider provider = getMQTTClientProvider(); initializeConnection(provider); @@ -399,7 +399,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 2 * 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSendAndReceiveAtLeastOnce() throws Exception { final MQTTClientProvider provider = getMQTTClientProvider(); initializeConnection(provider); @@ -415,7 +415,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveExactlyOnceWithInterceptors() throws Exception { MQTTIncomingInterceptor.clear(); MQTTOutoingInterceptor.clear(); @@ -441,7 +441,7 @@ public class MQTTTest extends MQTTTestSupport { @Disabled @Test - @Timeout(value = 600 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(600) public void testSendMoreThanUniqueId() throws Exception { int messages = MQTTUtil.TWO_BYTE_INT_MAX; @@ -468,7 +468,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 600 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(180) public void testNoMessageIdReuseBeforeAcknowledgment() throws Exception { final int messages = MQTTUtil.TWO_BYTE_INT_MAX; @@ -526,7 +526,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveLargeMessages() throws Exception { byte[] payload = new byte[1024 * 32]; for (int i = 0; i < payload.length; i++) { @@ -551,7 +551,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveRetainedMessages() throws Exception { final MQTTClientProvider publisher = getMQTTClientProvider(); initializeConnection(publisher); @@ -586,7 +586,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveRetainedLargeMessage() throws Exception { try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler()) { byte[] payload = new byte[ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE * 2]; @@ -640,7 +640,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 30 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testValidZeroLengthClientId() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId(""); @@ -652,7 +652,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 2 * 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testMQTTPathPatterns() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId(""); @@ -725,7 +725,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMQTTRetainQoS() throws Exception { String[] topics = {"AT_MOST_ONCE", "AT_LEAST_ONCE", "EXACTLY_ONCE"}; for (int i = 0; i < topics.length; i++) { @@ -765,7 +765,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDuplicateSubscriptions() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId("foo"); @@ -806,7 +806,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 120 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testRetainedMessage() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setKeepAlive((short) 60); @@ -876,7 +876,7 @@ public class MQTTTest extends MQTTTestSupport { @Disabled @Test - @Timeout(value = 120 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testRetainedMessageOnVirtualTopics() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setKeepAlive((short) 60); @@ -946,7 +946,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testUniqueMessageIds() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId("foo"); @@ -1035,7 +1035,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testResendMessageId() throws Exception { final MQTT mqtt = createMQTTConnection("resend", false); mqtt.setKeepAlive((short) 5); @@ -1093,7 +1093,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 90 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(90) public void testPacketIdGeneratorNonCleanSession() throws Exception { final MQTT mqtt = createMQTTConnection("nonclean-packetid", false); mqtt.setKeepAlive((short) 15); @@ -1169,7 +1169,7 @@ public class MQTTTest extends MQTTTestSupport { @Disabled @Test - @Timeout(value = 90 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(90) // TODO ActiveMQ 5.x does not reset the message id generator even after a clean session. In Artemis we always reset. // If there is a good reason for this we should follow ActiveMQ. public void testPacketIdGeneratorCleanSession() throws Exception { @@ -1231,7 +1231,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClientConnectionFailure() throws Exception { MQTT mqtt = createMQTTConnection("reconnect", false); mqtt.setKeepAlive((short) 1); @@ -1260,7 +1260,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClientConnectionFailureSendsWillMessage() throws Exception { getServer().createQueue(new QueueConfiguration("will")); @@ -1288,7 +1288,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testWillMessageIsRetained() throws Exception { getServer().createQueue(new QueueConfiguration("will")); @@ -1320,7 +1320,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCleanSessionForSubscriptions() throws Exception { final String CLIENTID = "cleansession"; final MQTT mqttNotClean = createMQTTConnection(CLIENTID, false); @@ -1368,7 +1368,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCleanSessionForMessages() throws Exception { final String CLIENTID = "cleansession"; final MQTT mqttNotClean = createMQTTConnection(CLIENTID, false); @@ -1395,13 +1395,13 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendMQTTReceiveJMS() throws Exception { doTestSendMQTTReceiveJMS("foo.*", "foo/bar"); } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLinkRouteAmqpReceiveMQTT() throws Exception { MQTT mqtt = createMQTTConnection(); @@ -1477,7 +1477,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 2 * 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testSendJMSReceiveMQTT() throws Exception { doTestSendJMSReceiveMQTT("foo.far"); } @@ -1509,7 +1509,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPingKeepsInactivityMonitorAlive() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId("foo"); @@ -1523,7 +1523,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testTurnOffInactivityMonitor() throws Exception { stopBroker(); protocolConfig = "transport.useInactivityMonitor=false"; @@ -1542,7 +1542,7 @@ public class MQTTTest extends MQTTTestSupport { @Disabled @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) // TODO Make dollar topics configurable in code base. public void testPublishDollarTopics() throws Exception { MQTT mqtt = createMQTTConnection(); @@ -1582,7 +1582,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDuplicateClientId() throws Exception { final String clientId = "duplicateClient"; MQTT mqtt = createMQTTConnection(clientId, false); @@ -1606,7 +1606,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRepeatedLinkStealing() throws Exception { final String clientId = "duplicateClient"; final AtomicReference oldConnection = new AtomicReference<>(); @@ -1636,7 +1636,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 30 * 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testJmsMapping() throws Exception { doTestJmsMapping("test.foo"); } @@ -1683,7 +1683,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 30 * 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSubscribeMultipleTopics() throws Exception { byte[] payload = new byte[1024 * 32]; @@ -1721,7 +1721,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReceiveMessageSentWhileOffline() throws Exception { final byte[] payload = new byte[1024 * 32]; for (int i = 0; i < payload.length; i++) { @@ -1780,7 +1780,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDefaultSessionExpiryInterval() throws Exception { final MQTT mqttSub = createMQTTConnection("MQTT-Sub-Client", false); @@ -1798,7 +1798,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 30 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testDefaultKeepAliveWhenClientSpecifiesZero() throws Exception { stopBroker(); protocolConfig = "transport.defaultKeepAlive=2000"; @@ -1814,7 +1814,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testReuseConnection() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId("Test-Client"); @@ -1834,7 +1834,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testNoMessageReceivedAfterUnsubscribeMQTT() throws Exception { Topic[] topics = {new Topic("TopicA", QoS.EXACTLY_ONCE)}; @@ -1887,7 +1887,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMQTT311Connection() throws Exception { MQTT mqtt = createMQTTConnection(); mqtt.setClientId("foo"); @@ -1995,7 +1995,7 @@ public class MQTTTest extends MQTTTestSupport { // } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testPingOnMQTT() throws Exception { stopBroker(); protocolConfig = "maxInactivityDuration=-1"; @@ -2012,7 +2012,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testClientDisconnectedOnMaxConsumerLimitReached() throws Exception { Exception peerDisconnectedException = null; try { @@ -2036,7 +2036,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAnycastPrefixWorksWithMQTT() throws Exception { String clientId = "testMqtt"; @@ -2070,7 +2070,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAnycastAddressWorksWithMQTT() throws Exception { String anycastAddress = "foo/bar"; @@ -2105,7 +2105,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAmbiguousRoutingWithMQTT() throws Exception { String anycastAddress = "foo/bar"; @@ -2174,7 +2174,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testBrokerRestartAfterSubHashWithConfigurationQueues() throws Exception { // Add some pre configured queues @@ -2267,7 +2267,7 @@ public class MQTTTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAutoDeleteRetainedQueue() throws Exception { final String TOPIC = "/abc/123"; final String RETAINED_QUEUE = MQTTUtil.getCoreRetainAddressFromMqttTopic(TOPIC, server.getConfiguration().getWildcardConfiguration()); @@ -2345,7 +2345,7 @@ public class MQTTTest extends MQTTTestSupport { * the message it received. */ @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRetainFlagOnEstablishedSubscription() throws Exception { CountDownLatch latch = new CountDownLatch(1); final String topic = getTopicName(); @@ -2379,7 +2379,7 @@ public class MQTTTest extends MQTTTestSupport { * sent as a result of a new subscription being made by a Client. */ @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testRetainFlagOnNewSubscription() throws Exception { CountDownLatch latch = new CountDownLatch(1); final String topic = getTopicName(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MqttAcknowledgementTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MqttAcknowledgementTest.java index 7dd22d6d79..c98a8c23e5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MqttAcknowledgementTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MqttAcknowledgementTest.java @@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.fail; import java.util.LinkedList; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.tests.util.Wait; import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; @@ -58,13 +57,13 @@ public class MqttAcknowledgementTest extends MQTTTestSupport { } @Test - @Timeout(value = 300000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAcknowledgementQOS1() throws Exception { test(1); } @Test - @Timeout(value = 300000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testAcknowledgementQOS0() throws Exception { assertThrows(AssertionError.class, () -> { test(0); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTQOS2SecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTQOS2SecurityTest.java index 99510e8190..0e97b589b7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTQOS2SecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTQOS2SecurityTest.java @@ -36,7 +36,6 @@ import org.junit.jupiter.api.Timeout; import java.util.HashSet; import java.util.Set; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; public class PahoMQTTQOS2SecurityTest extends MQTTTestSupport { @@ -66,7 +65,7 @@ public class PahoMQTTQOS2SecurityTest extends MQTTTestSupport { } @Test - @Timeout(value = 300000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveMQTT() throws Exception { final CountDownLatch latch = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTTest.java index 8f57a6c791..5431537b06 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTTest.java @@ -63,7 +63,7 @@ public class PahoMQTTTest extends MQTTTestSupport { } @TestTemplate - @Timeout(value = 300000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testLotsOfClients() throws Exception { final int CLIENTS = Integer.getInteger("PahoMQTTTest.CLIENTS", 100); @@ -140,7 +140,7 @@ public class PahoMQTTTest extends MQTTTestSupport { } @TestTemplate - @Timeout(value = 300000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveMQTT() throws Exception { final CountDownLatch latch = new CountDownLatch(1); @@ -175,7 +175,7 @@ public class PahoMQTTTest extends MQTTTestSupport { } @TestTemplate - @Timeout(value = 300000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSessionPresentWithCleanSession() throws Exception { MqttClient client = createPahoClient(RandomUtil.randomString()); MqttConnectOptions options = new MqttConnectOptions(); @@ -186,7 +186,7 @@ public class PahoMQTTTest extends MQTTTestSupport { } @TestTemplate - @Timeout(value = 300000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSessionPresent() throws Exception { MqttClient client = createPahoClient(RandomUtil.randomString()); MqttConnectOptions options = new MqttConnectOptions(); @@ -206,7 +206,7 @@ public class PahoMQTTTest extends MQTTTestSupport { * This test was adapted from a test from Eclipse Kapua submitted by a community member. */ @TestTemplate - @Timeout(value = 300000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDollarAndHashSubscriptions() throws Exception { final String CLIENT_ID_ADMIN = "test-client-admin"; final String CLIENT_ID_1 = "test-client-1"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5Test.java index 18012a59a3..0a4aebdb81 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5Test.java @@ -71,7 +71,7 @@ public class MQTT5Test extends MQTT5TestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSimpleSendReceive() throws Exception { String topic = RandomUtil.randomString(); @@ -94,7 +94,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTopicNameEscape() throws Exception { final String topic = "foo1.0/bar/baz"; AtomicReference receivedTopic = new AtomicReference<>(); @@ -119,7 +119,7 @@ public class MQTT5Test extends MQTT5TestSupport { * Ensure that the broker adds a timestamp on the message when sending via MQTT */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTimestamp() throws Exception { final String DESTINATION = RandomUtil.randomString(); @@ -141,7 +141,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testResumeSubscriptionsAfterRestart() throws Exception { final int SUBSCRIPTION_COUNT = 100; List topicNames = new ArrayList<>(SUBSCRIPTION_COUNT); @@ -205,7 +205,7 @@ public class MQTT5Test extends MQTT5TestSupport { * Trying to reproduce error from https://issues.apache.org/jira/browse/ARTEMIS-1184 */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAddressAutoCreation() throws Exception { final String DESTINATION = RandomUtil.randomString(); server.getAddressSettingsRepository().addMatch(DESTINATION, new AddressSettings().setAutoCreateAddresses(true)); @@ -220,7 +220,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAddressAutoCreationNegative() throws Exception { final String DESTINATION = RandomUtil.randomString(); server.getAddressSettingsRepository().addMatch(DESTINATION, new AddressSettings().setAutoCreateAddresses(false)); @@ -239,7 +239,7 @@ public class MQTT5Test extends MQTT5TestSupport { * in various places. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillMessageProperties() throws Exception { final byte[] WILL = RandomUtil.randomBytes(); final String[][] properties = new String[10][2]; @@ -288,7 +288,7 @@ public class MQTT5Test extends MQTT5TestSupport { * a new session expiry interval when disconnecting. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testExpiryDelayOnDisconnect() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); @@ -308,7 +308,7 @@ public class MQTT5Test extends MQTT5TestSupport { * If the Will flag is false then don't send a will message even if the session expiry is > 0 */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillFlagFalseWithSessionExpiryDelay() throws Exception { // enable send-to-dla-on-no-route so that we can detect an errant will message on disconnect server.createQueue(new QueueConfiguration("activemq.notifications")); @@ -326,7 +326,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQueueCleanOnRestart() throws Exception { String topic = RandomUtil.randomString(); String clientId = RandomUtil.randomString(); @@ -344,7 +344,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRecursiveWill() throws Exception { try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler()) { final String WILL_QUEUE = "will"; @@ -359,7 +359,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSharedSubscriptionsWithSameName() throws Exception { final String TOPIC1 = "myTopic1"; final String TOPIC2 = "myTopic2"; @@ -414,7 +414,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSharedSubscriptionsWithSameName2() throws Exception { final String TOPIC1 = "myTopic1"; final String TOPIC2 = "myTopic2"; @@ -460,7 +460,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSharedSubscriptionQueueRemoval() throws Exception { final String TOPIC = "myTopic"; final String SUB_NAME = "myShare"; @@ -536,7 +536,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAutoDeleteAddressWithWildcardSubscription() throws Exception { String prefix = "topic"; server.getAddressSettingsRepository().addMatch(prefix + ".#", new AddressSettings().setAutoDeleteAddresses(true).setAutoDeleteAddressesSkipUsageCheck(true)); @@ -578,7 +578,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnectionStealingDisabled() throws Exception { setAcceptorProperty("allowLinkStealing=false"); final String CLIENT_ID = RandomUtil.randomString(); @@ -605,7 +605,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnectionStealingOnMultipleAcceptors() throws Exception { int secondaryPort = 1884; final String CLIENT_ID = RandomUtil.randomString(); @@ -631,7 +631,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnectionStealingDisabledOnMultipleAcceptors() throws Exception { int secondaryPort = 1884; final String CLIENT_ID = RandomUtil.randomString(); @@ -661,7 +661,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQueueCleanedUpOnConsumerFail() throws Exception { final String topic = getName(); final String clientID = getName(); @@ -686,7 +686,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscriptionQueueName() throws Exception { final String topic = "a/b"; final String clientID = "myClientID"; @@ -700,7 +700,7 @@ public class MQTT5Test extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscriptionQueueCreatedWhenAutoCreateDisabled() throws Exception { final String topic = "a/b"; final String clientID = "myClientID"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5TestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5TestSupport.java index 8174eb524c..3e45285ba1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5TestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5TestSupport.java @@ -105,7 +105,7 @@ public class MQTT5TestSupport extends ActiveMQTestBase { } protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - protected static final long DEFAULT_TIMEOUT = 300000; + protected static final long DEFAULT_TIMEOUT_SEC = 60; protected ActiveMQServer server; protected int port = 1883; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTTRetainMessageManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTTRetainMessageManagerTest.java index e6cd239d28..99549649b1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTTRetainMessageManagerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTTRetainMessageManagerTest.java @@ -18,7 +18,6 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.IntStream; @@ -119,19 +118,19 @@ public class MQTTRetainMessageManagerTest extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAtMostOnce() { IntStream.of(numberOfTests).forEach(i -> test(0)); } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAtLeastOnce() { IntStream.of(numberOfTests).forEach(i -> test(1)); } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testExactlyOnce() { IntStream.of(numberOfTests).forEach(i -> test(2)); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTTStateManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTTStateManagerTest.java index ccd95a7be8..3ab691f311 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTTStateManagerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTTStateManagerTest.java @@ -42,19 +42,19 @@ import org.junit.jupiter.api.Timeout; public class MQTTStateManagerTest extends MQTT5TestSupport { @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testNullClientID() throws Exception { testBadStateMessage(null); } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testEmptyClientID() throws Exception { testBadStateMessage(""); } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testEmptyStateMessage() throws Exception { testBadStateMessage(RandomUtil.randomString()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/ControlPacketFormatTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/ControlPacketFormatTests.java index f752c7020e..4929805eb6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/ControlPacketFormatTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/ControlPacketFormatTests.java @@ -58,7 +58,7 @@ public class ControlPacketFormatTests extends MQTT5TestSupport { * [MQTT-2.2.1-2] A PUBLISH packet MUST NOT contain a Packet Identifier if its QoS value is set to 0. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPacketIdQoSZero() throws Exception { final String TOPIC = this.getTopicName(); final String CONSUMER_CLIENT_ID = "consumer"; @@ -96,7 +96,7 @@ public class ControlPacketFormatTests extends MQTT5TestSupport { * zero Packet Identifier that is currently unused. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPacketIdQoSGreaterThanZero() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -141,7 +141,7 @@ public class ControlPacketFormatTests extends MQTT5TestSupport { * packet that was originally sent. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPacketIdPubAckQoS2() throws Exception { AtomicInteger id = new AtomicInteger(0); AtomicBoolean failed = new AtomicBoolean(false); @@ -213,7 +213,7 @@ public class ControlPacketFormatTests extends MQTT5TestSupport { * packet that was originally sent. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPacketIdPubAckQoS1() throws Exception { AtomicInteger id = new AtomicInteger(0); AtomicBoolean failed = new AtomicBoolean(false); @@ -285,7 +285,7 @@ public class ControlPacketFormatTests extends MQTT5TestSupport { * SUBSCRIBE and UNSUBSCRIBE packet respectively. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPacketIdSubAckAndUnsubAck() throws Exception { AtomicInteger subId = new AtomicInteger(0); AtomicInteger unsubId = new AtomicInteger(0); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/EnhancedAuthenticationTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/EnhancedAuthenticationTests.java index 94ab93e642..a96e53c8dc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/EnhancedAuthenticationTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/EnhancedAuthenticationTests.java @@ -20,8 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.fail; -import java.util.concurrent.TimeUnit; - import org.apache.activemq.artemis.core.protocol.mqtt.MQTTReasonCodes; import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.apache.activemq.artemis.tests.util.RandomUtil; @@ -56,7 +54,7 @@ public class EnhancedAuthenticationTests extends MQTT5TestSupport { * 4.13 and MUST close the Network Connection. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testBadAuthenticationMethod() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/HandlingErrorTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/HandlingErrorTests.java index a41f2adac1..48442bb766 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/HandlingErrorTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/HandlingErrorTests.java @@ -20,8 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.fail; -import java.util.concurrent.TimeUnit; - import org.apache.activemq.artemis.core.protocol.mqtt.MQTTReasonCodes; import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.eclipse.paho.mqttv5.client.MqttClient; @@ -47,7 +45,7 @@ public class HandlingErrorTests extends MQTT5TestSupport { * This is one possible error condition where a Reason Code > 0x80 is specified and the network connection is closed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testEmptyClientIDWithoutCleanStart() throws Exception { MqttClient client = createPahoClient(""); MqttConnectionOptions options = new MqttConnectionOptionsBuilder() diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageDeliveryRetryTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageDeliveryRetryTests.java index f5642171ac..36884f991e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageDeliveryRetryTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageDeliveryRetryTests.java @@ -40,7 +40,7 @@ public class MessageDeliveryRetryTests extends MQTT5TestSupport { * Clients and Servers MUST NOT resend messages at any other time. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalseWithReconnect() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -86,7 +86,7 @@ public class MessageDeliveryRetryTests extends MQTT5TestSupport { * PUBLISH packet is treated as acknowledged, and MUST NOT be retransmitted. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTopicFilter() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageReceiptTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageReceiptTests.java index 19bde73c09..69fba6cda4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageReceiptTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageReceiptTests.java @@ -48,7 +48,7 @@ public class MessageReceiptTests extends MQTT5TestSupport { * This test is pretty generic. It just creates a bunch of individual consumers and sends a message to each one. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMessageReceipt() throws Exception { final String TOPIC = RandomUtil.randomString(); final String CONSUMER_ID = "consumer"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java index 554227a6bc..d25cb8f283 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java @@ -73,7 +73,7 @@ public class QoSTests extends MQTT5TestSupport { * This test looks at the PUBLISH packet coming from *the broker* to the client */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS1andDupFlag() throws Exception { final String TOPIC = RandomUtil.randomString(); @@ -106,7 +106,7 @@ public class QoSTests extends MQTT5TestSupport { * it has received the corresponding PUBACK packet from the receiver. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS1PubAck() throws Exception { final String TOPIC = RandomUtil.randomString(); final String CONSUMER_ID = "consumer"; @@ -162,7 +162,7 @@ public class QoSTests extends MQTT5TestSupport { * Packet Identifier from the incoming PUBLISH packet, having accepted ownership of the Application Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS1PubAckId() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch ackLatch = new CountDownLatch(1); @@ -249,7 +249,7 @@ public class QoSTests extends MQTT5TestSupport { * it has received the corresponding PUBREC packet from the receiver. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2PubRec() throws Exception { final String TOPIC = RandomUtil.randomString(); final String CONSUMER_ID = "consumer"; @@ -306,7 +306,7 @@ public class QoSTests extends MQTT5TestSupport { * Identifier as the original PUBLISH packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2PubRelId() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch ackLatch = new CountDownLatch(1); @@ -359,7 +359,7 @@ public class QoSTests extends MQTT5TestSupport { * it has received the corresponding PUBCOMP packet from the receiver. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2PubRel() throws Exception { final String TOPIC = RandomUtil.randomString(); final String CONSUMER_ID = "consumer"; @@ -424,7 +424,7 @@ public class QoSTests extends MQTT5TestSupport { * expiration. This test demonstrates that. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2WithExpiration() throws Exception { final String TOPIC = "myTopic"; final String CONSUMER_ID = "consumer"; @@ -490,7 +490,7 @@ public class QoSTests extends MQTT5TestSupport { * Identifier from the incoming PUBLISH packet, having accepted ownership of the Application Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2PubRecId() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch ackLatch = new CountDownLatch(1); @@ -541,7 +541,7 @@ public class QoSTests extends MQTT5TestSupport { * responds withe appropriate PUBREC and the client completes the QoS process. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2DuplicatePub() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch ackLatch = new CountDownLatch(1); @@ -599,7 +599,7 @@ public class QoSTests extends MQTT5TestSupport { * packet containing the same Packet Identifier as the PUBREL. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2PubCompId() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch ackLatch = new CountDownLatch(1); @@ -645,7 +645,7 @@ public class QoSTests extends MQTT5TestSupport { * if it has applied Application Message expiry. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2WithExpiration2() throws Exception { final String TOPIC = "myTopic"; final String CONSUMER_ID = "consumer"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SubscriptionTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SubscriptionTests.java index 563b477517..afc600b5ab 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SubscriptionTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SubscriptionTests.java @@ -54,7 +54,7 @@ public class SubscriptionTests extends MQTT5TestSupport { * [MQTT-4.8.2-3] The Server MUST respect the granted QoS for the Client's subscription. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSharedSubscriptionRespectQoS() throws Exception { final String TOPIC = "myTopic"; final String SUB_NAME = "myShare"; @@ -120,7 +120,7 @@ public class SubscriptionTests extends MQTT5TestSupport { * other Subscriber. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSharedSubscriptionWithAck() throws Exception { final String TOPIC = "myTopic"; final String SUB_NAME = "myShare"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/TopicNameAndFilterTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/TopicNameAndFilterTests.java index 77d647dada..4d199bbc93 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/TopicNameAndFilterTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/TopicNameAndFilterTests.java @@ -57,7 +57,7 @@ public class TopicNameAndFilterTests extends MQTT5TestSupport { * Names beginning with a $ character. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMatchingHash() throws Exception { testMatchingWildcard("#"); } @@ -67,7 +67,7 @@ public class TopicNameAndFilterTests extends MQTT5TestSupport { * Names beginning with a $ character. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMatchingPlus() throws Exception { testMatchingWildcard("+"); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnAckTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnAckTests.java index 43f398c001..5b284adae4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnAckTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnAckTests.java @@ -101,7 +101,7 @@ public class ConnAckTests extends MQTT5TestSupport { * not used by any other Session currently in the Server. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testEmptyClientID() throws Exception { // no session should exist @@ -128,7 +128,7 @@ public class ConnAckTests extends MQTT5TestSupport { * in the CONNACK packet. In both cases it MUST set a 0x00 (Success) Reason Code in the CONNACK packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnackWhenCleanStartFalse() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); @@ -161,7 +161,7 @@ public class ConnAckTests extends MQTT5TestSupport { * to 0 in the CONNACK packet in addition to setting a 0x00 (Success) Reason Code in the CONNACK packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnackWhenCleanStartTrue() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); @@ -187,7 +187,7 @@ public class ConnAckTests extends MQTT5TestSupport { * when the Network Connection is closed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalseWithAbsentSessionExpiryInterval() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -215,7 +215,7 @@ public class ConnAckTests extends MQTT5TestSupport { * If the Session Expiry Interval is 0xFFFFFFFF (UINT_MAX), the Session does not expire. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalseWithMaxSessionExpiryInterval() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -240,7 +240,7 @@ public class ConnAckTests extends MQTT5TestSupport { * than AUTH. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnackSentFirst() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); CountDownLatch latch = new CountDownLatch(1); @@ -274,7 +274,7 @@ public class ConnAckTests extends MQTT5TestSupport { * client ID is invalid) */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSessionPresentWithNonZeroConnackReasonCode() throws Exception { CountDownLatch latch = new CountDownLatch(1); @@ -309,7 +309,7 @@ public class ConnAckTests extends MQTT5TestSupport { * [MQTT-3.2.2-8] The Server sending the CONNACK packet MUST use one of the Connect Reason Code values. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnackReasonCode() throws Exception { CountDownLatch latch = new CountDownLatch(1); @@ -334,7 +334,7 @@ public class ConnAckTests extends MQTT5TestSupport { * The normal use-case with a postive maximum packet size. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMaxPacketSize() throws Exception { final int SIZE = 256; setAcceptorProperty("maximumPacketSize=" + SIZE); @@ -377,7 +377,7 @@ public class ConnAckTests extends MQTT5TestSupport { * Disable maximum packet size on the broker so that it doesn't appear in the CONNACK at all. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMaxPacketSizeNegativeOne() throws Exception { final int SIZE = -1; setAcceptorProperty("maximumPacketSize=" + SIZE); @@ -397,7 +397,7 @@ public class ConnAckTests extends MQTT5TestSupport { */ @Disabled @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMaxPacketSizeZero() throws Exception { final int SIZE = 0; setAcceptorProperty("maximumPacketSize=" + SIZE); @@ -424,7 +424,7 @@ public class ConnAckTests extends MQTT5TestSupport { * Disable topic alias maximum on the broker so that it is absent from the CONNACK. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTopicAliasMaxNegativeOne() throws Exception { final int SIZE = -1; setAcceptorProperty("topicAliasMaximum=" + SIZE); @@ -445,7 +445,7 @@ public class ConnAckTests extends MQTT5TestSupport { * Disable topic alias maximum on the broker. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTopicAliasMaxZero() throws Exception { final int SIZE = 0; setAcceptorProperty("topicAliasMaximum=" + SIZE); @@ -461,7 +461,7 @@ public class ConnAckTests extends MQTT5TestSupport { * instead of the Keep Alive value the Client sent on CONNECT. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testServerKeepAlive() throws Exception { final int SERVER_KEEP_ALIVE = 123; setAcceptorProperty("serverKeepAlive=" + SERVER_KEEP_ALIVE); @@ -480,7 +480,7 @@ public class ConnAckTests extends MQTT5TestSupport { * the Client on CONNECT. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testServerKeepAliveNegativeOne() throws Exception { final int KEEP_ALIVE = 1234; setAcceptorProperty("serverKeepAlive=-1"); @@ -507,7 +507,7 @@ public class ConnAckTests extends MQTT5TestSupport { * serverKeepAlive=0 completely disables keep alives no matter the client's keep alive value. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testServerKeepAliveZero() throws Exception { final int SERVER_KEEP_ALIVE = 0; setAcceptorProperty("serverKeepAlive=" + SERVER_KEEP_ALIVE); @@ -531,7 +531,7 @@ public class ConnAckTests extends MQTT5TestSupport { * the Client on CONNECT. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testServerKeepAliveWithClientKeepAliveZero() throws Exception { final int SERVER_KEEP_ALIVE = 123; setAcceptorProperty("serverKeepAlive=" + SERVER_KEEP_ALIVE); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java index d7d3ce4cb1..bb4e04684a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java @@ -116,7 +116,7 @@ public class ConnectTests extends MQTT5TestSupport { * associated with the Session. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillFlag() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); final byte[] WILL = RandomUtil.randomBytes(); @@ -147,7 +147,7 @@ public class ConnectTests extends MQTT5TestSupport { * intervals. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillMessageWithNoSessionExpiryDelayAndNoWillDelay() throws Exception { final String CLIENT_ID_1 = RandomUtil.randomString(); final String CLIENT_ID_2 = RandomUtil.randomString(); @@ -181,7 +181,7 @@ public class ConnectTests extends MQTT5TestSupport { * interval. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillFlagWithSessionExpiryDelayAndWillDelay() throws Exception { final byte[] WILL = RandomUtil.randomBytes(); @@ -218,7 +218,7 @@ public class ConnectTests extends MQTT5TestSupport { * expiry interval. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillFlagWithNoSessionExpiryDelayAndWillDelay() throws Exception { final byte[] WILL = RandomUtil.randomBytes(); @@ -252,7 +252,7 @@ public class ConnectTests extends MQTT5TestSupport { * elapsed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillFlagWithShorterSessionExpiryDelayThanWillDelay() throws Exception { final byte[] WILL = RandomUtil.randomBytes(); @@ -290,7 +290,7 @@ public class ConnectTests extends MQTT5TestSupport { * hasn't elapsed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillFlagWithSessionExpiryDelayAndWillDelayWithReconnect() throws Exception { final byte[] WILL = RandomUtil.randomBytes(); @@ -330,7 +330,7 @@ public class ConnectTests extends MQTT5TestSupport { * Do not publish will message if client disconnects normally. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillFlagWithDisconnect() throws Exception { final byte[] WILL = RandomUtil.randomBytes(); @@ -357,7 +357,7 @@ public class ConnectTests extends MQTT5TestSupport { * the Client. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillMessageRemovedOnceSent() throws Exception { final String WILL_CONSUMER = RandomUtil.randomString(); final String WILL_SENDER = RandomUtil.randomString(); @@ -395,7 +395,7 @@ public class ConnectTests extends MQTT5TestSupport { * the Client. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillMessageRemovedOnDisconnect() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); final byte[] WILL = RandomUtil.randomBytes(); @@ -419,7 +419,7 @@ public class ConnectTests extends MQTT5TestSupport { * as a non-retained message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillFlagWithRetain() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); final byte[] WILL = RandomUtil.randomBytes(); @@ -445,7 +445,7 @@ public class ConnectTests extends MQTT5TestSupport { * Client as if the network had failed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testKeepAlive() throws Exception { MQTTInterceptor incomingInterceptor = (packet, connection) -> { if (packet.fixedHeader().messageType() == MqttMessageType.PINGREQ) { @@ -475,7 +475,7 @@ public class ConnectTests extends MQTT5TestSupport { * as if it had completed sending that Application Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMaxPacketSize() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -518,7 +518,7 @@ public class ConnectTests extends MQTT5TestSupport { * Explicitly set topic alias maximum to 0 on the client. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTopicAliasDisabledOnClient() throws Exception { testTopicAliasOnClient(true); } @@ -530,7 +530,7 @@ public class ConnectTests extends MQTT5TestSupport { * Do not define the topic alias maximum on the client. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTopicAliasAbsentOnClient() throws Exception { testTopicAliasOnClient(true); } @@ -574,7 +574,7 @@ public class ConnectTests extends MQTT5TestSupport { * [MQTT-3.1.3-10] The Server MUST maintain the order of User Properties when forwarding the Application Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testUserPropertiesOrder() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -621,7 +621,7 @@ public class ConnectTests extends MQTT5TestSupport { * this MQTT Session between the Client and the Server. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testClientID() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); @@ -650,7 +650,7 @@ public class ConnectTests extends MQTT5TestSupport { * not used by any other Session currently in the Server. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testEmptyClientID() throws Exception { // no session should exist assertEquals(0, getSessionStates().size()); @@ -674,7 +674,7 @@ public class ConnectTests extends MQTT5TestSupport { * Network Connection. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testEmptyClientIDWithoutCleanStart() throws Exception { // no session should exist assertEquals(0, getSessionStates().size()); @@ -700,7 +700,7 @@ public class ConnectTests extends MQTT5TestSupport { * Connection. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAuthenticationFailure() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); @@ -719,7 +719,7 @@ public class ConnectTests extends MQTT5TestSupport { * close the Network Connection of the existing Client. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnectionStealing() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); @@ -761,7 +761,7 @@ public class ConnectTests extends MQTT5TestSupport { * close the Network Connection of the existing Client. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnectionStealingBy3_1_1() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); @@ -805,7 +805,7 @@ public class ConnectTests extends MQTT5TestSupport { * in the CONNACK packet. In both cases it MUST set a 0x00 (Success) Reason Code in the CONNACK packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnackWhenCleanStartFalse() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); @@ -838,7 +838,7 @@ public class ConnectTests extends MQTT5TestSupport { * to 0 in the CONNACK packet in addition to setting a 0x00 (Success) Reason Code in the CONNACK packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testConnackWhenCleanStartTrue() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); @@ -866,7 +866,7 @@ public class ConnectTests extends MQTT5TestSupport { * the Client Identifier, the Server MUST create a new Session. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalse() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); @@ -897,7 +897,7 @@ public class ConnectTests extends MQTT5TestSupport { * the Session Expiry Interval is greater than 0. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalseWithReconnect() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -949,7 +949,7 @@ public class ConnectTests extends MQTT5TestSupport { * Expiry Interval has passed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalseWith0SessionExpiryInterval() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -979,7 +979,7 @@ public class ConnectTests extends MQTT5TestSupport { * Expiry Interval has passed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalseWithNon0SessionExpiryInterval() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -1017,7 +1017,7 @@ public class ConnectTests extends MQTT5TestSupport { * when the Network Connection is closed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalseWithAbsentSessionExpiryInterval() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -1045,7 +1045,7 @@ public class ConnectTests extends MQTT5TestSupport { * If the Session Expiry Interval is 0xFFFFFFFF (UINT_MAX), the Session does not expire. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartFalseWithMaxSessionExpiryInterval() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -1072,7 +1072,7 @@ public class ConnectTests extends MQTT5TestSupport { * [MQTT-3.1.2-4] If a CONNECT packet is received with Clean Start is set to 1, the Client and Server MUST discard any existing Session and start a new Session. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCleanStartTrue() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTestsWithSecurity.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTestsWithSecurity.java index 8500e1a6e7..ac5f0a0ce5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTestsWithSecurity.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTestsWithSecurity.java @@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.nio.charset.StandardCharsets; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.core.protocol.mqtt.MQTTReasonCodes; import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; @@ -47,7 +46,7 @@ public class ConnectTestsWithSecurity extends MQTT5TestSupport { * Connection. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAuthenticationFailureWithBadCredentials() throws Exception { testAuthentication(new MqttConnectionOptionsBuilder() .username(RandomUtil.randomString()) @@ -61,7 +60,7 @@ public class ConnectTestsWithSecurity extends MQTT5TestSupport { * Connection. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAuthenticationFailureWithNoCredentials() throws Exception { testAuthentication(new MqttConnectionOptionsBuilder().build()); } @@ -82,7 +81,7 @@ public class ConnectTestsWithSecurity extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAuthenticationSuccess() throws Exception { final String CLIENT_ID = RandomUtil.randomString(); MqttConnectionOptions options = new MqttConnectionOptionsBuilder() diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/DisconnectTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/DisconnectTests.java index 315aabed4b..5c92bff8be 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/DisconnectTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/DisconnectTests.java @@ -68,7 +68,7 @@ public class DisconnectTests extends MQTT5TestSupport { * point the broker will disconnect the existing session. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testDisconnectReasonCode() throws Exception { final CountDownLatch latch = new CountDownLatch(1); @@ -99,7 +99,7 @@ public class DisconnectTests extends MQTT5TestSupport { * Message associated with the current Connection without publishing it. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillMessageRemovedOnDisconnect() throws Exception { final String CLIENT_ID = org.apache.activemq.artemis.tests.util.RandomUtil.randomString(); final byte[] WILL = RandomUtil.randomBytes(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PingReqTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PingReqTests.java index 9e27a259cc..fbd5c63c38 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PingReqTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PingReqTests.java @@ -36,7 +36,7 @@ public class PingReqTests extends MQTT5TestSupport { * [MQTT-3.12.4-1] The Server MUST send a PINGRESP packet in response to a PINGREQ packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPingResp() throws Exception { final CountDownLatch latch = new CountDownLatch(4); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubAckTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubAckTests.java index 7f0186042d..6c6af45acd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubAckTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubAckTests.java @@ -45,7 +45,7 @@ public class PubAckTests extends MQTT5TestSupport { * [MQTT-3.4.2-1] The Client or Server sending the PUBACK packet MUST use one of the PUBACK Reason Codes. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPubAckReasonCode() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch latch = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubCompTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubCompTests.java index 4840da4ed5..e5df7974ab 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubCompTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubCompTests.java @@ -45,7 +45,7 @@ public class PubCompTests extends MQTT5TestSupport { * [MQTT-3.7.2-1] The Client or Server sending the PUBCOMP packets MUST use one of the PUBCOMP Reason Codes. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPubCompReasonCode() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch latch = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRecTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRecTests.java index 61d25c8984..70db2daf27 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRecTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRecTests.java @@ -45,7 +45,7 @@ public class PubRecTests extends MQTT5TestSupport { * [MQTT-3.5.2-1] The Client or Server sending the PUBREC packet MUST use one of the PUBREC Reason Codes. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPubRecReasonCode() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch latch = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRelTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRelTests.java index ae162d325c..36024244d4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRelTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRelTests.java @@ -50,7 +50,7 @@ public class PubRelTests extends MQTT5TestSupport { * [MQTT-3.6.2-1] The Client or Server sending the PUBREL packet MUST use one of the PUBREL Reason Codes. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPubRelReasonCode() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch latch = new CountDownLatch(2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java index 7bc9a20b9d..06fb63a5a6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java @@ -91,7 +91,7 @@ public class PublishTests extends MQTT5TestSupport { * packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testDupFlag() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -153,7 +153,7 @@ public class PublishTests extends MQTT5TestSupport { * [MQTT-3.3.1-2] The DUP flag MUST be set to 0 for all QoS 0 messages. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testDupFlagQoSZero() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -189,7 +189,7 @@ public class PublishTests extends MQTT5TestSupport { * subscribers by the Server. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testDupFlagNotPropagated() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -226,7 +226,7 @@ public class PublishTests extends MQTT5TestSupport { * replace any existing retained message for this topic and store the Application Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainFlag() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -267,7 +267,7 @@ public class PublishTests extends MQTT5TestSupport { * the Server. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainFlagWithEmptyMessage() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -310,7 +310,7 @@ public class PublishTests extends MQTT5TestSupport { * the message as a retained message and MUST NOT remove or replace any existing retained message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainFlagFalse() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -363,7 +363,7 @@ public class PublishTests extends MQTT5TestSupport { * Simple test with just one subscription. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainHandlingZeroWithOneSubscription() throws Exception { internalTestRetainHandlingZero(false, 1); } @@ -380,7 +380,7 @@ public class PublishTests extends MQTT5TestSupport { * Testing with lots of individual subscriptions from a single client. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainHandlingZeroWithMultipleSubscriptions() throws Exception { internalTestRetainHandlingZero(false, 25); } @@ -397,7 +397,7 @@ public class PublishTests extends MQTT5TestSupport { * Testing topic filter subscription. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainHandlingZeroWithTopicFilterSubscription() throws Exception { internalTestRetainHandlingZero(true, 25); } @@ -478,7 +478,7 @@ public class PublishTests extends MQTT5TestSupport { * exist the Server MUST NOT send the retained messages. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainHandlingOne() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -545,7 +545,7 @@ public class PublishTests extends MQTT5TestSupport { * [MQTT-3.3.1-11] If Retain Handling is set to 2, the Server MUST NOT send the retained messages */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainHandlingTwo() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -588,7 +588,7 @@ public class PublishTests extends MQTT5TestSupport { * PUBLISH packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainAsPublishedZeroOnEstablishedSubscription() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -632,7 +632,7 @@ public class PublishTests extends MQTT5TestSupport { * RETAIN flag equal to the RETAIN flag in the received PUBLISH packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRetainAsPublishedOneOnEstablishedSubscription() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -690,7 +690,7 @@ public class PublishTests extends MQTT5TestSupport { * Subscription’s Topic Filter. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTopicFilter() throws Exception { final String PREFIX = "myTopic/"; final String TOPIC = PREFIX + RandomUtil.randomString(); @@ -730,7 +730,7 @@ public class PublishTests extends MQTT5TestSupport { * Subscription’s Topic Filter. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testX() throws Exception { final String PREFIX = ""; final String TOPIC = PREFIX + RandomUtil.randomString(); @@ -768,7 +768,7 @@ public class PublishTests extends MQTT5TestSupport { * [MQTT-3.3.2-4] A Server MUST send the Payload Format Indicator unaltered to all subscribers receiving the message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPayloadFormatIndicatorTrue() throws Exception { internalTestPayloadFormatIndicator(true); } @@ -777,7 +777,7 @@ public class PublishTests extends MQTT5TestSupport { * [MQTT-3.3.2-4] A Server MUST send the Payload Format Indicator unaltered to all subscribers receiving the message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPayloadFormatIndicatorFalse() throws Exception { internalTestPayloadFormatIndicator(false); } @@ -828,7 +828,7 @@ public class PublishTests extends MQTT5TestSupport { * to a matching subscriber, then it MUST delete the copy of the message for that subscriber. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMessageExpiryIntervalElapsed() throws Exception { server.createQueue(new QueueConfiguration(EXPIRY_ADDRESS).setRoutingType(RoutingType.ANYCAST)); final String CONSUMER_ID = RandomUtil.randomString(); @@ -876,7 +876,7 @@ public class PublishTests extends MQTT5TestSupport { * received value minus the time that the message has been waiting in the Server. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testMessageExpiryIntervalReturnValue() throws Exception { server.createQueue(new QueueConfiguration(EXPIRY_ADDRESS).setRoutingType(RoutingType.ANYCAST)); final String CONSUMER_ID = RandomUtil.randomString(); @@ -930,7 +930,7 @@ public class PublishTests extends MQTT5TestSupport { * value sent by the Client in the CONNECT packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testClientTopicAliasMaxFromServer() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -983,7 +983,7 @@ public class PublishTests extends MQTT5TestSupport { */ @Disabled @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testTopicAliasesNotCarriedForward() throws Exception { final String TOPIC = "myTopicName"; @@ -1023,7 +1023,7 @@ public class PublishTests extends MQTT5TestSupport { * Alias Maximum value that it returned in the CONNACK packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testServerTopicAliasMax() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -1068,7 +1068,7 @@ public class PublishTests extends MQTT5TestSupport { * same Topic Alias value and a different non-zero length Topic Name. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testModifiedTopicAlias() throws Exception { final String TOPIC_1 = this.getTopicName() + "1"; final String TOPIC_2 = this.getTopicName() + "2"; @@ -1132,7 +1132,7 @@ public class PublishTests extends MQTT5TestSupport { * Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testResponseTopicUnaltered() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -1171,7 +1171,7 @@ public class PublishTests extends MQTT5TestSupport { * Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCorrelationDataUnaltered() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -1212,7 +1212,7 @@ public class PublishTests extends MQTT5TestSupport { * [MQTT-3.3.2-18] The Server MUST maintain the order of User Properties when forwarding the Application Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testUserProperties() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -1259,7 +1259,7 @@ public class PublishTests extends MQTT5TestSupport { * Message. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testContentTypeUnaltered() throws Exception { final String CONSUMER_ID = RandomUtil.randomString(); final String TOPIC = this.getTopicName(); @@ -1302,7 +1302,7 @@ public class PublishTests extends MQTT5TestSupport { * described at https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_QoS_2:_Exactly. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS2() throws Exception { internalTestQoS(2); } @@ -1314,7 +1314,7 @@ public class PublishTests extends MQTT5TestSupport { * Spec says response should be PUBACK: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901120 */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS1() throws Exception { internalTestQoS(1); } @@ -1326,7 +1326,7 @@ public class PublishTests extends MQTT5TestSupport { * Spec says there should be no response: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901120 */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testQoS0() throws Exception { internalTestQoS(0); } @@ -1381,7 +1381,7 @@ public class PublishTests extends MQTT5TestSupport { * |================|=====================|================| */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testOverlappingSubscriptionsWithDifferentQoSMaximums() throws Exception { final String TOPIC = "foo/a/b/c"; @@ -1457,7 +1457,7 @@ public class PublishTests extends MQTT5TestSupport { * Identifier of the matching subscription if it has a Subscription Identifier. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscriptionIdentifierMultiLevel() throws Exception { // even though only 3 messages are sent, 6 messages will be received due to the overlapping subscriptions final CountDownLatch consumerLatch = new CountDownLatch(6); @@ -1533,7 +1533,7 @@ public class PublishTests extends MQTT5TestSupport { * Identifier of the matching subscription if it has a Subscription Identifier. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscriptionIdentifierSingleLevel() throws Exception { final CountDownLatch consumerLatch = new CountDownLatch(3); @@ -1601,7 +1601,7 @@ public class PublishTests extends MQTT5TestSupport { * properly. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testReceiveMaximum() throws Exception { AtomicInteger count = new AtomicInteger(0); AtomicBoolean failed = new AtomicBoolean(false); @@ -1665,7 +1665,7 @@ public class PublishTests extends MQTT5TestSupport { * Flow control isn't enforced on QoS 0 messages. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testReceiveMaximumQoS0() throws Exception { AtomicInteger count = new AtomicInteger(0); AtomicBoolean succeeded = new AtomicBoolean(false); @@ -1730,7 +1730,7 @@ public class PublishTests extends MQTT5TestSupport { * PUBLISH packets then it is a success. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testPacketDelayReceiveMaximum() throws Exception { AtomicBoolean succeeded = new AtomicBoolean(false); final int MESSAGE_COUNT = 2; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTestsWithSecurity.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTestsWithSecurity.java index 06b65fa630..7f940c9638 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTestsWithSecurity.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTestsWithSecurity.java @@ -50,7 +50,7 @@ public class PublishTestsWithSecurity extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testCreateAddressAuthorizationFailure() throws Exception { final String CLIENT_ID = "publisher"; final CountDownLatch latch = new CountDownLatch(1); @@ -82,7 +82,7 @@ public class PublishTestsWithSecurity extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSendAuthorizationFailure() throws Exception { final String CLIENT_ID = "publisher"; final String TOPIC = "/foo"; @@ -117,7 +117,7 @@ public class PublishTestsWithSecurity extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAuthorizationSuccess() throws Exception { final String CLIENT_ID = "publisher"; MqttConnectionOptions options = new MqttConnectionOptionsBuilder() @@ -139,13 +139,13 @@ public class PublishTestsWithSecurity extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillAuthorizationSuccess() throws Exception { internalTestWillAuthorization(fullUser, fullPass, true); } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testWillAuthorizationFailure() throws Exception { internalTestWillAuthorization(noprivUser, noprivPass, false); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubAckTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubAckTests.java index 87f0a099a2..e9276e20bd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubAckTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubAckTests.java @@ -19,8 +19,6 @@ package org.apache.activemq.artemis.tests.integration.mqtt5.spec.controlpackets; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import java.util.concurrent.TimeUnit; - import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.apache.activemq.artemis.utils.RandomUtil; @@ -48,7 +46,7 @@ public class SubAckTests extends MQTT5TestSupport { * Topic Filter received. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscribeAck() throws Exception { final int SUBSCRIPTION_COUNT = 30; final String TOPIC = RandomUtil.randomString(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTests.java index 9a11d4920c..793a02b156 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTests.java @@ -60,7 +60,7 @@ public class SubscribeTests extends MQTT5TestSupport { * Messages MUST NOT be forwarded to a connection with a ClientID equal to the ClientID of the publishing connection. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscribeNoLocal() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch latch = new CountDownLatch(1); @@ -91,7 +91,7 @@ public class SubscribeTests extends MQTT5TestSupport { * don't receive the messages that they send themselves. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testRequestResponseNoLocal() throws Exception { final String TOPIC = RandomUtil.randomString(); final String REQUEST = "request"; @@ -156,7 +156,7 @@ public class SubscribeTests extends MQTT5TestSupport { * [MQTT-3.8.4-1] When the Server receives a SUBSCRIBE packet from a Client, the Server MUST respond with a SUBACK packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubAck() throws Exception { final String TOPIC = RandomUtil.randomString(); final AtomicBoolean subscribed = new AtomicBoolean(false); @@ -194,7 +194,7 @@ public class SubscribeTests extends MQTT5TestSupport { * [MQTT-3.8.4-2] The SUBACK packet MUST have the same Packet Identifier as the SUBSCRIBE packet that it is acknowledging. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubAckPacketId() throws Exception { final String TOPIC = RandomUtil.randomString(); final AtomicBoolean subscribed = new AtomicBoolean(false); @@ -242,7 +242,7 @@ public class SubscribeTests extends MQTT5TestSupport { * This test will be testing a difference in the "no local" subscription option */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testReplaceSubscription() throws Exception { final String TOPIC = RandomUtil.randomString(); final CountDownLatch latch = new CountDownLatch(2); @@ -275,7 +275,7 @@ public class SubscribeTests extends MQTT5TestSupport { * be re-sent, but Application Messages MUST NOT be lost due to replacing the Subscription. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testReplaceSubscriptionRetainHandling() throws Exception { final String TOPIC = RandomUtil.randomString(); final String CLIENT_ID = RandomUtil.randomString(); @@ -316,7 +316,7 @@ public class SubscribeTests extends MQTT5TestSupport { * indicate that the subscription failed. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscribeAck() throws Exception { final int SUBSCRIPTION_COUNT = 30; final String TOPIC = RandomUtil.randomString(); @@ -369,7 +369,7 @@ public class SubscribeTests extends MQTT5TestSupport { * QoS will still be dispatched to the subscriber, just at the subscriber's max QoS. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscriptionQoS() throws Exception { final String TOPIC = RandomUtil.randomString(); final int PUBLISH_LOOP = 25; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTestsWithSecurity.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTestsWithSecurity.java index 98f624873f..962161b20b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTestsWithSecurity.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTestsWithSecurity.java @@ -19,7 +19,6 @@ package org.apache.activemq.artemis.tests.integration.mqtt5.spec.controlpackets; import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.charset.StandardCharsets; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.core.protocol.mqtt.MQTTReasonCodes; import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; @@ -41,7 +40,7 @@ public class SubscribeTestsWithSecurity extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAuthorizationFailure() throws Exception { final String CLIENT_ID = "consumer"; final int SUBSCRIPTION_COUNT = 10; @@ -67,7 +66,7 @@ public class SubscribeTestsWithSecurity extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testAuthorizationSuccess() throws Exception { final String CLIENT_ID = "consumer"; final int SUBSCRIPTION_COUNT = 10; @@ -97,7 +96,7 @@ public class SubscribeTestsWithSecurity extends MQTT5TestSupport { } @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSubscriptionQueueRemoved() throws Exception { final String CONSUMER_ID = "consumer"; MqttConnectionOptions options = new MqttConnectionOptionsBuilder() diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubAckTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubAckTests.java index 1e8d2e5706..b08524d7b7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubAckTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubAckTests.java @@ -20,8 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import java.util.concurrent.TimeUnit; - import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.protocol.mqtt.MQTTReasonCodes; import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; @@ -50,7 +48,7 @@ public class UnsubAckTests extends MQTT5TestSupport { * Topic Filter received. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testUnsubscribeAck() throws Exception { final int SUBSCRIPTION_COUNT = 10; final String TOPIC = RandomUtil.randomString(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubscribeTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubscribeTests.java index 746fb4634c..4f25bb97e6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubscribeTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubscribeTests.java @@ -63,7 +63,7 @@ public class UnsubscribeTests extends MQTT5TestSupport { * UNSUBACK response. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testUnsubscribe() throws Exception { final int SUBSCRIPTION_COUNT = 30; final String TOPIC = RandomUtil.randomString(); @@ -119,7 +119,7 @@ public class UnsubscribeTests extends MQTT5TestSupport { * Filters, for delivery to the Client. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testStopAddingMessagesOnUnsubscribe() throws Exception { final String TOPIC = RandomUtil.randomString(); @@ -161,7 +161,7 @@ public class UnsubscribeTests extends MQTT5TestSupport { * [MQTT-3.10.4-4] The Server MUST respond to an UNSUBSCRIBE request by sending an UNSUBACK packet. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testUnsubAck() throws Exception { final String TOPIC = RandomUtil.randomString(); final AtomicBoolean unsubscribed = new AtomicBoolean(false); @@ -200,7 +200,7 @@ public class UnsubscribeTests extends MQTT5TestSupport { * Topic Subscriptions are deleted, the Server MUST respond with an UNSUBACK. */ @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testUnsubAckPacketId() throws Exception { final String TOPIC = RandomUtil.randomString(); final AtomicBoolean unsubscribed = new AtomicBoolean(false); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/BasicSslTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/BasicSslTests.java index e3b143977b..e839477a30 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/BasicSslTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/BasicSslTests.java @@ -56,7 +56,7 @@ public class BasicSslTests extends MQTT5TestSupport { } @TestTemplate - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSimpleSendReceive() throws Exception { String topic = RandomUtil.randomString(); byte[] body = RandomUtil.randomBytes(32); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/CertificateAuthenticationSslTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/CertificateAuthenticationSslTests.java index b3ca430d08..f490399cd5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/CertificateAuthenticationSslTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/CertificateAuthenticationSslTests.java @@ -95,7 +95,7 @@ public class CertificateAuthenticationSslTests extends MQTT5TestSupport { * Basic mutual SSL test with certificate-based authentication */ @TestTemplate - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSimpleSendReceive() throws Exception { final String topic = RandomUtil.randomString(); final String clientId = "subscriber"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/websocket/BasicWebSocketTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/websocket/BasicWebSocketTests.java index d2c3b5f030..18673b5618 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/websocket/BasicWebSocketTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/websocket/BasicWebSocketTests.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Timeout; public class BasicWebSocketTests extends MQTT5TestSupport { @Test - @Timeout(value = DEFAULT_TIMEOUT, unit = TimeUnit.MILLISECONDS) + @Timeout(DEFAULT_TIMEOUT_SEC) public void testSimpleSendReceive() throws Exception { String topic = RandomUtil.randomString(); byte[] body = RandomUtil.randomBytes(32); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/FastReconnectOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/FastReconnectOpenWireTest.java index 36ed0d636c..b162bb2684 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/FastReconnectOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/FastReconnectOpenWireTest.java @@ -66,7 +66,7 @@ public class FastReconnectOpenWireTest extends OpenWireTestBase { @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testFastReconnectCreateConsumerNoErrors() throws Exception { final ArrayList errors = new ArrayList<>(); @@ -129,7 +129,7 @@ public class FastReconnectOpenWireTest extends OpenWireTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testFastReconnectCreateConsumerNoErrorsNoClientId() throws Exception { final ArrayList errors = new ArrayList<>(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/LargeMessageQueueAutoCreationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/LargeMessageQueueAutoCreationTest.java index eef909083b..a7f72a9dad 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/LargeMessageQueueAutoCreationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/LargeMessageQueueAutoCreationTest.java @@ -51,7 +51,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Map; import java.util.Random; -import java.util.concurrent.TimeUnit; //adapted from https://issues.apache.org/jira/browse/ARTEMIS-1416 @ExtendWith(ParameterizedTestExtension.class) @@ -104,13 +103,13 @@ public class LargeMessageQueueAutoCreationTest extends BasicOpenWireTest { } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testSmallString() throws Exception { sendStringOfSize(1024); } @TestTemplate - @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) + @Timeout(30) public void testHugeString() throws Exception { sendStringOfSize(1024 * 1024); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireFlowControlFailTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireFlowControlFailTest.java index 395505b822..404be74f8a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireFlowControlFailTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireFlowControlFailTest.java @@ -30,7 +30,6 @@ import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; import java.util.Map; -import java.util.concurrent.TimeUnit; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.artemis.api.core.QueueConfiguration; @@ -56,7 +55,7 @@ public class OpenWireFlowControlFailTest extends OpenWireTestBase { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMessagesNotSent() throws Exception { AddressInfo addressInfo = new AddressInfo(SimpleString.toSimpleString("Test"), RoutingType.ANYCAST); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/PrefetchRedeliveryCountOpenwireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/PrefetchRedeliveryCountOpenwireTest.java index 990c5662f3..7c4b02ced1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/PrefetchRedeliveryCountOpenwireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/PrefetchRedeliveryCountOpenwireTest.java @@ -96,13 +96,13 @@ public class PrefetchRedeliveryCountOpenwireTest extends OpenWireTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumerSingleMessageLoopExclusive() throws Exception { doTestConsumerSingleMessageLoop(true); } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testConsumerSingleMessageLoopNonExclusive() throws Exception { doTestConsumerSingleMessageLoop(false); } @@ -152,7 +152,7 @@ public class PrefetchRedeliveryCountOpenwireTest extends OpenWireTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExclusiveConsumerOrderOnReconnectionLargePrefetch() throws Exception { Connection exConn = null; @@ -222,7 +222,7 @@ public class PrefetchRedeliveryCountOpenwireTest extends OpenWireTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testServerSideRollbackOnCloseOrder() throws Exception { final ArrayList errors = new ArrayList<>(); @@ -384,7 +384,7 @@ public class PrefetchRedeliveryCountOpenwireTest extends OpenWireTestBase { } @Test - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testExclusiveConsumerBatchOrderUnderLoad() throws Exception { final ArrayList errors = new ArrayList<>(); @@ -639,7 +639,7 @@ public class PrefetchRedeliveryCountOpenwireTest extends OpenWireTestBase { } @Test - @Timeout(value = 120_000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testExclusiveConsumerTransactionalBatchOnReconnectionLargePrefetch() throws Exception { doTestExclusiveConsumerTransactionalBatchOnReconnectionLargePrefetch(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ConnectionErrorSocketCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ConnectionErrorSocketCloseTest.java index f0f498c3a4..f4c5d3d553 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ConnectionErrorSocketCloseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ConnectionErrorSocketCloseTest.java @@ -19,8 +19,6 @@ package org.apache.activemq.artemis.tests.integration.openwire.amq; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import java.util.concurrent.TimeUnit; - import javax.jms.Connection; import org.apache.activemq.artemis.tests.integration.openwire.BasicOpenWireTest; @@ -39,7 +37,7 @@ public class ConnectionErrorSocketCloseTest extends BasicOpenWireTest { //We want to make sure that the socket will be closed if there as an error on broker.addConnection //even if the client doesn't close the connection to prevent dangling open sockets @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testDuplicateClientIdCloseConnection() throws Exception { connection.start(); Wait.waitFor(() -> server.getRemotingService().getConnections().size() == 1, 10000, 500); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/AnonymousProducerPageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/AnonymousProducerPageTest.java index 982c03cbcf..8ef8fda554 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/AnonymousProducerPageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/AnonymousProducerPageTest.java @@ -29,7 +29,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl; @@ -111,7 +110,7 @@ public class AnonymousProducerPageTest extends ActiveMQTestBase { } @TestTemplate - @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testNotBlockOnGlobalMaxSizeWithAnonymousProduce() throws Exception { final int MSG_SIZE = 1000; final StringBuilder builder = new StringBuilder(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/AmqpPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/AmqpPluginTest.java index 4aeef3d136..d1401cfba0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/AmqpPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/AmqpPluginTest.java @@ -88,7 +88,7 @@ public class AmqpPluginTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQueueReceiverReadAndAckMessage() throws Exception { sendMessages(getQueueName(), 1); @@ -119,7 +119,7 @@ public class AmqpPluginTest extends AmqpClientTestSupport { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQueueReceiverAutoCreatedQueue() throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MqttPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MqttPluginTest.java index d47ad2f892..60c0b979ea 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MqttPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MqttPluginTest.java @@ -80,7 +80,7 @@ public class MqttPluginTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendAndReceiveMQTT() throws Exception { final MQTTClientProvider subscriptionProvider = getMQTTClientProvider(); initializeConnection(subscriptionProvider); @@ -130,7 +130,7 @@ public class MqttPluginTest extends MQTTTestSupport { } @Test - @Timeout(value = 60 * 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testMQTTAutoCreate() throws Exception { final MQTTClientProvider subscriptionProvider = getMQTTClientProvider(); initializeConnection(subscriptionProvider); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/OpenwirePluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/OpenwirePluginTest.java index c4158945ec..366488592a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/OpenwirePluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/OpenwirePluginTest.java @@ -53,7 +53,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import javax.jms.JMSException; @@ -106,7 +105,7 @@ public class OpenwirePluginTest extends BasicOpenWireTest { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testAckedMessageAreConsumed() throws JMSException { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -143,7 +142,7 @@ public class OpenwirePluginTest extends BasicOpenWireTest { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testAutoCreatedQueue() throws JMSException { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/routing/ElasticQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/routing/ElasticQueueTest.java index 979d576a4b..d74984c06e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/routing/ElasticQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/routing/ElasticQueueTest.java @@ -450,7 +450,7 @@ public class ElasticQueueTest extends ActiveMQTestBase { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testScale0_1() throws Exception { prepareNodesAndStartCombinedHeadTail(); @@ -546,7 +546,7 @@ public class ElasticQueueTest extends ActiveMQTestBase { // will get nothing to avoid out of order messages, b/c it is connected to the head broker, not the tail! // Some pure CONSUMER role needs to drain the tail in this case. @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testScale0_1_CombinedProducerConsumerConnectionWithProducerRole() throws Exception { prepareNodesAndStartCombinedHeadTail(); @@ -645,7 +645,7 @@ public class ElasticQueueTest extends ActiveMQTestBase { // blocking credit takes effect for new links, existing producers will see the FAIL exception. // Blocked producers make use of jms.sendTimeout to error out. @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testScale0_1_CombinedRoleConnection() throws Exception { prepareNodesAndStartCombinedHeadTail(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompPropertiesInterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompPropertiesInterceptorTest.java index a659d2f94d..296a691e41 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompPropertiesInterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompPropertiesInterceptorTest.java @@ -37,7 +37,6 @@ import java.util.Collection; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; @ExtendWith(ParameterizedTestExtension.class) public class StompPropertiesInterceptorTest extends StompTestBase { @@ -82,7 +81,7 @@ public class StompPropertiesInterceptorTest extends StompTestBase { private static Map expectedProperties = new ConcurrentHashMap<>(); @TestTemplate - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCheckInterceptedStompMessageProperties() throws Exception { final String msgText = "Test intercepted message"; final String myHeader = "TestInterceptedHeader"; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/checkTest/CheckTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/checkTest/CheckTest.java index ec9727debb..a53262f978 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/checkTest/CheckTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/checkTest/CheckTest.java @@ -28,7 +28,6 @@ import javax.jms.Session; import javax.jms.TextMessage; import java.io.File; import java.lang.invoke.MethodHandles; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.QueueConfiguration; import org.apache.activemq.artemis.api.core.RoutingType; @@ -100,7 +99,7 @@ public class CheckTest extends SmokeTestBase { } @Test - @Timeout(value = 60_000L, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testNodeCheckActions() throws Exception { primaryProcess = startServer(SERVER_NAME_1, 0, 0); ServerUtil.waitForServerToStart("tcp://localhost:61616", 5_000); @@ -160,7 +159,7 @@ public class CheckTest extends SmokeTestBase { } @Test - @Timeout(value = 60_000L, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testCheckTopology() throws Exception { primaryProcess = startServer(SERVER_NAME_1, 0, 0); ServerUtil.waitForServerToStart("tcp://localhost:61616", 5_000); @@ -230,7 +229,7 @@ public class CheckTest extends SmokeTestBase { } @Test - @Timeout(value = 60_000L, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testQueueCheckUp() throws Exception { primaryProcess = startServer(SERVER_NAME_1, 0, 0); ServerUtil.waitForServerToStart("tcp://localhost:61616", 5_000); diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/crossprotocol/MultiThreadConvertTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/crossprotocol/MultiThreadConvertTest.java index 24230cbacd..01a8511423 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/crossprotocol/MultiThreadConvertTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/crossprotocol/MultiThreadConvertTest.java @@ -102,13 +102,13 @@ public class MultiThreadConvertTest extends SmokeTestBase { } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendLotsOfDurableMessagesOnTopicWithManySubscribersPersistent() throws Exception { doTestSendLotsOfDurableMessagesOnTopicWithManySubscribers(DeliveryMode.PERSISTENT); } @Test - @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) + @Timeout(60) public void testSendLotsOfDurableMessagesOnTopicWithManySubscribersNonPersistent() throws Exception { doTestSendLotsOfDurableMessagesOnTopicWithManySubscribers(DeliveryMode.NON_PERSISTENT); } diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/InterruptedLargeMessageTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/InterruptedLargeMessageTest.java index 33a2c92eac..0c4003d541 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/InterruptedLargeMessageTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/InterruptedLargeMessageTest.java @@ -144,13 +144,13 @@ public class InterruptedLargeMessageTest extends SoakTestBase { } @Test - @Timeout(value = 240_000L, unit = TimeUnit.MILLISECONDS) + @Timeout(240) public void testAMQP() throws Exception { testInterrupt("AMQP"); } @Test - @Timeout(value = 240_000L, unit = TimeUnit.MILLISECONDS) + @Timeout(240) public void testCORE() throws Exception { testInterrupt("CORE"); } diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/PagedSNFSoakTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/PagedSNFSoakTest.java index 54a39d28dc..3ff5b0fc3f 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/PagedSNFSoakTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/PagedSNFSoakTest.java @@ -125,13 +125,13 @@ public class PagedSNFSoakTest extends SoakTestBase { } @Test - @Timeout(value = 240_000L, unit = TimeUnit.MILLISECONDS) + @Timeout(240) public void testAMQP() throws Exception { testAccumulateAndSend("AMQP"); } @Test - @Timeout(value = 240_000L, unit = TimeUnit.MILLISECONDS) + @Timeout(240) public void testCORE() throws Exception { testAccumulateAndSend("CORE"); } diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/ValidateExportSpeedTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/ValidateExportSpeedTest.java index 3144267363..2c858126e6 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/ValidateExportSpeedTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/ValidateExportSpeedTest.java @@ -35,7 +35,6 @@ import javax.jms.TextMessage; import java.io.File; import java.lang.invoke.MethodHandles; import java.nio.charset.StandardCharsets; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.cli.commands.ActionContext; import org.apache.activemq.artemis.cli.commands.tools.xml.XmlDataExporter; @@ -212,14 +211,14 @@ public class ValidateExportSpeedTest extends SoakTestBase { } @Test - @Timeout(value = 120_000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testExportAMQP() throws Exception { testExport("AMQP", false, 100, 1); // small sample of data to validate the test itself testExport("AMQP", true, 50_000, 100); } @Test - @Timeout(value = 120_000, unit = TimeUnit.MILLISECONDS) + @Timeout(120) public void testExportCORE() throws Exception { testExport("CORE", false, 100, 1); // small sample of data to validate the test itself testExport("CORE", true, 50_000, 100); diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java index fb27976818..45ef7d5734 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java @@ -39,7 +39,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.List; -import java.util.concurrent.TimeUnit; @ExtendWith(ParameterizedTestExtension.class) public class AllClassesTest { @@ -85,7 +84,7 @@ public class AllClassesTest { @TestTemplate - @Timeout(value = 3000, unit = TimeUnit.MILLISECONDS) + @Timeout(3) public void testToString() { Object targetInstance = null; diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java index 08d627310f..f355dcfb02 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java @@ -1478,7 +1478,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testCheckExecutionIsNotRepeated() throws Exception { SequentialFileFactory factory = new FakeSequentialFileFactory(); diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/jndi/ObjectFactoryTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/jndi/ObjectFactoryTest.java index f511222099..237c8b30dc 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/jndi/ObjectFactoryTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/jndi/ObjectFactoryTest.java @@ -24,7 +24,6 @@ import javax.naming.StringRefAddr; import java.net.URI; import java.util.Map; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; @@ -40,7 +39,7 @@ import org.junit.jupiter.api.Timeout; public class ObjectFactoryTest { @Test - @Timeout(value = 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(1) public void testConnectionFactory() throws Exception { // Create sample connection factory ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://0"); @@ -129,7 +128,7 @@ public class ObjectFactoryTest { } @Test - @Timeout(value = 1000, unit = TimeUnit.MILLISECONDS) + @Timeout(1) public void testDestination() throws Exception { // Create sample destination ActiveMQDestination dest = (ActiveMQDestination) ActiveMQJMSClient.createQueue(RandomUtil.randomString()); diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/jndi/StringRefAddrReferenceTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/jndi/StringRefAddrReferenceTest.java index faafd72b31..7047ccd05a 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/jndi/StringRefAddrReferenceTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/jms/jndi/StringRefAddrReferenceTest.java @@ -23,7 +23,6 @@ import javax.naming.StringRefAddr; import javax.naming.spi.ObjectFactory; import java.util.Enumeration; import java.util.Properties; -import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQQueue; @@ -41,7 +40,7 @@ public class StringRefAddrReferenceTest { private static final String TYPE = "type"; @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testActiveMQQueueFromPropertiesJNDI() throws Exception { Properties properties = new Properties(); properties.setProperty(TYPE, ActiveMQQueue.class.getName()); @@ -59,7 +58,7 @@ public class StringRefAddrReferenceTest { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testActiveMQTopicFromPropertiesJNDI() throws Exception { Properties properties = new Properties(); properties.setProperty(TYPE, ActiveMQTopic.class.getName()); @@ -77,7 +76,7 @@ public class StringRefAddrReferenceTest { } @Test - @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) + @Timeout(10) public void testActiveMQConnectionFactoryFromPropertiesJNDI() throws Exception { Properties properties = new Properties(); properties.setProperty(TYPE, ActiveMQConnectionFactory.class.getName());