Package dk.netarkivet.common.distribute
Class JMSConnectionTester
- java.lang.Object
-
- dk.netarkivet.common.distribute.JMSConnectionTester
-
public class JMSConnectionTester extends Object
Tests JMSConnection, the class that handles all JMS operations for Netarkivet.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JMSConnectionTester.DummyServer
-
Constructor Summary
Constructors Constructor Description JMSConnectionTester()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
void
tearDown()
void
testFakeJMSConnection()
Test that asking for a fake JMSConnection actually gets you just that.void
testGetConsumerKey()
void
testInitConnection()
Tests that initconnection actually starts a topic connection and a queue connection.void
testReply()
void
testResendArgumentsNotNull()
Test resend() methods arguments.void
testResendCorrectSendBehaviour()
Test the resend method.void
testSendToQueue()
void
testSendToTopic()
void
testSetListener()
void
testUnpackInvalidPayload()
Tests for correct error handling if ObjectMessage has the wrong payload.void
testUnpackOfCorrectPayload()
Tests if correct payload is unwrapped.void
testUnpackParameterIsAnObjectMessage()
Tests for wrong parameters.void
testUnpackParameterIsNull()
Tests for null parameters.
-
-
-
Method Detail
-
setUp
public void setUp()
-
tearDown
public void tearDown()
-
testFakeJMSConnection
public void testFakeJMSConnection()
Test that asking for a fake JMSConnection actually gets you just that.
-
testUnpackParameterIsNull
public void testUnpackParameterIsNull()
Tests for null parameters.
-
testUnpackParameterIsAnObjectMessage
public void testUnpackParameterIsAnObjectMessage()
Tests for wrong parameters.
-
testUnpackInvalidPayload
public void testUnpackInvalidPayload()
Tests for correct error handling if ObjectMessage has the wrong payload.
-
testUnpackOfCorrectPayload
public void testUnpackOfCorrectPayload()
Tests if correct payload is unwrapped.
-
testResendArgumentsNotNull
public void testResendArgumentsNotNull()
Test resend() methods arguments.
-
testResendCorrectSendBehaviour
public void testResendCorrectSendBehaviour()
Test the resend method. Message shouldn't be sent according to the address specified in the "to" field of the message. It should be sent to the address given in the "to" parameter of the resend() method.
-
testInitConnection
public void testInitConnection() throws Exception
Tests that initconnection actually starts a topic connection and a queue connection.- Throws:
Exception
- On failures
-
testSendToQueue
public void testSendToQueue() throws javax.jms.JMSException, NoSuchFieldException, IllegalAccessException
- Throws:
javax.jms.JMSException
NoSuchFieldException
IllegalAccessException
-
testSendToTopic
public void testSendToTopic() throws javax.jms.JMSException, NoSuchFieldException, IllegalAccessException
- Throws:
javax.jms.JMSException
NoSuchFieldException
IllegalAccessException
-
testSetListener
public void testSetListener() throws javax.jms.JMSException, NoSuchFieldException, IllegalAccessException
- Throws:
javax.jms.JMSException
NoSuchFieldException
IllegalAccessException
-
testGetConsumerKey
public void testGetConsumerKey() throws NoSuchMethodException, IllegalAccessException
-
testReply
public void testReply() throws javax.jms.JMSException, NoSuchFieldException, IllegalAccessException
- Throws:
javax.jms.JMSException
NoSuchFieldException
IllegalAccessException
-
-