@Test
public void testAttachments() throws Exception {
PATask task1 = new PATask(getUniqueTaskID(), new URI(
"http://hellonico.net"));
AttachmentMetadata attMetadata = new AttachmentMetadata();
Attachment att = new Attachment(attMetadata, new URL(
"file:///thisisadocument1.txt"));
Attachment att2 = new Attachment(attMetadata, new URL(
"file:///thisisadocument2.txt"));
task1.addAttachment(att);
task1.addAttachment(att2);
task1.getUserOwners().add("niko");
persist(task1);
PATask task2 = new PATask(getUniqueTaskID(), new URI(
"http://hellonico.net"));
task2.getUserOwners().add("niko");
AttachmentMetadata attMetadata2 = new AttachmentMetadata();
Attachment att3 = new Attachment(attMetadata2, new URL(
"file:///thisisadocument3.txt"));
task2.addAttachment(att3);
persist(task2);