/** * @return string for debugging purposes. */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "\n DiscoveredService" ); buf.append( "\n CacheNames = [" + getCacheNames() + "]" ); buf.append( "\n ServiceAddress = [" + getServiceAddress() + "]" ); buf.append( "\n ServicePort = [" + getServicePort() + "]" ); buf.append( "\n LastHearFromTime = [" + getLastHearFromTime() + "]" ); return buf.toString(); } }
/** * @return string for debugging purposes. */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "\n DiscoveredService" ); buf.append( "\n CacheNames = [" + getCacheNames() + "]" ); buf.append( "\n ServiceAddress = [" + getServiceAddress() + "]" ); buf.append( "\n ServicePort = [" + getServicePort() + "]" ); buf.append( "\n LastHearFromTime = [" + getLastHearFromTime() + "]" ); return buf.toString(); } }
if ( ( now - service.getLastHearFromTime() ) > ( maxIdleTimeSeconds * 1000 ) )
if ( ( now - service.getLastHearFromTime() ) > ( maxIdleTimeSeconds * 1000 ) )
assertEquals( "The match should have the new last heard from time.", service1.getLastHearFromTime(), discoveredService2.getLastHearFromTime() ); assertEquals( "The names should be updated.", service1.getCacheNames() + "", differentCacheNames + "" );
assertEquals( "The match should have the new last heard from time.", service1.getLastHearFromTime(), discoveredService2.getLastHearFromTime() ); assertEquals( "The names should be updated.", service1.getCacheNames() + "", differentCacheNames + "" );
assertEquals( "The match should have the new last heard from time.", service1.getLastHearFromTime(), discoveredService2.getLastHearFromTime() );
assertEquals( "The match should have the new last heard from time.", service1.getLastHearFromTime(), discoveredService2.getLastHearFromTime() );