File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/mail/MailMessageTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/mail/MailMessageTest.java | |||
Method name: void testAsciiCharset()
|
Method name: void testEmptyBody()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | testMailClient.to("Ceki G\u00fclc\u00fc <abuse@mail-abuse.org>");↵ | 1 | testMailClient.to("to@you.com");↵ | |
2 | testMailClient.setSubject("Test subject");↵ | 2 | testMailClient.setSubject("Test subject");↵ | |
3 | testMailClient.setMessage("");↵ | 3 | testMailClient.setMessage("");↵ | |
4 | Thread client = new Thread(testMailClient);↵ | 4 | Thread client = new Thread(testMailClient);↵ | |
5 | client.start();↵ | 5 | client.start();↵ | |
6 | try {↵ | 6 | try {↵ | |
7 | server.join(60 * 1000); // 60s↵ | 7 | server.join(60 * 1000); // 60s↵ | |
8 | client.join(30 * 1000); // a further 30s↵ | 8 | client.join(30 * 1000); // a further 30s↵ | |
9 | } catch (InterruptedException ie ) {↵ | 9 | } catch (InterruptedException ie ) {↵ | |
10 | fail("InterruptedException: " + ie);↵ | 10 | fail( "InterruptedException: " + ie );↵ | |
11 | }↵ | 11 | }↵ | |
12 | String result = testMailServer.getResult();↵ | 12 | String result = testMailServer.getResult();↵ | |
13 | String expectedResult = "220 test SMTP EmailTaskTest\r\n" +↵ | 13 | String expectedResult = "220 test SMTP EmailTaskTest\r\n" +↵ | |
14 | "HELO " + local + "\r\n" +↵ | 14 | "HELO " + local + "\r\n" +↵ | |
15 | "250 " + local + " Hello " + local + " [127.0.0.1], pleased to meet you\r\n" +↵ | 15 | "250 " + local + " Hello " + local + " [127.0.0.1], pleased to meet you\r\n" +↵ | |
16 | "MAIL FROM: <EmailTaskTest@ant.apache.org>\r\n" +↵ | 16 | "MAIL FROM: <EmailTaskTest@ant.apache.org>\r\n" +↵ | |
17 | "250\r\n" +↵ | 17 | "250\r\n" +↵ | |
18 | "RCPT TO: <abuse@mail-abuse.org>\r\n" +↵ | 18 | "RCPT TO: <to@you.com>\r\n" +↵ | |
19 | "250\r\n" +↵ | 19 | "250\r\n" +↵ | |
20 | "DATA\r\n" +↵ | 20 | "DATA\r\n" +↵ | |
21 | "354\r\n" +↵ | 21 | "354\r\n" +↵ | |
22 | "Subject: Test subject\r\n" +↵ | 22 | "Subject: Test subject\r\n" +↵ | |
23 | "From: Mail Message <EmailTaskTest@ant.apache.org>\r\n" +↵ | 23 | "From: Mail Message <EmailTaskTest@ant.apache.org>\r\n" +↵ | |
24 | "To: Ceki G\u00fclc\u00fc <abuse@mail-abuse.org>\r\n" +↵ | 24 | "To: to@you.com\r\n" +↵ | |
25 | "X-Mailer: org.apache.tools.mail.MailMessage (ant.apache.org)\r\n" +↵ | 25 | "X-Mailer: org.apache.tools.mail.MailMessage (ant.apache.org)\r\n" +↵ | |
26 | "\r\n" +↵ | 26 | "\r\n" +↵ | |
27 | "\r\n" +↵ | 27 | "\r\n" +↵ | |
28 | "\r\n" +↵ | 28 | "\r\n" +↵ | |
29 | ".\r\n" +↵ | 29 | ".\r\n" +↵ | |
30 | "250\r\n" +↵ | 30 | "250\r\n" +↵ | |
31 | "QUIT\r\n" +↵ | 31 | "QUIT\r\n" +↵ | |
32 | "221\r\n"; | 32 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 38 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | testMailClient.to("Ceki G\u00fclc\u00fc <abuse@mail-abuse.org>"); |
| 6 | testMailClient.to("to@you.com"); | |||||||||||||
7 | testMailClient.setSubject("Test subject"); | 7 | testMailClient.setSubject("Test subject"); | ||||||||||||||
8 | testMailClient.setMessage(""); | 8 | testMailClient.setMessage(""); | ||||||||||||||
9 | Thread client = new Thread(testMailClient); | 9 | Thread client = new Thread(testMailClient); | ||||||||||||||
10 | client.start(); | 10 | client.start(); | ||||||||||||||
11 | try | 11 | try | ||||||||||||||
12 | server.join(60 * 1000); | 12 | server.join(60 * 1000); | ||||||||||||||
13 | client.join(30 * 1000); | 13 | client.join(30 * 1000); | ||||||||||||||
14 | String result = testMailServer.getResult(); | 14 | String result = testMailServer.getResult(); | ||||||||||||||
15 | String expectedResult = "220 test SMTP EmailTaskTest\r\n" + "HELO " + local + "\r\n" + "250 " + local + " Hello " + local + " [127.0.0.1], pleased to meet you\r\n" + "MAIL FROM: <EmailTaskTest@ant.apache.org>\r\n" + "250\r\n" + "RCPT TO: <abuse@mail-abuse.org>\r\n" + "250\r\n" + "DATA\r\n" + "354\r\n" + "Subject: Test subject\r\n" + "From: Mail Message <EmailTaskTest@ant.apache.org>\r\n" + "To: Ceki G\u00fclc\u00fc <abuse@mail-abuse.org>\r\n" + "X-Mailer: org.apache.tools.mail.MailMessage (ant.apache.org)\r\n" + "\r\n" + "\r\n" + "\r\n" + ".\r\n" + "250\r\n" + "QUIT\r\n" + "221\r\n"; |
| 15 | String expectedResult = "220 test SMTP EmailTaskTest\r\n" + "HELO " + local + "\r\n" + "250 " + local + " Hello " + local + " [127.0.0.1], pleased to meet you\r\n" + "MAIL FROM: <EmailTaskTest@ant.apache.org>\r\n" + "250\r\n" + "RCPT TO: <to@you.com>\r\n" + "250\r\n" + "DATA\r\n" + "354\r\n" + "Subject: Test subject\r\n" + "From: Mail Message <EmailTaskTest@ant.apache.org>\r\n" + "To: to@you.com\r\n" + "X-Mailer: org.apache.tools.mail.MailMessage (ant.apache.org)\r\n" + "\r\n" + "\r\n" + "\r\n" + ".\r\n" + "250\r\n" + "QUIT\r\n" + "221\r\n"; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables expectedResult, result , while Clone fragment #2 returns variables result, expectedResult |