CollaborationInfoElement { public static org.holodeckb2b.common.messagemodel.CollaborationInfo readElement(final OMElement ciElement) { if (ciElement == null) return null; final org.holodeckb2b.common.messagemodel.CollaborationInfo ciData = new org.holodeckb2b.common.messagemodel.CollaborationInfo(); OMElement child = ServiceElement.getElement(ciElement); if (child != null) ciData.setService(ServiceElement.readElement(child)); child = ciElement.getFirstChildWithName(Q_ACTION); if (child != null) ciData.setAction(child.getText()); child = ciElement.getFirstChildWithName(Q_CONVERSATIONID); if (child != null) ciData.setConversationId(child.getText()); child = AgreementRefElement.getElement(ciElement); if (child != null) ciData.setAgreement(AgreementRefElement.readElement(child)); return ciData; }  static OMElement createElement(final OMElement umElement, final ICollaborationInfo data); static OMElement getElement(final OMElement parent); static org.holodeckb2b.common.messagemodel.CollaborationInfo readElement(final OMElement ciElement); static final QName Q_ELEMENT_NAME; }
@Test public void testReadElement() throws Exception { String action = "ReadElement"; String convID = UUID.randomUUID().toString(); CollaborationInfo collaborationInfo = CollaborationInfoElement.readElement(createXML( " <eb3:CollaborationInfo" + " xmlns:eb3=\"http: " <eb3:AgreementRef>http: " <eb3:Service type=\"org:holodeckb2b:services\">PackagingTest</eb3:Service>\n" + " <eb3:Action>" + action + "</eb3:Action>\n" + " <eb3:ConversationId>" + convID + "</eb3:ConversationId>\n" + " </eb3:CollaborationInfo>" )); assertNotNull(collaborationInfo); assertNotNull(collaborationInfo.getService()); assertEquals(action, collaborationInfo.getAction()); assertEquals(convID, collaborationInfo.getConversationId()); }