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