Search in sources :

Example 1 with FileManagedConnectionFactory

use of org.teiid.resource.adapter.file.FileManagedConnectionFactory in project teiid by teiid.

the class TestTeiidPlatform method init.

@BeforeClass
public static void init() throws VirtualDatabaseException, ConnectorManagerException, TranslatorException, FileNotFoundException, IOException, ResourceException, SQLException {
    server = new EmbeddedServer();
    FileExecutionFactory executionFactory = new FileExecutionFactory();
    server.addTranslator("file", executionFactory);
    FileManagedConnectionFactory fileManagedconnectionFactory = new FileManagedConnectionFactory();
    fileManagedconnectionFactory.setParentDirectory(UnitTestUtil.getTestDataPath() + File.separator + "file");
    ConnectionFactory connectionFactory = fileManagedconnectionFactory.createConnectionFactory();
    ConnectionFactoryProvider<ConnectionFactory> connectionFactoryProvider = new EmbeddedServer.SimpleConnectionFactoryProvider<ConnectionFactory>(connectionFactory);
    server.addConnectionFactoryProvider("java:/marketdata-file", connectionFactoryProvider);
    EmbeddedConfiguration config = new EmbeddedConfiguration();
    server.start(config);
    DriverManager.registerDriver(server.getDriver());
    server.deployVDB(new FileInputStream(UnitTestUtil.getTestDataFile("vdb" + File.separator + "marketdata-vdb.xml")));
    factory = Persistence.createEntityManagerFactory("org.teiid.eclipselink.test");
}
Also used : ConnectionFactory(javax.resource.cci.ConnectionFactory) FileManagedConnectionFactory(org.teiid.resource.adapter.file.FileManagedConnectionFactory) FileExecutionFactory(org.teiid.translator.file.FileExecutionFactory) EmbeddedServer(org.teiid.runtime.EmbeddedServer) EmbeddedConfiguration(org.teiid.runtime.EmbeddedConfiguration) FileManagedConnectionFactory(org.teiid.resource.adapter.file.FileManagedConnectionFactory) FileInputStream(java.io.FileInputStream) BeforeClass(org.junit.BeforeClass)

Aggregations

FileInputStream (java.io.FileInputStream)1 ConnectionFactory (javax.resource.cci.ConnectionFactory)1 BeforeClass (org.junit.BeforeClass)1 FileManagedConnectionFactory (org.teiid.resource.adapter.file.FileManagedConnectionFactory)1 EmbeddedConfiguration (org.teiid.runtime.EmbeddedConfiguration)1 EmbeddedServer (org.teiid.runtime.EmbeddedServer)1 FileExecutionFactory (org.teiid.translator.file.FileExecutionFactory)1