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