test_class.declarator: spaceEnvironment
test_class.modifier: private
test_class.original_string: private StandaloneInteractiveSpacesEnvironment spaceEnvironment;
test_class.type: StandaloneInteractiveSpacesEnvironment
test_class.var_name: spaceEnvironment
test_class.declarator: restartable
test_class.modifier: private
test_class.original_string: private Restartable restartable;
test_class.type: Restartable
test_class.var_name: restartable
test_class.declarator: restartListener
test_class.modifier: private
test_class.original_string: private RestartStrategyListener restartListener;
test_class.type: RestartStrategyListener
test_class.var_name: restartListener
test_class.declarator: timeProvider
test_class.modifier: private
test_class.original_string: private TimeProvider timeProvider;
test_class.type: TimeProvider
test_class.var_name: timeProvider
test_class.file: interactivespaces-core/src/test/java/interactivespaces/util/process/restart/LimitedRetryRestartStrategyTest.java
test_class.identifier: LimitedRetryRestartStrategyTest
test_case.body: @Test
    public void testFailureFromListener() throws Exception {
      LimitedRetryRestartStrategy strategy = new LimitedRetryRestartStrategy(3, 20, 40, spaceEnvironment);
      strategy.addRestartStrategyListener(restartListener);
  
      Mockito.when(restartable.isRestarted()).thenReturn(false);
      Mockito.when(restartListener.onRestartAttempt(strategy, restartable, true)).thenReturn(false);
  
      Mockito.when(timeProvider.getCurrentTime()).thenReturn(0l, 100l);
  
      RestartStrategyInstance instance = strategy.newInstance(restartable);
  
      Thread.sleep(1000);
  
      Mockito.verify(restartable, Mockito.times(0)).attemptRestart();
      Mockito.verify(restartable, Mockito.times(1)).restartComplete(false);
      Mockito.verify(restartListener, Mockito.times(1)).onRestartFailure(strategy, restartable);
      Mockito.verify(restartListener, Mockito.times(1)).onRestartAttempt(strategy, restartable, true);
      Mockito.verify(restartListener, Mockito.times(0)).onRestartSuccess(strategy, restartable);
    }
test_case.class_method_signature: LimitedRetryRestartStrategyTest.testFailureFromListener()
test_case.full_signature: @Test public void testFailureFromListener()
test_case.identifier: testFailureFromListener
test_case.invocations: addRestartStrategyListener thenReturn when isRestarted thenReturn when onRestartAttempt thenReturn when getCurrentTime newInstance sleep attemptRestart verify times restartComplete verify times onRestartFailure verify times onRestartAttempt verify times onRestartSuccess verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFailureFromListener()
focal_class.declarator: numberRetries
focal_class.modifier: private final
focal_class.original_string: private final int numberRetries;
focal_class.type: int
focal_class.var_name: numberRetries
focal_class.declarator: sampleDelay
focal_class.modifier: private final
focal_class.original_string: private final long sampleDelay;
focal_class.type: long
focal_class.var_name: sampleDelay
focal_class.declarator: timeDurationSuccessfulRestart
focal_class.modifier: private final
focal_class.original_string: private final long timeDurationSuccessfulRestart;
focal_class.type: long
focal_class.var_name: timeDurationSuccessfulRestart
focal_class.declarator: spaceEnvironment
focal_class.modifier: private final
focal_class.original_string: private final InteractiveSpacesEnvironment spaceEnvironment;
focal_class.type: InteractiveSpacesEnvironment
focal_class.var_name: spaceEnvironment
focal_class.file: interactivespaces-core/src/main/java/interactivespaces/util/process/restart/LimitedRetryRestartStrategy.java
focal_class.identifier: LimitedRetryRestartStrategy
focal_class.class_method_signature: LimitedRetryRestartStrategy.LimitedRetryRestartStrategy(int numberRetries, long sampleDelay, long timeDurationSuccessfulRestart,
        InteractiveSpacesEnvironment spaceEnvironment)
focal_class.full_signature: public  LimitedRetryRestartStrategy(int numberRetries, long sampleDelay, long timeDurationSuccessfulRestart,
        InteractiveSpacesEnvironment spaceEnvironment)
focal_class.identifier: LimitedRetryRestartStrategy
focal_class.modifiers: public
focal_class.parameters: (int numberRetries, long sampleDelay, long timeDurationSuccessfulRestart,
        InteractiveSpacesEnvironment spaceEnvironment)
focal_class.signature:  LimitedRetryRestartStrategy(int numberRetries, long sampleDelay, long timeDurationSuccessfulRestart,
        InteractiveSpacesEnvironment spaceEnvironment)
focal_class.class_method_signature: LimitedRetryRestartStrategy.newInstance(T restartable)
focal_class.full_signature: @Override public RestartStrategyInstance<T> newInstance(T restartable)
focal_class.identifier: newInstance
focal_class.modifiers: @Override public
focal_class.parameters: (T restartable)
focal_class.return: RestartStrategyInstance<T>
focal_class.signature: RestartStrategyInstance<T> newInstance(T restartable)
focal_class.superclass: extends BaseRestartStrategy<T>
focal_method.body: @Override
    public RestartStrategyInstance<T> newInstance(T restartable) {
      LimitedRetryRestartStrategyInstance<T> instance =
          new LimitedRetryRestartStrategyInstance<T>(restartable, this, numberRetries, sampleDelay,
              timeDurationSuccessfulRestart, spaceEnvironment.getTimeProvider(), spaceEnvironment.getExecutorService());
      instance.startRestartAttempts();
  
      return instance;
    }
focal_method.class_method_signature: LimitedRetryRestartStrategy.newInstance(T restartable)
focal_method.full_signature: @Override public RestartStrategyInstance<T> newInstance(T restartable)
focal_method.identifier: newInstance
focal_method.invocations: getTimeProvider getExecutorService startRestartAttempts
focal_method.modifiers: @Override public
focal_method.parameters: (T restartable)
focal_method.return: RestartStrategyInstance<T>
focal_method.signature: RestartStrategyInstance<T> newInstance(T restartable)