Examples of ConnectorManager


Examples of org.teiid.dqp.internal.datamgr.ConnectorManager

 
          String sourceName = getSourceName(resourceName, model, translator);
          if (sourceName == null) {
            continue;
          }
          ConnectorManager cm = cmr.getConnectorManager(sourceName);
          String status = cm.getStausMessage();
          if (status != null && status.length() > 0) {
            model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), status);
            LogManager.logInfo(LogConstants.CTX_RUNTIME, status);         
          } else {
            //get the pending metadata load
View Full Code Here

Examples of org.teiid.dqp.internal.datamgr.ConnectorManager

       1. requestMsg.isTransactional() must be TRUE
       *  2. manager.isXa() must be FALSE  ()
       3. command must NOT be a SELECT
       *  4. Then, set isImmutable to TRUE, we should SUCCEED
       */
    ConnectorManager cm = TestConnectorManager.getConnectorManager();
    ((FakeConnector)cm.getExecutionFactory()).setImmutable(true);
   

    // command must not be a SELECT
    Command command = helpGetCommand("update bqt1.smalla set stringkey = 1 where stringkey = 2", EXAMPLE_BQT); //$NON-NLS-1$
    AtomicRequestMessage requestMsg = createNewAtomicRequestMessage(1, 1);
View Full Code Here

Examples of org.teiid.dqp.internal.datamgr.ConnectorManager

       1. requestMsg.isTransactional() must be TRUE
       *  2. manager.isXa() must be FALSE  ()
       3. command must NOT be a SELECT
       *  4. Then, set isImmutable to FALSE, and we should FAIL
       */
    ConnectorManager cm = TestConnectorManager.getConnectorManager();
    ((FakeConnector)cm.getExecutionFactory()).setImmutable(false);
   
       
    // command must not be a SELECT
    Command command = helpGetCommand("update bqt1.smalla set stringkey = 1 where stringkey = 2", EXAMPLE_BQT); //$NON-NLS-1$
    AtomicRequestMessage requestMsg = createNewAtomicRequestMessage(1, 1);
View Full Code Here

Examples of org.teiid.dqp.internal.datamgr.ConnectorManager

    private AtomicRequestMessage request;
    private ConnectorManager csm;
   
  static ConnectorManager getConnectorManager() throws Exception {
    final FakeConnector c = new FakeConnector();
    ConnectorManager cm = new ConnectorManager("FakeConnector","FakeConnector") { //$NON-NLS-1$ //$NON-NLS-2$
      protected ExecutionFactory getExecutionFactory() {
        return c;
      }
      protected Object getConnectionFactory(){
        return c.getConnection();
      }
    };
    cm.start();
    return cm;
  }
View Full Code Here

Examples of org.teiid.dqp.internal.datamgr.ConnectorManager

  private static ConnectorManager getConnectorManager(String modelName, String translatorName, String connectionName,  List<FunctionMethod> funcs) {
    final ExecutionFactory<Object, Object> ef = Mockito.mock(ExecutionFactory.class);
   
    Mockito.stub(ef.getPushDownFunctions()).toReturn(funcs);
   
    ConnectorManager cm = new ConnectorManager(translatorName,connectionName) {
      protected ExecutionFactory getExecutionFactory() {
        return ef;
      }
    };
    cm.setModelName(modelName);
    cm.start();
    return cm;
  }
View Full Code Here

Examples of org.teiid.dqp.internal.datamgr.ConnectorManager

       
        BasicSourceCapabilities basicSourceCapabilities = new BasicSourceCapabilities();
        basicSourceCapabilities.setFunctionSupport(functionName, true);

        ConnectorManagerRepository repo = Mockito.mock(ConnectorManagerRepository.class);
        ConnectorManager cm = Mockito.mock(ConnectorManager.class);
        Mockito.stub(cm.getCapabilities()).toReturn(basicSourceCapabilities);
        Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(cm);
       
        CachedFinder finder = new CachedFinder(repo, vdb);
       
        // Test
View Full Code Here

Examples of org.teiid.dqp.internal.datamgr.ConnectorManager

        this.dqp.setBufferService(new FakeBufferService());
        this.dqp.setCacheFactory(new DefaultCacheFactory());
        this.dqp.setTransactionService(new FakeTransactionService());
       
        cmr = Mockito.mock(ConnectorManagerRepository.class);
        Mockito.stub(cmr.getConnectorManager("source")).toReturn(new ConnectorManager("x", "x") {
          @Override
          public SourceCapabilities getCapabilities() {
            return new BasicSourceCapabilities();
          }
        });
View Full Code Here

Examples of org.teiid.dqp.internal.datamgr.ConnectorManager

        }
        TranslatorException exception = null;
        ModelMetaData model = vdb.getModel(modelName);
        for (String sourceName:model.getSourceNames()) {
          try {
            ConnectorManager mgr = this.connectorRepo.getConnectorManager(sourceName);
            if (mgr == null) {
              throw new TranslatorException(QueryPlugin.Util.getString("CachedFinder.no_connector_found", sourceName, modelName, sourceName)); //$NON-NLS-1$
            }
            caps = mgr.getCapabilities();
            break;
            } catch(TranslatorException e) {
              if (exception == null) {
                exception = e;
              }
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.