Author: tan_pham_dinh
Date: 2009-11-25 23:31:46 -0500 (Wed, 25 Nov 2009)
New Revision: 806
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
Log:
GTNPORTAL-280: Write TestCase for OrganizationService
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
===================================================================
---
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java 2009-11-26
01:03:34 UTC (rev 805)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java 2009-11-26
04:31:46 UTC (rev 806)
@@ -82,4 +82,24 @@
System.out.println(a.getUserName());
}
}
+
+ public void testFindUserByUserName() throws Exception
+ {
+ UserHandler uHandler = organizationService.getUserHandler();
+ User user = uHandler.findUserByName("root");
+ assertNotNull(user);
+ assertEquals("gtn", user.getPassword());
+
+ // Test changing password
+ user.setPassword("newPassword");
+ uHandler.saveUser(user, false);
+ user = uHandler.findUserByName("root");
+ assertNotNull(user);
+ assertEquals("newPassword", user.getPassword());
+
+ // Reset to default password
+ user.setPassword("gtn");
+ uHandler.saveUser(user, false);
+
+ }
}
Show replies by date