@Test(dataProvider = "getOutputDurationDP") public void getOutputDuration(TestCaseState state, Date startDate, Date stopDate, String expectedOutputDuration) { TestCase tc = new TestCase("testCase", "testCaseId"); tc.setStartDate(startDate); tc.setStopDate(stopDate); tc.setState(state); GetOutputDurationFunction getOutputDurationFunction = new GetOutputDurationFunction(); assertEquals(getOutputDurationFunction.execute(Arrays.asList(tc)), expectedOutputDuration); }
@Override protected Object execute(List<Object> arguments) { AbstractTestDataEntity testDataEntity = (AbstractTestDataEntity) arguments.get(0); if (testDataEntity == null || testDataEntity.getState().isError() || testDataEntity.getDuration() < 0) { return UNKNOWN_DURATION; } return String.format(Locale.ENGLISH, "%.2fs", testDataEntity.getDuration()); }
GetOutputDurationFunction extends AbstractFunction { @Override protected Object execute(List<Object> arguments) { AbstractTestDataEntity testDataEntity = (AbstractTestDataEntity) arguments.get(0); if (testDataEntity == null || testDataEntity.getState().isError() || testDataEntity.getDuration() < 0) { return UNKNOWN_DURATION; } return String.format(Locale.ENGLISH, "%.2fs", testDataEntity.getDuration()); } }
GetOutputDurationFunction extends AbstractFunction { @Override protected Object execute(List<Object> arguments) { AbstractTestDataEntity testDataEntity = (AbstractTestDataEntity) arguments.get(0); if (testDataEntity == null || testDataEntity.getState().isError() || testDataEntity.getDuration() < 0) { return UNKNOWN_DURATION; } return String.format(Locale.ENGLISH, "%.2fs", testDataEntity.getDuration()); }  }
GetOutputDurationFunction extends AbstractFunction { @Override protected Object execute(List<Object> arguments) { AbstractTestDataEntity testDataEntity = (AbstractTestDataEntity) arguments.get(0); if (testDataEntity == null || testDataEntity.getState().isError() || testDataEntity.getDuration() < 0) { return UNKNOWN_DURATION; } return String.format(Locale.ENGLISH, "%.2fs", testDataEntity.getDuration()); }  @Override String name(); }
GetOutputDurationFunction extends AbstractFunction { @Override protected Object execute(List<Object> arguments) { AbstractTestDataEntity testDataEntity = (AbstractTestDataEntity) arguments.get(0); if (testDataEntity == null || testDataEntity.getState().isError() || testDataEntity.getDuration() < 0) { return UNKNOWN_DURATION; } return String.format(Locale.ENGLISH, "%.2fs", testDataEntity.getDuration()); }  @Override String name();  }