use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.
the class DuplicateAttributesTest method cleanup.
@AfterClass
public static void cleanup() throws XMLDBException {
final CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
service.removeCollection("test");
}
use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.
the class EntitiesTest 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 EntitiesTest method tearDown.
@After
public void tearDown() throws Exception {
final CollectionManagementService service = (CollectionManagementService) existEmbeddedServer.getRoot().getService("CollectionManagementService", "1.0");
service.removeCollection("test");
testCollection = null;
}
use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.
the class OptimizerTest method initDatabase.
@BeforeClass
public static void initDatabase() throws ClassNotFoundException, IllegalAccessException, InstantiationException, XMLDBException, IOException, URISyntaxException {
// initialize driver
Class<?> cl = Class.forName("org.exist.xmldb.DatabaseImpl");
Database database = (Database) cl.newInstance();
database.setProperty("create-database", "true");
DatabaseManager.registerDatabase(database);
Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
testCollection = service.createCollection("test");
Assert.assertNotNull(testCollection);
IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
idxConf.configureCollection(COLLECTION_CONFIG);
XMLResource resource = (XMLResource) testCollection.createResource("test.xml", "XMLResource");
resource.setContent(XML);
testCollection.storeResource(resource);
for (final String sampleName : SAMPLES.getShakespeareXmlSampleNames()) {
resource = (XMLResource) testCollection.createResource(sampleName, XMLResource.RESOURCE_TYPE);
try (final InputStream is = SAMPLES.getShakespeareSample(sampleName)) {
resource.setContent(InputStreamUtil.readString(is, UTF_8));
}
testCollection.storeResource(resource);
}
}
use of org.xmldb.api.modules.CollectionManagementService in project exist by eXist-db.
the class QueryPoolTest method tearDown.
@After
public void tearDown() throws Exception {
final CollectionManagementService service = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
service.removeCollection("/db/test-pool");
testCollection.close();
}
Aggregations