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());
}
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());
}
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());
}
Aggregations