Package org.teiid.query.util

Examples of org.teiid.query.util.CommandContext


            }
        }
    }
   
    public static void helpTestProcess(ProcessorPlan procPlan, List[] expectedResults, ProcessorDataManager dataMgr, QueryMetadataInterface metadata) throws Exception {
        CommandContext context = new CommandContext("pID", null, null, null, 1); //$NON-NLS-1$
        if (!(metadata instanceof TempMetadataAdapter)) {
          metadata = new TempMetadataAdapter(metadata, new TempMetadataStore());
        }
        context.setMetadata(metadata);         
       
      TestProcessor.helpProcess(procPlan, context, dataMgr, expectedResults);
      assertNotNull("Expected processing to fail", expectedResults);
    }
View Full Code Here


        List[] expected = new List[] {
            Arrays.asList(new Object[] { "First"})//$NON-NLS-1$
            Arrays.asList(new Object[] { "Second"})//$NON-NLS-1$
            Arrays.asList(new Object[] { "Third"})//$NON-NLS-1$
            Arrays.asList(new Object[] { "Fourth"})};           //$NON-NLS-1$
        CommandContext context = new CommandContext("pID", null, null, null, 1); //$NON-NLS-1$
        context.setMetadata(metadata);
        context.setProcessorBatchSize(1); //ensure that the final temp result set will not be deleted prematurely

      TestProcessor.helpProcess(plan, context, dataMgr, expected);
    }
View Full Code Here

      }
    }
   
    public void helpTestJoinDirect(List[] expectedResults, int batchSize, int processingBytes) throws TeiidComponentException, TeiidProcessingException {
        BufferManager mgr = NodeTestUtil.getTestBufferManager(processingBytes, batchSize);
        CommandContext context = new CommandContext("pid", "test", null, null, 1);               //$NON-NLS-1$ //$NON-NLS-2$
       
        join.addChild(leftNode);
        join.addChild(rightNode);
       
        leftNode.initialize(context, mgr, dataMgr);
View Full Code Here

   
    public void helpTestProcessor(FakeProcessorPlan plan, long timeslice, List[] expectedResults) throws TeiidException {
        BufferManager bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
        FakeDataManager dataManager = new FakeDataManager();

        CommandContext context = new CommandContext("pid", "group", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
        QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataManager);
        BatchCollector collector = processor.createBatchCollector();
        TupleBuffer tsID = null;
        while(true) {
            try {
View Full Code Here

        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);
        context.setQueryProcessorFactory(new QueryProcessorFactoryImpl(bs.getBufferManager(), dtm, new DefaultCapabilitiesFinder(), null, metadata));
        workItem = TestDQPCoreRequestHandling.addRequest(rm, original, requestID, null, workContext);
View Full Code Here

        Map elementMap = new HashMap();
        ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
        elementMap.put(e1, new Integer(0));
       
        List tuple = Arrays.asList(new String[]{"a"}); //$NON-NLS-1$
        CommandContext cc = new CommandContext();
        assertEquals(expectedResult, new Evaluator(elementMap, null, cc) {
          @Override
          protected ValueIterator evaluateSubquery(
              SubqueryContainer container, List tuple)
              throws TeiidProcessingException, BlockedException,
View Full Code Here

            for(int i=0; i<inputs.length; i++) {
                types[i] = DataTypeManager.determineDataTypeClass(inputs[i]);  
            }       
      }
      if (context == null) {
        context = new CommandContext();
      }
        Object actualOutput = null;
        // Find function descriptor
        FunctionDescriptor descriptor = library.findFunction(fname, types);        
        if (descriptor.requiresContext()) {
View Full Code Here

        // this does not actually fail but returns a result
        assertNotNull(helpInvokeMethod("rand", new Class<?>[] {Integer.class}, new Object[] {null}, null)); //$NON-NLS-1$
    }
   
    @Test public void testInvokeUser() throws Exception {
        CommandContext c = new CommandContext();
        c.setUserName("foodude"); //$NON-NLS-1$
        helpInvokeMethod("user", new Class<?>[] {}, new Object[] {}, c, "foodude"); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

        c.setUserName("foodude"); //$NON-NLS-1$
        helpInvokeMethod("user", new Class<?>[] {}, new Object[] {}, c, "foodude"); //$NON-NLS-1$ //$NON-NLS-2$
    }
   
    @Test public void testInvokeEnv() throws Exception {
        CommandContext c = new CommandContext();
        Properties props = new Properties();
        props.setProperty("env_test", "env_value"); //$NON-NLS-1$ //$NON-NLS-2$
        c.setEnvironmentProperties(props);
        helpInvokeMethod("env", new Class<?>[] {String.class}, new Object[] {"env_test"}, c, "env_value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$       
        helpInvokeMethod("env", new Class<?>[] {String.class}, new Object[] {null}, c, null); //$NON-NLS-1$
    }
View Full Code Here

        helpInvokeMethod("env", new Class<?>[] {String.class}, new Object[] {"env_test"}, c, "env_value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$       
        helpInvokeMethod("env", new Class<?>[] {String.class}, new Object[] {null}, c, null); //$NON-NLS-1$
    }
   
    @Test public void testInvokeCommandPayload() throws Exception {
        CommandContext c = new CommandContext();       
        c.setCommandPayload("payload_too heavy"); //$NON-NLS-1$
        helpInvokeMethod("commandpayload", new Class<?>[] {}, new Object[] {}, c, "payload_too heavy"); //$NON-NLS-1$ //$NON-NLS-2$
        helpInvokeMethod("commandpayload", new Class<?>[] {String.class}, new Object[] {null}, c, null); //$NON-NLS-1$
        Properties props = new Properties();
        props.setProperty("payload", "payload_too heavy"); //$NON-NLS-1$ //$NON-NLS-2$
        c.setCommandPayload(props);
        helpInvokeMethod("commandpayload", new Class<?>[] {String.class}, new Object[] {"payload"}, c, "payload_too heavy"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }   
View Full Code Here

TOP

Related Classes of org.teiid.query.util.CommandContext

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.