@Test
public void testCreateElement() throws Exception {

    CollaborationInfo ciData = new CollaborationInfo();
    String aName = "agreement_name";
    String aType = "agreement_type";
    String aPmode = "some_pmode_id";
    ciData.setAgreement(new AgreementReference(aName, aType, aPmode));
    ciData.setService(new Service("PackagingTest"));
    ciData.setAction("some action");
    ciData.setConversationId("conv id");
    OMElement ciElement = CollaborationInfoElement.createElement(createParent(), ciData);
    assertNotNull(ciElement);
    assertEquals(COLLABORATION_INFO_ELEMENT_NAME, ciElement.getQName());
    OMElement arElement = AgreementRefElement.getElement(ciElement);
    assertEquals(AGREEMENT_REF_INFO_ELEMENT_NAME, arElement.getQName());
    assertEquals(aName, arElement.getText());
    assertEquals(aType,
            arElement.getAttribute(new QName("type")).getAttributeValue());
    assertEquals(aPmode,
            arElement.getAttribute(new QName("pmode")).getAttributeValue());
    OMElement sElement = ServiceElement.getElement(ciElement);
    assertEquals(SERVICE_ELEMENT_NAME, sElement.getQName());
    assertNotNull(ciElement.getChildrenWithName(ACTION_ELEMENT_NAME).next());
    assertNotNull(ciElement.getChildrenWithName(
            CONVERSATIONID_ELEMENT_NAME).next());
}