Search in sources :

Example 1 with PreTypeParser

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

the class PreTypeRoundRobin method setUp.

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

Example 2 with PreTypeParser

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

the class PreTypeParserTest method testNewStyle.

/**
	 * @throws Exception
	 */
@Test
public void testNewStyle() throws Exception {
    PreTypeParser producer = new PreTypeParser();
    Prerequisite prereq = producer.parse("TYPE", "1,Mithral,Adamantine,Darkwood", false, false);
    System.out.println(prereq.toString());
    assertEquals("<prereq operator=\"GTEQ\" operand=\"1\" >\n" + "<prereq kind=\"type\" key=\"Mithral\" operator=\"EQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"type\" key=\"Adamantine\" operator=\"EQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"type\" key=\"Darkwood\" operator=\"EQ\" operand=\"1\" >\n" + "</prereq>\n" + "</prereq>\n", prereq.toString());
}
Also used : PreTypeParser(plugin.pretokens.parser.PreTypeParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 3 with PreTypeParser

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

the class PreTypeParserTest method testNewStyle2.

/**
	 * @throws Exception
	 */
@Test
public void testNewStyle2() throws Exception {
    PreTypeParser producer = new PreTypeParser();
    Prerequisite prereq = producer.parse("TYPE", "1,Animal", true, false);
    System.out.println(prereq.toString());
    /*		assertEquals("<prereq operator=\"lt\" operand=\"1\" >\n" + 
		 "<prereq kind=\"type\" key=\"Animal\" operator=\"eq\" operand=\"1\" >\n" + 
		 "</prereq>\n" + 
		 "</prereq>\n",
		 prereq.toString());
		 */
    assertEquals("<prereq kind=\"TYPE\" key=\"Animal\" operator=\"NEQ\" operand=\"1\" >\n" + "</prereq>\n", prereq.toString());
}
Also used : PreTypeParser(plugin.pretokens.parser.PreTypeParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Aggregations

PreTypeParser (plugin.pretokens.parser.PreTypeParser)3 Test (org.junit.Test)2 Prerequisite (pcgen.core.prereq.Prerequisite)2 PreTypeWriter (plugin.pretokens.writer.PreTypeWriter)1