Assert.assertEquals(xml, "<message from=\"from@domain\" id=\"id\" to=\"to@domain\" type=\"chat\"><thread parent=\"parentThread\"></thread></message>");
}
@Test
public void marshalMessageBody() throws JAXBException, XMLStreamException {
Message message = new Message(new Jid("to", "domain"), Message.Type.CHAT);
message.setId("id");
message.setFrom(new Jid("from", "domain"));
message.getBodies().add(new AbstractMessage.Body("body", "de"));
AbstractMessage.Body body2 = new AbstractMessage.Body("body2");
body2.setLanguage("fr");
message.getBodies().add(body2);
String xml = marshal(message);
Assert.assertEquals(xml, "<message from=\"from@domain\" id=\"id\" to=\"to@domain\" type=\"chat\"><body xml:lang=\"de\">body</body><body xml:lang=\"fr\">body2</body></message>");
}