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