Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 13555 invoked from network); 11 Jul 2006 12:49:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Jul 2006 12:49:17 -0000 Received: (qmail 43237 invoked by uid 500); 11 Jul 2006 12:49:17 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 43209 invoked by uid 500); 11 Jul 2006 12:49:17 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 43198 invoked by uid 99); 11 Jul 2006 12:49:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2006 05:49:17 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2006 05:49:15 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id F1DB81A981A; Tue, 11 Jul 2006 05:48:54 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: harmony-commits@incubator.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060711124854.F1DB81A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 @@ - - 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));