use of org.teiid.translator.file.FileExecutionFactory in project teiid by teiid.
the class TestEmbeddedServerAdmin method init.
@BeforeClass
public static void init() throws Exception {
server = new EmbeddedServer();
EmbeddedConfiguration config = new EmbeddedConfiguration();
server.start(config);
FileExecutionFactory executionFactory = new FileExecutionFactory();
executionFactory.start();
server.addTranslator("file", executionFactory);
server.deployVDB(new FileInputStream(new File("src/test/resources/adminapi-test-vdb.xml")));
// admin = server.getAdmin();
admin = EmbeddedAdminFactory.getInstance().createAdmin(server);
}
use of org.teiid.translator.file.FileExecutionFactory 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");
}
use of org.teiid.translator.file.FileExecutionFactory in project teiid by teiid.
the class TestDDLMetadataStore method testConvertVDBXML.
@Test
public void testConvertVDBXML() throws Exception {
EmbeddedConfiguration ec = new EmbeddedConfiguration();
ec.setUseDisk(false);
es.addTranslator("file", new FileExecutionFactory());
es.addTranslator("h2", new ExecutionFactory<>());
es.start(ec);
FileInputStream vdb = new FileInputStream(UnitTestUtil.getTestDataPath() + "/" + "portfolio-vdb.xml");
es.deployVDB(vdb);
String content = ConvertVDB.convert(new File(UnitTestUtil.getTestDataPath() + "/" + "portfolio-vdb.xml"));
es.undeployVDB("Portfolio");
/*
FileWriter fw = new FileWriter(new File(UnitTestUtil.getTestDataPath() + "/" + "portfolio-vdb.ddl"));
fw.write(content);
fw.close();
*/
String expected = ObjectConverterUtil.convertFileToString(new File(UnitTestUtil.getTestDataPath() + "/" + "portfolio-vdb.ddl"));
assertEquals(expected, content);
// make sure the output is valid
es.deployVDB(new ByteArrayInputStream(content.getBytes("UTF-8")), true);
}
Aggregations