Object obj = waitForMessage();
Object obj = waitForMessage();
/** * Test sending a request broadcast. * <p> * @throws Exception on error */ public void testRequestBroadcast() throws Exception { // DO WORK sender.requestBroadcast(); // VERIFY // grab the sent message Object obj = receiver.waitForMessage(); assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; assertEquals( "wrong message type", BroadcastType.REQUEST, msg.getMessageType() ); } }
/** * Test sending a request broadcast. * <p> * @throws Exception on error */ public void testRequestBroadcast() throws Exception { // DO WORK sender.requestBroadcast(); // VERIFY // grab the sent message Object obj = receiver.waitForMessage(); assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; assertEquals( "wrong message type", BroadcastType.REQUEST, msg.getMessageType() ); } }
/** * Test sending a live messages. * <p> * @throws Exception on error */ public void testPassiveBroadcast() throws Exception { // SETUP ArrayList<String> cacheNames = new ArrayList<String>(); // DO WORK sender.passiveBroadcast( SENDING_HOST, SENDING_PORT, cacheNames, 1L ); // VERIFY // grab the sent message Object obj = receiver.waitForMessage() ; assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; // disabled test because of JCS-89 // assertEquals( "wrong host", SENDING_HOST, msg.getHost() ); assertEquals( "wrong port", SENDING_PORT, msg.getPort() ); assertEquals( "wrong message type", BroadcastType.PASSIVE, msg.getMessageType() ); }
/** * Test sending a live messages. * <p> * @throws Exception on error */ public void testPassiveBroadcast() throws Exception { // SETUP ArrayList<String> cacheNames = new ArrayList<String>(); // DO WORK sender.passiveBroadcast( SENDING_HOST, SENDING_PORT, cacheNames, 1L ); // VERIFY // grab the sent message Object obj = receiver.waitForMessage() ; assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; // disabled test because of JCS-89 // assertEquals( "wrong host", SENDING_HOST, msg.getHost() ); assertEquals( "wrong port", SENDING_PORT, msg.getPort() ); assertEquals( "wrong message type", BroadcastType.PASSIVE, msg.getMessageType() ); }
/** * Test sending a remove broadcast. * <p> * @throws Exception on error */ public void testRemoveBroadcast() throws Exception { // SETUP ArrayList<String> cacheNames = new ArrayList<String>(); // DO WORK sender.removeBroadcast( SENDING_HOST, SENDING_PORT, cacheNames, 1L ); // VERIFY // grab the sent message Object obj = receiver.waitForMessage(); assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; // disabled test because of JCS-89 // assertEquals( "wrong host", SENDING_HOST, msg.getHost() ); assertEquals( "wrong port", SENDING_PORT, msg.getPort() ); assertEquals( "wrong message type", BroadcastType.REMOVE, msg.getMessageType() ); }
/** * Test sending a remove broadcast. * <p> * @throws Exception on error */ public void testRemoveBroadcast() throws Exception { // SETUP ArrayList<String> cacheNames = new ArrayList<String>(); // DO WORK sender.removeBroadcast( SENDING_HOST, SENDING_PORT, cacheNames, 1L ); // VERIFY // grab the sent message Object obj = receiver.waitForMessage(); assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; // disabled test because of JCS-89 // assertEquals( "wrong host", SENDING_HOST, msg.getHost() ); assertEquals( "wrong port", SENDING_PORT, msg.getPort() ); assertEquals( "wrong message type", BroadcastType.REMOVE, msg.getMessageType() ); }