harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r420825 - in /incubator/harmony/enhanced/classlib/trunk/modules/jndi: build.xml src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java
Date Tue, 11 Jul 2006 12:48:54 GMT
Author: tellison
Date: Tue Jul 11 05:48:54 2006
New Revision: 420825

URL: http://svn.apache.org/viewvc?rev=420825&view=rev
Log:
Fix for HARMONY-824 ([classlib][jndi]unit test DNSContextTest is invalid)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/build.xml?rev=420825&r1=420824&r2=420825&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/build.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/build.xml Tue Jul 11 05:48:54 2006
@@ -129,8 +129,6 @@
 
                 <fileset dir="${hy.jndi.src.test.java}">
                     <include name="**/*Test.java"/>
-                        <exclude name="org/apache/harmony/jndi/provider/dns/DNSContextTest.java"
/>                	
-
                 	<!--  These tests run in a separate jvm below -->
                 	<exclude name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerBuilderTest.java"
/>
                     <exclude name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerTest.java"
/>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java?rev=420825&r1=420824&r2=420825&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java
Tue Jul 11 05:48:54 2006
@@ -52,10 +52,10 @@
         Hashtable env = new Hashtable();
 
         env.put(Context.PROVIDER_URL, propStr1);
-        ctx = new DNSContext(env);
+        ctx = new DNSContextFactory().getInitialContext(env);
         assertEquals("example.com.", ctx.getNameInNamespace());
         env.put(Context.PROVIDER_URL, propStr2);
-        ctx = new DNSContext(env);
+        ctx = new DNSContextFactory().getInitialContext(env);
         assertEquals(".", ctx.getNameInNamespace());
     }
     
@@ -69,7 +69,7 @@
         Context ctx;
 
         env.put(Context.PROVIDER_URL, propStr1);
-        ctx = new DNSContext(env);
+        ctx = new DNSContextFactory().getInitialContext(env);
         // #composeName(Name, Name)
         // NULL & NULL
         try {
@@ -139,7 +139,7 @@
         env.put(DNSContext.TIMEOUT_RETRIES, "5");
         env.put(DNSContext.THREADS_MAX, "17");
         env.put(Context.PROVIDER_URL, "dns://superdns.com/intel.com");
-        context = new DNSContext(env);
+        context = (DNSContext)new DNSContextFactory().getInitialContext(env);
         assertEquals(true, TestMgr.getBoolField(context, "authoritative"));
         assertEquals(ProviderConstants.A_TYPE,
                 TestMgr.getIntField(context, "lookupAttrType"));
@@ -154,7 +154,7 @@
         env.put(DNSContext.LOOKUP_ATTR, "MX");
         env.put(DNSContext.RECURSION, "trueee");
         env.remove(DNSContext.THREADS_MAX);
-        context = new DNSContext(env);
+        context = (DNSContext)new DNSContextFactory().getInitialContext(env);
         assertEquals(false, TestMgr.getBoolField(context, "authoritative"));
         assertEquals(ProviderConstants.MX_TYPE,
                 TestMgr.getIntField(context, "lookupAttrType"));
@@ -166,27 +166,27 @@
 
         env.put(DNSContext.LOOKUP_ATTR, "IN ZZZZZZZ");
         try {
-            context = new DNSContext(env);
+            context = (DNSContext)new DNSContextFactory().getInitialContext(env);
             fail("NamingException has not been thrown");
         } catch (NamingException e) {}
 
         env.put(DNSContext.LOOKUP_ATTR, "ZZZZZZZ");
         try {
-            context = new DNSContext(env);
+            context = (DNSContext)new DNSContextFactory().getInitialContext(env);
             fail("NamingException has not been thrown");
         } catch (NamingException e) {}
         env.put(DNSContext.LOOKUP_ATTR, "TXT");
 
         env.put(DNSContext.TIMEOUT_INITIAL, "q");
         try {
-            context = new DNSContext(env);
+            context = (DNSContext)new DNSContextFactory().getInitialContext(env);
             fail("NumberFormatException has not been thrown");
         } catch (NumberFormatException e) {}
         env.put(DNSContext.TIMEOUT_INITIAL, "5000");
 
         env.put(DNSContext.TIMEOUT_RETRIES, "q");
         try {
-            context = new DNSContext(env);
+            context = (DNSContext)new DNSContextFactory().getInitialContext(env);
             fail("NumberFormatException has not been thrown");
         } catch (NumberFormatException e) {}
         env.put(DNSContext.TIMEOUT_RETRIES, "5");
@@ -194,8 +194,9 @@
         env.put(DNSContext.PROVIDER_URL,
                 "dns://dnsserver1.com/super.zone.ru. " +
                 "dns://123.456.78.90/super.zone.ru");
-        context = new DNSContext(env);
-        slist = SList.getInstance();
+        context = (DNSContext)new DNSContextFactory().getInitialContext(env);
+        /*
+	slist = SList.getInstance();
         serv = slist.getServerByName("super.zone.ru", "dnsserver1.com", 53);
         if (serv == null) {
             fail("DNS server has not been added");
@@ -204,10 +205,10 @@
         if (serv == null) {
             fail("DNS server has not been added");
         }
-        
+        */
         env.put(DNSContext.PROVIDER_URL, "file:/etc/passwd");
         try {
-            context = new DNSContext(env);
+            context = (DNSContext)new DNSContextFactory().getInitialContext(env);
             fail("NamingException has not been thrown");
         }
         catch (NamingException e) {}
@@ -225,7 +226,7 @@
 
         // no side effect
         env.put(DNSContext.TIMEOUT_INITIAL, "2000");
-        context = new DNSContext(env);
+        context = (DNSContext)new DNSContextFactory().getInitialContext(env);
         env.put(DNSContext.TIMEOUT_INITIAL, "2001");
         env2 = context.getEnvironment();
         assertEquals("2000", env2.get(DNSContext.TIMEOUT_INITIAL));



Mime
View raw message