Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8187580

java/net/httpclient/RequestBodyTest.java fails for small message files

    Details

      Description

      I see java/net/httpclient/RequestBodyTest.java failing.
      In licensee code the file 'notsobigfile.txt' used by the test is smaller than in openJdk because of the changed copyright section. With this small file the test is failing.

      The test is quite confusing because notsobigfile.txt is smaller than smallfile.txt.

      test RequestBodyTest.exchange("http://127.0.0.1:53017/echo/foo", BYTE_ARRAY_OFFSET, BYTE_ARRAY, "/files/notsobigfile.txt", false): failure
      java.lang.IndexOutOfBoundsException
      at java.base/java.nio.Buffer.checkBounds(Buffer.java:696)
      at java.base/java.nio.HeapByteBuffer.put(HeapByteBuffer.java:227)
      at jdk.incubator.httpclient/jdk.incubator.http.RequestProcessors$ByteArrayProcessor.copy(RequestProcessors.java:85)
      at jdk.incubator.httpclient/jdk.incubator.http.RequestProcessors$ByteArrayProcessor.subscribe(RequestProcessors.java:96)
      at jdk.incubator.httpclient/jdk.incubator.http.Http1Request.writeFixedContent(Http1Request.java:455)
      at jdk.incubator.httpclient/jdk.incubator.http.Http1Request.continueRequest(Http1Request.java:272)
      at jdk.incubator.httpclient/jdk.incubator.http.Http1Exchange.sendBody(Http1Exchange.java:148)
      at jdk.incubator.httpclient/jdk.incubator.http.Exchange.responseImpl0(Exchange.java:299)
      at jdk.incubator.httpclient/jdk.incubator.http.Exchange.responseImpl(Exchange.java:245)
      at jdk.incubator.httpclient/jdk.incubator.http.Exchange.response(Exchange.java:121)
      at jdk.incubator.httpclient/jdk.incubator.http.MultiExchange.response(MultiExchange.java:154)
      at jdk.incubator.httpclient/jdk.incubator.http.HttpClientImpl.send(HttpClientImpl.java:234)
      at RequestBodyTest.getResponse(RequestBodyTest.java:268)
      at RequestBodyTest.checkResponse(RequestBodyTest.java:216)
      at RequestBodyTest.exchange(RequestBodyTest.java:148)
      at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
      at org.testng.TestRunner.privateRun(TestRunner.java:773)
      at org.testng.TestRunner.run(TestRunner.java:623)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
      at org.testng.SuiteRunner.run(SuiteRunner.java:259)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
      at org.testng.TestNG.run(TestNG.java:1018)
      at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
      at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
      at java.base/java.lang.Thread.run(Thread.java:844)
      test RequestBodyTest.exchange("http://127.0.0.1:53017/echo/foo", BYTE_ARRAY_OFFSET, BYTE_ARRAY_CONSUMER, "/files/notsobigfile.txt", false): failure
      java.lang.IndexOutOfBoundsException
      at java.base/java.nio.Buffer.checkBounds(Buffer.java:696)
      at java.base/java.nio.HeapByteBuffer.put(HeapByteBuffer.java:227)
      at jdk.incubator.httpclient/jdk.incubator.http.RequestProcessors$ByteArrayProcessor.copy(RequestProcessors.java:85)
      at jdk.incubator.httpclient/jdk.incubator.http.RequestProcessors$ByteArrayProcessor.subscribe(RequestProcessors.java:96)
      at jdk.incubator.httpclient/jdk.incubator.http.Http1Request.writeFixedContent(Http1Request.java:455)
      at jdk.incubator.httpclient/jdk.incubator.http.Http1Request.continueRequest(Http1Request.java:272)
      at jdk.incubator.httpclient/jdk.incubator.http.Http1Exchange.sendBody(Http1Exchange.java:148)
      at jdk.incubator.httpclient/jdk.incubator.http.Exchange.responseImpl0(Exchange.java:299)
      at jdk.incubator.httpclient/jdk.incubator.http.Exchange.responseImpl(Exchange.java:245)
      at jdk.incubator.httpclient/jdk.incubator.http.Exchange.response(Exchange.java:121)
      at jdk.incubator.httpclient/jdk.incubator.http.MultiExchange.response(MultiExchange.java:154)
      at jdk.incubator.httpclient/jdk.incubator.http.HttpClientImpl.send(HttpClientImpl.java:234)
      at RequestBodyTest.getResponse(RequestBodyTest.java:268)
      at RequestBodyTest.checkResponse(RequestBodyTest.java:222)
      at RequestBodyTest.exchange(RequestBodyTest.java:148)
      at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
      at org.testng.TestRunner.privateRun(TestRunner.java:773)
      at org.testng.TestRunner.run(TestRunner.java:623)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
      at org.testng.SuiteRunner.run(SuiteRunner.java:259)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
      at org.testng.TestNG.run(TestNG.java:1018)
      at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
      at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
      at java.base/java.lang.Thread.run(Thread.java:844)

        Attachments

          Activity

            People

            • Assignee:
              chegar Chris Hegarty
              Reporter:
              goetz Goetz Lindenmaier
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: