Package org.teiid.translator

Examples of org.teiid.translator.ProcedureExecution


    request.setFetchSize(5);
    return request;
  }

  @Test public void testProcedureBatching() throws Exception {
    ProcedureExecution exec = new FakeProcedureExecution(2, 1);

    // this has two result set columns and 1 out parameter
    int total_columns = 3;
    StoredProcedure command = (StoredProcedure)helpGetCommand("{call pm2.spTest8(?)}", EXAMPLE_BQT); //$NON-NLS-1$     
    command.getInputParameters().get(0).setExpression(new Constant(1));
View Full Code Here


        AbstractMetadataRecord metaObject = procedure.getMetadataObject();
       
        TestCase.assertEquals("AnyModel.ProcedureB",procedure.getProcedureName()); //$NON-NLS-1$
        TestCase.assertEquals("PROC", metaObject.getNameInSource()); //$NON-NLS-1$
        TestCase.assertEquals(props, metaObject.getProperties());
        ProcedureExecution exec = Mockito.mock(ProcedureExecution.class);
        Mockito.stub(exec.next()).toReturn(null);
        return exec;
  }
View Full Code Here

  //@Override
  public ProcedureExecution createProcedureExecution(final Call command,
      final ExecutionContext executionContext, final RuntimeMetadata metadata,
      final FileConnection fc) throws TranslatorException {
    if (command.getProcedureName().equalsIgnoreCase(SAVEFILE)) {
      return new ProcedureExecution() {
       
        @Override
        public void execute() throws TranslatorException {
          String filePath = (String)command.getArguments().get(0).getArgumentValue().getValue();
          Object file = command.getArguments().get(1).getArgumentValue().getValue();
View Full Code Here

  @Test public void testGetTextFiles() throws Exception {
    FileExecutionFactory fef = new FileExecutionFactory();
    FileConnection fc = Mockito.mock(FileConnection.class);
    Mockito.stub(fc.getFile("*.txt")).toReturn(new File(UnitTestUtil.getTestDataPath(), "*.txt"));
    Call call = fef.getLanguageFactory().createCall("getTextFiles", Arrays.asList(new Argument(Direction.IN, new Literal("*.txt", TypeFacility.RUNTIME_TYPES.STRING), TypeFacility.RUNTIME_TYPES.STRING, null)), null);
    ProcedureExecution pe = fef.createProcedureExecution(call, null, null, fc);
    pe.execute();
    int count = 0;
    while (true) {
      if (pe.next() == null) {
        break;
      }
      count++;
    }
    assertEquals(2, count);
View Full Code Here

TOP

Related Classes of org.teiid.translator.ProcedureExecution

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.