Hi,

I try to find a way to create JUnit test the following sql statement;
SELECT MIN(column_name), MAX(column_name) FROM table_name

but I can't understand how to? Any one who has ideas on how to mock the sql 
statement above?

I have tried do the following using the MockDataProvider to mock the result 
without luck.

In the execute method I do;

DSLContext dslContext = DSL.using(SQLDialect.SQLSERVER2008);


Result<MyTableRecord> tableRecords = dslContext.newResult(MyTable);

tableRecords.add(dslContext.newRecord(MyTable));
tableRecords.get(0).setValue(MyTable.DOBLEVALUE_COLUMN, minValue);

tableRecords.add(dslContext.newRecord(turbineTable));
tableRecords.get(1).setValue(MyTable.DOBLEVALUE_COLUMN, maxValue);

results[0] = new MockResult(1, tableRecords);
return results;


And I get the following result??
10:46:22.460 [main] DEBUG org.jooq.tools.LoggerListener - Fetched result  : 
+------+------+
10:46:22.460 [main] DEBUG org.jooq.tools.LoggerListener 
-                          : |   min|   max|
10:46:22.460 [main] DEBUG org.jooq.tools.LoggerListener 
-                          : +------+------+
10:46:22.460 [main] DEBUG org.jooq.tools.LoggerListener 
-                          : |{null}|{null}|
10:46:22.461 [main] DEBUG org.jooq.tools.LoggerListener 
-                          : |{null}|{null}|
10:46:22.461 [main] DEBUG org.jooq.tools.LoggerListener 
-                          : +------+------+
10:46:22.461 [main] DEBUG org.jooq.tools.StopWatch - 
Finishing                : Total: 14.906s, +4.469s



Best regards
Carlos

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to