@Test
public void testCreateElement() throws Exception {

    UserMessage userMessage = new UserMessage();
    userMessage.setMessageId(UUID.randomUUID().toString());
    userMessage.setTimestamp(new Date());
    TradingPartner sender = new TradingPartner();
    sender.addPartyId(new PartyId("TheSender", null));
    sender.setRole("Sender");
    userMessage.setSender(sender);
    TradingPartner receiver = new TradingPartner();
    receiver.addPartyId(new PartyId("TheRecipient", null));
    receiver.setRole("Receiver");
    userMessage.setReceiver(receiver);
    CollaborationInfo collabInfo = new CollaborationInfo();
    collabInfo.setService(new Service("PackagingTest"));
    collabInfo.setAction("Create");
    userMessage.setCollaborationInfo(collabInfo);
	userMessage.addMessageProperty(new Property("some-meta-data", "description"));
    Payload p = new Payload();
	p.setPayloadURI("cid:as_attachment");
	p.addProperty(new Property("p1", "v1"));
	userMessage.addPayload(p);
	OMElement umElement = UserMessageElement.createElement(createParent(), userMessage);
	
	assertNotNull(umElement);
    assertEquals(USER_MESSAGE_ELEMENT_NAME, umElement.getQName());
    
    assertNotNull(MessageInfoElement.getElement(umElement));
    assertNotNull(CollaborationInfoElement.getElement(umElement));
    assertNotNull(MessagePropertiesElement.getElement(umElement));
    assertNotNull(PayloadInfoElement.getElement(umElement));
}