/** * Tries to lookup the server. If unsuccessful it will rebind the server using the factory * rebind method. * <p> */ @Override public void run() { checkAndRestoreIfNeeded(); }
/** * Tries to lookup the server. If unsuccessful it will rebind the server using the factory * rebind method. * <p> */ @Override public void run() { checkAndRestoreIfNeeded(); }
/** Verify that we get the appropriate event log */ public void testCheckAndRestoreIfNeeded_failure() { // SETUP String host = "localhost"; int port = 1234; String service = "doesn'texist"; MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service ); runner.setCacheEventLogger( cacheEventLogger ); // DO WORK runner.checkAndRestoreIfNeeded(); // VERIFY // 1 for the lookup, one for the rebind since the server isn't created yet assertEquals( "error tally", 2, cacheEventLogger.errorEventCalls ); //System.out.println( cacheEventLogger.errorMessages ); } }
/** Verify that we get the appropriate event log */ public void testCheckAndRestoreIfNeeded_failure() { // SETUP String host = "localhost"; int port = 1234; String service = "doesn'texist"; MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service ); runner.setCacheEventLogger( cacheEventLogger ); // DO WORK runner.checkAndRestoreIfNeeded(); // VERIFY // 1 for the lookup, one for the rebind since the server isn't created yet assertEquals( "error tally", 2, cacheEventLogger.errorEventCalls ); //System.out.println( cacheEventLogger.errorMessages ); } }