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