Search in sources :

Example 76 with CollectionManagementService

use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.

the class DeadlockTest method clearDB.

@After
public void clearDB() throws XMLDBException {
    final org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist:///db/test", "admin", "");
    CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
    service.removeCollection(".");
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService) Database(org.xmldb.api.base.Database)

Example 77 with CollectionManagementService

use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.

the class XmldbBinariesTest method removeCollection.

@Override
protected void removeCollection(final XmldbURI collectionUri) throws Exception {
    Collection colRoot = null;
    try {
        colRoot = DatabaseManager.getCollection(getBaseUri() + "/db", ADMIN_DB_USER, ADMIN_DB_PWD);
        final Collection colTest = colRoot.getChildCollection("test");
        try {
            final CollectionManagementService cms = (CollectionManagementService) colTest.getService("CollectionManagementService", "1.0");
            final String testCollectionName = collectionUri.lastSegment().toString();
            cms.removeCollection(testCollectionName);
        } finally {
            if (colTest != null) {
                colTest.close();
            }
        }
    } finally {
        if (colRoot != null) {
            colRoot.close();
        }
    }
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService)

Example 78 with CollectionManagementService

use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.

the class DocTest method tearDown.

@After
public void tearDown() throws XMLDBException {
    final CollectionManagementService cms = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
    // Creates the 'test' collection
    cms.removeCollection("test");
    test = null;
    existEmbeddedServer.getRoot().removeResource(existEmbeddedServer.getRoot().getResource("test.xml"));
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService)

Example 79 with CollectionManagementService

use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.

the class XQueryTest method tearDown.

@After
public void tearDown() throws XMLDBException {
    final CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
    service.removeCollection("test");
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService)

Example 80 with CollectionManagementService

use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.

the class XQueryTest method setup.

@Before
public void setup() throws XMLDBException {
    final CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
    service.createCollection("test");
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService)

Aggregations

CollectionManagementService (org.xmldb.api.modules.CollectionManagementService)148 Collection (org.xmldb.api.base.Collection)84 XMLResource (org.xmldb.api.modules.XMLResource)33 Resource (org.xmldb.api.base.Resource)25 Before (org.junit.Before)23 EXistCollectionManagementService (org.exist.xmldb.EXistCollectionManagementService)21 After (org.junit.After)21 Test (org.junit.Test)19 UserManagementService (org.exist.xmldb.UserManagementService)14 ResourceSet (org.xmldb.api.base.ResourceSet)14 BinaryResource (org.xmldb.api.modules.BinaryResource)13 XPathQueryService (org.xmldb.api.modules.XPathQueryService)9 Account (org.exist.security.Account)7 IndexQueryService (org.exist.xmldb.IndexQueryService)6 AfterClass (org.junit.AfterClass)6 Database (org.xmldb.api.base.Database)6 XMLDBException (org.xmldb.api.base.XMLDBException)6 Path (java.nio.file.Path)5 BeforeClass (org.junit.BeforeClass)5 InputStream (java.io.InputStream)4