class ContentExtractorTestBase extends ProcessorTestBase {

    
    /**
     * An extractor created during the setUp.
     */
    protected Extractor extractor;

    
    /**
     * Sets up the {@link #extractor}.
     */
    final public void setUp() {
        extractor = makeExtractor();
    }
    
    
    @Override
    protected Object makeModule() {
        return makeExtractor();
    }
        
    
    /**
     * Subclasses should return an Extractor instance to test.
     * 
     * @return   an Extractor instance to test
     */
    protected abstract Extractor makeExtractor();
    
    
    /**
     * Returns a CrawlURI for testing purposes.
     * 
     * @return   a CrawlURI
     * @throws Exception   just in case
     */
    protected CrawlURI defaultURI() throws Exception {<FILL_FUNCTION_BODY>}
    
    
    /**
     * Tests that a URI with a zero content length has no links extracted.
     * 
     * @throws Exception   just in case
     */
    public void testZeroContent() throws Exception {
        CrawlURI uri = defaultURI();
        Recorder recorder = createRecorder("");
        uri.setContentType("text/plain");
        uri.setRecorder(recorder);
        extractor.process(uri);
        assertEquals(0, uri.getOutLinks().size());
        assertNoSideEffects(uri);
    }
    
    
    /**
     * Tests that a URI whose linkExtractionFinished flag has been set has
     * no links extracted.
     * 
     * @throws Exception   just in case
     */
    public void testFinished() throws Exception {
        CrawlURI uri = defaultURI();
        uri.linkExtractorFinished();
        extractor.process(uri);
        assertEquals(0, uri.getOutLinks().size());
        assertNoSideEffects(uri);        
    }

    
    /**
     * Asserts that the given URI has no URI errors, no localized errors, and
     * no annotations.
     * 
     * @param uri   the URI to test
     */
    protected static void assertNoSideEffects(CrawlURI uri) {
        assertEquals(0, uri.getNonFatalFailures().size());
        assertTrue(uri.getAnnotations().isEmpty());
    }
    
    @Deprecated
    public static Recorder createRecorder(String content) throws IOException {
        return createRecorder(content, Charset.defaultCharset().name());
    }
    
    public static Recorder createRecorder(String content, String charset)
            throws IOException {
        File temp = File.createTempFile("test", ".tmp");
        Recorder recorder = new Recorder(temp, 1024, 1024);
        byte[] b = content.getBytes(charset);
        ByteArrayInputStream bais = new ByteArrayInputStream(b);
        InputStream is = recorder.inputWrap(bais);
        recorder.markContentBegin();
        for (int x = is.read(); x >= 0; x = is.read());
        is.close();
        return recorder;
    }

}

        UURI uuri = UURIFactory.getInstance("http://www.archive.org/start/");
        return new CrawlURI(uuri, null, null, LinkContext.NAVLINK_MISC);
    
<methods>public non-sealed void <init>() <variables>