Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions activemq-amqp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,80 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>${surefire.argLine}</argLine>
<runOrder>alphabetical</runOrder>
<reportFormat>plain</reportFormat>
<failIfNoTests>false</failIfNoTests>
<excludedGroups>org.apache.activemq.transport.amqp.ParallelTest</excludedGroups>
<systemPropertyVariables>
<org.apache.activemq.default.directory.prefix>${project.build.directory}/</org.apache.activemq.default.directory.prefix>
</systemPropertyVariables>
<consoleOutputReporter>
<disable>true</disable>
</consoleOutputReporter>
<statelessTestsetInfoReporter
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
<printStacktraceOnError>true</printStacktraceOnError>
<printStacktraceOnFailure>true</printStacktraceOnFailure>
<printStdoutOnError>true</printStdoutOnError>
<printStdoutOnFailure>true</printStdoutOnFailure>
<printStderrOnError>true</printStderrOnError>
<printStderrOnFailure>true</printStderrOnFailure>
</statelessTestsetInfoReporter>
<includes>
<include>**/*Test.*</include>
</includes>
<excludes>
<exclude>**/*LoadTest.java</exclude>
<exclude>**/*StressTest.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>parallel</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<!-- drop the default excludedGroups -->
<excludedGroups combine.self="override"/>
<groups>org.apache.activemq.transport.amqp.ParallelTest</groups>
<forkCount>2C</forkCount>
<reuseForks>false</reuseForks>
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
<failIfNoTests>false</failIfNoTests>
<systemPropertyVariables>
<org.apache.activemq.default.directory.prefix>${project.build.directory}/parallel-tests-${surefire.forkNumber}/</org.apache.activemq.default.directory.prefix>
<!-- when running tests in parallel in the CI (quite slow) we need to bump the wireformat negotiation timeout (5s by default) -->
<org.apache.activemq.transport.wireFormatNegotiationTimeout>30000</org.apache.activemq.transport.wireFormatNegotiationTimeout>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${surefire.version}</version>
</dependency>
<dependency>
<groupId>me.fabriciorby</groupId>
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
<version>1.5.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<!-- profile which is activated is the swiftmq-client-home prop is defined.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class AmqpAndMqttTest {

protected BrokerService broker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Category(ParallelTest.class)
public class AmqpAndStompInteropTest {

private static final Logger LOG = LoggerFactory.getLogger(AmqpAndStompInteropTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import org.apache.activemq.spring.SpringSslContext;
import org.apache.activemq.store.kahadb.KahaDBStore;
import org.apache.activemq.transport.amqp.protocol.AmqpConnection;
import org.apache.activemq.util.IOHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
Expand All @@ -61,7 +62,6 @@
public class AmqpTestSupport {

public static final String MESSAGE_NUMBER = "MessageNumber";
public static final String KAHADB_DIRECTORY = "target/activemq-data/";

@Rule public TestName name = new TestName();

Expand Down Expand Up @@ -120,7 +120,7 @@ protected void createBroker(boolean deleteAllMessages) throws Exception {
brokerService.setDeleteAllMessagesOnStartup(deleteAllMessages);
if (isPersistent()) {
KahaDBStore kaha = new KahaDBStore();
kaha.setDirectory(new File(KAHADB_DIRECTORY + getTestName()));
kaha.setDirectory(new File(IOHelper.getDefaultDataDirectory() + getTestName()));
brokerService.setPersistenceAdapter(kaha);
}
brokerService.setSchedulerSupport(isSchedulerEnabled());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
import org.apache.activemq.transport.amqp.client.AmqpSession;
import org.junit.After;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Category(ParallelTest.class)
public class AmqpTransformerTest {

private static final Logger LOG = LoggerFactory.getLogger(AmqpTransformerTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Category(ParallelTest.class)
public class JMSClientSimpleAuthTest {

@Rule public TestName name = new TestName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@
import org.apache.activemq.util.Wait;
import org.apache.qpid.jms.JmsConnectionFactory;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.objectweb.jtests.jms.framework.TestConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Category(ParallelTest.class)
public class JMSClientTest extends JMSClientTestSupport {

protected static final Logger LOG = LoggerFactory.getLogger(JMSClientTest.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.transport.amqp;


/**
* Marker interface used with {@code @Category(ParallelTest.class)} to opt a
* test class or method into the {@code all-parallel} Maven profile. Only tests
* explicitly tagged with this category execute when the profile is enabled,
* which allows a gradual migration toward full parallelism.
*/
public interface ParallelTest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@
import org.apache.activemq.transport.amqp.client.AmqpReceiver;
import org.apache.activemq.transport.amqp.client.AmqpSender;
import org.apache.activemq.transport.amqp.client.AmqpSession;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;

