@Test
public void test() throws URISyntaxException, IOException {

    // Initialize the analyzer and the necessary classes
    Serializer serializer = new GzipJavaUriSerializer();
    SimpleUriCollector collector = new SimpleUriCollector(serializer);
    Sink sink = new InMemorySink();
    Analyzer analyzer = new RDFAnalyzer(collector);
    // Prepare the file the analyzer should read
    CrawleableUri curi = new CrawleableUri(new URI("http://aksw.test.org/test"));
    File dataFile = File.createTempFile("analyzer-test-", "");
    try (InputStream in = this.getClass().getClassLoader().getResourceAsStream(resourceName);
            OutputStream out = new BufferedOutputStream(new FileOutputStream(dataFile))) {
        IOUtils.copy(in, out);
    }
    // Open the sink and collector
    sink.openSinkForUri(curi);
    collector.openSinkForUri(curi);
    // Need to do this even if other things are moved to Before/After due how Stopwatch works.
    startTime = stopwatch.runtime(TimeUnit.MILLISECONDS);
    // Analyze the file
    analyzer.analyze(curi, dataFile, sink);
    endTime = stopwatch.runtime(TimeUnit.MILLISECONDS);
    // Check the result and close the sink and collector
    Assert.assertEquals("Number of triples in " + resourceName, expectedNumberOfTriples, collector.getSize());
    Assert.assertTrue("Failed parse attempts for " + resourceName + ": " + ((RDFAnalyzer)analyzer).failedParseAttempts + " <= 2",
            ((RDFAnalyzer)analyzer).failedParseAttempts <= 2);
    sink.closeSinkForUri(curi);
    collector.closeSinkForUri(curi);
}