Package org.teiid.client

Examples of org.teiid.client.RequestMessage


    }
   
    public void testGetConnectorInfo() {
        DQPCore rm = new DQPCore();
        rm.setTransactionService(new FakeTransactionService());
        RequestMessage r0 = new RequestMessage("foo"); //$NON-NLS-1$
        RequestID requestID = new RequestID(SESSION_STRING, 1);
        RequestWorkItem workItem = addRequest(rm, r0, requestID, null, null);
        AtomicRequestMessage atomicReq = new AtomicRequestMessage(workItem.requestMsg, workItem.getDqpWorkContext(), 1);

        DataTierTupleSource info = Mockito.mock(DataTierTupleSource.class);
View Full Code Here


    }
   
    public void testRemoveConnectorInfo() {
        DQPCore rm = new DQPCore();
        rm.setTransactionService(new FakeTransactionService());
        RequestMessage r0 = new RequestMessage("foo"); //$NON-NLS-1$
        RequestID requestID = new RequestID(SESSION_STRING, 1);
        RequestWorkItem workItem = addRequest(rm, r0, requestID, null, null);
        AtomicRequestMessage atomicReq = new AtomicRequestMessage(workItem.requestMsg, workItem.getDqpWorkContext(), 1);

        DataTierTupleSource info = Mockito.mock(DataTierTupleSource.class);
View Full Code Here

@Ignore(value="Serialization of language objects has been turned off")
public class TestAtomicRequestMessage {

    public static AtomicRequestMessage example() {
        RequestMessage rm = new RequestMessage();
        DQPWorkContext workContext = new DQPWorkContext();
        workContext.getSession().setSessionId(String.valueOf(2));
        AtomicRequestMessage message = new AtomicRequestMessage(rm, workContext, 1000);
        message.setCommand(TestQueryImpl.helpExample(true));
        message.setFetchSize(100);
View Full Code Here

       
        Request request = new Request();
        Command command = QueryParser.getQueryParser().parseCommand(QUERY);
        QueryResolver.resolveCommand(command, metadata);
       
        RequestMessage message = new RequestMessage();
        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, FakeMetadataFactory.example1VDB());
       
        request.initialize(message, null, null,new FakeTransactionService(), TEMP_TABLE_STORE, workContext, null);
        request.initMetadata();
        request.setAuthorizationValidator(new DataRoleAuthorizationValidator(true, true, true));
View Full Code Here

    public void testProcessRequest() throws Exception {
        QueryMetadataInterface metadata = FakeMetadataFactory.example1Cached();
       
        //Try before plan is cached.
        //If this doesn't throw an exception, assume it was successful.
        RequestMessage message = new RequestMessage(QUERY);
        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, FakeMetadataFactory.example1VDB());

        helpProcessMessage(message, null, workContext);
       
        //Try again, now that plan is already cached.
        //If this doesn't throw an exception, assume it was successful.       
        message = new RequestMessage(QUERY);
        helpProcessMessage(message, null, workContext);
    }
View Full Code Here

    public void testCommandContext() throws Exception {
        QueryMetadataInterface metadata = FakeMetadataFactory.example1Cached();
       
        //Try before plan is cached.
        //If this doesn't throw an exception, assume it was successful.
        RequestMessage message = new RequestMessage(QUERY);
        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, FakeMetadataFactory.example1VDB());
       
        Request request = helpProcessMessage(message, null, workContext);
        assertEquals("1", request.context.getEnvironmentProperties().get(ContextProperties.SESSION_ID)); //$NON-NLS-1$
    }
View Full Code Here

        SessionAwareCache<PreparedPlan> cache = new SessionAwareCache<PreparedPlan>();
       

        //Try before plan is cached.
        //If this doesn't throw an exception, assume it was successful.
        RequestMessage message = new RequestMessage(QUERY);
        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, FakeMetadataFactory.example1VDB());
       
        message.setStatementType(StatementType.PREPARED);
        message.setParameterValues(new ArrayList());
       
        helpProcessMessage(message, cache, workContext);
       
        //Try again, now that plan is already cached.
        //If this doesn't throw an exception, assume it was successful.
        message = new RequestMessage(QUERY);
        message.setStatementType(StatementType.PREPARED);
        message.setParameterValues(new ArrayList());

        helpProcessMessage(message, cache, workContext);
    }
View Full Code Here

       
        dtm = new DataTierManagerImpl(rm,
                                  bs, true);
        command = helpGetCommand(sql, metadata);
       
        RequestMessage original = new RequestMessage();
        original.setExecutionId(1);
        original.setPartialResults(true);
        RequestID requestID = workContext.getRequestID(original.getExecutionId());
       
        context = new CommandContext();
        context.setProcessorID(requestID);
        context.setVdbName("test"); //$NON-NLS-1$
        context.setVdbVersion(1);
View Full Code Here

      DQPWorkContext.setWorkContext(new DQPWorkContext());
      core.stop();
    }

    public RequestMessage exampleRequestMessage(String sql) {
        RequestMessage msg = new RequestMessage(sql);
        msg.setCursorType(ResultSet.TYPE_SCROLL_INSENSITIVE);
        msg.setFetchSize(10);
        msg.setPartialResults(false);
        msg.setExecutionId(100);
        return msg;
    }
View Full Code Here

     * @since 4.3
     */
    @Test public void testPlanningException() throws Exception {
        String sql = "SELECT IntKey FROM BQT1.BadIdea "; //$NON-NLS-1$
       
        RequestMessage reqMsg = exampleRequestMessage(sql);

        Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
        try {
          message.get(5000, TimeUnit.MILLISECONDS);
        } catch (ExecutionException e) {
          assertTrue(e.getCause() instanceof QueryResolverException);
        }
View Full Code Here

TOP

Related Classes of org.teiid.client.RequestMessage

Copyright © 2018 www.massapicom. 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.