Search in sources :

Example 96 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class AbstractQualifierTokenTestCase method testRoundRobinMultTypes.

@Test
public void testRoundRobinMultTypes() throws PersistenceLayerException {
    CDOMObject a = construct(primaryContext, "Typed1");
    a.addToListFor(ListKey.TYPE, Type.getConstant("Buckler"));
    CDOMObject b = construct(primaryContext, "Typed2");
    b.addToListFor(ListKey.TYPE, Type.getConstant("Heavy"));
    CDOMObject c = construct(secondaryContext, "Typed1");
    c.addToListFor(ListKey.TYPE, Type.getConstant("Buckler"));
    CDOMObject d = construct(secondaryContext, "Typed2");
    d.addToListFor(ListKey.TYPE, Type.getConstant("Heavy"));
    CDOMObject e = construct(primaryContext, "Typed3");
    e.addToListFor(ListKey.TYPE, Type.getConstant("Light"));
    CDOMObject g = construct(secondaryContext, "Typed3");
    g.addToListFor(ListKey.TYPE, Type.getConstant("Light"));
    runRoundRobin(getSubTokenName() + '|' + qualifier + "[TYPE=Buckler|TYPE=Heavy|TYPE=Light]");
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) Test(org.junit.Test)

Example 97 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class AbstractQualifierTokenTestCase method testValidQualifiedInputLotsAnd.

@Test
public void testValidQualifiedInputLotsAnd() throws PersistenceLayerException {
    CDOMObject a = construct(primaryContext, "Typed1");
    a.addToListFor(ListKey.TYPE, Type.getConstant("Foo"));
    CDOMObject b = construct(primaryContext, "Typed2");
    b.addToListFor(ListKey.TYPE, Type.getConstant("Yea"));
    CDOMObject c = construct(secondaryContext, "Typed1");
    c.addToListFor(ListKey.TYPE, Type.getConstant("Foo"));
    CDOMObject d = construct(secondaryContext, "Typed2");
    d.addToListFor(ListKey.TYPE, Type.getConstant("Yea"));
    CDOMObject e = construct(primaryContext, "Typed3");
    e.addToListFor(ListKey.TYPE, Type.getConstant("Bar"));
    CDOMObject f = construct(primaryContext, "Typed4");
    f.addToListFor(ListKey.TYPE, Type.getConstant("Goo"));
    CDOMObject g = construct(secondaryContext, "Typed3");
    g.addToListFor(ListKey.TYPE, Type.getConstant("Bar"));
    CDOMObject h = construct(secondaryContext, "Typed4");
    h.addToListFor(ListKey.TYPE, Type.getConstant("Goo"));
    runRoundRobin(getSubTokenName() + '|' + qualifier + "[TYPE=Bar,TYPE=Goo]," + qualifier + "[TYPE=Foo,TYPE=Yea]");
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) Test(org.junit.Test)

Example 98 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class AbstractListInputTokenTestCase method testRoundRobinWithEqualType.

@Test
public void testRoundRobinWithEqualType() throws PersistenceLayerException {
    if (isTypeLegal()) {
        construct(primaryContext, "TestWP1");
        construct(primaryContext, "TestWP2");
        construct(secondaryContext, "TestWP1");
        construct(secondaryContext, "TestWP2");
        CDOMObject a = (CDOMObject) construct(primaryContext, "Typed1");
        a.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
        CDOMObject b = (CDOMObject) construct(primaryContext, "Typed2");
        b.addToListFor(ListKey.TYPE, Type.getConstant("OtherTestType"));
        CDOMObject c = (CDOMObject) construct(secondaryContext, "Typed1");
        c.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
        CDOMObject d = (CDOMObject) construct(secondaryContext, "Typed2");
        d.addToListFor(ListKey.TYPE, Type.getConstant("OtherTestType"));
        runRoundRobin("TestWP1" + getJoinCharacter() + "TestWP2" + getJoinCharacter() + "TYPE=OtherTestType" + getJoinCharacter() + "TYPE=TestType");
    }
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) Test(org.junit.Test)

