CustomerDocument doc =
CustomerDocument.Factory.parse(
TestEnv.xbeanCase("schema/simple/person.xml"), null);
// Move from the root to the root customer element
Person person = doc.getCustomer();
Assert.assertEquals("Howdy", person.getFirstname());
Assert.assertEquals(4, person.sizeOfNumberArray());
Assert.assertEquals(436, person.getNumberArray(0));
Assert.assertEquals(123, person.getNumberArray(1));
Assert.assertEquals(44, person.getNumberArray(2));
Assert.assertEquals(933, person.getNumberArray(3));
Assert.assertEquals(2, person.sizeOfBirthdayArray());
Assert.assertEquals(new Date("Tue Aug 25 17:00:00 PDT 1998"), person.getBirthdayArray(0));
Person.Gender.Enum g = person.getGender();
Assert.assertEquals(Person.Gender.MALE, g);
Assert.assertEquals("EGIQTWYZJ", new String(person.getHex()));
Assert.assertEquals("This string is base64Binary encoded!",
new String(person.getBase64()));
Assert.assertEquals("GGIQTWYGG", new String(person.getHexAtt()));
Assert.assertEquals("This string is base64Binary encoded!",
new String(person.getBase64Att()));
person.setFirstname("George");
Assert.assertEquals("George", person.getFirstname());
person.setHex("hex encoding".getBytes());
Assert.assertEquals("hex encoding", new String(person.getHex()));
person.setBase64("base64 encoded".getBytes());
Assert.assertEquals("base64 encoded",
new String(person.getBase64()));
//person.setHexAtt("hex encoding in attributes".getBytes());
//Assert.assertEquals("hex encoding in attributes",
// new String(person.getHexAtt()));