01: /*
02: * Copyright 2001-2005 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
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: * @param name name
33: */
34: public DefaultAuthenticatorTest(String name) {
35: super (name);
36: }
37:
38: /** */
39: public void testDefaultAuthenticatorConstructor() {
40: //insert code testing basic functionality
41: String strUsername = "user.name";
42: String strPassword = "user.pwd";
43: DefaultAuthenticator authenicator = new DefaultAuthenticator(
44: strUsername, strPassword);
45:
46: assertTrue(PasswordAuthentication.class.isInstance(authenicator
47: .getPasswordAuthentication()));
48: assertEquals(strUsername, authenicator
49: .getPasswordAuthentication().getUserName());
50: assertEquals(strPassword, authenicator
51: .getPasswordAuthentication().getPassword());
52: }
53:
54: }
|