Example 99 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class AbstractGlobalListTokenTestCase method testRoundRobinTestEqualThree.

@Test
public void testRoundRobinTestEqualThree() throws PersistenceLayerException {
    if (isTypeLegal()) {
        CDOMObject b = construct(primaryContext, "TestWP3");
        b.addToListFor(ListKey.TYPE, Type.getConstant("TestAltType"));
        b.addToListFor(ListKey.TYPE, Type.getConstant("TestThirdType"));
        b.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
        CDOMObject d = construct(secondaryContext, "TestWP3");
        d.addToListFor(ListKey.TYPE, Type.getConstant("TestAltType"));
        d.addToListFor(ListKey.TYPE, Type.getConstant("TestThirdType"));
        d.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
        runRoundRobin("TYPE=TestAltType.TestThirdType.TestType");
    }
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) Test(org.junit.Test)

Example 100 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class AbstractChooseTokenTestCase method testValidQualifiedPCInputLotsAnd.

@Test
public void testValidQualifiedPCInputLotsAnd() throws PersistenceLayerException {
    if (allowsPCQualifier) {
        CDOMObject a = (CDOMObject) construct(primaryContext, "Typed1");
        a.addToListFor(ListKey.TYPE, Type.getConstant("Foo"));
        CDOMObject b = (CDOMObject) construct(primaryContext, "Typed2");
        b.addToListFor(ListKey.TYPE, Type.getConstant("Yea"));
        CDOMObject c = (CDOMObject) construct(secondaryContext, "Typed1");
        c.addToListFor(ListKey.TYPE, Type.getConstant("Foo"));
        CDOMObject d = (CDOMObject) construct(secondaryContext, "Typed2");
        d.addToListFor(ListKey.TYPE, Type.getConstant("Yea"));
        CDOMObject e = (CDOMObject) construct(primaryContext, "Typed3");
        e.addToListFor(ListKey.TYPE, Type.getConstant("Bar"));
        CDOMObject f = (CDOMObject) construct(primaryContext, "Typed4");
        f.addToListFor(ListKey.TYPE, Type.getConstant("Goo"));
        CDOMObject g = (CDOMObject) construct(secondaryContext, "Typed3");
        g.addToListFor(ListKey.TYPE, Type.getConstant("Bar"));
        CDOMObject h = (CDOMObject) construct(secondaryContext, "Typed4");
        h.addToListFor(ListKey.TYPE, Type.getConstant("Goo"));
        runRoundRobin(getSubTokenName() + '|' + "PC[TYPE=Bar,TYPE=Goo],PC[TYPE=Foo,TYPE=Yea]");
    }
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) Test(org.junit.Test)

Aggregations

CDOMObject (pcgen.cdom.base.CDOMObject)235 Test (org.junit.Test)68 CharID (pcgen.cdom.enumeration.CharID)53 PCTemplate (pcgen.core.PCTemplate)30 ArrayList (java.util.ArrayList)22 PCClass (pcgen.core.PCClass)18 DataFacetChangeEvent (pcgen.cdom.facet.event.DataFacetChangeEvent)17 Race (pcgen.core.Race)17 Equipment (pcgen.core.Equipment)15 PlayerCharacter (pcgen.core.PlayerCharacter)15 Map (java.util.Map)14 AssociatedPrereqObject (pcgen.cdom.base.AssociatedPrereqObject)14 CDOMReference (pcgen.cdom.base.CDOMReference)14 BonusObj (pcgen.core.bonus.BonusObj)14 IdentityHashMap (java.util.IdentityHashMap)12 Set (java.util.Set)12 VariableKey (pcgen.cdom.enumeration.VariableKey)11 HashMap (java.util.HashMap)10 CNAbility (pcgen.cdom.content.CNAbility)10 Spell (pcgen.core.spell.Spell)9