ZeromqComponent extends DefaultComponent { @Override protected ZeromqEndpoint createEndpoint(String uri, String remaining, Map<String, Object> params) throws Exception { ZeromqEndpoint e = new ZeromqEndpoint(uri, remaining, this); setProperties(e, params); return e; }    }
@Test public void testEndpointCreated() throws Exception { Map<String, Object> params = new HashMap<String, Object>(); String uri = "zeromq:tcp: String remaining = "tcp: ZeromqComponent comp = new ZeromqComponent(); comp.setCamelContext(context); ZeromqEndpoint endpoint = comp.createEndpoint(uri, remaining, params); assertNotNull(endpoint); }
@Test public void testPropertiesSet() throws Exception { Map<String, Object> params = new HashMap<String, Object>(); params.put("asyncConsumer", false); params.put("messageIdEnabled", true); params.put("topics", "coldplay,cream"); params.put("messageConvertor", ThreadDeath.class); params.put("socketType", ZeromqSocketType.PULL); params.put("linger", 100); params.put("highWaterMark", 51); String uri = "zeromq:tcp: String remaining = "tcp: ZeromqComponent comp = new ZeromqComponent(); comp.setCamelContext(context); ZeromqEndpoint endpoint = comp.createEndpoint(uri, remaining, params); assertEquals("tcp", endpoint.getProtocol()); assertEquals("localhost", endpoint.getHostname()); assertEquals(5555, endpoint.getPort()); assertEquals("coldplay,cream", endpoint.getTopics()); assertEquals(ZeromqSocketType.PULL, endpoint.getSocketType()); assertEquals(ThreadDeath.class, endpoint.getMessageConvertor()); assertEquals(100, endpoint.getLinger()); assertEquals(51, endpoint.getHighWaterMark()); assertFalse(endpoint.isAsyncConsumer()); assertTrue(endpoint.isMessageIdEnabled()); }