1 package com.thoughtworks.acceptance; 2 3 import com.thoughtworks.acceptance.someobjects.X; 4 import com.thoughtworks.xstream.alias.CannotResolveClassException; 5 6 9 public class AliasTest extends AbstractAcceptanceTest { 10 11 public void testBarfsIfAliasDoesNotExist() { 12 13 String xml = "" + 14 "<X-array>\n" + 15 " <X>\n" + 16 " <anInt>0</anInt>\n" + 17 " </X>\n" + 18 "</X-array>"; 19 20 xstream.alias("Xxxxxxxx", X.class); 22 try { 23 xstream.fromXML(xml); 24 fail("Should have barfed"); 25 } catch (CannotResolveClassException expectedException) { 26 } 28 } 29 30 } 31 | Popular Tags |