import org.junit.Test;
public class JU_Email {
-
- private ByteArrayOutputStream outStream;
- private ByteArrayOutputStream errStream;
- Email email;
- Identity usersI;
- Message msg;
- PrintStream ps;
-
- @Before
- public void setUp() throws FileNotFoundException {
- outStream = new ByteArrayOutputStream();
- errStream = new ByteArrayOutputStream();
- ps = new PrintStream(errStream);
- System.setOut(new PrintStream(outStream));
- System.setErr(ps);
-
- usersI = mock(Identity.class);
- msg = new Message();
- email = new Email();
- }
+
+ private ByteArrayOutputStream outStream;
+ private ByteArrayOutputStream errStream;
+ Email email;
+ Identity usersI;
+ Message msg;
+ PrintStream ps;
+
+ @Before
+ public void setUp() throws FileNotFoundException {
+ outStream = new ByteArrayOutputStream();
+ errStream = new ByteArrayOutputStream();
+ ps = new PrintStream(errStream);
+ System.setOut(new PrintStream(outStream));
+ System.setErr(ps);
+
+ usersI = mock(Identity.class);
+ msg = new Message();
+ email = new Email();
+ }
- @Test
- public void testClear() {
- Assert.assertNotNull(email.clear());
- }
-
- @Test
- public void testIndent() {
- email.indent("indent");
- }
-
- @Test
- public void testPreamble() {
- email.preamble("format");
- }
-
- @Test
- public void testAddTo() {
- email.addTo(usersI);
-
-// Collection col = mock(Collection.class);
-// col.add("test");
-// email.addTo(col);
-
- email.addTo("email");
- }
-
- @Test
- public void testAddCC() {
- email.addCC(usersI);
- email.addCC("email");
- }
-
-// @Test
-// public void testAdd() throws OrganizationException {
-// email.add(usersI, true);
-// }
-
- @Test
- public void testSubject() {
- email.subject("format");
- email.subject("for%smat","format");
- }
-
- @Test
- public void testSignature() {
- email.signature("format","arg");
- }
-
- @Test
- public void testMsg() {
- email.msg(msg);
- }
-
- @Test
- public void testExec() {
- AuthzTrans trans = mock(AuthzTrans.class);
- Organization org = mock(Organization.class);
- email.preamble("format");
- email.msg(msg);
- email.signature("format","arg");
-
- email.exec(trans, org, "text");
- }
-
- @Test
- public void testLog() throws FileNotFoundException {
- email.addTo("email");
- email.addCC("email");
- email.log(ps, "email");
- email.addTo("emails");
- email.addCC("emails");
- email.log(ps, "emails");
- }
-
- @After
- public void cleanUp() {
- System.setErr(System.err);
- System.setOut(System.out);
- }
+ @Test
+ public void testClear() {
+ Assert.assertNotNull(email.clear());
+ }
+
+ @Test
+ public void testIndent() {
+ email.indent("indent");
+ }
+
+ @Test
+ public void testPreamble() {
+ email.preamble("format");
+ }
+
+ @Test
+ public void testAddTo() {
+ email.addTo(usersI);
+
+// Collection col = mock(Collection.class);
+// col.add("test");
+// email.addTo(col);
+
+ email.addTo("email");
+ }
+
+ @Test
+ public void testAddCC() {
+ email.addCC(usersI);
+ email.addCC("email");
+ }
+
+// @Test
+// public void testAdd() throws OrganizationException {
+// email.add(usersI, true);
+// }
+
+ @Test
+ public void testSubject() {
+ email.subject("format");
+ email.subject("for%smat","format");
+ }
+
+ @Test
+ public void testSignature() {
+ email.signature("format","arg");
+ }
+
+ @Test
+ public void testMsg() {
+ email.msg(msg);
+ }
+
+ @Test
+ public void testExec() {
+ AuthzTrans trans = mock(AuthzTrans.class);
+ Organization org = mock(Organization.class);
+ email.preamble("format");
+ email.msg(msg);
+ email.signature("format","arg");
+
+ email.exec(trans, org, "text");
+ }
+
+ @Test
+ public void testLog() throws FileNotFoundException {
+ email.addTo("email");
+ email.addCC("email");
+ email.log(ps, "email");
+ email.addTo("emails");
+ email.addCC("emails");
+ email.log(ps, "emails");
+ }
+
+ @After
+ public void cleanUp() {
+ System.setErr(System.err);
+ System.setOut(System.out);
+ }
}