public void testAdaptStream() throws IOException { InputStream is = new FileInputStream(new File(TestInfo.WORKING_DIR, DEDUP_CRAWL_LOG)); OutputStream os = new ByteArrayOutputStream(); DeduplicateToCDXAdapterInterface adapter = new DeduplicateToCDXAdapter(); adapter.adaptStream(is, os); os.close(); String output = os.toString(); String[] lines = output.split("\n"); CDXLineToSearchResultAdapter adapter2 = new CDXLineToSearchResultAdapter(); for (String line : lines) { CaptureSearchResult csr = adapter2.adapt(line); assertNotNull( "Should have a valid mime type for every line, inclding '" + line + "'", csr.getMimeType()); } assertTrue("expect at least 3 lines of output, got " + lines.length, lines.length > 2); }