Package org.teiid.jdbc

Examples of org.teiid.jdbc.FakeServer


    static Connection connection;
   
    static final String VDB = "PartsSupplier";
   
  @BeforeClass public static void setUp() throws Exception {
      FakeServer server = new FakeServer();
      server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
      connection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$   
    }
View Full Code Here


    addr = new InetSocketAddress(0);
    config.setBindAddress(addr.getHostName());
    config.setPortNumber(0);
    odbcTransport = new ODBCSocketListener(config, BufferManagerFactory.getStandaloneBufferManager(), 0, 100000);
   
    FakeServer server = new FakeServer();
    server.setUseCallingThread(false);
    server.deployVDB("parts", UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
   
    TeiidDriver driver = new TeiidDriver();
    driver.setEmbeddedProfile(server);
    odbcTransport.setDriver(driver);
   
View Full Code Here

  static Connection connection;
   
    static final String VDB = "metadata";
   
  @BeforeClass public static void setUp() throws Exception {
      FakeServer server = new FakeServer();
      MetadataRepository repo = Mockito.mock(MetadataRepository.class);
      server.setMetadataRepository(repo);
      Mockito.stub(repo.getViewDefinition(Mockito.anyString(), Mockito.anyInt(), (Table)Mockito.anyObject())).toAnswer(new Answer<String>() {
        @Override
        public String answer(InvocationOnMock invocation) throws Throwable {
          Table t = (Table)invocation.getArguments()[2];
          if (t.getName().equals("vw")) {
            return "select '2011'";
          }
          return null;
        }
    });
      Mockito.stub(repo.getProcedureDefinition(Mockito.anyString(), Mockito.anyInt(), (Procedure)Mockito.anyObject())).toAnswer(new Answer<String>() {
        @Override
        public String answer(InvocationOnMock invocation) throws Throwable {
          Procedure t = (Procedure)invocation.getArguments()[2];
          if (t.getName().equals("proc")) {
            return "create virtual procedure begin select '2011'; end";
          }
          return null;
        }
    });
      Mockito.stub(repo.getInsteadOfTriggerDefinition(Mockito.anyString(), Mockito.anyInt(), (Table)Mockito.anyObject(), (Table.TriggerEvent) Mockito.anyObject())).toAnswer(new Answer<String>() {
        @Override
        public String answer(InvocationOnMock invocation) throws Throwable {
        return "for each row select 1/0;";
        }
    });
      Mockito.stub(repo.isInsteadOfTriggerEnabled(Mockito.anyString(), Mockito.anyInt(), (Table)Mockito.anyObject(), (Table.TriggerEvent) Mockito.anyObject())).toAnswer(new Answer<Boolean>() {
        @Override
        public Boolean answer(InvocationOnMock invocation) throws Throwable {
        return Boolean.TRUE;
        }
    });
      server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/metadata.vdb");
      connection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$   
    }
View Full Code Here

    // with another tool which uses tab as delimiter
    super.DELIMITER = "\t"; //$NON-NLS-1$
  }
 
    @Before public void setUp() throws Exception {
      FakeServer server = new FakeServer();
      server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
      this.internalConnection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$ 
     }
View Full Code Here

    // with another tool which uses tab as delimiter
    super.DELIMITER = "\t"; //$NON-NLS-1$
  }
   
    @Before public void setUp() throws Exception {
      FakeServer server = new FakeServer();
      server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
      this.internalConnection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$       
    }
View Full Code Here

    // with another tool which uses tab as delimiter
    super.DELIMITER = "\t"; //$NON-NLS-1$
  }
 
    @Before public void setUp() throws Exception {
      FakeServer server = new FakeServer();
      server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/bqt.vdb");
      this.internalConnection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$ 
     }
View Full Code Here

    private static final String MATVIEWS = "matviews";
  private Connection conn;
  private FakeServer server;

  @Before public void setUp() throws Exception {
      server = new FakeServer();
      server.deployVDB(MATVIEWS, UnitTestUtil.getTestDataPath() + "/matviews.vdb");
      conn = server.createConnection("jdbc:teiid:matviews");
    }
View Full Code Here

    config.setSSLConfiguration(new SSLConfiguration());
    addr = new InetSocketAddress(0);
    config.setBindAddress(addr.getHostName());
    config.setPortNumber(0);
   
    FakeServer server = new FakeServer();
    server.setUseCallingThread(false);
    server.deployVDB("parts", UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
   
    jdbcTransport = new SocketListener(config, server, BufferManagerFactory.getStandaloneBufferManager(), 0);
  }
View Full Code Here

    static Connection connection;
   
    static final String VDB = "PartsSupplier";
   
  @BeforeClass public static void setUp() throws Exception {
      FakeServer server = new FakeServer();
      server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
      connection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$   
      dbMetadata = connection.getMetaData();
    }
View Full Code Here

    // with another tool which uses tab as delimiter
    super.DELIMITER = "\t"; //$NON-NLS-1$
  }
 
    @Before public void setUp() throws Exception {
      FakeServer server = new FakeServer();
      server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
      this.internalConnection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$ 
     }
View Full Code Here

TOP

Related Classes of org.teiid.jdbc.FakeServer

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.