@Test public void testInitWhenParameterIsLesserThanZero() { int expected = GepardDataFeeder.INIT_FAILED_WITH_PARAMETER_ERROR; int actual = underTest.init("com.epam.test.TestClass", "-2", null); Assert.assertEquals(expected, actual); }
@Override public int init(final String testClassName, final String parameter, final Environment environment) { int returnValue = 0; try { multiplier = Integer.valueOf(parameter); if (multiplier <= 0) { returnValue = INIT_FAILED_WITH_PARAMETER_ERROR; } } catch (NumberFormatException e) { returnValue = INIT_FAILED_WITH_INVALID_PARAMETER; } return returnValue; }
BruteMultiplierDataFeeder implements GepardDataFeeder { @Override public int init(final String testClassName, final String parameter, final Environment environment) { int returnValue = 0; try { multiplier = Integer.valueOf(parameter); if (multiplier <= 0) { returnValue = INIT_FAILED_WITH_PARAMETER_ERROR; } } catch (NumberFormatException e) { returnValue = INIT_FAILED_WITH_INVALID_PARAMETER; } return returnValue; } }
BruteMultiplierDataFeeder implements GepardDataFeeder { @Override public int init(final String testClassName, final String parameter, final Environment environment) { int returnValue = 0; try { multiplier = Integer.valueOf(parameter); if (multiplier <= 0) { returnValue = INIT_FAILED_WITH_PARAMETER_ERROR; } } catch (NumberFormatException e) { returnValue = INIT_FAILED_WITH_INVALID_PARAMETER; } return returnValue; }  }
BruteMultiplierDataFeeder implements GepardDataFeeder { @Override public int init(final String testClassName, final String parameter, final Environment environment) { int returnValue = 0; try { multiplier = Integer.valueOf(parameter); if (multiplier <= 0) { returnValue = INIT_FAILED_WITH_PARAMETER_ERROR; } } catch (NumberFormatException e) { returnValue = INIT_FAILED_WITH_INVALID_PARAMETER; } return returnValue; }  @Override int init(final String testClassName, final String parameter, final Environment environment); @Override int calculateRuns(final String className, final int inputRows); @Override DataDrivenParameterArray calculateParameterArray(final String className, final DataDrivenParameterArray inputParameterArray); }
BruteMultiplierDataFeeder implements GepardDataFeeder { @Override public int init(final String testClassName, final String parameter, final Environment environment) { int returnValue = 0; try { multiplier = Integer.valueOf(parameter); if (multiplier <= 0) { returnValue = INIT_FAILED_WITH_PARAMETER_ERROR; } } catch (NumberFormatException e) { returnValue = INIT_FAILED_WITH_INVALID_PARAMETER; } return returnValue; }  @Override int init(final String testClassName, final String parameter, final Environment environment); @Override int calculateRuns(final String className, final int inputRows); @Override DataDrivenParameterArray calculateParameterArray(final String className, final DataDrivenParameterArray inputParameterArray);  }