Search in sources :

Example 16 with ParseInfo

use of org.teiid.query.parser.ParseInfo in project teiid by teiid.

the class TestODataSQLBuilder method helpInsert.

private UpdateState helpInsert(String url, String sqlExpected, StringServletInputStream stream, String method) throws Exception {
    UpdateState state = (UpdateState) setup(DEFAULT_DDL, url, method, stream, new UpdateState());
    Client client = state.client;
    ArgumentCaptor<Command> arg1 = ArgumentCaptor.forClass(Command.class);
    ArgumentCaptor<List> arg2 = ArgumentCaptor.forClass(List.class);
    if (sqlExpected != null) {
        Command actualCommand = (Command) QueryParser.getQueryParser().parseCommand(sqlExpected, new ParseInfo());
        Mockito.verify(client).executeUpdate(arg1.capture(), arg2.capture());
        Assert.assertEquals(actualCommand.toString(), arg1.getValue().toString());
    }
    state.commandArg = arg1;
    return state;
}
Also used : Command(org.teiid.query.sql.lang.Command) ArrayList(java.util.ArrayList) List(java.util.List) ParseInfo(org.teiid.query.parser.ParseInfo) Client(org.teiid.odata.api.Client)

Aggregations

ParseInfo (org.teiid.query.parser.ParseInfo)16 CacheID (org.teiid.dqp.internal.process.SessionAwareCache.CacheID)11 Test (org.junit.Test)6 Cachable (org.teiid.cache.Cachable)6 Command (org.teiid.query.sql.lang.Command)4 ArrayList (java.util.ArrayList)3 Client (org.teiid.odata.api.Client)2 BatchCollector (org.teiid.query.processor.BatchCollector)2 Reference (org.teiid.query.sql.symbol.Reference)2 LinkedList (java.util.LinkedList)1 List (java.util.List)1 BlockedException (org.teiid.common.buffer.BlockedException)1 TupleBatch (org.teiid.common.buffer.TupleBatch)1 TupleBuffer (org.teiid.common.buffer.TupleBuffer)1 TeiidComponentException (org.teiid.core.TeiidComponentException)1 TeiidProcessingException (org.teiid.core.TeiidProcessingException)1 TransformationException (org.teiid.core.types.TransformationException)1 CachedResults (org.teiid.dqp.internal.process.CachedResults)1 PreparedPlan (org.teiid.dqp.internal.process.PreparedPlan)1 TransactionContext (org.teiid.dqp.service.TransactionContext)1