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