File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/command/ForwardCommandTest.java | File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/command/ReplyCommandTest.java | |||
Method name: void testForewardWithAttachment()
|
Method name: void test()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | System.out.println("input=" + input);↵ | 1 | System.out.println("input=" + input);↵ | |
2 | // create stream from string↵ | 2 | // create stream from string↵ | |
3 | InputStream inputStream = FolderTstHelper↵ | 3 | InputStream inputStream = FolderTstHelper↵ | |
4 | .getByteArrayInputStream(input);↵ | 4 | .getByteArrayInputStream(input);↵ | |
5 | // add stream to folder↵ | 5 | // add stream to folder↵ | |
6 | Object uid = getSourceFolder().addMessage(inputStream);↵ | 6 | Object uid = getSourceFolder().addMessage(inputStream);↵ | |
7 | // create Command reference↵ | 7 | // create Command reference↵ | |
8 | MailFolderCommandReference ref = new MailFolderCommandReference(↵ | 8 | MailFolderCommandReference ref = new MailFolderCommandReference(↵ | |
9 | getSourceFolder(), new Object[] { uid });↵ | 9 | getSourceFolder(), new Object[] { uid });↵ | |
10 | ↵ | |||
11 | // create copy command↵ | 10 | // create copy command↵ | |
12 | ForwardCommand command = new ForwardCommand(ref);↵ | 11 | ReplyCommand command = new ReplyCommand(ref);↵ | |
13 | ↵ | |||
14 | // execute command -> use mock object class as worker which does↵ | 12 | // execute command -> use mock object class as worker which does↵ | |
15 | // nothing↵ | 13 | // nothing↵ | |
16 | command.execute(NullWorkerStatusController.getInstance());↵ | 14 | command.execute(NullWorkerStatusController.getInstance());↵ | |
17 | ↵ | 15 | ↵ | |
18 | // model should contain the data↵ | 16 | // model should contain the data↵ | |
19 | ComposerModel model = command.getModel();↵ | 17 | ComposerModel model = command.getModel();↵ | |
20 | List attachments↵ | 18 | ↵ | |
21 | = model.getAttachments(); | 19 | String subject = model.getSubject(); | |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 30 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | System.out.println("input=" + input); | 2 | System.out.println("input=" + input); | |||||||||||||||||||
3 | InputStream inputStream = FolderTstHelper.getByteArrayInputStream(input); | 3 | InputStream inputStream = FolderTstHelper.getByteArrayInputStream(input); | |||||||||||||||||||
4 | Object uid = getSourceFolder().addMessage(inputStream); | 4 | Object uid = getSourceFolder().addMessage(inputStream); | |||||||||||||||||||
5 | MailFolderCommandReference ref = new MailFolderCommandReference(getSourceFolder(), new Object[] {uid}); | 5 | MailFolderCommandReference ref = new MailFolderCommandReference(getSourceFolder(), new Object[] {uid}); | |||||||||||||||||||
6 | ForwardCommand command = new ForwardCommand(ref); |
| 6 | ReplyCommand command = new ReplyCommand(ref); | ||||||||||||||||||
7 | command.execute(NullWorkerStatusController.getInstance()); |
| 7 | command.execute(NullWorkerStatusController.getInstance()); | ||||||||||||||||||
8 | ComposerModel model = command.getModel(); |
| 8 | ComposerModel model = command.getModel(); | ||||||||||||||||||
|
| 9 | String subject = model.getSubject(); | |||||||||||||||||||
9 | List attachments = model.getAttachments(); |
| |
Row | Violation |
---|---|
1 | Expression new ForwardCommand(ref) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new ReplyCommand(ref) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression command cannot be unified with expression command , because common superclass org.columba.core.command.Command does not declare member(s) public org.columba.mail.gui.composer.ComposerModel getModel() |
4 | Unmatched statement String subject=model.getSubject(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement List attachments=model.getAttachments(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |