discoveredService.setServiceAddress( message.getHost() ); discoveredService.setCacheNames( message.getCacheNames() ); discoveredService.setServicePort( message.getPort() ); discoveredService.setLastHearFromTime( System.currentTimeMillis() );
discoveredService.setServiceAddress( message.getHost() ); discoveredService.setCacheNames( message.getCacheNames() ); discoveredService.setServicePort( message.getPort() ); discoveredService.setLastHearFromTime( System.currentTimeMillis() );
/** * 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() ); }