Derby
  1. Derby
  2. DERBY-5424

On z/OS testConnectWrongSubprotocolWithSystemProperty(org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest)junit.framework.Asserti ailedError

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.8.2.2
    • Fix Version/s: 10.9.2.2
    • Component/s: Test
    • Labels:
      None
    • Environment:
    • Issue & fix info:
      Newcomer, Patch Available, Repro attached

      Description

      With the release candidate 10.8.2.1 - (1170221) I saw the following two failures on z/OS in testConnectWrongSubprotoctestolWithoutSystemProperty

      There were 2 failures:
      1) testConnectWrongSubprotocolWithSystemProperty(org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest)junit.framework.Asserti
      onFailedError
      at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.checkConnectWrongSubprotocol(ConnectWrongSubprotocolTest.java
      :82)
      at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.testConnectWrongSubprotocolWithSystemProperty(ConnectWrongSub
      protocolTest.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:16)
      2) testConnectWrongSubprotoctestolWithoutSystemProperty(org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest)junit.framework.
      AssertionFailedError
      at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.checkConnectWrongSubprotocol(ConnectWrongSubprotocolTest.java
      :82)
      at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.testConnectWrongSubprotoctestolWithoutSystemProperty(ConnectW
      rongSubprotocolTest.java:76)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:16)

      FAILURES!!!
      Tests run: 13984, Failures: 2, Errors: 0

      The test is newly converted with DERBY-5084 so not likely a regression, but probably more likely an encoding issue related to this test:
      String ijResult = runIjScript(ijScript, useSystemProperties);
      assertTrue(ijResult.indexOf("08001") > -1);

        Issue Links

          Activity

          Hide
          Kathey Marsden added a comment -

          linking to the associated test conversion. I think the runIjScript method in ConnectWrongSubProtocolTest needs to be made to work on systems where the default encoding is not compatible with US-ASCII. Perhaps by just changing return new String(baos.toByteArray());
          to the constructor that takes a Charset argument.

          Show
          Kathey Marsden added a comment - linking to the associated test conversion. I think the runIjScript method in ConnectWrongSubProtocolTest needs to be made to work on systems where the default encoding is not compatible with US-ASCII. Perhaps by just changing return new String(baos.toByteArray()); to the constructor that takes a Charset argument.
          Hide
          Kathey Marsden added a comment -

          To reproduce the problem on Windows or other platform you can change the file.encoding system property, e.g.
          $ java -Dderby.tests.basePort=1627 -Dfile.encoding="UTF-16" junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest

          .F.F
          Time: 4
          There were 2 failures:
          1) testConnectWrongSubprotocolWithSystemProperty(org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest)junit.framework.Asserti
          onFailedError
          at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.checkConnectWrongSubprotocol(ConnectWrongSubprotocolTest.java
          :82)
          at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.testConnectWrongSubprotocolWithSystemProperty(ConnectWrongSub
          protocolTest.java:68)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
          at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
          at junit.extensions.TestSetup.run(TestSetup.java:25)
          2) testConnectWrongSubprotoctestolWithoutSystemProperty(org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest)junit.framework.
          AssertionFailedError
          at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.checkConnectWrongSubprotocol(ConnectWrongSubprotocolTest.java
          :82)
          at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.testConnectWrongSubprotoctestolWithoutSystemProperty(ConnectW
          rongSubprotocolTest.java:76)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
          at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
          at junit.extensions.TestSetup.run(TestSetup.java:25)

          FAILURES!!!
          Tests run: 2, Failures: 2, Errors: 0

          Show
          Kathey Marsden added a comment - To reproduce the problem on Windows or other platform you can change the file.encoding system property, e.g. $ java -Dderby.tests.basePort=1627 -Dfile.encoding="UTF-16" junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest .F.F Time: 4 There were 2 failures: 1) testConnectWrongSubprotocolWithSystemProperty(org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest)junit.framework.Asserti onFailedError at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.checkConnectWrongSubprotocol(ConnectWrongSubprotocolTest.java :82) at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.testConnectWrongSubprotocolWithSystemProperty(ConnectWrongSub protocolTest.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.extensions.TestSetup.run(TestSetup.java:25) 2) testConnectWrongSubprotoctestolWithoutSystemProperty(org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest)junit.framework. AssertionFailedError at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.checkConnectWrongSubprotocol(ConnectWrongSubprotocolTest.java :82) at org.apache.derbyTesting.functionTests.tests.tools.ConnectWrongSubprotocolTest.testConnectWrongSubprotoctestolWithoutSystemProperty(ConnectW rongSubprotocolTest.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.extensions.TestSetup.run(TestSetup.java:25) FAILURES!!! Tests run: 2, Failures: 2, Errors: 0
          Hide
          Kathey Marsden added a comment -

          Attached is a patch for this issue to use a consistent encoding for comparison on all platforms

          Show
          Kathey Marsden added a comment - Attached is a patch for this issue to use a consistent encoding for comparison on all platforms

            People

            • Assignee:
              Kathey Marsden
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development