[jboss-cvs] JBossAS SVN: r90031 - in branches/Branch_5_x: testsuite/src/main/org/jboss/test/profileservice/testsecure and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 9 22:04:18 EDT 2009


Author: scott.stark at jboss.org
Date: 2009-06-09 22:04:17 -0400 (Tue, 09 Jun 2009)
New Revision: 90031

Modified:
   branches/Branch_5_x/profileservice/src/resources/profileservice-roles.properties
   branches/Branch_5_x/profileservice/src/resources/profileservice-users.properties
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/testsecure/ProfileServiceUnitTestCase.java
Log:
JBAS-6982, include an admin/admin user

Modified: branches/Branch_5_x/profileservice/src/resources/profileservice-roles.properties
===================================================================
--- branches/Branch_5_x/profileservice/src/resources/profileservice-roles.properties	2009-06-10 01:24:54 UTC (rev 90030)
+++ branches/Branch_5_x/profileservice/src/resources/profileservice-roles.properties	2009-06-10 02:04:17 UTC (rev 90031)
@@ -1,2 +1,3 @@
 jduke=User
-javaduke=Administrator
\ No newline at end of file
+javaduke=Administrator
+admin=Administrator
\ No newline at end of file

Modified: branches/Branch_5_x/profileservice/src/resources/profileservice-users.properties
===================================================================
--- branches/Branch_5_x/profileservice/src/resources/profileservice-users.properties	2009-06-10 01:24:54 UTC (rev 90030)
+++ branches/Branch_5_x/profileservice/src/resources/profileservice-users.properties	2009-06-10 02:04:17 UTC (rev 90031)
@@ -1,2 +1,3 @@
 jduke=theduke
 javaduke=anotherduke
+admin=admin
\ No newline at end of file

Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/testsecure/ProfileServiceUnitTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/testsecure/ProfileServiceUnitTestCase.java	2009-06-10 01:24:54 UTC (rev 90030)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/testsecure/ProfileServiceUnitTestCase.java	2009-06-10 02:04:17 UTC (rev 90031)
@@ -116,9 +116,33 @@
 
 
    /**
-    * Try to 
+    * Try to access a method with an invalid login
     * @throws Exception
     */
+   public void testInvalidUserDefaultDSComponentCount()
+      throws Exception
+   {
+      login("admin", "non-admin".toCharArray());
+      ManagementView mgtView = getManagementView();
+      ComponentType type = new ComponentType("DataSource", "LocalTx");
+      try
+      {
+         Set<ManagedComponent> comps = mgtView.getComponentsForType(type);
+         fail("jduke was able to invoke getComponentsForType");
+      }
+      catch(Exception e)
+      {
+         log.info("jduke calling getComponentsForType failed as expected, "+e.getMessage());
+      }
+      finally
+      {
+         logout();
+      }
+   }
+   /**
+    * Try to access a method with a user that does not have admin rights
+    * @throws Exception
+    */
    public void testNonAdminDefaultDSComponentCount()
       throws Exception
    {
@@ -177,7 +201,9 @@
       throws Exception
    {
       InitialContext ctx = super.getInitialContext();
-      ProfileService ps = (ProfileService) ctx.lookup("SecureProfileService/remote");
+      Object ref = ctx.lookup("SecureProfileService/remote");
+      log.debug("SecureProfileService/remote: "+ref);
+      ProfileService ps = (ProfileService) ref;
       return ps;
    }
    @Override




More information about the jboss-cvs-commits mailing list