Failure when parsing GeneratorFactory.parse("randompath(length(80))")
gw4e opened this issue · comments
Hi
The following parsing fails and it should not since length (integer) is a documented stop condition .
GeneratorFactory.parse("randompath(length(80))")
Adding the following test in GeneratorFactoryTest.java exhibit the problem :
@test
public void randompath_length_coverage() {
PathGenerator generator = GeneratorFactory.parse("randompath(length(80))");
Assert.assertThat(generator, instanceOf(RandomPath.class));
Assert.assertThat(generator.getStopCondition(), instanceOf(Length.class));
Assert.assertThat(((Length) generator.getStopCondition()).getLength(), is(80l));
}
Regards.
Looks like the class GeneratorLoader, that is used by the GeneratorFactory, doesn't support the Length condition. I guess that this was missed when the GeneratorLoader was implemented.
I created a pull request.
Fixed by PR #141