Search in sources :

Example 6 with MockUIDelegate

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());
}
Also used : Skill(pcgen.core.Skill) LocalAddedSkillCostFacet(pcgen.cdom.facet.input.LocalAddedSkillCostFacet) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) LocalSkillCostFacet(pcgen.cdom.facet.analysis.LocalSkillCostFacet) PCClass(pcgen.core.PCClass)

Example 7 with 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());
}
Also used : Skill(pcgen.core.Skill) LocalAddedSkillCostFacet(pcgen.cdom.facet.input.LocalAddedSkillCostFacet) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) LocalSkillCostFacet(pcgen.cdom.facet.analysis.LocalSkillCostFacet) PCClass(pcgen.core.PCClass)

Example 8 with 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());
}
Also used : MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) FavoredClassFacet(pcgen.cdom.facet.analysis.FavoredClassFacet)

Example 9 with 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"));
}
Also used : LogRecord(java.util.logging.LogRecord) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) ArrayList(java.util.ArrayList) SourceFileLoader(pcgen.persistence.SourceFileLoader) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) UIDelegate(pcgen.facade.core.UIDelegate) Test(org.junit.Test)

Example 10 with MockUIDelegate

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());
}
Also used : Skill(pcgen.core.Skill) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) LocalSkillCostFacet(pcgen.cdom.facet.analysis.LocalSkillCostFacet) PCClass(pcgen.core.PCClass)

Aggregations

MockUIDelegate (pcgen.gui2.facade.MockUIDelegate)14 PCClass (pcgen.core.PCClass)9 Skill (pcgen.core.Skill)7 LocalSkillCostFacet (pcgen.cdom.facet.analysis.LocalSkillCostFacet)4 FavoredClassFacet (pcgen.cdom.facet.analysis.FavoredClassFacet)2 ListSkillCostFacet (pcgen.cdom.facet.analysis.ListSkillCostFacet)2 LocalAddedSkillCostFacet (pcgen.cdom.facet.input.LocalAddedSkillCostFacet)2 Spell (pcgen.core.spell.Spell)2 ArrayList (java.util.ArrayList)1 LogRecord (java.util.logging.LogRecord)1 Test (org.junit.Test)1 DirectAbilityFacet (pcgen.cdom.facet.DirectAbilityFacet)1 RaceSelectionFacet (pcgen.cdom.facet.RaceSelectionFacet)1 TemplateSelectionFacet (pcgen.cdom.facet.TemplateSelectionFacet)1 WeaponProfFacet (pcgen.cdom.facet.WeaponProfFacet)1 MonsterCSkillFacet (pcgen.cdom.facet.input.MonsterCSkillFacet)1 ActiveEqModFacet (pcgen.cdom.facet.model.ActiveEqModFacet)1 AlignmentFacet (pcgen.cdom.facet.model.AlignmentFacet)1 BioSetFacet (pcgen.cdom.facet.model.BioSetFacet)1 CheckFacet (pcgen.cdom.facet.model.CheckFacet)1