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
66 changes: 60 additions & 6 deletions activemq-stomp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<artifactId>activemq-stomp</artifactId>
<packaging>jar</packaging>
<name>ActiveMQ :: STOMP Protocol</name>

<properties>
<surefire.version>3.5.3</surefire.version>
</properties>

<description>The ActiveMQ STOMP Protocol Implementation</description>

<dependencies>
Expand Down Expand Up @@ -125,23 +130,72 @@

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<argLine>${surefire.argLine}</argLine>
<runOrder>alphabetical</runOrder>
<reportFormat>plain</reportFormat>
<failIfNoTests>false</failIfNoTests>
<systemPropertyVariables>
<org.apache.activemq.default.directory.prefix>target</org.apache.activemq.default.directory.prefix>
</systemPropertyVariables>
<excludedGroups>org.apache.activemq.transport.stomp.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>**/StompNIOSSLLoadTest.java</exclude>
<exclude>**/*LoadTest.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.stomp.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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// https://issues.apache.org/jira/browse/AMQ-3393
@Category(ParallelTest.class)
public class ConnectTest {

private static final Logger LOG = LoggerFactory.getLogger(ConnectTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
import org.apache.activemq.command.ActiveMQDestination;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

/**
* Tests for conversion capabilities of LegacyFrameTranslator
*/
@Category(ParallelTest.class)
public class LegacyFrameTranslatorTest {

private ProtocolConverter converter;
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.stomp;


/**
* 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 @@ -40,6 +40,9 @@

import static org.junit.Assert.*;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class Stomp11Test extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(Stomp11Test.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class Stomp12Test extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(Stomp12Test.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompAdvisoryTest extends StompTestSupport {
static final String STATS_DESTINATION_PREFIX = "ActiveMQ.Statistics.Destination";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

/**
* Tests for support of composite destination support over STOMP
*/
@Category(ParallelTest.class)
public class StompCompositeDestinationTest extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(StompCompositeDestinationTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

/**
* Test that connection attempts that don't send the connect performative
* get cleaned up by the inactivity monitor.
*/
@Category(ParallelTest.class)
@RunWith(Parameterized.class)
public class StompConnectTimeoutTest extends StompTestSupport {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
*/
package org.apache.activemq.transport.stomp;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class StompEmptyDestinationTest extends StompTestSupport{
@Category(ParallelTest.class)
public class StompEmptyDestinationTest extends StompTestSupport{
private static final Logger LOG = LoggerFactory.getLogger(StompEmptyDestinationTest.class);

@Test(timeout = 60000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import java.util.HashMap;

import org.junit.Test;
import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompFrameTest {
StompFrame underTest = new StompFrame();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

/**
* Test that the inactivity monitor works as expected.
*/
@Category(ParallelTest.class)
@RunWith(Parameterized.class)
public class StompInactivityMonitorTest extends StompTestSupport {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

import org.junit.Test;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompMaxDataSizeTest extends StompTestSupport {

private static final int TEST_MAX_DATA_SIZE = 64 * 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import org.junit.experimental.categories.Category;


@Category(ParallelTest.class)
@RunWith(Parameterized.class)
public class StompMaxFrameSizeTest extends StompTestSupport {

Expand Down Expand Up @@ -273,7 +277,7 @@ protected void doOversizedTestMessage(int port, boolean useSsl, int dataSize) th

stompConnection.sendFrame(frame);

StompFrame received = stompConnection.receive(5000);
StompFrame received = stompConnection.receive(10000);
assertNotNull(received);
assertEquals("ERROR", received.getAction());
assertTrue(received.getBody().contains("maximum frame size"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompMissingMessageTest extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(StompMissingMessageTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@

import org.apache.activemq.util.DefaultTestAppender;

import org.junit.experimental.categories.Category;

/**
* Testcase for AMQ-6526.
* Checks if the \<Unknown\> in the Stomp ProtocolException is replaced
* with the proper Stomp operation.
*
*/
@Category(ParallelTest.class)
public class StompNIOSSLLargeMessageTest extends StompTestSupport {

protected static final Logger LOG = LoggerFactory.getLogger(StompNIOSSLLargeMessageTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompPrefetchTest extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(StompPrefetchTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompSubscriptionRemoveTest extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(StompSubscriptionRemoveTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompTelnetTest extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(StompTelnetTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
import com.thoughtworks.xstream.io.xml.XppReader;
import com.thoughtworks.xstream.io.xml.xppdom.XppFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompTest extends StompTestSupport {
private static final Logger LOG = LoggerFactory.getLogger(StompTest.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompTimeStampingBrokerPluginTest extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(StompTimeStampingBrokerPluginTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;

@Category(ParallelTest.class)
public class StompVirtualTopicTest extends StompTestSupport {

private static final Logger LOG = LoggerFactory.getLogger(StompVirtualTopicTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.net.ssl.SSLSocketFactory;

import org.apache.activemq.transport.auto.AutoTcpTransportServer;
import org.apache.activemq.transport.stomp.ParallelTest;
import org.apache.activemq.transport.stomp.StompTestSupport;
import org.apache.activemq.util.Wait;
import org.junit.Test;
Expand All @@ -36,10 +37,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.experimental.categories.Category;
/**
* Test that connection attempts that don't send the connect get cleaned by
* by the protocolDetectionTimeOut property
*/
@Category(ParallelTest.class)
@RunWith(Parameterized.class)
public class AutoStompConnectTimeoutTest extends StompTestSupport {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@
import org.apache.activemq.broker.BrokerPlugin;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ConnectionInfo;
import org.apache.activemq.transport.stomp.ParallelTest;
import org.apache.activemq.transport.stomp.Stomp;
import org.apache.activemq.transport.stomp.StompTestSupport;
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;

@Category(ParallelTest.class)
@RunWith(Parameterized.class)
public class StompAutoSslAuthTest extends StompTestSupport {

Expand Down