public class ReplyToAllCommandTest extends AbstractComposerTst { public ReplyToAllCommandTest(String arg0) { super(arg0); } /** * @param arg0 */ public ReplyToAllCommandTest(MailboxTstFactory factory, String arg0) { super(factory, arg0); } public void test() throws Exception { // add message "0.eml" as inputstream to folder String input = FolderTstHelper.getString(0); System.out.println("input=" + input); // create stream from string InputStream inputStream = FolderTstHelper .getByteArrayInputStream(input); // add stream to folder Object uid = getSourceFolder().addMessage(inputStream); // create Command reference MailFolderCommandReference ref = new MailFolderCommandReference( getSourceFolder(), new Object[] { uid }); // create copy command ReplyToAllCommand command = new ReplyToAllCommand(ref); // execute command -> use mock object class as worker which does // nothing command.execute(NullWorkerStatusController.getInstance()); // model should contain the data ComposerModel model = command.getModel(); String subject = model.getSubject(); assertEquals("Subject", "Re: test", subject);
public class ReplyToMailingListCommandTest extends AbstractComposerTst { public ReplyToMailingListCommandTest(String arg0) { super(arg0); } /** * @param arg0 */ public ReplyToMailingListCommandTest(MailboxTstFactory factory, String arg0) { super(factory, arg0); } public void test() throws Exception { // add message "0.eml" as inputstream to folder String input = FolderTstHelper.getString(0); System.out.println("input=" + input); // create stream from string InputStream inputStream = FolderTstHelper .getByteArrayInputStream(input); // add stream to folder Object uid = getSourceFolder().addMessage(inputStream); // create Command reference MailFolderCommandReference ref = new MailFolderCommandReference( getSourceFolder(), new Object[] { uid }); // create copy command ReplyToMailingListCommand command = new ReplyToMailingListCommand(ref); // execute command -> use mock object class as worker which does // nothing command.execute(NullWorkerStatusController.getInstance()); // model should contain the data ComposerModel model = command.getModel(); String subject = model.getSubject(); assertEquals("Subject", "Re: test", subject);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/command/ReplyToAllCommandTest.java File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/command/ReplyToMailingListCommandTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class ReplyToAllCommandTest extends AbstractComposerTst {
1
public class ReplyToMailingListCommandTest extends AbstractComposerTst {
2
    public ReplyToAllCommandTest(String arg0) {
2
    public ReplyToMailingListCommandTest(String arg0) {
3
        super(arg0);
3
        super(arg0);
4
        
4
        
5
    }
5
    }
6
    
6
    
7
    /**
7
    /**
8
     * @param arg0
8
     * @param arg0
9
     */
9
     */
10
    public ReplyToAllCommandTest(MailboxTstFactory factory, String arg0) {
10
    public ReplyToMailingListCommandTest(MailboxTstFactory factory, String arg0) {
11
        super(factory, arg0);
11
        super(factory, arg0);
12
    }
12
    }
13
    
14
    public void test() throws Exception {
13
    public void test() throws Exception {
15
        // add message "0.eml" as inputstream to folder
14
        // add message "0.eml" as inputstream to folder
16
        String input = FolderTstHelper.getString(0);
15
        String input = FolderTstHelper.getString(0);
17
        System.out.println("input=" + input);
16
        System.out.println("input=" + input);
18
        // create stream from string
17
        // create stream from string
19
        InputStream inputStream = FolderTstHelper
18
        InputStream inputStream = FolderTstHelper
20
                .getByteArrayInputStream(input);
19
                .getByteArrayInputStream(input);
21
        // add stream to folder
20
        // add stream to folder
22
        Object uid = getSourceFolder().addMessage(inputStream);
21
        Object uid = getSourceFolder().addMessage(inputStream);
23
//      create Command reference
22
//      create Command reference
24
        MailFolderCommandReference ref = new MailFolderCommandReference(
23
        MailFolderCommandReference ref = new MailFolderCommandReference(
25
				getSourceFolder(), new Object[] { uid });
24
				getSourceFolder(), new Object[] { uid });
26
        // create copy command
25
        // create copy command
27
        ReplyToAllCommand command = new ReplyToAllCommand(ref);
26
        ReplyToMailingListCommand command = new ReplyToMailingListCommand(ref);
28
        // execute command -> use mock object class as worker which does
27
        // execute command -> use mock object class as worker which does
29
        // nothing
28
        // nothing
30
        command.execute(NullWorkerStatusController.getInstance());
29
        command.execute(NullWorkerStatusController.getInstance());
31
        
32
        // model should contain the data
30
        // model should contain the data
33
        ComposerModel model = command.getModel();
31
        ComposerModel model = command.getModel();
34
        
35
        String subject = model.getSubject();
32
        String subject = model.getSubject();
36
        
37
        assertEquals("Subject", "Re: test", subject);
33
        assertEquals("Subject", "Re: test", subject);
38
    
34
    
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