1 17 18 package javax.mail; 19 import junit.framework.TestCase; 20 23 public class PasswordAuthenticationTest extends TestCase { 24 public PasswordAuthenticationTest(String name) { 25 super(name); 26 } 27 public void testPA() { 28 String user = String.valueOf(System.currentTimeMillis()); 29 String password = "JobbyJobbyJobby" + user; 30 PasswordAuthentication pa = new PasswordAuthentication(user, password); 31 assertEquals(user, pa.getUserName()); 32 assertEquals(password, pa.getPassword()); 33 } 34 public void testPasswordAuthentication() { 35 PasswordAuthentication pa = new PasswordAuthentication("Alex", "xelA"); 36 assertEquals("Alex", pa.getUserName()); 37 assertEquals("xelA", pa.getPassword()); 38 } 39 } 40 | Popular Tags |