public static void main(String[] args) throws Exception { Protocol[] prot_stack={ new UDP().setValue("bind_addr", InetAddress.getByName("127.0.0.1")), new PING(), new MERGE3(),
public void channelLookupTest() { when(mockChannel.getAddress()).thenReturn(a); when(mockChannel.down(isA(Event.class))).thenReturn(a); when(mockChannel.getView()).thenReturn(v); when(mockChannel.getProtocolStack()).thenReturn(ps); when(ps.getTransport()).thenReturn(new UDP()); EmbeddedCacheManager cm = null; try { GlobalConfigurationBuilder gc = GlobalConfigurationBuilder.defaultClusteredBuilder(); gc.transport().defaultTransport().addProperty("channelLookup", DummyLookup.class.getName()); cm = TestCacheManagerFactory.createClusteredCacheManager(gc, new ConfigurationBuilder()); cm.start(); cm.getCache(); GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(cm); Transport t = gcr.getComponent(Transport.class); assertNotNull(t); assertTrue(t instanceof JGroupsTransport); assertNotSame(JChannel.class, ((JGroupsTransport) t).getChannel().getClass()); } finally { TestingUtil.killCacheManagers(cm); } }
public static void main(String[] args) throws Exception { Protocol[] prot_stack={ new UDP().setValue("bind_addr", InetAddress.getByName("127.0.0.1")), new PING(), new MERGE3(),