list2.clear();
}
//@Test
public void addingRendezvousMessages1() throws DbException, XQueryException {
XStream xstream = new XStream();
XBirdCollectionStrategy<String, Object> strategy = new XBirdCollectionStrategy<String, Object>(COLLECTION_NAME, xstream);
xstream.processAnnotations(RendezvousMessage.class);
RendezvousMessage msg1 = new RendezvousMessage(15, Arrays.asList(new Author("anonymous"), new Author("makoto")));
System.out.println(xstream.toXML(msg1));
System.out.println();
RendezvousMessage msg2 = new RendezvousMessage(15, Arrays.asList(new Author("anonymous")), "firstPart", "secondPart");
System.out.println(xstream.toXML(msg2));
System.out.println();
List<RendezvousMessage> list = new XmlArrayList(strategy);
list.add(msg1);
list.add(msg2);
Assert.assertEquals(2, list.size());
String query1 = "fn:collection('/" + COLLECTION_NAME + "/1.xml')//author[1]";
XQueryProcessor proc = new XQueryProcessor();
XQueryModule compiled1 = proc.parse(query1);
StringWriter sw = new StringWriter();
SAXWriter handler = new SAXWriter(sw);
SAXSerializer ser = new SAXSerializer(handler);
proc.execute(compiled1, ser);
handler.flush();
String result1 = sw.toString();
System.err.println(result1);
Author author1 = (Author) xstream.fromXML(result1);
Assert.assertEquals("anonymous", author1.getName());
}