use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class AutoArmorProfTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = AUTO_ARMORPROF_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 AutoLangTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = AUTO_LANG_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 AutoWeaponProfListTargetTest method testFromAbility.
@Test
public void testFromAbility() throws PersistenceLayerException {
Ability source = create(Ability.class, "Source");
context.getReferenceContext().reassociateCategory(AbilityCategory.FEAT, source);
Ability granted = createGrantedObject();
context.getReferenceContext().constructCDOMObject(Language.class, "English");
ParseResult result = new MultToken().parseToken(context, granted, "YES");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
result = new MultToken().parseToken(context, source, "YES");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
result = new LangToken().parseToken(context, granted, "ALL");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
result = new LangToken().parseToken(context, source, "ALL");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
result = token.parseToken(context, source, "FEAT|Granted (%LIST)");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
finishLoad();
assertEquals(0, directAbilityFacet.getCount(id));
CNAbilitySelection cas = new CNAbilitySelection(CNAbilityFactory.getCNAbility(AbilityCategory.FEAT, Nature.AUTOMATIC, source), "English");
directAbilityFacet.add(id, cas, UserSelection.getInstance());
assertTrue(containsExpected());
assertEquals(2, directAbilityFacet.getCount(id));
directAbilityFacet.remove(id, cas, UserSelection.getInstance());
assertEquals(0, directAbilityFacet.getCount(id));
}
use of pcgen.rules.persistence.token.ParseResult in project pcgen by PCGen.
the class AutoWeaponProfTest method processToken.
@Override
public void processToken(CDOMObject source) {
ParseResult result = AUTO_WEAPONPROF_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 AbstractAbilityGrantCheckTest method getMultNo.
public Ability getMultNo(String s) {
Ability a = create(Ability.class, s);
context.getReferenceContext().reassociateCategory(AbilityCategory.FEAT, a);
ParseResult result = TYPE_TOKEN.parseToken(context, a, "Selectable");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
return a;
}
Aggregations