jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milamber <milam...@apache.org>
Subject Re: svn commit: r1780852 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java test/src/org/apache/jmeter/protocol/http/control/TestDNSCacheManager.java
Date Sun, 05 Feb 2017 16:40:09 GMT


On 29/01/2017 20:35, pmouawad@apache.org wrote:
> Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestDNSCacheManager.java
> URL:http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestDNSCacheManager.java?rev=1780852&r1=1780851&r2=1780852&view=diff
> ==============================================================================
> --- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestDNSCacheManager.java
(original)
> +++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestDNSCacheManager.java
Sun Jan 29 20:35:59 2017
> @@ -20,18 +20,92 @@ package org.apache.jmeter.protocol.http.
>   
>   import static org.junit.Assert.fail;
>   [....]
> -
> +
> +    @Test
> +    public void testResolveExistingHostWithSystemDefaultDnsServer() throws UnknownHostException
{
> +        DNSCacheManager original = new DNSCacheManager();
> +        original.setCustomResolver(false);
> +        try {
> +            InetAddress[] result = original.resolve("www.example.org");
> +            Assert.assertNotNull(result);
> +            Assert.assertNull(original.resolver);
> +            // IPv4 and IPv6
> +            Assert.assertTrue(result.length == 2);

When I execute test ant task, I have this error below.
When I resolve the www.example.org, I've found only IPv4 address (my 
network is only on ipv4).

Have you the same error (on ipv4 installation)?



      [java] There was 1 failure:
      [java] 1) 
testResolveExistingHostWithSystemDefaultDnsServer(org.apache.jmeter.protocol.http.control.TestDNSCacheManager)
      [java] java.lang.AssertionError
      [java]     at org.junit.Assert.fail(Assert.java:86)
      [java]     at org.junit.Assert.assertTrue(Assert.java:41)
      [java]     at org.junit.Assert.assertTrue(Assert.java:52)
      [java]     at 
org.apache.jmeter.protocol.http.control.TestDNSCacheManager.testResolveExistingHostWithSystemDefaultDnsServer(TestDNSCacheManager.java:154)
      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
      [java]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [java]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [java]     at java.lang.reflect.Method.invoke(Method.java:498)
      [java]     at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      [java]     at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      [java]     at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      [java]     at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      [java]     at 
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      [java]     at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      [java]     at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      [java]     at 
org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      [java]     at 
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      [java]     at 
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      [java]     at 
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      [java]     at 
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      [java]     at 
org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      [java]     at org.junit.runners.Suite.runChild(Suite.java:128)
      [java]     at org.junit.runners.Suite.runChild(Suite.java:27)
      [java]     at 
org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      [java]     at 
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      [java]     at 
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      [java]     at 
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      [java]     at 
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      [java]     at 
org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      [java]     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      [java]     at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
      [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:222)
      [java]
      [java] FAILURES!!!
      [java] Tests run: 2700,  Failures: 1
      [java]




> +        } catch (UnknownHostException e) {
> +            Assert.fail("Should not have failed");
> +        }
> +    }
> +
> +    @Test
> +    public void testResolveNonExistingHostWithSystemDefaultDnsServer() throws UnknownHostException
{
> +        DNSCacheManager original = new DNSCacheManager();
> +        original.setCustomResolver(false);
> +        try {
> +            original.resolve("jmeterxxx.apache.org");
> +            fail();
> +        } catch (UnknownHostException e) {
> +            Assert.assertNull(original.resolver);
> +            // OK
> +        }
> +    }
>   }
>
>
>


Mime
View raw message