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");
}
Aggregations