Package org.xmldb.api.modules

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


            database.setProperty("create-database", "true");
            DatabaseManager.registerDatabase(database);

            Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
            CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
            Collection testCol = mgmt.createCollection("triggers");

            for (int i = 1; i <= 2; i++) {
                mgmt = (CollectionManagementService) testCol.getService("CollectionManagementService", "1.0");
                testCol = mgmt.createCollection("sub" + i);
            }
View Full Code Here


            CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
            Collection testCol = mgmt.createCollection("triggers");

            for (int i = 1; i <= 2; i++) {
                mgmt = (CollectionManagementService) testCol.getService("CollectionManagementService", "1.0");
                testCol = mgmt.createCollection("sub" + i);
            }

        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
View Full Code Here

    @Before
    public void storePreliminaryDocuments() throws XMLDBException {
        TestUtils.cleanupDB();
        final CollectionManagementService service = (CollectionManagementService) root
                .getService("CollectionManagementService", "1.0");
        testCollection = service.createCollection(TEST_COLLECTION);
        assertNotNull(testCollection);

        final XMLResource doc = (XMLResource) testCollection.createResource(LOG_NAME, "XMLResource" );
        doc.setContent(EMPTY_LOG);
        testCollection.storeResource(doc);
View Full Code Here

    public void collectionCreate() throws XMLDBException {
        final IndexQueryService idxConf = (IndexQueryService) root.getService("IndexQueryService", "1.0");
        idxConf.configureCollection(COLLECTION_CONFIG);

        final CollectionManagementService service = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        final Collection collection = service.createCollection("test");
        assertNotNull(collection);

        // remove the trigger for the Collection under test
        idxConf.configureCollection(EMPTY_COLLECTION_CONFIG);
View Full Code Here

    public void collectionDelete() throws XMLDBException {
        final IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
        idxConf.configureCollection(COLLECTION_CONFIG);

        final CollectionManagementService service = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        final Collection collection = service.createCollection("test");
        assertNotNull(collection);

        service.removeCollection("test");

        // remove the trigger for the Collection under test
View Full Code Here

        DatabaseManager.registerDatabase(database);

        root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
        final CollectionManagementService service = (CollectionManagementService) root
                .getService("CollectionManagementService", "1.0");
        testCollection = service.createCollection(TEST_COLLECTION);
        assertNotNull(testCollection);
    }

    @AfterClass
    public static void shutdownDB() throws XMLDBException {
View Full Code Here

            database.setProperty("create-database", "true");
            DatabaseManager.registerDatabase(database);

            Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
            CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
            Collection testCol = mgmt.createCollection("triggers");

            for (int i = 1; i <= 2; i++) {
                mgmt = (CollectionManagementService) testCol.getService("CollectionManagementService", "1.0");
                testCol = mgmt.createCollection("sub" + i);
            }
View Full Code Here

            CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
            Collection testCol = mgmt.createCollection("triggers");

            for (int i = 1; i <= 2; i++) {
                mgmt = (CollectionManagementService) testCol.getService("CollectionManagementService", "1.0");
                testCol = mgmt.createCollection("sub" + i);
            }

        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
View Full Code Here

                (CollectionManagementService) root.getService(
                        "CollectionManagementService",
                "1.0");
            testCollection = root.getChildCollection(TEST_COLLECTION_NAME);
            if (testCollection == null) {
                testCollection = service.createCollection(TEST_COLLECTION_NAME);
                assertNotNull(testCollection);
                IndexQueryService idxConf = (IndexQueryService)
                testCollection.getService("IndexQueryService", "1.0");
                idxConf.configureCollection(COLLECTION_CONFIG);
            }
View Full Code Here

        }
    }

    private void storeDocs(String collectionName) throws XMLDBException {
        CollectionManagementService service = (CollectionManagementService) test.getService("CollectionManagementService", "1.0");
        Collection collection = service.createCollection(collectionName);
        IndexQueryService iqs = (IndexQueryService) collection.getService("IndexQueryService", "1.0");
        iqs.configureCollection(COLLECTION_CONFIG1);

        String existHome = System.getProperty("exist.home");
        File existDir = existHome==null ? new File(".") : new File(existHome);
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.