Search in sources :

Example 16 with PreAbilityParser

use of plugin.pretokens.parser.PreAbilityParser in project pcgen by PCGen.

the class PreAbilityParserTest method testTwoCategories.

/**
	 * Test that an error is produced if two categories are specified.
	 * @throws Exception
	 */
@Test
public void testTwoCategories() throws Exception {
    try {
        PreAbilityParser parser = new PreAbilityParser();
        Prerequisite prereq = parser.parse("ability", "1,CATEGORY.Mutation,KEY_a,CATEGORY.Foo", false, false);
        fail("Should have thrown a PersistenceLayerException.");
    } catch (PersistenceLayerException e) {
    // Ignore, this is the expected result.
    }
}
Also used : PreAbilityParser(plugin.pretokens.parser.PreAbilityParser) PersistenceLayerException(pcgen.persistence.PersistenceLayerException) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 17 with PreAbilityParser

use of plugin.pretokens.parser.PreAbilityParser in project pcgen by PCGen.

the class PreAbilityRoundRobin method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    TokenRegistration.register(new PreAbilityParser());
    TokenRegistration.register(new PreAbilityWriter());
}
Also used : PreAbilityParser(plugin.pretokens.parser.PreAbilityParser) PreAbilityWriter(plugin.pretokens.writer.PreAbilityWriter)

Aggregations

PreAbilityParser (plugin.pretokens.parser.PreAbilityParser)17 Ability (pcgen.core.Ability)8 PlayerCharacter (pcgen.core.PlayerCharacter)8 Prerequisite (pcgen.core.prereq.Prerequisite)8 Test (org.junit.Test)7 PersistenceLayerException (pcgen.persistence.PersistenceLayerException)3 AbilityFacade (pcgen.facade.core.AbilityFacade)1 PreAbilityWriter (plugin.pretokens.writer.PreAbilityWriter)1