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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 1 23:49:07 EST 2007


Author: scott.stark at jboss.org
Date: 2007-02-01 23:49:06 -0500 (Thu, 01 Feb 2007)
New Revision: 60182

Modified:
   trunk/testsuite/src/main/org/jboss/test/naming/test/ExternalContextUnitTestCase.java
Log:
JBAS-4048, look to all superclass interfaces when creating the proxy

Modified: trunk/testsuite/src/main/org/jboss/test/naming/test/ExternalContextUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/naming/test/ExternalContextUnitTestCase.java	2007-02-02 04:47:48 UTC (rev 60181)
+++ trunk/testsuite/src/main/org/jboss/test/naming/test/ExternalContextUnitTestCase.java	2007-02-02 04:49:06 UTC (rev 60182)
@@ -1,24 +1,24 @@
 /*
-  * 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.
-  */
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.naming.test;
 
 import java.util.ArrayList;
@@ -37,27 +37,26 @@
  * A test of the ExternalContext naming mbean. To test there needs to be one or
  * more ExternalContex mbeans setup. An example filesystem context setup would
  * be: 
-  <mbean code="org.jboss.naming.ExternalContext" name="jboss:service=ExternalContext,jndiName=external/fs/tmp">
-    <attribute name="JndiName">external/fs/Scott</attribute>
-    <attribute name="Properties">tmp.fs</attribute>
-    <attribute name="RemoteAccess">true</attribute>
-  </mbean>
+<server>
+   <mbean code="org.jboss.naming.ExternalContext" name="jboss.test:service=ExternalContext,jndiName=external/SubMockNamingContext">
+      <attribute name="JndiName">external/SubMockNamingContext</attribute>
+      <attribute name="InitialContext">org.jboss.test.naming.factory.MockInitialContext</attribute>
+      <attribute name="Properties">
+         # Dummy JNDI properties
+         java.naming.factory.initial=org.jboss.test.naming.factory.MockInitialContextFactory
+         java.naming.provider.url=http://www.jboss.org
+      </attribute>
+      <attribute name="RemoteAccess">true</attribute>
+   </mbean>
+</server>
 
-where tmp.fs is a Properties file containing:
-# JNDI properties for /Scott filesystem directory
-java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
-java.naming.provider.url=file:/tmp
-
- *
- * @author    Scott_Stark at displayscape.com
- * @version   $Revision$
+ @author Scott.Stark at jboss.org
+ @version $Revision$
  */
 public class ExternalContextUnitTestCase extends JBossTestCase
 {
    private ObjectName[] contextNames;
 
-//    private RemoteMBeanServer server;
-
    /**
     * Constructor for the ExternalContextUnitTestCase object
     *
@@ -103,48 +102,35 @@
     */
    protected void setUp() throws Exception
    {
-      try
+      super.setUp();
+      super.redeploy("extcontext.sar");
+      contextNames = null;
+      ObjectName pattern = new ObjectName("*:service=ExternalContext,*");
+      Set names = getServer().queryMBeans(pattern, null);
+      Iterator iter = names.iterator();
+      ArrayList tmp = new ArrayList();
+      while (iter.hasNext())
       {
-         super.setUp();
-         contextNames = null;
-         ObjectName pattern = new ObjectName("*:service=ExternalContext,*");
-         Set names = getServer().queryMBeans(pattern, null);
-         Iterator iter = names.iterator();
-         ArrayList tmp = new ArrayList();
-         while (iter.hasNext())
-         {
-            ObjectInstance oi = (ObjectInstance)iter.next();
-            ObjectName name = oi.getObjectName();
-            getLog().debug(name);
-            tmp.add(name);
-         }
-         if (tmp.size() > 0)
-         {
-            contextNames = new ObjectName[tmp.size()];
-            tmp.toArray(contextNames);
-         }
+         ObjectInstance oi = (ObjectInstance)iter.next();
+         ObjectName name = oi.getObjectName();
+         getLog().debug(name);
+         tmp.add(name);
       }
-      catch (Exception x)
+      if (tmp.size() > 0)
       {
-         if (x instanceof RuntimeMBeanException)
-         {
-            getLog().error("setUp RuntimeMBeanException:",((RuntimeMBeanException)x).getTargetException());
-         }
-         else
-         {
-            getLog().error("setUp Error:" , x);
-         }
+         contextNames = new ObjectName[tmp.size()];
+         tmp.toArray(contextNames);
       }
    }
 
    private void list(Context ctx) throws NamingException
    {
-      NamingEnumeration enumeration = ctx.list("");
-      while (enumeration.hasMore())
+      NamingEnumeration i = ctx.list("");
+      while (i.hasMore())
       {
-         getLog().debug(enumeration.next());
+         getLog().debug(i.next());
       }
-      enumeration.close();
+      i.close();
    }
 
 }




More information about the jboss-cvs-commits mailing list