/**
* Test for support of Anonymous sender links.
*/
@Category(ParallelTest.class)
public class AmqpAnonymousSenderTest extends AmqpClientTestSupport {

@Test(timeout = 60000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@
import org.apache.activemq.transport.amqp.client.AmqpConnection;
import org.apache.activemq.transport.amqp.client.AmqpConnectionListener;
import org.apache.activemq.transport.amqp.client.AmqpValidator;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.apache.activemq.util.Wait;
import org.apache.qpid.proton.engine.Connection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.experimental.categories.Category;

/**
* Test handling of heartbeats requested by the broker.
*/
@RunWith(Parameterized.class)
@Category(ParallelTest.class)
public class AmqpBrokerReuqestedHearbeatsTest extends AmqpClientTestSupport {

private final int TEST_IDLE_TIMEOUT = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@
import org.apache.activemq.transport.amqp.client.AmqpConnection;
import org.apache.activemq.transport.amqp.client.AmqpConnectionListener;
import org.apache.activemq.transport.amqp.client.AmqpValidator;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.apache.activemq.util.Wait;
import org.apache.qpid.proton.engine.Connection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.experimental.categories.Category;

/**
* Tests that cover broker behavior when the client requests heartbeats
*/
@RunWith(Parameterized.class)
@Category(ParallelTest.class)
public class AmqpClientRequestsHeartbeatsTest extends AmqpClientTestSupport {

private final int TEST_IDLE_TIMEOUT = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@
import org.apache.activemq.transport.amqp.client.AmqpClient;
import org.apache.activemq.transport.amqp.client.AmqpClientTestSupport;
import org.apache.activemq.transport.amqp.client.AmqpConnection;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.experimental.categories.Category;

/**
* Test for the transportConnector maximumConnections URI option.
*/
@RunWith(Parameterized.class)
@Category(ParallelTest.class)
public class AmqpConfiguredMaxConnectionsTest extends AmqpClientTestSupport {

private static final int MAX_CONNECTIONS = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.activemq.transport.amqp.client.AmqpSender;
import org.apache.activemq.transport.amqp.client.AmqpSession;
import org.apache.activemq.transport.amqp.client.AmqpValidator;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.apache.qpid.proton.amqp.Symbol;
import org.apache.qpid.proton.amqp.transport.AmqpError;
import org.apache.qpid.proton.amqp.transport.ErrorCondition;
Expand All @@ -48,11 +49,13 @@
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.experimental.categories.Category;

/**
* Test broker handling of AMQP connections with various configurations.
*/
@RunWith(Parameterized.class)
@Category(ParallelTest.class)
public class AmqpConnectionsTest extends AmqpClientTestSupport {

private static final Symbol QUEUE_PREFIX = Symbol.valueOf("queue-prefix");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,22 @@
import org.apache.activemq.transport.amqp.client.AmqpReceiver;
import org.apache.activemq.transport.amqp.client.AmqpSender;
import org.apache.activemq.transport.amqp.client.AmqpSession;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.apache.qpid.proton.amqp.Binary;
import org.apache.qpid.proton.amqp.UnsignedLong;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Tests that the AMQP CorrelationId value and type are preserved.
*/
@RunWith(Parameterized.class)
@Category(ParallelTest.class)
public class AmqpCorrelationIdPreservationTest extends AmqpClientTestSupport {

protected static final Logger LOG = LoggerFactory.getLogger(JMSInteroperabilityTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@
import org.apache.activemq.transport.amqp.client.AmqpClient;
import org.apache.activemq.transport.amqp.client.AmqpClientTestSupport;
import org.apache.activemq.transport.amqp.client.AmqpConnection;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.apache.activemq.util.Wait;
import org.junit.Test;
import org.junit.experimental.categories.Category;

/**
* Test that broker closes connection and allows a new one when the transport
* receives a bad chunk of data after a successful connect.
*/
@Category(ParallelTest.class)
public class AmqpCorruptedFrameHandlingTest extends AmqpClientTestSupport {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@
import org.apache.activemq.transport.amqp.client.AmqpReceiver;
import org.apache.activemq.transport.amqp.client.AmqpSender;
import org.apache.activemq.transport.amqp.client.AmqpSession;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.experimental.categories.Category;

/**
* Test around the handling of Deliver Annotations in messages sent and received.
*/
@RunWith(Parameterized.class)
@Category(ParallelTest.class)
public class AmqpDeliveryAnnotationsTest extends AmqpClientTestSupport {

private final String DELIVERY_ANNOTATION_NAME = "TEST-DELIVERY-ANNOTATION";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,19 @@
import org.apache.activemq.transport.amqp.client.AmqpReceiver;
import org.apache.activemq.transport.amqp.client.AmqpSender;
import org.apache.activemq.transport.amqp.client.AmqpSession;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.experimental.categories.Category;

/**
* Test that the broker can pass through an AMQP message with a described type
* in the message body regardless of transformer in use.
*/
@RunWith(Parameterized.class)
@Category(ParallelTest.class)
public class AmqpDescribedTypePayloadTest extends AmqpClientTestSupport {

private final String transformer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
import org.apache.activemq.transport.amqp.client.AmqpClientTestSupport;
import org.apache.activemq.transport.amqp.client.AmqpConnection;
import org.apache.activemq.transport.amqp.client.AmqpValidator;
import org.apache.activemq.transport.amqp.ParallelTest;
import org.apache.qpid.proton.engine.Connection;
import org.junit.Test;
import org.junit.experimental.categories.Category;

/**
* Test broker behaviors around Idle timeout when the inactivity monitor is disabled.
*/
@Category(ParallelTest.class)
public class AmqpDisabledInactivityMonitorTest extends AmqpClientTestSupport {

private final int TEST_IDLE_TIMEOUT = 3000;
Expand Down
Loading