0

We have a fitness test where in we check the data from Database. The Database is Postgres and the columns are in quotations

e.g.

SELECT * FROM "MYTABLE_ONE" WHERE "ID" = 123456;

When I execute the Script in HSQL tool it returns no records but working while in Fitness Test it returns a Null Pointer issue in jdbcslim.jar file (plugin)

I did check the plugin file but I no longer know where to check / proceed since it is already a plugin of Fitness.

Please hope someone can give me some light.

__EXCEPTION__:java.lang.NullPointerException at 

six42.fitnesse.jdbcslim.SheetCommandBase.getColumnValueByName(SheetCommandBase.java:152) [jdbcslim.jar]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_144]

jdbcslim.jar (152)

public String getColumnValueByName(String columnName) { return getColumnValueByNameFromRow(columnName, 1); }

  public String getColumnValueByNameFromRow(String columnName, int row)
  {
    List<String> Data = getRowValues(row);
    List<String> Header = (List)resultSheet.get(0);

    for (int i = 0; i < Header.size(); i++) {
      if (HeaderLine.isHeaderNameEqual((String)Header.get(i), columnName)) return (String)Data.get(i);
    }
    throw new RuntimeException("Column not found   (" + columnName + ").");
  }
Yejin
  • 541
  • 2
  • 15
  • 32

1 Answers1

0

How does your test looks like? If you want to validate that there is no record as output of your query, you can use 'getRowCount'.

F.e.:

|script|SQLCommand |!-MyDatabase-!|
|run|{{{SELECT * FROM "MYTABLE_ONE" WHERE "ID" = 123456}}}|
|show|resultSheet|
|check|getRowcount|0|
Unforgettable631
  • 940
  • 6
  • 10
  • Thanks for the reply. We have found that the issue is on the configuration of the database server. Thanks. – Yejin Jun 28 '18 at 12:25