Package org.teiid.adminapi

Examples of org.teiid.adminapi.VDB


 
  //@AfterClass
  public static void end() throws Exception {
    admin = AdminFactory.getInstance().createAdmin("admin", "admin".toCharArray(), "mm://localhost:31443"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    VDB vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
    if (vdb != null) {
      admin.deleteVDB("TransactionsRevisited", 1); //$NON-NLS-1$
    }
    admin.close();
  }
View Full Code Here


    admin.close();
  }
 
  @Test public void testVDBDeploy() throws Exception {
   
    VDB vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
    if (vdb != null) {
      admin.deleteVDB("TransactionsRevisited", 1); //$NON-NLS-1$
    }
   
    installVDB();
View Full Code Here

    assertNull(admin.getVDB("TransactionsRevisited", 1)); //$NON-NLS-1$
  }
 
  @Test
  public void testChangeConnectionType() throws Exception {
    VDB vdb = admin.getVDB("TransactionsRevisited", 1);
    assertNotNull(vdb); //$NON-NLS-1$
   
    ConnectionType ct = vdb.getConnectionType();
    assertEquals(ConnectionType.BY_VERSION, ct);
   
    admin.changeVDBConnectionType("TransactionsRevisited", 1, ConnectionType.ANY);
   
    vdb = admin.getVDB("TransactionsRevisited", 1);
   
    ct = vdb.getConnectionType();
    assertEquals(ConnectionType.ANY, ct);   
  }
View Full Code Here

    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();
View Full Code Here

      t.join();
    }
  }

  private static void installVDB() throws AdminException, FileNotFoundException {
    VDB vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
    if (vdb == null) {
      File f = UnitTestUtil.getTestDataFile("TransactionsRevisited.vdb"); //$NON-NLS-1$
      FileInputStream fis = new FileInputStream(f);
      admin.deployVDB(f.getName(), fis);
      try {
View Full Code Here

 
  @Test public void testAssignConnectorBinding() throws Exception {
    admin.assignToModel("TransactionsRevisited", 1, "pm1", "mysql", "mysql", "jndi:FOO"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
   
    boolean checked = false;
    VDB vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
    List<Model> models = vdb.getModels();
    for (Model model:models) {
      if (model.getName().equals("pm1")) { //$NON-NLS-1$
        List<String> sources = model.getSourceNames();
        for (String source:sources) {
          if (source.equals("mysql")) { //$NON-NLS-1$
View Full Code Here

 
  @Test public void testAddRoleNames() throws Exception {
    installVDB();
    admin.addDataRoleMapping("TransactionsRevisited", 1, "policy1", "managers"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
   
    VDB vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
    List<DataPolicy> policies = vdb.getDataPolicies();
    assertTrue (!policies.isEmpty());
    for (DataPolicy policy:policies) {
      if (policy.getName().equals("policy1")) { //$NON-NLS-1$
        List<String> sources = policy.getMappedRoleNames();
        assertTrue(sources.contains("managers"));
      }
    }
   
    // remove the role
    admin.removeDataRoleMapping("TransactionsRevisited", 1, "policy1", "managers");
   
    vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
    policies = vdb.getDataPolicies();
    assertTrue (!policies.isEmpty());
   
    for (DataPolicy policy:policies) {
      if (policy.getName().equals("policy1")) { //$NON-NLS-1$
        List<String> sources = policy.getMappedRoleNames();
View Full Code Here

TOP

Related Classes of org.teiid.adminapi.VDB

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.