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