SleepTimeRunner implements Runner { @Override public String execute() { String sleepTime = testStep.getValue(); long sleepValue = 0; try { sleepValue = Long.parseLong(eval(sleepTime, variables)); } catch (NumberFormatException e1) { LOG.warn(LogUtil.getLogMessage("Error parsing min Sleep Time from step " + testPlanName) + " with value of " + sleepTime); } if (sleepValue < 1) { sleepValue = 1; } LOG.debug("Sleeping for " + sleepValue); if (APITestHarness.getInstance().hasMetSimulationTime() && LOG.isDebugEnabled()) { LOG.debug(LogUtil.getLogMessage("Sleeping for " + sleepValue + "ms. after simulation time has been met with at step " + testPlanName + ".")); } sleep(sleepValue); return TankConstants.HTTP_CASE_PASS; } SleepTimeRunner(TestStepContext tsc); @Override String execute();  }
@Test public void testExecute_1() throws Exception { TestPlanRunner testPlanRunner = new TestPlanRunner(new HDTestPlan(), 1, "com.intuit.tank.runner.TestHttpClient"); testPlanRunner.setHttpClient(null); TestStepContext testStepContext = new TestStepContext(new SleepTimeStep(), new Variables(), "", "", new TimerMap(), testPlanRunner); SleepTimeRunner fixture = new SleepTimeRunner(testStepContext); String result = fixture.execute(); assertNotNull(result); }
@Test public void testExecute_2() throws Exception { TestPlanRunner testPlanRunner = new TestPlanRunner(new HDTestPlan(), 1, "com.intuit.tank.runner.TestHttpClient"); testPlanRunner.setHttpClient(null); TestStepContext testStepContext = new TestStepContext(new SleepTimeStep(), new Variables(), "", "", new TimerMap(), testPlanRunner); SleepTimeRunner fixture = new SleepTimeRunner(testStepContext); String result = fixture.execute(); assertNotNull(result); }
@Test public void testExecute_3() throws Exception { TestPlanRunner testPlanRunner = new TestPlanRunner(new HDTestPlan(), 1, "com.intuit.tank.runner.TestHttpClient"); testPlanRunner.setHttpClient(null); TestStepContext testStepContext = new TestStepContext(new SleepTimeStep(), new Variables(), "", "", new TimerMap(), testPlanRunner); SleepTimeRunner fixture = new SleepTimeRunner(testStepContext); String result = fixture.execute(); assertNotNull(result); }