Search in sources :

Example 51 with CollectionManagementService

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

the class NamespaceUpdateTest method setUp.

@Before
public void setUp() throws ClassNotFoundException, IllegalAccessException, InstantiationException, XMLDBException {
    // initialize driver
    final CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
    testCollection = service.createCollection("test");
    assertNotNull(testCollection);
    final XMLResource doc = (XMLResource) testCollection.createResource("namespace-updates.xml", "XMLResource");
    doc.setContent(namespaces);
    testCollection.storeResource(doc);
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService) XMLResource(org.xmldb.api.modules.XMLResource) Before(org.junit.Before)

Example 52 with CollectionManagementService

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

the class SpecialNamesTest method setUp.

@Before
public void setUp() throws ClassNotFoundException, IllegalAccessException, InstantiationException, XMLDBException {
    final CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
    testCollection = service.createCollection("test");
    assertNotNull(testCollection);
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService) Before(org.junit.Before)

Example 53 with CollectionManagementService

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

the class TransformTest method setUp.

@Before
public void setUp() throws ClassNotFoundException, IllegalAccessException, InstantiationException, XMLDBException {
    CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
    testCollection = service.createCollection(TEST_COLLECTION_NAME);
    assertNotNull(testCollection);
    service = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
    Collection xsl1 = service.createCollection("xsl1");
    assertNotNull(xsl1);
    Collection xsl3 = service.createCollection("xsl3");
    assertNotNull(xsl3);
    service = (CollectionManagementService) xsl1.getService("CollectionManagementService", "1.0");
    Collection xsl2 = service.createCollection("xsl2");
    assertNotNull(xsl2);
    String doc1 = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>\n" + "<xsl:import href='xsl2/2.xsl' />\n" + "<xsl:template match='/'>\n" + "<doc>" + "<p>Start Template 1</p>" + "<xsl:call-template name='template-2' />" + "<xsl:call-template name='template-3' />" + "<p>End Template 1</p>" + "</doc>" + "</xsl:template>" + "</xsl:stylesheet>";
    String doc2 = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>\n" + "<xsl:import href='../../xsl3/3.xsl' />\n" + "<xsl:template name='template-2'>\n" + "<p>Start Template 2</p>" + "<xsl:call-template name='template-3' />" + "<p>End Template 2</p>" + "</xsl:template>" + "</xsl:stylesheet>";
    String doc3 = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>\n" + "<xsl:template name='template-3'>\n" + "<p>Template 3</p>" + "</xsl:template>" + "</xsl:stylesheet>";
    addXMLDocument(xsl1, doc1, "1.xsl");
    addXMLDocument(xsl2, doc2, "2.xsl");
    addXMLDocument(xsl3, doc3, "3.xsl");
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService) Collection(org.xmldb.api.base.Collection) Before(org.junit.Before)

Example 54 with CollectionManagementService

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

the class UnionTest method tearDown.

@AfterClass
public static void tearDown() throws Exception {
    final CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
    service.removeCollection(TEST_COLLECTION_NAME);
    testCollection = null;
}
Also used : CollectionManagementService(org.xmldb.api.modules.CollectionManagementService)

Example 55 with CollectionManagementService

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

the class UnionTest method createTestCollection.

@BeforeClass
public static void createTestCollection() throws Exception {
    final CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
    testCollection = service.createCollection(TEST_COLLECTION_NAME);
    assertNotNull(testCollection);
}
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