Search in sources :

Example 1 with ListKey

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

the class DeityTokenTest method testUnparseGenericsFail.

@SuppressWarnings("unchecked")
@Test
public void testUnparseGenericsFail() throws PersistenceLayerException {
    ListKey objectKey = ListKey.DEITY;
    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 2 with ListKey

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

the class ArmorProfTokenTest method testUnparseGenericsFail.

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

Example 3 with ListKey

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

the class EquipTokenTest method testUnparseGenericsFail.

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

Example 4 with ListKey

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

the class WeaponProfTokenTest method testUnparseGenericsFail.

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

Example 5 with ListKey

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

the class AbstractTextPropertyTokenTestCase method testUnparseGenericsFail.

/*
	 * TODO Need to define the appropriate behavior here - is this the token's
	 * responsibility?
	 */
@SuppressWarnings("unchecked")
@Test
public void testUnparseGenericsFail() throws PersistenceLayerException {
    ListKey objectKey = getListKey();
    primaryProf.addToListFor(objectKey, new Object());
    try {
        getToken().unparse(primaryContext, primaryProf);
        fail();
    } catch (ClassCastException e) {
    // Yep!
    }
}
Also used : ListKey(pcgen.cdom.enumeration.ListKey) CDOMObject(pcgen.cdom.base.CDOMObject) 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