use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class GlobalVisionTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = token.parseToken(context, source, "Normal (40)");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class TemplateFavoredClassTest method testDirect.
@Test
public void testDirect() throws PersistenceLayerException {
PCTemplate source = create(PCTemplate.class, "Source");
ParseResult result = token.parseToken(context, source, "Favorite");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
assertEquals(baseCount(), targetFacetCount());
templateInputFacet.directAdd(id, source, getAssoc());
assertTrue(containsExpected());
assertEquals(baseCount() + 1, targetFacetCount());
templateInputFacet.remove(id, source);
assertEquals(baseCount(), targetFacetCount());
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class GlobalCSkillTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = token.parseToken(context, source, "Granted");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class GlobalCSkillTest method testList.
@Test
public void testList() throws PersistenceLayerException {
PCTemplate source = create(PCTemplate.class, "Source");
ParseResult result = token.parseToken(context, source, "LIST");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
result = CHOOSE_SKILL_TOKEN.parseToken(context, source, "Granted");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
PCClass wizard = create(PCClass.class, "Wizard");
finishLoad();
pc.incrementClassLevel(1, wizard);
assertFalse(globalAddedSkillCostFacet.contains(id, SkillCost.CLASS, granted));
assertEquals(SkillCost.CROSS_CLASS, pc.getSkillCostForClass(granted, wizard));
templateInputFacet.directAdd(id, source, granted);
pc.calcActiveBonuses();
assertEquals(SkillCost.CLASS, pc.getSkillCostForClass(granted, wizard));
assertTrue(globalAddedSkillCostFacet.contains(id, SkillCost.CLASS, granted));
templateInputFacet.remove(id, source);
pc.calcActiveBonuses();
assertFalse(globalAddedSkillCostFacet.contains(id, SkillCost.CLASS, granted));
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class GlobalCcSkillTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = token.parseToken(context, source, "Granted");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
}
Aggregations