Package org.teiid.client

Examples of org.teiid.client.DQP.executeRequest()


    Mockito.stub(serverConn.getLogonResult()).toReturn(logonResult);
    Mockito.stub(logonResult.getTimeZone()).toReturn(TimeZone.getDefault());

    // a dummy result message that is specific to this test case
    ResultsFuture<ResultsMessage> results = new ResultsFuture<ResultsMessage>();
    Mockito.stub(dqp.executeRequest(Matchers.anyLong(), (RequestMessage)Matchers.anyObject())).toReturn(results);
    ResultsMessage rm = new ResultsMessage();
    rm.setResults(new List<?>[] {Arrays.asList(0), Arrays.asList(0), Arrays.asList(0)});
    rm.setUpdateResult(true);
    results.getResultsReceiver().receiveResults(rm);
    Mockito.stub(conn.getDQP()).toReturn(dqp);
View Full Code Here


  @Test public void testBatchExecution() throws Exception {
    ConnectionImpl conn = Mockito.mock(ConnectionImpl.class);
    DQP dqp = Mockito.mock(DQP.class);
    ResultsFuture<ResultsMessage> results = new ResultsFuture<ResultsMessage>();
    Mockito.stub(dqp.executeRequest(Mockito.anyLong(), (RequestMessage)Mockito.anyObject())).toReturn(results);
    ResultsMessage rm = new ResultsMessage();
    rm.setResults(new List<?>[] {Arrays.asList(1), Arrays.asList(2)});
    rm.setUpdateResult(true);
    results.getResultsReceiver().receiveResults(rm);
    Mockito.stub(conn.getDQP()).toReturn(dqp);
View Full Code Here

    StatementImpl statement = new StatementImpl(conn, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    statement.setQueryTimeoutMS(1);
    DQP dqp = Mockito.mock(DQP.class);
    Mockito.stub(statement.getDQP()).toReturn(dqp);
    ResultsFuture<ResultsMessage> future = new ResultsFuture<ResultsMessage>();
    Mockito.stub(dqp.executeRequest(Mockito.anyLong(), (RequestMessage) Mockito.anyObject())).toReturn(future);
    statement.submitExecute("select 'hello world'");
    Thread.sleep(100);
    Mockito.verify(dqp).cancelRequest(0);
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.