Esempio n. 1
0
  public void testIsFulfilled()
      throws StopConditionException, GeneratorException, InterruptedException {
    ModelBasedTesting mbt = ModelBasedTesting.getInstance();
    mbt.setGraph(graph);
    mbt.setGenerator(new RandomPathGenerator(new EdgeCoverage()));
    assertTrue(mbt.hasNextStep());

    assertEquals(false, mbt.getGenerator().getStopCondition().isFulfilled());
    mbt.getNextStep();
    assertEquals(false, mbt.getGenerator().getStopCondition().isFulfilled());
    mbt.getNextStep();
    assertEquals(true, mbt.getGenerator().getStopCondition().isFulfilled());
  }
Esempio n. 2
0
  public void testFulfillment()
      throws StopConditionException, GeneratorException, InterruptedException {
    ModelBasedTesting mbt = ModelBasedTesting.getInstance();
    mbt.setGraph(graph);
    mbt.setGenerator(new RandomPathGenerator(new EdgeCoverage()));
    assertTrue(mbt.hasNextStep());

    assertEquals((double) 0 / 2, mbt.getGenerator().getStopCondition().getFulfilment(), 0.01);
    mbt.getNextStep();
    assertEquals((double) 1 / 2, mbt.getGenerator().getStopCondition().getFulfilment(), 0.01);
    mbt.getNextStep();
    assertEquals((double) 2 / 2, mbt.getGenerator().getStopCondition().getFulfilment(), 0.01);
  }