use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class RaceMonCSkillTest method testDirect.
@Test
public void testDirect() throws PersistenceLayerException {
Race source = create(Race.class, "Source");
ParseResult result = token.parseToken(context, source, "MySkill");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
raceFacet.directSet(id, source, getAssoc());
ClassSkillList dragonCSL = context.getReferenceContext().silentlyGetConstructedCDOMObject(ClassSkillList.class, "Dragon");
assertTrue(lscFacet.contains(id, dragonCSL, SkillCost.CLASS, sk));
assertEquals(SkillCost.CROSS_CLASS, pc.getSkillCostForClass(sk, dragon));
pc.incrementClassLevel(1, dragon);
assertEquals(SkillCost.CLASS, pc.getSkillCostForClass(sk, dragon));
raceFacet.remove(id);
assertFalse(lscFacet.contains(id, dragonCSL, SkillCost.CLASS, sk));
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class SkillClassesTest method testDirect.
@Test
public void testDirect() throws PersistenceLayerException {
ParseResult result = token.parseToken(context, sk, "Dragon");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
pc.incrementClassLevel(1, dragon);
assertEquals(SkillCost.CLASS, pc.getSkillCostForClass(sk, dragon));
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class GlobalSpellKnownTest method testConditional.
public void testConditional() {
Ability source = create(Ability.class, "Source");
context.getReferenceContext().reassociateCategory(AbilityCategory.FEAT, source);
ParseResult result = token.parseToken(context, source, "CLASS|Wizard=2|Fireball|PREVARLTEQ:3,MyCasterLevel");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
assertEquals(baseCount(), targetFacetCount());
CNAbilitySelection cas = new CNAbilitySelection(CNAbilityFactory.getCNAbility(AbilityCategory.FEAT, Nature.AUTOMATIC, source));
directAbilityFacet.add(id, cas, UserSelection.getInstance());
assertFalse(containsExpected());
PCTemplate varsource = create(PCTemplate.class, "VarSource");
varsource.put(VariableKey.getConstant("MyCasterLevel"), FormulaFactory.getFormulaFor(4.0));
templateInputFacet.directAdd(id, varsource, null);
pc.calcActiveBonuses();
assertTrue(containsExpected());
assertEquals(baseCount() + 1, targetFacetCount());
directAbilityFacet.remove(id, cas, UserSelection.getInstance());
pc.calcActiveBonuses();
assertEquals(baseCount(), targetFacetCount());
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class GlobalUdamTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = token.parseToken(context, source, "7");
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 GlobalUnencumberedMoveLoadTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = token.parseToken(context, source, "LightLoad");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
}
Aggregations