Search in sources :

Example 16 with ListKey

use of pcgen.cdom.enumeration.ListKey in project pcgen by PCGen.

the class AddLevelTokenTest method testUnparseGenericsFail.

@SuppressWarnings("unchecked")
@Test
public void testUnparseGenericsFail() throws PersistenceLayerException {
    ListKey objectKey = ListKey.ADD_LEVEL;
    primaryProf.addToListFor(objectKey, new Object());
    try {
        getToken().unparse(primaryContext, primaryProf);
        fail();
    } catch (ClassCastException e) {
    // Yep!
    }
}
Also used : ListKey(pcgen.cdom.enumeration.ListKey) Test(org.junit.Test)

Example 17 with ListKey

use of pcgen.cdom.enumeration.ListKey in project pcgen by PCGen.

the class DeityWeapTokenTest method testUnparseGenericsFail.

@SuppressWarnings("unchecked")
@Test
public void testUnparseGenericsFail() throws PersistenceLayerException {
    ListKey objectKey = ListKey.DEITYWEAPON;
    primaryProf.addToListFor(objectKey, new Object());
    try {
        getToken().unparse(primaryContext, primaryProf);
        fail();
    } catch (ClassCastException e) {
    // Yep!
    }
}
Also used : ListKey(pcgen.cdom.enumeration.ListKey) Test(org.junit.Test)

Aggregations

ListKey (pcgen.cdom.enumeration.ListKey)17 Test (org.junit.Test)15 QualifiedObject (pcgen.core.QualifiedObject)5 CDOMObject (pcgen.cdom.base.CDOMObject)4 ArrayList (java.util.ArrayList)2 AssociatedPrereqObject (pcgen.cdom.base.AssociatedPrereqObject)2 CDOMReference (pcgen.cdom.base.CDOMReference)2 ChooseSelectionActor (pcgen.cdom.base.ChooseSelectionActor)2 Nature (pcgen.cdom.enumeration.Nature)2 AbilitySelector (pcgen.cdom.helper.AbilitySelector)2 AbilityTargetSelector (pcgen.cdom.helper.AbilityTargetSelector)2 AbilityList (pcgen.cdom.list.AbilityList)2 CDOMSingleRef (pcgen.cdom.reference.CDOMSingleRef)2 Ability (pcgen.core.Ability)2 AbilityCategory (pcgen.core.AbilityCategory)2 Prerequisite (pcgen.core.prereq.Prerequisite)2 List (java.util.List)1 StringTokenizer (java.util.StringTokenizer)1 TreeSet (java.util.TreeSet)1 MapToList (pcgen.base.util.MapToList)1