public class TransportChannelProviderTest extends TestCase {
public void testVmChannelWithProperties() throws Exception {
TransportChannel channel = createChannel("vm://localhost:0?asyncSend=true&sendCapacity=100&receiveCapacity=20");
assertTrue(channel instanceof VmTransportChannel);
VmTransportChannel vmChannel = (VmTransportChannel) channel;
assertEquals("sendCapacity", 100, vmChannel.getSendCapacity());
assertEquals("receiveCapacity", 20, vmChannel.getReceiveCapacity());
assertEquals("asyncSend", true, vmChannel.isAsyncSend());
vmChannel.start();
assertTrue("has send channel", vmChannel.getSendChannel() != null);
assertTrue("has receive channel", vmChannel.getReceiveChannel() != null);
vmChannel.stop();
vmChannel = (VmTransportChannel) createChannel("vm://localhost?receiveCapacity=20");
vmChannel.start();
assertTrue("has no send channel", vmChannel.getSendChannel() == null);
assertTrue("has receive channel", vmChannel.getReceiveChannel() == null);
vmChannel.stop();
}