void testRemoveComments1() { String input = "<html><body><p><!- this is a text without comments -></p></body></html>"; String result = HtmlParser.removeComments(input); assertTrue(result .equals("<html><body><p><!- this is a text without comments -></p></body></html>")); } public void testRemoveComments2() { String input = "<html><body><p><!-- this is a comment -->And some text</p></body></html>"; String result = HtmlParser.removeComments(input); assertTrue(result .equals("<html><body><p>And some text</p></body></html>"));
void testRemoveComments2() { String input = "<html><body><p><!-- this is a comment -->And some text</p></body></html>"; String result = HtmlParser.removeComments(input); assertTrue(result .equals("<html><body><p>And some text</p></body></html>")); } public void testRemoveComments3() { String input = "<html><body><p><!-- this is a comment \n" + "\t\twhich is spread over \n" + " multiple lines-->And some text</p> \n\n" + "<h1>A header </h><!-- a little comment --><p>" + "<i>The end</i></p></body></html>"; String result = HtmlParser.removeComments(input); assertTrue(result.equals("<html><body><p>And some text</p> \n\n" + "<h1>A header </h><p>" + "<i>The end</i></p></body></html>"));
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/parser/text/HtmlParserTest.java File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/parser/text/HtmlParserTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testRemoveComments1() {
1
void testRemoveComments2() {
2
        String input = "<html><body><p><!- this is a text without comments -></p></body></html>";
2
        String input = "<html><body><p><!-- this is a comment -->And some text</p></body></html>";
3
        String result = HtmlParser.removeComments(input);
3
        String result = HtmlParser.removeComments(input);
4
        assertTrue(result
4
        assertTrue(result
5
                .equals("<html><body><p><!- this is a text without comments -></p></body></html>"));
5
                .equals("<html><body><p>And some text</p></body></html>"));
6
    }
6
    }
7
    public void testRemoveComments2() {
7
    public void testRemoveComments3() {
8
        String input = "<html><body><p><!-- this is a comment -->And some text
8
        String input = "<html><body><p><!-- this is a comment \n"
9
                + "\t\twhich is spread over \n"
10
                + "   multiple lines-->And some text</p> \n\n"
11
                + "<h1>A header </h><!-- a little comment --><p>"
9
</p></body></html>";
12
                + "<i>The end</i></p></body></html>";
10
        String result = HtmlParser.removeComments(input);
13
        String result = HtmlParser.removeComments(input);
11
        assertTrue(result
14
        assertTrue(result
12
                .equals("<html><body><p>And some text</p>
15
.equals("<html><body><p>And some text</p> \n\n"
13
</body></html>"));
16
                + "<h1>A header </h><p>" + "<i>The end</i></p></body></html>"));
14
    
17
    
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