use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class GlobalCcSkillTest 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");
new ExclusiveToken().parseToken(context, granted, "Yes");
finishLoad();
pc.incrementClassLevel(1, wizard);
assertFalse(globalAddedSkillCostFacet.contains(id, SkillCost.CROSS_CLASS, granted));
assertEquals(SkillCost.EXCLUSIVE, pc.getSkillCostForClass(granted, wizard));
templateInputFacet.directAdd(id, source, granted);
pc.calcActiveBonuses();
assertEquals(SkillCost.CROSS_CLASS, pc.getSkillCostForClass(granted, wizard));
assertTrue(globalAddedSkillCostFacet.contains(id, SkillCost.CROSS_CLASS, granted));
templateInputFacet.remove(id, source);
pc.calcActiveBonuses();
assertFalse(globalAddedSkillCostFacet.contains(id, SkillCost.CROSS_CLASS, granted));
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class DomainCSkillTest method testDirect.
@Test
public void testDirect() throws PersistenceLayerException {
Domain source = create(Domain.class, "Source");
ParseResult result = token.parseToken(context, source, "MySkill");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
assertEquals(SkillCost.CROSS_CLASS, pc.getSkillCostForClass(sk, dragon));
domainInputFacet.add(id, source, new ClassSource(dragon, 0));
assertTrue(lscFacet.contains(id, dragon, SkillCost.CLASS, sk));
pc.addClass(dragon);
pc.setDirty(true);
assertEquals(SkillCost.CLASS, pc.getSkillCostForClass(sk, dragon));
domainInputFacet.remove(id, source);
assertFalse(lscFacet.contains(id, dragon, SkillCost.CLASS, sk));
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class GlobalCompanionListTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = token.parseToken(context, source, "Animal Companion|Ape|FOLLOWERADJUSTMENT:-3");
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 GlobalDefineUnlockedStatTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = token.parseToken(context, source, "UNLOCK|INT");
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 GlobalMoveCloneTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = token.parseToken(context, source, "Walk,Fly,*2");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
}
Aggregations