geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: rev 47549 - in geronimo/trunk/modules/naming/src: java/org/apache/geronimo/naming/java test/org/apache/geronimo/naming/java
Date Thu, 30 Sep 2004 04:05:19 GMT
Author: jboynes
Date: Wed Sep 29 21:05:18 2004
New Revision: 47549

Modified:
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
   geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
Log:
Need to define comp/env context even if its empty

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
Wed Sep 29 21:05:18 2004
@@ -40,6 +40,11 @@
     public ComponentContextBuilder(ReferenceFactory referenceFactory) {
         this.referenceFactory = referenceFactory;
         this.context = new ReadOnlyContext();
+        try {
+            context.internalBind("env", new ReadOnlyContext());
+        } catch (NamingException e) {
+            throw new AssertionError();
+        }
     }
 
     public ReadOnlyContext getContext() {

Modified: geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
(original)
+++ geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
Wed Sep 29 21:05:18 2004
@@ -129,6 +129,16 @@
         }
     }
 
+    public void testEmptyEnvironment() {
+        ReadOnlyContext context = builder.getContext();
+        try {
+            ReadOnlyContext env = (ReadOnlyContext) context.lookup("env");
+            assertNotNull(env);
+        } catch (NamingException e) {
+            fail();
+        }
+    }
+
     protected void setUp() throws Exception {
         super.setUp();
         ReferenceFactory referenceFactory = new JMXReferenceFactory("geronimo.server", "geronimo");

Mime
View raw message