public class ElementReferenceTest extends TestCase {
public void testSingleElementReference() {
CheckEligibility1 echCheckEligibility1 = new CheckEligibility1();
AtbRequestCheckEligibility_type0 atbRequestCheckEligibility = new AtbRequestCheckEligibility_type0();
echCheckEligibility1.setAtbRequestCheckEligibility(atbRequestCheckEligibility);
atbRequestCheckEligibility.setCardNumber("carnumber");
atbRequestCheckEligibility.setClientId("clientid");
atbRequestCheckEligibility.setExpirationDate("date");
atbRequestCheckEligibility.setNameAsOnCard("cardname");
atbRequestCheckEligibility.setYearOfRedemption(2);
try {
OMElement omElement = echCheckEligibility1.getOMElement(CheckEligibility1.MY_QNAME, OMAbstractFactory.getSOAP12Factory());
String omElementString = omElement.toStringWithConsume();
XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
CheckEligibility1 result = CheckEligibility1.Factory.parse(xmlReader);
assertEquals(result.getAtbRequestCheckEligibility().getCardNumber(), "carnumber");
assertEquals(result.getAtbRequestCheckEligibility().getClientId(), "clientid");
assertEquals(result.getAtbRequestCheckEligibility().getExpirationDate(), "date");
assertEquals(result.getAtbRequestCheckEligibility().getNameAsOnCard(), "cardname");
assertEquals(result.getAtbRequestCheckEligibility().getYearOfRedemption(), 2);
} catch (Exception e) {
fail();
}
}