Search in sources :

Example 1 with SQLServerAdapter

use of org.apache.cayenne.dba.sqlserver.SQLServerAdapter in project cayenne by apache.

the class DbGeneratorTaskTest method testSetAdapter.

@Test
public void testSetAdapter() throws Exception {
    DataSource ds = mock(DataSource.class);
    Injector injector = DIBootstrap.createInjector(new ToolsModule(mock(Logger.class)));
    DbGeneratorTask task = new DbGeneratorTask();
    DbAdapter autoAdapter = task.getAdapter(injector, ds);
    assertTrue(autoAdapter instanceof AutoAdapter);
    task.setAdapter(SQLServerAdapter.class.getName());
    DbAdapter sqlServerAdapter = task.getAdapter(injector, ds);
    assertTrue(sqlServerAdapter instanceof SQLServerAdapter);
}
Also used : SQLServerAdapter(org.apache.cayenne.dba.sqlserver.SQLServerAdapter) DbAdapter(org.apache.cayenne.dba.DbAdapter) Injector(org.apache.cayenne.di.Injector) AutoAdapter(org.apache.cayenne.dba.AutoAdapter) ToolsModule(org.apache.cayenne.dbsync.reverse.configuration.ToolsModule) DataSource(javax.sql.DataSource) Test(org.junit.Test)

Aggregations

DataSource (javax.sql.DataSource)1 AutoAdapter (org.apache.cayenne.dba.AutoAdapter)1 DbAdapter (org.apache.cayenne.dba.DbAdapter)1 SQLServerAdapter (org.apache.cayenne.dba.sqlserver.SQLServerAdapter)1 ToolsModule (org.apache.cayenne.dbsync.reverse.configuration.ToolsModule)1 Injector (org.apache.cayenne.di.Injector)1 Test (org.junit.Test)1