|
Spring Framework example source code file (JmsDestinationAccessorTests.java)
The Spring Framework JmsDestinationAccessorTests.java source codepackage org.springframework.jms.support.destination; import junit.framework.TestCase; import org.easymock.MockControl; import org.springframework.test.AssertThrows; import javax.jms.ConnectionFactory; /** * Unit tests for the {@link JmsDestinationAccessor} class. * * @author Rick Evans */ public final class JmsDestinationAccessorTests extends TestCase { public void testChokesIfDestinationResolverIsetToNullExplcitly() throws Exception { MockControl mockConnectionFactory = MockControl.createControl(ConnectionFactory.class); final ConnectionFactory connectionFactory = (ConnectionFactory) mockConnectionFactory.getMock(); mockConnectionFactory.replay(); new AssertThrows(IllegalArgumentException.class) { public void test() throws Exception { JmsDestinationAccessor accessor = new StubJmsDestinationAccessor(); accessor.setConnectionFactory(connectionFactory); accessor.setDestinationResolver(null); accessor.afterPropertiesSet(); } }.runTest(); mockConnectionFactory.verify(); } public void testSessionTransactedModeReallyDoesDefaultToFalse() throws Exception { JmsDestinationAccessor accessor = new StubJmsDestinationAccessor(); assertFalse("The [pubSubDomain] property of JmsDestinationAccessor must default to " + "false (i.e. Queues are used by default). Change this test (and the " + "attendant Javadoc) if you have changed the default.", accessor.isPubSubDomain()); } private static class StubJmsDestinationAccessor extends JmsDestinationAccessor { } } Other Spring Framework examples (source code examples)Here is a short list of links related to this Spring Framework JmsDestinationAccessorTests.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.