Search in sources :

Example 1 with EntityCollectionResponse

use of org.teiid.olingo.service.EntityCollectionResponse in project teiid by teiid.

the class TestODataSQLBuilder method helpTest.

public QueryState helpTest(String url, String sqlExpected, Integer skip, Integer top, Boolean count) throws Exception {
    QueryState state = setup(url);
    Client client = state.client;
    ArgumentCaptor<Query> arg1 = ArgumentCaptor.forClass(Query.class);
    ArgumentCaptor<EntityCollectionResponse> arg6 = ArgumentCaptor.forClass(EntityCollectionResponse.class);
    List<SQLParameter> parameters = new ArrayList<SQLParameter>();
    if (sqlExpected != null) {
        Query actualCommand = (Query) QueryParser.getQueryParser().parseCommand(sqlExpected, new ParseInfo());
        Mockito.verify(client).executeSQL(arg1.capture(), Mockito.eq(parameters), Mockito.eq(count), (Integer) Mockito.eq(skip), (Integer) Mockito.eq(top), (String) Mockito.eq(null), Mockito.anyInt(), arg6.capture());
        Assert.assertEquals(actualCommand.toString(), arg1.getValue().toString());
    }
    state.parameters = parameters;
    state.arg1 = arg1;
    state.arg6 = arg6;
    return state;
}
Also used : Query(org.teiid.query.sql.lang.Query) EntityCollectionResponse(org.teiid.olingo.service.EntityCollectionResponse) SQLParameter(org.teiid.odata.api.SQLParameter) ArrayList(java.util.ArrayList) ParseInfo(org.teiid.query.parser.ParseInfo) Client(org.teiid.odata.api.Client)

Aggregations

ArrayList (java.util.ArrayList)1 Client (org.teiid.odata.api.Client)1 SQLParameter (org.teiid.odata.api.SQLParameter)1 EntityCollectionResponse (org.teiid.olingo.service.EntityCollectionResponse)1 ParseInfo (org.teiid.query.parser.ParseInfo)1 Query (org.teiid.query.sql.lang.Query)1