use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.
the class DomainCcSkillTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
lscFacet = FacetLibrary.getFacet(LocalSkillCostFacet.class);
lascFacet = FacetLibrary.getFacet(LocalAddedSkillCostFacet.class);
sk = context.getReferenceContext().constructCDOMObject(Skill.class, "MySkill");
dragon = context.getReferenceContext().constructCDOMObject(PCClass.class, "Dragon");
dragon.addToListFor(ListKey.TYPE, Type.MONSTER);
ChooserFactory.setDelegate(new MockUIDelegate());
}
use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.
the class DomainCSkillTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
lscFacet = FacetLibrary.getFacet(LocalSkillCostFacet.class);
lascFacet = FacetLibrary.getFacet(LocalAddedSkillCostFacet.class);
sk = context.getReferenceContext().constructCDOMObject(Skill.class, "MySkill");
dragon = context.getReferenceContext().constructCDOMObject(PCClass.class, "Dragon");
dragon.addToListFor(ListKey.TYPE, Type.MONSTER);
ChooserFactory.setDelegate(new MockUIDelegate());
}
use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.
the class RaceFavClassTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
fcFacet = FacetLibrary.getFacet(FavoredClassFacet.class);
context.getReferenceContext().constructCDOMObject(PCClass.class, "Favorite");
TokenRegistration.register(CHOOSE_CLASS_TOKEN);
ChooserFactory.setDelegate(new MockUIDelegate());
}
use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.
the class DataLoadTest method testLoadSources.
/**
* Test the load of the current source. This will check for any load errors or warnings but ignores deprecation warnings.
*/
@Test
public void testLoadSources() {
UIDelegate uiDelegate = new MockUIDelegate();
SourceFileLoader loader = new SourceFileLoader(sourceSelection, uiDelegate);
errors = new ArrayList<>();
loader.addPCGenTaskListener(this);
loader.execute();
List<String> errorList = new ArrayList<>();
List<String> warningList = new ArrayList<>();
for (LogRecord logRecord : errors) {
if (logRecord.getLevel().intValue() > Logging.WARNING.intValue()) {
errorList.add(logRecord.getMessage());
} else if (logRecord.getLevel().intValue() > Logging.INFO.intValue()) {
warningList.add(logRecord.getMessage());
}
}
assertEquals("Errors encountered while loading " + sourceSelection, "", StringUtils.join(errorList, ",\n"));
assertEquals("Warnings encountered while loading " + sourceSelection, "", StringUtils.join(errorList, ",\n"));
}
use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.
the class PCClassLevelCCSkillTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
lscFacet = FacetLibrary.getFacet(LocalSkillCostFacet.class);
sk = context.getReferenceContext().constructCDOMObject(Skill.class, "MySkill");
dragon = context.getReferenceContext().constructCDOMObject(PCClass.class, "Dragon");
dragon.addToListFor(ListKey.TYPE, Type.MONSTER);
ChooserFactory.setDelegate(new MockUIDelegate());
}
Aggregations