git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1166164 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2011-09-07 13:19:49 +00:00
parent 6e6d8605d3
commit 9529b24046
9 changed files with 29 additions and 67 deletions

View File

@ -32,7 +32,7 @@ import javax.jms.Session;
import javax.jms.TemporaryQueue;
/**
*
*
*/
public class TempQueueMemoryTest extends EmbeddedBrokerTestSupport {
protected Connection serverConnection;
@ -46,13 +46,13 @@ public class TempQueueMemoryTest extends EmbeddedBrokerTestSupport {
protected boolean clientTransactional = false;
protected int numConsumers = 1;
protected int numProducers = 1;
public void testConcurrentProducerRequestReply() throws Exception {
numProducers = 10;
testLoadRequestReply();
}
public void testLoadRequestReply() throws Exception {
for (int i=0; i< numConsumers; i++) {
serverSession.createConsumer(serverDestination).setMessageListener(new MessageListener() {
@ -66,24 +66,23 @@ public class TempQueueMemoryTest extends EmbeddedBrokerTestSupport {
}
producer.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
class Producer extends Thread {
private int numToSend;
public Producer(int numToSend) {
this.numToSend = numToSend;
}
public void run() {
public void run() {
try {
Session session = clientConnection.createSession(clientTransactional,
Session session = clientConnection.createSession(clientTransactional,
clientTransactional ? Session.SESSION_TRANSACTED : Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(serverDestination);
for (int i =0; i< numToSend; i++) {
TemporaryQueue replyTo = session.createTemporaryQueue();
MessageConsumer consumer = session.createConsumer(replyTo);
@ -105,7 +104,6 @@ public class TempQueueMemoryTest extends EmbeddedBrokerTestSupport {
}
}
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@ -115,27 +113,27 @@ public class TempQueueMemoryTest extends EmbeddedBrokerTestSupport {
threads.add(new Producer(messagesToSend/numProducers));
}
startAndJoinThreads(threads);
clientSession.close();
serverSession.close();
clientConnection.close();
serverConnection.close();
AdvisoryBroker ab = (AdvisoryBroker) broker.getBroker().getAdaptor(
AdvisoryBroker.class);
///The server destination will be left
assertTrue(ab.getAdvisoryDestinations().size() == 1);
assertTrue("should be zero but is "+ab.getAdvisoryConsumers().size(),ab.getAdvisoryConsumers().size() == 0);
assertTrue("should be zero but is "+ab.getAdvisoryProducers().size(),ab.getAdvisoryProducers().size() == 0);
RegionBroker rb = (RegionBroker) broker.getBroker().getAdaptor(
RegionBroker.class);
//serverDestination +
assertEquals(6, rb.getDestinationMap().size());
//serverDestination +
assertEquals(6, rb.getDestinationMap().size());
}
private void startAndJoinThreads(Vector<Thread> threads) throws Exception {
@ -159,15 +157,15 @@ public class TempQueueMemoryTest extends EmbeddedBrokerTestSupport {
}
protected void tearDown() throws Exception {
super.tearDown();
serverTransactional = clientTransactional = false;
numConsumers = numProducers = 1;
messagesToSend = 2000;
}
protected ActiveMQDestination createDestination() {
return new ActiveMQQueue(getClass().getName());
}
}

View File

@ -38,7 +38,7 @@ import javax.jms.Session;
import javax.jms.TextMessage;
/**
*
*
*/
public abstract class CursorSupport extends CombinationTestSupport {
@ -124,7 +124,6 @@ public abstract class CursorSupport extends CombinationTestSupport {
// using the cursor on the broker
Thread.sleep(50);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
consumerList.add(msg);
@ -158,7 +157,7 @@ public abstract class CursorSupport extends CombinationTestSupport {
assertEquals("This should be the same at pos " + i + " in the list", sent.getJMSMessageID(), consumed.getJMSMessageID());
}
}
protected Connection getConsumerConnection(ConnectionFactory fac) throws JMSException {
Connection connection = fac.createConnection();
connection.setClientID("testConsumer");

View File

@ -24,7 +24,7 @@ import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
*
*
*/
public class DummyPolicyTest extends SpringTestSupport {
@ -37,7 +37,6 @@ public class DummyPolicyTest extends SpringTestSupport {
}
protected AbstractApplicationContext createApplicationContext() {
// TODO Auto-generated method stub
return new ClassPathXmlApplicationContext("org/apache/activemq/filter/dummyPolicy.xml");
}

View File

@ -69,7 +69,6 @@ public class SimpleNetworkTest extends org.apache.activemq.TestSupport {
textMsg.setText(payload);
remoteProducer.send(replyTo, textMsg);
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@ -168,8 +167,8 @@ public class SimpleNetworkTest extends org.apache.activemq.TestSupport {
for (int i = 0; i < MESSAGE_COUNT / 2; i++) {
assertNotNull("message count: " + i, remoteConsumer.receive(2500));
}
}
}
@Override
protected void setUp() throws Exception {
setAutoFail(true);

View File

@ -104,7 +104,6 @@ public class QueueBridgeTest extends TestCase implements MessageListener {
textMsg.setText(payload);
requestServerProducer.send(replyTo, textMsg);
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

View File

@ -99,7 +99,6 @@ public class TopicBridgeSpringTest extends TestCase implements MessageListener {
LOG.info("Sending response: " + textMsg);
requestServerProducer.send(replyTo, textMsg);
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

View File

@ -30,7 +30,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
*
*/
public class PerfConsumer implements MessageListener {
private static final Logger LOG = LoggerFactory.getLogger(PerfConsumer.class);
@ -98,7 +98,6 @@ public class PerfConsumer implements MessageListener {
}
lastMsgId=msg.getJMSMessageID();
} catch (JMSException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {

View File

@ -21,12 +21,11 @@ import javax.jms.JMSException;
import javax.jms.Session;
/**
*
*
*/
public class TemporaryTopicMemoryAllocationTest extends MemoryAllocationTest {
public TemporaryTopicMemoryAllocationTest() {
super();
// TODO Auto-generated constructor stub
}
protected Destination getDestination(Session session) throws JMSException {

View File

@ -25,7 +25,7 @@ import java.util.Date;
import java.util.Set;
public class StubX509Certificate extends X509Certificate {
private final Principal id;
public StubX509Certificate(Principal id) {
@ -38,129 +38,100 @@ public class StubX509Certificate extends X509Certificate {
// --- Stubbed Methods ---
public void checkValidity() {
// TODO Auto-generated method stub
}
public void checkValidity(Date arg0) {
// TODO Auto-generated method stub
}
public int getVersion() {
// TODO Auto-generated method stub
return 0;
}
public BigInteger getSerialNumber() {
// TODO Auto-generated method stub
return null;
}
public Principal getIssuerDN() {
// TODO Auto-generated method stub
return null;
}
public Date getNotBefore() {
// TODO Auto-generated method stub
return null;
}
public Date getNotAfter() {
// TODO Auto-generated method stub
return null;
}
public byte[] getTBSCertificate() {
// TODO Auto-generated method stub
return null;
}
public byte[] getSignature() {
// TODO Auto-generated method stub
return null;
}
public String getSigAlgName() {
// TODO Auto-generated method stub
return null;
}
public String getSigAlgOID() {
// TODO Auto-generated method stub
return null;
}
public byte[] getSigAlgParams() {
// TODO Auto-generated method stub
return null;
}
public boolean[] getIssuerUniqueID() {
// TODO Auto-generated method stub
return null;
}
public boolean[] getSubjectUniqueID() {
// TODO Auto-generated method stub
return null;
}
public boolean[] getKeyUsage() {
// TODO Auto-generated method stub
return null;
}
public int getBasicConstraints() {
// TODO Auto-generated method stub
return 0;
}
public byte[] getEncoded() {
// TODO Auto-generated method stub
return null;
}
public void verify(PublicKey arg0) {
// TODO Auto-generated method stub
}
public void verify(PublicKey arg0, String arg1) {
// TODO Auto-generated method stub
}
public String toString() {
// TODO Auto-generated method stub
return null;
}
public PublicKey getPublicKey() {
// TODO Auto-generated method stub
return null;
}
public boolean hasUnsupportedCriticalExtension() {
// TODO Auto-generated method stub
return false;
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public Set getCriticalExtensionOIDs() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public Set getNonCriticalExtensionOIDs() {
// TODO Auto-generated method stub
return null;
}
public byte[] getExtensionValue(String arg0) {
// TODO Auto-generated method stub
return null;
}