ct = vdb.getConnectionType();
assertEquals(ConnectionType.ANY, ct);
}
@Test public void testGetVDB() throws Exception {
VDB vdb = admin.getVDB("TransactionsRevisited", 1);
assertNotNull(vdb); //$NON-NLS-1$
assertEquals("TransactionsRevisited", vdb.getName());
assertEquals(1, vdb.getVersion());
assertEquals("A VDB to test transactions", vdb.getDescription());
//assertEquals("sample-value", vdb.getPropertyValue("sample"));
assertEquals(VDB.Status.INACTIVE, vdb.getStatus());
// test model
List<Model> models = vdb.getModels();
assertEquals(4, models.size());
Model model = null;
for (Model m:models) {
if (m.getName().equals("pm1")) {
model = m;
break;
}
}
assertNotNull(model);
assertEquals(Model.Type.PHYSICAL, model.getModelType());
assertEquals("sample-value", model.getPropertyValue("sample"));
List<String> sourceNames = model.getSourceNames();
assertEquals(1, sourceNames.size());
assertEquals("mysql", model.getSourceTranslatorName(sourceNames.get(0)));
assertEquals("java:mysql-connector-binding", model.getSourceConnectionJndiName(sourceNames.get(0)));
assertTrue(model.isSource());
//assertTrue(model.isSupportsMultiSourceBindings());
assertTrue(model.isVisible());
// test data policies
List<DataPolicy> policies = vdb.getDataPolicies();
assertEquals(1, policies.size());
assertEquals("policy1", policies.get(0).getName());
assertEquals("roleOne described", policies.get(0).getDescription());
List<DataPolicy.DataPermission> permissions = policies.get(0).getPermissions();