Package org.xmldb.api.modules

Examples of org.xmldb.api.modules.CollectionManagementService.removeCollection()


       

        testCol = rootCol.getChildCollection(XmldbURI.ROOT_COLLECTION + "/test");
        if(testCol != null) {
            CollectionManagementService mgr = DBUtils.getCollectionManagementService(rootCol);
            mgr.removeCollection(XmldbURI.ROOT_COLLECTION + "/test");
        }
       
        testCol = DBUtils.addCollection(rootCol, "test");
        assertNotNull(testCol);
       
View Full Code Here


            col = DatabaseManager.getCollection(baseUri + "/db", uid, pwd);
            final Collection child = col.getChildCollection(collectionName);
            if(child != null) {
                child.close();
                final CollectionManagementService cms = (CollectionManagementService)col.getService("CollectionManagementService", "1.0");
                cms.removeCollection(collectionName);
            }
        } catch(final XMLDBException xmldbe) {
            throw new ApiException(xmldbe);
        } finally {
            if(col != null) {
View Full Code Here

    public void tearDown() throws Exception {

        //delete the test collection
        Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
        CollectionManagementService cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
        cms.removeCollection(TEST_COLLECTION);

        DatabaseInstanceManager dim = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
        dim.shutdown();
    }
   
View Full Code Here

        assertNotNull(test);
        Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
        test = root.getChildCollection(TestConstants.SPECIAL_NAME);
        assertNotNull(test);
        CollectionManagementService service = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
        service.removeCollection(TestConstants.SPECIAL_NAME);
    }

    @Before
    public void setUp() throws Exception {
        // initialize driver
View Full Code Here

    public void tearDown() throws XMLDBException {

        //delete the test collection
        Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
        CollectionManagementService service = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
        service.removeCollection(TEST_COLLECTION);

        //shutdownDB the db
        DatabaseInstanceManager dim = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
        dim.shutdown();
    }
View Full Code Here

      try {
          Collection rootCollection = DatabaseManager.getCollection(URI + XmldbURI.ROOT_COLLECTION, "admin", "");
          assertNotNull(rootCollection);
          CollectionManagementService cms = (CollectionManagementService) rootCollection.getService(
                  "CollectionManagementService", "1.0");
          cms.removeCollection(CHILD_COLLECTION);
        } catch (Exception e) {           
            fail(e.getMessage());
        }
    }
View Full Code Here

    @After
    public void tearDown() throws XMLDBException {
        //delete the test collection
        Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
        CollectionManagementService cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
        cms.removeCollection(TEST_COLLECTION);
    }

    @Test
    public void rootCollectionHasNoParent() throws XMLDBException {
        final Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
View Full Code Here

        cms.createCollection("dummy3");
        Collection c3 = c2.getChildCollection("dummy3");
        assertNotNull(c3);

        cms.setCollection(testCol);
        cms.removeCollection("dummy1");
        printChildren(testCol);
        c1 = testCol.getChildCollection("dummy1");
        assertNull(c1);
    }
View Full Code Here

        for (int i = 0; i < INSTANCE_COUNT; i++) {
            System.out.println("Shutting down instance test"+i);
            Collection root = DatabaseManager.getCollection("xmldb:test" + i + "://" + XmldbURI.ROOT_COLLECTION, "admin", null);
            CollectionManagementService service = (CollectionManagementService)
                root.getService("CollectionManagementService", "1.0");
            service.removeCollection("test");

            DatabaseInstanceManager mgr = (DatabaseInstanceManager)
                root.getService("DatabaseInstanceManager", "1.0");
            mgr.shutdown();
        }
View Full Code Here

    {
      Collection testCollection = root.getChildCollection(collectionName);
      if(testCollection != null)
      {
        CollectionManagementService cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
        cms.removeCollection(collectionPath);
      }
    }
    catch (XMLDBException e)
    {
      System.err.println("Error removing existing test collection:");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.