ChangeAppender implements MultiChangeSinkRunnableChangeSource { @Override public void run() { try { Map<String, Object> metaData; metaData = new HashMap<String, Object>(); for (DataPostbox<ChangeContainer> source : sources) { metaData.putAll(source.outputInitialize()); } changeSink.initialize(metaData); for (DataPostbox<ChangeContainer> source : sources) { while (source.hasNext()) { changeSink.process(source.getNext()); } } changeSink.complete(); for (DataPostbox<ChangeContainer> source : sources) { source.outputComplete(); } } finally { changeSink.close(); for (DataPostbox<ChangeContainer> source : sources) { source.outputRelease(); } } } ChangeAppender(int sourceCount, int inputBufferCapacity); @Override ChangeSink getChangeSink(int instance); @Override int getChangeSinkCount(); @Override void setChangeSink(ChangeSink changeSink); @Override void run();  }
@Test public void testAppend() throws IOException { File sourceFile1; File sourceFile2; File expectedOutputFile; File actualOutputFile; sourceFile1 = dataUtils.createDataFile("v0_6/append-change-in1.osc"); sourceFile2 = dataUtils.createDataFile("v0_6/append-change-in2.osc"); expectedOutputFile = dataUtils.createDataFile("v0_6/append-change-out.osc"); actualOutputFile = dataUtils.newFile(); Osmosis.run( new String[] { "-q", "--read-xml-change-0.6", sourceFile2.getPath(), "--read-xml-change-0.6", sourceFile1.getPath(), "--append-change-0.6", "--write-xml-change-0.6", actualOutputFile.getPath() } ); dataUtils.compareFiles(expectedOutputFile, actualOutputFile); }