Search in sources :

Example 11 with ListKey

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

the class DomainTokenTest method testUnparseGenericsFail.

@SuppressWarnings("unchecked")
@Test
public void testUnparseGenericsFail() throws PersistenceLayerException {
    ListKey objectKey = ListKey.DOMAIN;
    primaryProf.addToListFor(objectKey, 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 12 with ListKey

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

the class DomainTokenTest method testUnparseGenericsFail.

@SuppressWarnings("unchecked")
@Test
public void testUnparseGenericsFail() throws PersistenceLayerException {
    ListKey objectKey = ListKey.DOMAIN;
    primaryProf.addToListFor(objectKey, 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 13 with ListKey

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

the class ArmortypeTokenTest method testUnparseGenericsFail.

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

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

the class LangTokenTest method testUnparseGenericsFail.

@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testUnparseGenericsFail() throws PersistenceLayerException {
    ListKey listKey = ListKey.AUTO_LANGUAGE;
    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 15 with ListKey

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

the class ShieldProfTokenTest method testUnparseGenericsFail.

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

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