use of org.datanucleus.store.rdbms.adapter.DatabaseMetaData in project tests by datanucleus.
the class RDBMSAdapterFactoryTest method testGetNewDatastoreAdapter2.
/**
* datastores are identified by product name
* test unknown product with given adapterClassName
*/
public void testGetNewDatastoreAdapter2() {
DatabaseMetaData md = new DatabaseMetaData();
md.setProductName("unknown");
md.setProductVersion("1");
DatastoreAdapter adapter = factory.getNewDatastoreAdapter(clr, md, DerbyAdapter.class.getName(), pluginMgr);
assertNotNull(adapter);
assertEquals(DerbyAdapter.class.getName(), adapter.getClass().getName());
}
use of org.datanucleus.store.rdbms.adapter.DatabaseMetaData in project tests by datanucleus.
the class RDBMSAdapterFactoryTest method testGetNewDatastoreAdapter3.
/**
* datastores are identified by product name
* test Derby adapter with null adapterClassName
*/
public void testGetNewDatastoreAdapter3() {
DatabaseMetaData md = new DatabaseMetaData();
// test Derby adapter
md.setProductName("Derby");
md.setProductVersion("10");
DatastoreAdapter adapter = factory.getNewDatastoreAdapter(clr, md, null, pluginMgr);
assertNotNull(adapter);
assertEquals(DerbyAdapter.class.getName(), adapter.getClass().getName());
}
use of org.datanucleus.store.rdbms.adapter.DatabaseMetaData in project tests by datanucleus.
the class RDBMSAdapterFactoryTest method testGetNewDatastoreAdapter1.
/**
* datastores are identified by product name
* test unknown product
*/
public void testGetNewDatastoreAdapter1() {
DatabaseMetaData md = new DatabaseMetaData();
md.setProductName("unknown");
md.setProductVersion("1");
DatastoreAdapter adapter = factory.getNewDatastoreAdapter(clr, md, null, pluginMgr);
assertNull(adapter);
}
use of org.datanucleus.store.rdbms.adapter.DatabaseMetaData in project tests by datanucleus.
the class RDBMSAdapterFactoryTest method testGetNewDatastoreAdapter4.
/**
* datastores are identified by product name
* test jdbc driver returns null for product name
*/
public void testGetNewDatastoreAdapter4() {
DatabaseMetaData md = new DatabaseMetaData();
md.setProductName(null);
DatastoreAdapter adapter = factory.getNewDatastoreAdapter(clr, md, null, pluginMgr);
assertNull(adapter);
}
Aggregations