1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.mail;
17
18 import javax.mail.PasswordAuthentication;
19
20 import junit.framework.TestCase;
21
22 /***
23 * JUnit test case for DefaultAuthenticator Class
24 *
25 * @since 1.0
26 * @author <a href="mailto:corey.scott@gmail.com">Corey Scott</a>
27 * @version $Id: DefaultAuthenticatorTest.java 240031 2005-08-25 10:01:21Z henning $
28 */
29
30 public class DefaultAuthenticatorTest extends TestCase
31 {
32 /***
33 * @param name name
34 */
35 public DefaultAuthenticatorTest(String name)
36 {
37 super(name);
38 }
39
40 /*** */
41 public void testDefaultAuthenticatorConstructor()
42 {
43
44 String strUsername = "user.name";
45 String strPassword = "user.pwd";
46 DefaultAuthenticator authenicator =
47 new DefaultAuthenticator(strUsername, strPassword);
48
49 assertTrue(
50 PasswordAuthentication.class.isInstance(
51 authenicator.getPasswordAuthentication()));
52 assertEquals(
53 strUsername,
54 authenicator.getPasswordAuthentication().getUserName());
55 assertEquals(
56 strPassword,
57 authenicator.getPasswordAuthentication().getPassword());
58 }
59
60 }