Forum Discussion

sclavell's avatar
sclavell
Occasional Contributor
9 years ago

JDBC response changes everything to upper case with 1.9.0

I have many, many tests that get data from JDBC test steps to use as parameters in other test steps or for assertions.  Prior to release 1.9.0 these JDBC results returned column names in the same case as they are in the database.  Now with 1.9.0 they are converted to all upper case.  All of my tests - months of development work - are broken and have to be reworked for this change.  PLEASE tell me there is a way to make JDBC test steps return data as it is found in the database, or make GetData references so they are not case sensitive.

 

- NOT happy.

  • Okay - I looked more closely at what your script is doing and realized there is now a checkbox in the JDBC test step for converting responses to upper case.  I hadn't noticed that was there.  I can go through each test and uncheck that box.  I appreciate your trying to automate that for me.

     

    Thanks,

  • AV's avatar
    AV
    SmartBear Alumni (Retired)

    Hi, sclavell!

     

    If you use Jdbc Request TestStep, please use next sript:

    import com.eviware.soapui.impl.wsdl.WsdlTestSuite
    import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase
    import com.eviware.soapui.model.testsuite.TestStep
    import com.eviware.soapui.support.StringUtils
    import com.eviware.soapui.impl.wsdl.teststeps.JdbcRequestTestStep
    
    context.getTestCase().getTestSuite().getProject().getTestSuiteList().each { WsdlTestSuite testSuite ->
        log.info("TestSuite: " + testSuite.getName())
        testSuite.getTestCaseList().each { WsdlTestCase testCase ->
            log.info("    TestCase: " + testCase.getName())
            testCase.getTestStepList().each { TestStep testStep ->
                if (testStep instanceof JdbcRequestTestStep)    {
                    log.info("       TestStep: " + testStep.getName())
                    JdbcRequestTestStep jdbcTestStep = (JdbcRequestTestStep)testStep
                    jdbcTestStep.setConvertColumnNamesToUpperCase(false)
                }
            }
        }    
    }

    Paste it into Setup script of your project and run it. Afterwards remove it. Now everything should be Ok.

    • sclavell's avatar
      sclavell
      Occasional Contributor

      Thanks for the response.  I tried what you suggest and got the following error:

       

      groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.panels.support.MockProjectRunContext.getTestCase() is applicable for argument types: () values: [] Possible solutions: getTestRunner(), getMetaClass()

       

      I tried changing it to context.getTestRunner().getTestCase()...  but got the same error.

      • sclavell's avatar
        sclavell
        Occasional Contributor

        Okay - I looked more closely at what your script is doing and realized there is now a checkbox in the JDBC test step for converting responses to upper case.  I hadn't noticed that was there.  I can go through each test and uncheck that box.  I appreciate your trying to automate that for me.

         

        Thanks,