use of plugin.lsttokens.auto.WeaponProfToken in project pcgen by PCGen.
the class AbstractGlobalTargetedSaveRestoreTest method testAutoWeaponProf.
@Test
public void testAutoWeaponProf() {
WeaponProf granted = create(WeaponProf.class, "Granted");
create(WeaponProf.class, "Ignored");
T target = create(getObjectClass(), "Target");
new WeaponProfToken().parseToken(context, target, "Granted");
Object o = prepare(target);
finishLoad();
assertFalse(pc.hasWeaponProf(granted));
applyObject(target);
assertTrue(pc.hasWeaponProf(granted));
runRoundRobin(getPreEqualityCleanup());
assertTrue(pc.hasWeaponProf(granted));
assertTrue(reloadedPC.hasWeaponProf(granted));
remove(o);
reloadedPC.setDirty(true);
assertFalse(reloadedPC.hasWeaponProf(granted));
}
use of plugin.lsttokens.auto.WeaponProfToken in project pcgen by PCGen.
the class AbstractGlobalTargetedSaveRestoreTest method testAutoWeaponProfList.
@Test
public void testAutoWeaponProfList() {
WeaponProf granted = create(WeaponProf.class, "Granted");
create(WeaponProf.class, "Ignored");
T target = create(getObjectClass(), "Target");
new WeaponProfToken().parseToken(context, target, "%LIST");
new plugin.lsttokens.choose.WeaponProficiencyToken().parseToken(context, target, "Granted|Ignored");
additionalChooseSet(target);
Object o = prepare(target);
finishLoad();
assertFalse(pc.hasWeaponProf(granted));
applyObject(target);
assertTrue(pc.hasWeaponProf(granted));
runRoundRobin(getPreEqualityCleanup());
assertTrue(pc.hasWeaponProf(granted));
assertTrue(reloadedPC.hasWeaponProf(granted));
remove(o);
reloadedPC.setDirty(true);
if (isSymmetric()) {
assertFalse(reloadedPC.hasWeaponProf(granted));
}
}
Aggregations