@Test
public void testPublish() {

	t1.advertise();
	while (DummyHandler.latest == null) {
		Thread.yield();
	}
	DummyHandler.latest = null;
	t1.publish(new Message("{\"test1\":\"test2\"}"));
	while (DummyHandler.latest == null) {
		Thread.yield();
	}
	assertNotNull(DummyHandler.latest);
	assertEquals(
			"{\"op\":\"publish\",\"id\":\"publish:myTopic1:1\",\"topic\":\"myTopic1\""
					+ ",\"msg\":{\"test1\":\"test2\"}}",
			DummyHandler.latest.toString());
	assertTrue(t1.isAdvertised());
	assertFalse(t1.isSubscribed());
}