AgreementRefElement { public static AgreementReference readElement(final OMElement element) { if (element == null) return null; final String agreement = element.getText(); final String type = element.getAttributeValue(new QName(LN_ATTR_TYPE)); final String pmode = element.getAttributeValue(new QName(LN_ATTR_PMODE)); return new AgreementReference(agreement, type, pmode); }  static OMElement createElement(final OMElement ciElement, final IAgreementReference data); static OMElement getElement(final OMElement ciElement); static AgreementReference readElement(final OMElement element); static final QName Q_ELEMENT_NAME; static final String LN_ATTR_TYPE; static final String LN_ATTR_PMODE; }
@Test public void testReadElement() throws Exception { String name = "agreement_name"; String type = "agreement_type"; String pmodeId = "some pmode id string"; AgreementReference agreementReference = AgreementRefElement.readElement(createXML( "<eb3:AgreementRef xmlns:eb3=\"http: + " type=\"" + type + "\" pmode=\"" + pmodeId + "\">" + name + "</eb3:AgreementRef>")); assertNotNull(agreementReference); assertEquals(name, agreementReference.getName()); assertEquals(type, agreementReference.getType()); assertEquals(pmodeId, agreementReference.getPModeId()); }