@Test public void testGetNotify() throws Exception { Notify notify1 = APP.getNotify("/notify/test"); Notify notify2 = APP.getNotify("/notify/test/tmp"); Notify notify3 = APP.getNotify(new String("/notify/test/tmp")); assertNotEquals(notify1, notify2); assertEquals(notify3, notify2); }
/** * Rigorous Test :-) * * @throws IOException */ @Test public void testInstanceProp() throws IOException { App app = App.instance(); Notify notify = app.getNotify("/notify/test"); notify.replaceProperty("a".getBytes(), "I Love it.".getBytes()); byte[] v = notify.getProperty("a".getBytes()); System.out.println(new String(v)); }
@Test(expected = NullPointerException.class) public void testClose() throws Exception { App app = new App(URL, 10000); app.notifyMap = null; try { app.getNotify("/notify/test"); } finally { app.close(); } }
/** * Rigorous Test :-) * * @throws IOException */ @Test public void testAppNull() throws IOException { App app = App.instance(); Notify notify = app.getNotify("/notify/test/tmplevt"); assertNull(notify); }