Java Code Examples for javax.jms.TopicConnection#stop()

The following examples show how to use javax.jms.TopicConnection#stop() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SingleConnectionFactoryTests.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Test
public void testWithTopicConnection() throws JMSException {
	Connection con = mock(TopicConnection.class);

	SingleConnectionFactory scf = new SingleConnectionFactory(con);
	TopicConnection con1 = scf.createTopicConnection();
	con1.start();
	con1.stop();
	con1.close();
	TopicConnection con2 = scf.createTopicConnection();
	con2.start();
	con2.stop();
	con2.close();
	scf.destroy();  // should trigger actual close

	verify(con, times(2)).start();
	verify(con, times(2)).stop();
	verify(con).close();
	verifyNoMoreInteractions(con);
}
 
Example 2
Source File: SingleConnectionFactoryTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Test
public void testWithTopicConnection() throws JMSException {
	Connection con = mock(TopicConnection.class);

	SingleConnectionFactory scf = new SingleConnectionFactory(con);
	TopicConnection con1 = scf.createTopicConnection();
	con1.start();
	con1.stop();
	con1.close();
	TopicConnection con2 = scf.createTopicConnection();
	con2.start();
	con2.stop();
	con2.close();
	scf.destroy();  // should trigger actual close

	verify(con, times(2)).start();
	verify(con, times(2)).stop();
	verify(con).close();
	verifyNoMoreInteractions(con);
}
 
Example 3
Source File: SingleConnectionFactoryTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Test
public void testWithTopicConnection() throws JMSException {
	Connection con = mock(TopicConnection.class);

	SingleConnectionFactory scf = new SingleConnectionFactory(con);
	TopicConnection con1 = scf.createTopicConnection();
	con1.start();
	con1.stop();
	con1.close();
	TopicConnection con2 = scf.createTopicConnection();
	con2.start();
	con2.stop();
	con2.close();
	scf.destroy();  // should trigger actual close

	verify(con, times(2)).start();
	verify(con, times(2)).stop();
	verify(con).close();
	verifyNoMoreInteractions(con);
}