OK, back to answer my own question!!!
The problem was that I needed to create the empty Result object with no
members:
private class EmptyResultsDataProvider implements MockDataProvider {
@Override
public MockResult[] execute(MockExecuteContext ctx) throws SQLException {
MockResult[] mock = new MockResult[1];
Result<Record4<String>> result = create.newResult(...);
mock[0] = new MockResult(0, result);
return mock;
}
}
On Tuesday, June 24, 2014 9:24:58 AM UTC-4, Deven Phillips wrote:
>
> I would like to know if someone could explain what I am doing wrong here...
>
> I have created an implementation of MockDataProvider which always returns
> an empty result set:
>
> private class EmptyResultsDataProvider implements MockDataProvider {
> @Override
> public MockResult[] execute(MockExecuteContext ctx) throws SQLException {
> MockResult[] mock = new MockResult[1];
> mock[0] = new MockResult(0, null);
> return mock;
> }
> }
>
> But, when I try to run a query using that MockDataProvider, I get a
> NullPointerException instead of a null result from fetchOne()???
>
> I have another MockDataProvider that actually returns data for that same
> query, and it runs fine.
>
> Any thoughts or suggestions?
>
> Thanks in advance!!
>
> Deven
>
--
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.