1 package org.tigris.scarab.om; 2 3 48 49 import java.util.Calendar ; 50 import java.util.List ; 51 52 import org.tigris.scarab.test.BaseScarabTestCase; 53 54 60 public class ScarabUserTest extends BaseScarabTestCase 61 { 62 63 64 65 public void testSetPasswordExpire() 66 throws Exception 67 { 68 69 ScarabUser user = getUser1(); 70 Calendar cal = Calendar.getInstance(); 71 cal.set(2010, 9, 2); 72 user.setPasswordExpire(cal); 73 assertEquals(user.isPasswordExpired(), false); 74 cal.set(2001, 9, 2); 75 user.setPasswordExpire(cal); 76 assertEquals(user.isPasswordExpired(), true); 77 user.setPasswordExpire(null); 78 assertEquals(user.isPasswordExpired(), false); 79 } 80 81 public void testGetModules() 82 throws Exception 83 { 84 ScarabUser user = getUser1(); 85 List modules = user.getModules(true); 86 assertTrue(modules.size()>0); 87 } 88 } 89 | Popular Tags |