Search in sources :

Example 1 with PreClassParser

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

the class AbstractTextPropertyIntegrationTestCase method localClassSetUp.

public final void localClassSetUp() throws PersistenceLayerException {
    TokenRegistration.register(new PreLevelParser());
    TokenRegistration.register(new PreClassParser());
    TokenRegistration.register(new PreLevelWriter());
    TokenRegistration.register(new PreClassWriter());
    setClassSetUpFired(true);
}
Also used : PreClassParser(plugin.pretokens.parser.PreClassParser) PreLevelWriter(plugin.pretokens.writer.PreLevelWriter) PreClassWriter(plugin.pretokens.writer.PreClassWriter) PreLevelParser(plugin.pretokens.parser.PreLevelParser)

Example 2 with PreClassParser

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

the class PreClassLevelMaxRobin method setUp.

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

Example 3 with PreClassParser

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

the class PreClassRoundRobin method setUp.

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

Example 4 with PreClassParser

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

the class PreClassTest method testInvalidNegate.

/**
	 * Test that an error is produced if separators are incorrect
	 * @throws Exception
	 */
@Test
public void testInvalidNegate() throws Exception {
    try {
        PreClassParser parser = new PreClassParser();
        Prerequisite prereq = parser.parse("class", "1,Monk=1[Cleric=1]", false, false);
        fail("Should have thrown a PersistenceLayerException.");
    } catch (PersistenceLayerException e) {
    // Ignore, this is the expected result.
    }
}
Also used : PersistenceLayerException(pcgen.persistence.PersistenceLayerException) PreClassParser(plugin.pretokens.parser.PreClassParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 5 with PreClassParser

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

the class PreClassTest method testInvalidCharacter.

/**
	 * Test that an error is produced if separators are incorrect
	 * @throws Exception
	 */
@Test
public void testInvalidCharacter() throws Exception {
    try {
        PreClassParser parser = new PreClassParser();
        Prerequisite prereq = parser.parse("class", "1,Monk=1|Cleric=1", false, false);
        fail("Should have thrown a PersistenceLayerException.");
    } catch (PersistenceLayerException e) {
    // Ignore, this is the expected result.
    }
}
Also used : PersistenceLayerException(pcgen.persistence.PersistenceLayerException) PreClassParser(plugin.pretokens.parser.PreClassParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Aggregations

PreClassParser (plugin.pretokens.parser.PreClassParser)13 PreClassWriter (plugin.pretokens.writer.PreClassWriter)6 Test (org.junit.Test)4 Prerequisite (pcgen.core.prereq.Prerequisite)4 PreLevelParser (plugin.pretokens.parser.PreLevelParser)4 PreLevelWriter (plugin.pretokens.writer.PreLevelWriter)4 PersistenceLayerException (pcgen.persistence.PersistenceLayerException)3 Before (org.junit.Before)2 BeforeClass (org.junit.BeforeClass)2 PCClass (pcgen.core.PCClass)1 PlayerCharacter (pcgen.core.PlayerCharacter)1 LoadContext (pcgen.rules.context.LoadContext)1 PreClassLevelMaxParser (plugin.pretokens.parser.PreClassLevelMaxParser)1 PreRaceParser (plugin.pretokens.parser.PreRaceParser)1 PreRaceWriter (plugin.pretokens.writer.PreRaceWriter)1