[jboss-cvs] JBossAS SVN: r77449 - branches/JBPAPP_4_2_0_GA_CP/test/src/main/org/jboss/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 25 13:48:08 EDT 2008


Author: smcgowan at redhat.com
Date: 2008-08-25 13:48:07 -0400 (Mon, 25 Aug 2008)
New Revision: 77449

Modified:
   branches/JBPAPP_4_2_0_GA_CP/test/src/main/org/jboss/test/JBossIIOPTestCase.java
Log:
JBPAPP-1130 - fix tests to run with JDK 6 

Modified: branches/JBPAPP_4_2_0_GA_CP/test/src/main/org/jboss/test/JBossIIOPTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/test/src/main/org/jboss/test/JBossIIOPTestCase.java	2008-08-25 16:31:37 UTC (rev 77448)
+++ branches/JBPAPP_4_2_0_GA_CP/test/src/main/org/jboss/test/JBossIIOPTestCase.java	2008-08-25 17:48:07 UTC (rev 77449)
@@ -34,6 +34,10 @@
  */
 public class JBossIIOPTestCase extends JBossTestCase
 {
+
+   // JBAS-5758, cache the initial context to avoid premature ORB destruction
+   protected InitialContext ic = null;
+
    protected Properties jndiProps;
 
    public JBossIIOPTestCase(String name)
@@ -44,7 +48,7 @@
    // Override getInitialContext() ----------------------------------
    protected InitialContext getInitialContext() throws Exception
    {
-      if( jndiProps == null )
+      if ( jndiProps == null )
       {
          URL url  = ClassLoader.getSystemResource("cosnaming.jndi.properties");
          jndiProps = new java.util.Properties();
@@ -53,7 +57,11 @@
          String corbaloc = "corbaloc::"+host+":3528/JBoss/Naming/root";
          jndiProps.setProperty("java.naming.provider.url", corbaloc);
       }
-      return new InitialContext(jndiProps);
+
+      if (ic == null)
+         ic = new InitialContext(jndiProps);
+
+      return ic;
    }
    
    protected InitialContext getInitialJnpContext() throws Exception




More information about the jboss-cvs-commits mailing list