package test; import junit.framework.TestCase; import com.thoughtworks.xstream.XStream; /** * @author Hari Krishna Dara */ public class XSTR478 extends TestCase { public void testPolymorphicEnums() { XStream xs = new XStream(); xs.addDefaultImplementation(EnumI.class, EnumT.class); String xml = xs.toXML(new TestType()); assertFalse("Default implemention is not expected in the output: " + xml, xml.contains("EnumT")); } interface EnumI { } enum EnumT implements EnumI { ENUM1, ENUM2 } static class TestType { EnumI type = EnumT.ENUM1; } }