This commit is contained in:
Clebert Suconic 2017-12-20 16:06:23 -05:00
commit 43b72759e5
21 changed files with 67 additions and 35 deletions

View File

@ -26,9 +26,11 @@ import junit.framework.TestCase;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQMessageConsumer;
import org.apache.activemq.command.ActiveMQQueue;
import org.junit.Test;
public class ConfigUsingDestinationOptions extends TestCase {
public class ConfigUsingDestinationOptionsTest extends TestCase {
@Test(timeout = 60000)
public void testValidSelectorConfig() throws JMSException {
ActiveMQQueue queue = new ActiveMQQueue("TEST.FOO?consumer.selector=test=1");
@ -46,6 +48,7 @@ public class ConfigUsingDestinationOptions extends TestCase {
assertEquals("test=1", cons.getMessageSelector());
}
@Test(timeout = 60000)
public void testInvalidSelectorConfig() throws JMSException {
ActiveMQQueue queue = new ActiveMQQueue("TEST.FOO?consumer.selector=test||1");

View File

@ -44,6 +44,7 @@ import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
public class ConsumerWindowSizeTest extends ActiveMQTestBase {
@ -542,8 +543,9 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase {
internalTestSlowConsumerNoBuffer(false);
}
// I believe this test became invalid after we started using another thread to deliver the large message
public void disabled_testSlowConsumerNoBufferLargeMessages() throws Exception {
@Test
@Ignore("I believe this test became invalid after we started using another thread to deliver the large message")
public void testSlowConsumerNoBufferLargeMessages() throws Exception {
internalTestSlowConsumerNoBuffer(true);
}
@ -559,13 +561,12 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase {
server.start();
locator.setConsumerWindowSize(0);
if (largeMessages) {
locator.setMinLargeMessageSize(100);
}
ClientSessionFactory sf = createSessionFactory(locator);
if (largeMessages) {
sf.getServerLocator().setMinLargeMessageSize(100);
}
session = sf.createSession(false, true, true);
SimpleString ADDRESS = addressA;

View File

@ -1579,6 +1579,7 @@ public class ClusteredGroupingTest extends ClusterTestBase {
}
@Test
public void testGroupingMultipleSending() throws Exception {
setupServer(0, isFileStorage(), isNetty());
setupServer(1, isFileStorage(), isNetty());

View File

@ -18,6 +18,7 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution;
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
public class ClusteredRequestResponseTest extends ClusterTestBase {
@ -83,7 +84,9 @@ public class ClusteredRequestResponseTest extends ClusterTestBase {
*
* TODO: I believe this test is invalid. I'm just ignoring it for now. It will probably go away
*/
public void invalidTest_testRequestResponseNoWaitForBindings() throws Exception {
@Test
@Ignore
public void testRequestResponseNoWaitForBindings() throws Exception {
setupCluster();
startServers(0, 1, 2, 3, 4);

View File

@ -38,7 +38,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FailoverTestWithDivert extends FailoverTestBase {
public class FailoverWithDivertTest extends FailoverTestBase {
private static final String DIVERT_ADDRESS = "jms.queue.testQueue";
private static final String DIVERT_FORWARD_ADDRESS = "jms.queue.divertedQueue";

View File

@ -26,7 +26,7 @@ import org.apache.activemq.artemis.tests.integration.cluster.distribution.Cluste
import org.junit.Before;
import org.junit.Test;
public class HAAutomaticBackupSharedStore extends ClusterTestBase {
public class HAAutomaticBackupSharedStoreTest extends ClusterTestBase {
@Before
public void setup() throws Exception {

View File

@ -44,7 +44,7 @@ import org.apache.activemq.artemis.tests.util.Wait;
import org.junit.Assert;
import org.junit.Test;
public class ShutdownOnCriticalIOErrorMoveNext extends ActiveMQTestBase {
public class ShutdownOnCriticalIOErrorMoveNextTest extends ActiveMQTestBase {
@Test
public void testSimplyDownAfterError() throws Exception {

View File

@ -44,7 +44,7 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class AMQPToJMSCore extends ActiveMQTestBase {
public class AMQPToJMSCoreTest extends ActiveMQTestBase {
private ActiveMQServer server;
protected String queueName = "amqTestQueue1";

View File

@ -29,6 +29,7 @@ import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
import org.apache.activemq.artemis.api.jms.JMSFactoryType;
import org.apache.activemq.artemis.tests.util.JMSTestBase;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
public class PreACKJMSTest extends JMSTestBase {
@ -95,7 +96,9 @@ public class PreACKJMSTest extends JMSTestBase {
assertNull("ConnectionFactory is on PreACK mode, the message shouldn't be received", msg2);
}
public void disabled_testPreACKTransactional() throws Exception {
@Test
@Ignore
public void testPreACKTransactional() throws Exception {
conn = cf.createConnection();
Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);

View File

@ -25,12 +25,14 @@ import org.apache.activemq.artemis.api.jms.JMSFactoryType;
import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.activemq.artemis.tests.util.JMSTestBase;
import org.junit.Test;
/**
* A CloseConnectionOnGCTest
*/
public class CloseConnectionFactoryOnGCest extends JMSTestBase {
public class CloseConnectionFactoryOnGCTest extends JMSTestBase {
@Test(timeout = 60000)
public void testCloseCFOnGC() throws Exception {
final AtomicInteger valueGC = new AtomicInteger(0);

View File

@ -72,6 +72,7 @@ import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
public class SimpleOpenWireTest extends BasicOpenWireTest {
@ -526,7 +527,8 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
}
}
// @Test -- ignored for now
@Test
@Ignore("ignored for now")
public void testKeepAlive() throws Exception {
connection.start();

View File

@ -49,7 +49,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class OutgoingConnectionTestJTA extends ActiveMQRATestBase {
public class OutgoingConnectionJTATest extends ActiveMQRATestBase {
protected ActiveMQResourceAdapter resourceAdapter;
protected ActiveMQRAConnectionFactory qraConnectionFactory;

View File

@ -38,6 +38,7 @@ import org.junit.Test;
import javax.jms.Connection;
import javax.jms.JMSContext;
import javax.jms.JMSProducer;
import javax.jms.JMSRuntimeException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
@ -48,7 +49,7 @@ import javax.jms.TextMessage;
import java.util.HashSet;
import java.util.Set;
public class OutgoingConnectionTestNoJTA extends ActiveMQRATestBase {
public class OutgoingConnectionNoJTATest extends ActiveMQRATestBase {
protected ActiveMQResourceAdapter resourceAdapter;
protected ActiveMQRAConnectionFactory qraConnectionFactory;
@ -192,14 +193,22 @@ public class OutgoingConnectionTestNoJTA extends ActiveMQRATestBase {
}
@Test
public void sessionTransactedTestNoActiveJTATx() throws Exception {
JMSContext context = qraConnectionFactory.createContext(JMSContext.SESSION_TRANSACTED);
public void sessionNotTransactedTestNoActiveJTATx() throws Exception {
JMSContext context = qraConnectionFactory.createContext(JMSContext.AUTO_ACKNOWLEDGE);
assertEquals(context.getSessionMode(), JMSContext.AUTO_ACKNOWLEDGE);
}
@Test
public void sessionTransactedTestNoActiveJTATx() throws Exception {
try {
qraConnectionFactory.createContext(JMSContext.SESSION_TRANSACTED);
fail("Exception expected");
} catch (JMSRuntimeException ignored) {
}
}
@Test
public void testQueuSessionAckMode() throws Exception {
public void testQueueSessionAckMode() throws Exception {
QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
@ -216,7 +225,7 @@ public class OutgoingConnectionTestNoJTA extends ActiveMQRATestBase {
try (ClientSessionFactory sf = locator.createSessionFactory();
ClientSession session = sf.createSession();
ClientConsumer consVerify = session.createConsumer("jms.queue." + MDBQUEUE);
ClientConsumer consVerify = session.createConsumer(MDBQUEUE);
JMSContext jmsctx = qraConnectionFactory.createContext();
) {
session.start();
@ -252,7 +261,7 @@ public class OutgoingConnectionTestNoJTA extends ActiveMQRATestBase {
Queue q = ActiveMQJMSClient.createQueue(MDBQUEUE);
try (ClientSessionFactory sf = locator.createSessionFactory();
ClientSession session = sf.createSession();
ClientConsumer consVerify = session.createConsumer("jms.queue." + MDBQUEUE);
ClientConsumer consVerify = session.createConsumer(MDBQUEUE);
Connection conn = qraConnectionFactory.createConnection();
) {
Session jmsSess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

View File

@ -62,6 +62,7 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.tests.util.CreateMessage;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
public class SecurityTest extends ActiveMQTestBase {
@ -1605,7 +1606,9 @@ public class SecurityTest extends ActiveMQTestBase {
}
public void _testComplexRoles2() throws Exception {
@Test
@Ignore
public void testComplexRoles2() throws Exception {
ActiveMQServer server = createServer();
server.start();
ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
@ -1645,8 +1648,8 @@ public class SecurityTest extends ActiveMQTestBase {
ClientSession andrewConnection = null;
ClientSession frankConnection = null;
ClientSession samConnection = null;
locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true);
ClientSessionFactory factory = createSessionFactory(locator);
factory.getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true);
ClientSession adminSession = factory.createSession("all", "all", false, true, true, false, -1);
String genericQueueName = "genericQueue";

View File

@ -34,7 +34,7 @@ import java.util.List;
import java.util.Map;
@RunWith(value = Parameterized.class)
public class StompTestPropertiesInterceptor extends StompTestBase {
public class StompPropertiesInterceptorTest extends StompTestBase {
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> data() {
@ -44,14 +44,14 @@ public class StompTestPropertiesInterceptor extends StompTestBase {
@Override
public List<String> getIncomingInterceptors() {
List<String> stompIncomingInterceptor = new ArrayList<>();
stompIncomingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompTestPropertiesInterceptor$StompFramePropertiesInterceptor");
stompIncomingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompPropertiesInterceptorTest$StompFramePropertiesInterceptor");
return stompIncomingInterceptor;
}
@Override
public List<String> getOutgoingInterceptors() {
List<String> stompOutgoingInterceptor = new ArrayList<>();
stompOutgoingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompTestPropertiesInterceptor$StompFramePropertiesInterceptor");
stompOutgoingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompPropertiesInterceptorTest$StompFramePropertiesInterceptor");
return stompOutgoingInterceptor;
}

View File

@ -33,13 +33,13 @@ import org.apache.activemq.artemis.tests.util.Wait;
import org.junit.Assert;
import org.junit.Test;
public class StompTestWithInterceptors extends StompTestBase {
public class StompWithInterceptorsTest extends StompTestBase {
@Override
public List<String> getIncomingInterceptors() {
List<String> stompIncomingInterceptor = new ArrayList<>();
stompIncomingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompTestWithInterceptors$MyIncomingStompFrameInterceptor");
stompIncomingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompTestWithInterceptors$MyCoreInterceptor");
stompIncomingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompWithInterceptorsTest$MyIncomingStompFrameInterceptor");
stompIncomingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompWithInterceptorsTest$MyCoreInterceptor");
return stompIncomingInterceptor;
}
@ -47,7 +47,7 @@ public class StompTestWithInterceptors extends StompTestBase {
@Override
public List<String> getOutgoingInterceptors() {
List<String> stompOutgoingInterceptor = new ArrayList<>();
stompOutgoingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompTestWithInterceptors$MyOutgoingStompFrameInterceptor");
stompOutgoingInterceptor.add("org.apache.activemq.artemis.tests.integration.stomp.StompWithInterceptorsTest$MyOutgoingStompFrameInterceptor");
return stompOutgoingInterceptor;
}

View File

@ -36,7 +36,7 @@ import org.junit.runners.Parameterized;
@RunWith(Parameterized.class)
@Ignore
public class StompTestWithLargeMessages extends StompTestBase {
public class StompWithLargeMessagesTest extends StompTestBase {
// Web Socket has max frame size of 64kb. Large message tests only available over TCP.
@Parameterized.Parameters(name = "{0}")

View File

@ -29,7 +29,7 @@ import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConne
import org.junit.Assert;
import org.junit.Test;
public class StompTestWithMessageID extends StompTestBase {
public class StompWithMessageIDTest extends StompTestBase {
@Override
public boolean isEnableStompMessageId() {

View File

@ -25,7 +25,7 @@ import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConne
import org.junit.Assert;
import org.junit.Test;
public class StompTestWithSecurity extends StompTestBase {
public class StompWithSecurityTest extends StompTestBase {
@Override
public boolean isSecurityEnabled() {

View File

@ -33,6 +33,7 @@ import org.apache.activemq.artemis.jms.tests.ActiveMQServerTestCase;
import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
@ -883,7 +884,9 @@ public class SelectorTest extends ActiveMQServerTestCase {
// Test case proposed by a customer on this user forum:
// http://community.jboss.org/thread/153426?tstart=0
// This test needs to be moved away
public void disabled_testMultipleConsumers() throws Exception {
@Test
@Ignore
public void testMultipleConsumers() throws Exception {
Connection conn = null;
try {

View File

@ -19,6 +19,7 @@ package org.apache.activemq.artemis.tests.unit.core.server.group.impl;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.junit.Test;
public class SystemPropertyOverrideTest extends ActiveMQTestBase {
// Constants -----------------------------------------------------
@ -31,6 +32,7 @@ public class SystemPropertyOverrideTest extends ActiveMQTestBase {
// Public --------------------------------------------------------
@Test
public void testSystemPropertyOverride() throws Exception {
final String groupTimeoutPropertyValue = "1234";
final String reaperPeriodPropertyValue = "5678";