@Test public void testJoinMessage() throws Exception { ZipAggregator aggr = new ZipAggregator(); AdaptrisMessageFactory fac = AdaptrisMessageFactory.getDefaultInstance(); AdaptrisMessage original = fac.newMessage(); AdaptrisMessage splitMsg1 = fac.newMessage("<document>hello</document>"); splitMsg1.addMetadata(DEFAULT_FILENAME_METADATA, "file1.xml"); AdaptrisMessage splitMsg2 = fac.newMessage("<document>world</document>"); splitMsg2.addMetadata(DEFAULT_FILENAME_METADATA, "file2.xml"); AdaptrisMessage willBeIgnoredMsg = fac.newMessage("<document>world</document>"); aggr.joinMessage(original, Arrays.asList(splitMsg1, splitMsg2, willBeIgnoredMsg)); boolean isZipped = new ZipInputStream(new ByteArrayInputStream(original.getPayload())).getNextEntry() != null; assertTrue(isZipped); Map<String, String> results = zipBytesToResultsMap(original.getPayload()); assertEquals(2, results.size()); assertTrue(results.containsKey("file1.xml")); assertTrue(results.containsKey("file2.xml")); assertEquals(results.get("file1.xml"), "<document>hello</document>"); assertEquals(results.get("file2.xml"), "<document>world</document>"); }
@Override public void joinMessage(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs) throws CoreException { aggregate(msg, msgs); }
ZipAggregator extends MessageAggregatorImpl { @Override public void joinMessage(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs) throws CoreException { aggregate(msg, msgs); } }
ZipAggregator extends MessageAggregatorImpl { @Override public void joinMessage(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs) throws CoreException { aggregate(msg, msgs); }  }
ZipAggregator extends MessageAggregatorImpl { @Override public void joinMessage(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs) throws CoreException { aggregate(msg, msgs); }  @Override void joinMessage(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs); @Override void aggregate(AdaptrisMessage original, Iterable<AdaptrisMessage> messages); }
ZipAggregator extends MessageAggregatorImpl { @Override public void joinMessage(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs) throws CoreException { aggregate(msg, msgs); }  @Override void joinMessage(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs); @Override void aggregate(AdaptrisMessage original, Iterable<AdaptrisMessage> messages); static final String DEFAULT_FILENAME_METADATA; }