void testOneLiner() throws IOException { String line = "This is a test"; InputStream in = new ByteArrayInputStream(line.getBytes()); StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream( in)); assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1"))); } public void testMultiLiner1() throws IOException { String line = "This is a test\nForget the rest\n\n"; InputStream in = new ByteArrayInputStream(line.getBytes()); StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream( in)); assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1"))); }
void testMultiLiner2() throws IOException { String line = "This is a test\nForget the rest\n\n\n"; InputStream in = new ByteArrayInputStream(line.getBytes()); StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream( in)); assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1"))); } public void testMultiLiner3() throws IOException { String line = "\nThis is a test\nForget the rest\n\n\n"; InputStream in = new ByteArrayInputStream(line.getBytes()); StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream( in)); assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1"))); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/util/QuoteFilterInputStreamTest.java File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/util/QuoteFilterInputStreamTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testOneLiner() throws IOException {
1
void testMultiLiner2() throws IOException {
2
        String line = "This is a test";
2
        String line = "This is a test\nForget the rest\n\n\n";
3
        InputStream in = new ByteArrayInputStream(line.getBytes());
3
        InputStream in = new ByteArrayInputStream(line.getBytes());
4
        StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream(
4
        StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream(
5
                    in));
5
                    in));
6
        assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1")));
6
        assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1")));
7
    }
7
    }
8
    public void testMultiLiner1() throws IOException {
8
    public void testMultiLiner3() throws IOException {
9
        String line = "This is a test\nForget the rest\n\n";
9
        String line = "\nThis is a test\nForget the rest\n\n\n";
10
        InputStream in = new ByteArrayInputStream(line.getBytes());
10
        InputStream in = new ByteArrayInputStream(line.getBytes());
11
        StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream(
11
        StringBuffer result = StreamUtils.readCharacterStream(new QuoteFilterInputStream(
12
                    in));
12
                    in));
13
        assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1")));
13
        assertTrue(result.toString().equals(line.replaceAll("(?m)^(.*)$", "> $1")));
14
    }
14
    }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0