Search in sources :

Example 1 with SQLServerUnitDbAdapter

use of org.apache.cayenne.unit.SQLServerUnitDbAdapter in project cayenne by apache.

the class SQLServerSnifferIT method testCreateAdapter.

@Test
public void testCreateAdapter() throws Exception {
    SQLServerSniffer sniffer = new SQLServerSniffer(objectFactory);
    DbAdapter adapter = null;
    try (Connection c = dataSourceFactory.getSharedDataSource().getConnection()) {
        adapter = sniffer.createAdapter(c.getMetaData());
    }
    if (accessStackAdapter instanceof SQLServerUnitDbAdapter) {
        assertNotNull(adapter);
    } else {
        assertNull(adapter);
    }
}
Also used : SQLServerUnitDbAdapter(org.apache.cayenne.unit.SQLServerUnitDbAdapter) UnitDbAdapter(org.apache.cayenne.unit.UnitDbAdapter) SQLServerUnitDbAdapter(org.apache.cayenne.unit.SQLServerUnitDbAdapter) DbAdapter(org.apache.cayenne.dba.DbAdapter) Connection(java.sql.Connection) Test(org.junit.Test)

Aggregations

Connection (java.sql.Connection)1 DbAdapter (org.apache.cayenne.dba.DbAdapter)1 SQLServerUnitDbAdapter (org.apache.cayenne.unit.SQLServerUnitDbAdapter)1 UnitDbAdapter (org.apache.cayenne.unit.UnitDbAdapter)1 Test (org.junit.Test)1