use of plugin.pretokens.parser.PreRaceParser in project pcgen by PCGen.
the class PreRaceParserTest method testExclusions.
/**
* Test that exclusions are parsed properly.
* @throws Exception
*/
@Test
public void testExclusions() throws Exception {
PreRaceParser parser = new PreRaceParser();
Prerequisite prereq = parser.parse("race", "1,Elf%,[Elf (aquatic)]", false, false);
assertEquals("PRERACE with an excluded race", "<prereq operator=\"GTEQ\" operand=\"2\" >\n" + "<prereq kind=\"race\" count-multiples=\"true\" key=\"Elf%\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"race\" count-multiples=\"true\" key=\"Elf (aquatic)\" operator=\"LT\" operand=\"1\" >\n" + "</prereq>\n</prereq>\n", prereq.toString());
}
use of plugin.pretokens.parser.PreRaceParser in project pcgen by PCGen.
the class AbilityLstTest method setUp.
@Override
public void setUp() throws PersistenceLayerException, URISyntaxException {
super.setUp();
TokenRegistration.register(new PreRaceParser());
TokenRegistration.register(new PreRaceWriter());
TokenRegistration.register(new PreLevelParser());
TokenRegistration.register(new PreLevelWriter());
TokenRegistration.register(new PreClassParser());
TokenRegistration.register(new PreClassWriter());
}
use of plugin.pretokens.parser.PreRaceParser in project pcgen by PCGen.
the class PreRaceParserTest method testInvalidSeparators.
/**
* Test that an error is produced if separators are incorrect
* @throws Exception
*/
@Test
public void testInvalidSeparators() throws Exception {
try {
PreRaceParser parser = new PreRaceParser();
Prerequisite prereq = parser.parse("race", "1,,KEY_a", false, false);
fail("Should have thrown a PersistenceLayerException.");
} catch (PersistenceLayerException e) {
// Ignore, this is the expected result.
}
}
use of plugin.pretokens.parser.PreRaceParser in project pcgen by PCGen.
the class PreRaceParserTest method testInvalidCharacter.
/**
* Test that an error is produced if separators are incorrect
* @throws Exception
*/
@Test
public void testInvalidCharacter() throws Exception {
try {
PreRaceParser parser = new PreRaceParser();
Prerequisite prereq = parser.parse("race", "1,KEY_a|Key_b", false, false);
fail("Should have thrown a PersistenceLayerException.");
} catch (PersistenceLayerException e) {
// Ignore, this is the expected result.
}
}
use of plugin.pretokens.parser.PreRaceParser in project pcgen by PCGen.
the class PreRaceRoundRobin method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
TokenRegistration.register(new PreRaceParser());
TokenRegistration.register(new PreRaceWriter());
}
Aggregations