1

I am new to SoapUI framework. I am trying to use soapUI framework for testing REST API. While testing for REST API, I need to verify data from backend database as well like Hive and Cassandra.

I could do the setup for SoapUI and could test a query on Cassandra using groovy script that is provided SoapUI framework. But when I searched for connecting to hive using SoapUI, I couldn't find any reference for that. Also on there sites, JDBC drivers are not provided but hive is not mentioned there.

So is there any option to connect to hive from SoapUI framework?
Should I think about using Hive JDBC driver from SoapUI?

Thanks for your help!

pritid
  • 11
  • 1

1 Answers1

0

I believe you should be able to use it for different data bases using following ways:

  1. JDBC test step
  2. Groovy Script (you should be able to use almost java code)

Either of the ways, copy the drivers/libraries into SOAPUI_HOME/bin/ext directory and restart SoapUI

Here is the link for client code (in Java) to connect to Hive.

Sample connection code from above link(so should be able to use in groovy) :

try {
      Class.forName(driverName);
    } catch (ClassNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      System.exit(1);
    }
    Connection con = DriverManager.getConnection("jdbc:hive://localhost:10000/default", "", "");
    Statement stmt = con.createStatement();
    String tableName = "testHiveDriverTable";
    stmt.executeQuery("drop table " + tableName);
    ResultSet res = stmt.executeQuery("create table " + tableName + " (key int, value string)");
    // show tables
    String sql = "show tables '" + tableName + "'";
    System.out.println("Running: " + sql);
    res = stmt.executeQuery(sql);
Rao
  • 20,781
  • 11
  • 57
  • 77