[jboss-cvs] JBossAS SVN: r62091 - trunk/testsuite/src/main/org/jboss/test/security/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 4 14:06:13 EDT 2007


Author: anil.saldhana at jboss.com
Date: 2007-04-04 14:06:13 -0400 (Wed, 04 Apr 2007)
New Revision: 62091

Removed:
   trunk/testsuite/src/main/org/jboss/test/security/test/LoginConfigInterceptorUnitTestCase.java
Log:
remove the obsolete  LoginConfigInterceptorUnitTestCase

Deleted: trunk/testsuite/src/main/org/jboss/test/security/test/LoginConfigInterceptorUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/security/test/LoginConfigInterceptorUnitTestCase.java	2007-04-04 18:05:37 UTC (rev 62090)
+++ trunk/testsuite/src/main/org/jboss/test/security/test/LoginConfigInterceptorUnitTestCase.java	2007-04-04 18:06:13 UTC (rev 62091)
@@ -1,93 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.security.test;
-
-import javax.management.MBeanServerConnection;
-
-import org.jboss.security.auth.login.XMLLoginConfigMBean;
-import org.jboss.test.JBossTestCase;
-
-/**
- * Test the LoginConfigInterceptor when used with an ejb
- * 
- * @author  <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
- * @version $Revision$
- */
-public class LoginConfigInterceptorUnitTestCase
-   extends JBossTestCase
-{
-   public LoginConfigInterceptorUnitTestCase(String name)
-   {
-      super(name);
-   }
-
-   /** Test the LoginConfigInterceptor when used with an ejb
-    */
-   public void testLoginConfigInterceptorWithEjb()
-      throws Exception
-   {
-      getLog().info("+++ testLoginConfigInterceptorWithEjb");
-
-      MBeanServerConnection server = getServer();
-      String module = "security-incpt.jar";
-
-      assertFalse("'other2' domain not registered",
-            isSecurityDomainPresent(server, "other2", "anonymous2"));
-      
-      deploy(module);
-      
-      assertTrue("'other2' domain registered",
-            isSecurityDomainPresent(server, "other2", "anonymous2"));
-      
-      undeploy(module);
-      
-      assertFalse("'other2' domain not registered",
-            isSecurityDomainPresent(server, "other2", "anonymous2"));         
-   }
-   
-   /**
-    * Sort of a hack to find out if a security domain has been created.
-    * We call "displayAppConfig" on the XMLLoginConfig MBean passing the domain
-    * and we look for a particular substring in the result.
-    * 
-    * It seems this method will return in any case the default "other" security
-    * domain, if a domain is not registered, so the deployed test ejb includes
-    * a login-config.xml that creates domain "other2" with the addition of 
-    * a distinguishable unathenticatedIdentity "anonymous2".
-    * 
-    * By looking for "anonymous2" in the response we can ascertain the registration
-    * was successful.
-    *  
-    * <module-option name="unauthenticatedIdentity">anonymous2</module-option>
-    */
-   private boolean isSecurityDomainPresent(MBeanServerConnection server, String domain, String substr)
-      throws Exception
-   {
-      String result = (String)server.invoke(
-            XMLLoginConfigMBean.OBJECT_NAME,
-            "displayAppConfig",
-            new Object[] { domain },
-            new String[] { domain.getClass().getName() });
-
-      return result.indexOf(substr) >= 0;
-   }
-}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list