directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: rev 6176 - in incubator/directory/naming/trunk/factory/src: java/org/apache/directory/naming/config test test/org/apache/directory/naming/config
Date Thu, 15 Jan 2004 23:30:48 GMT
Author: brett
Date: Thu Jan 15 15:30:47 2004
New Revision: 6176

Modified:
   incubator/directory/naming/trunk/factory/src/java/org/apache/directory/naming/config/Config.java
   incubator/directory/naming/trunk/factory/src/test/org/apache/directory/naming/config/XmlConfiguratorTest.java
   incubator/directory/naming/trunk/factory/src/test/test-jndi.xml
Log:
add ommitted types to configuration


Modified: incubator/directory/naming/trunk/factory/src/java/org/apache/directory/naming/config/Config.java
==============================================================================
--- incubator/directory/naming/trunk/factory/src/java/org/apache/directory/naming/config/Config.java
(original)
+++ incubator/directory/naming/trunk/factory/src/java/org/apache/directory/naming/config/Config.java
Thu Jan 15 15:30:47 2004
@@ -251,9 +251,37 @@
             {
                 return value;
             }
+            else if (type.equals(Boolean.class.getName()))
+            {
+                return Boolean.valueOf(value);
+            }
             else if (type.equals(Integer.class.getName()))
             {
                 return Integer.valueOf(value);
+            }
+            else if (type.equals(Short.class.getName()))
+            {
+                return Short.valueOf(value);
+            }
+            else if (type.equals(Character.class.getName()))
+            {
+                return new Character(value.charAt(0));
+            }
+            else if (type.equals(Double.class.getName()))
+            {
+                return Double.valueOf(value);
+            }
+            else if (type.equals(Float.class.getName()))
+            {
+                return Float.valueOf(value);
+            }
+            else if (type.equals(Byte.class.getName()))
+            {
+                return Byte.valueOf(value);
+            }
+            else if (type.equals(Long.class.getName()))
+            {
+                return Long.valueOf(value);
             }
             return null;
         }

Modified: incubator/directory/naming/trunk/factory/src/test/org/apache/directory/naming/config/XmlConfiguratorTest.java
==============================================================================
--- incubator/directory/naming/trunk/factory/src/test/org/apache/directory/naming/config/XmlConfiguratorTest.java
(original)
+++ incubator/directory/naming/trunk/factory/src/test/org/apache/directory/naming/config/XmlConfiguratorTest.java
Thu Jan 15 15:30:47 2004
@@ -115,6 +115,12 @@
 
         assertEquals("Check host", "www.apache.org", host);
         assertEquals("Check port", new Integer(80), port);
+
+        Boolean trueBool = (Boolean) env.lookup("config/mytruebool");
+        Boolean falseBool = (Boolean) env.lookup("config/myfalsebool");
+
+        assertTrue("Check true boolean value", trueBool.booleanValue());
+        assertTrue("Check false boolean value", !falseBool.booleanValue());
     }
   
     /**

Modified: incubator/directory/naming/trunk/factory/src/test/test-jndi.xml
==============================================================================
--- incubator/directory/naming/trunk/factory/src/test/test-jndi.xml	(original)
+++ incubator/directory/naming/trunk/factory/src/test/test-jndi.xml	Thu Jan 15 15:30:47 2004
@@ -7,6 +7,8 @@
     </context>
 
     <environment name="config/host" value="www.apache.org" type="java.lang.String" />
+    <environment name="config/mytruebool" value="true" type="java.lang.Boolean" />
+    <environment name="config/myfalsebool" value="false" type="java.lang.Boolean" />
     <environment name="config/port" value="80" type="java.lang.Integer" />
 
     <environment name="jdbc/config/pool/user" value="dbuser" type="java.lang.String" />

Mime
View raw message