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);
}
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);
}
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");
}
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;
}
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);
}
Aggregations