Package org.lilyproject.repository.model.api

Examples of org.lilyproject.repository.model.api.RepositoryModel.create()


    public void createRepository(String repositoryName) {
        try {
            RepositoryModel model = new RepositoryModelImpl(getZooKeeper());
            if (!model.repositoryExistsAndActive(repositoryName)) {
                model.create(repositoryName);
                model.waitUntilRepositoryInState(repositoryName, RepositoryDefinition.RepositoryLifecycleState.ACTIVE,
                        100000);
            }
        } catch (Exception ex) {
            throw new RuntimeException(ex);
View Full Code Here


     * Trying to get a non-existing table should fail.
     */
    @Test(expected = RepositoryExistsException.class)
    public void testCreateRepositoryTwice() throws Exception {
        RepositoryModel repositoryModel = repoSetup.getRepositoryModel();
        repositoryModel.create("somerepo");
        repositoryModel.create("somerepo");
    }

    /**
     * Tests that two repositories can have a table with the same name containing records with the
View Full Code Here

     */
    @Test(expected = RepositoryExistsException.class)
    public void testCreateRepositoryTwice() throws Exception {
        RepositoryModel repositoryModel = repoSetup.getRepositoryModel();
        repositoryModel.create("somerepo");
        repositoryModel.create("somerepo");
    }

    /**
     * Tests that two repositories can have a table with the same name containing records with the
     * same id's, without conflict.
View Full Code Here

     * same id's, without conflict.
     */
    @Test
    public void testTwoRepositoriesSameTableSameId() throws Exception {
        RepositoryModel repositoryModel = repoSetup.getRepositoryModel();
        repositoryModel.create("company1");
        repositoryModel.create("company2");
        assertTrue(repositoryModel.waitUntilRepositoryInState("company1", RepositoryDefinition.RepositoryLifecycleState.ACTIVE, 60000L));
        assertTrue(repositoryModel.waitUntilRepositoryInState("company2", RepositoryDefinition.RepositoryLifecycleState.ACTIVE, 60000L));

        TypeManager typeMgr = repositoryManager.getDefaultRepository().getTypeManager();
View Full Code Here

     */
    @Test
    public void testTwoRepositoriesSameTableSameId() throws Exception {
        RepositoryModel repositoryModel = repoSetup.getRepositoryModel();
        repositoryModel.create("company1");
        repositoryModel.create("company2");
        assertTrue(repositoryModel.waitUntilRepositoryInState("company1", RepositoryDefinition.RepositoryLifecycleState.ACTIVE, 60000L));
        assertTrue(repositoryModel.waitUntilRepositoryInState("company2", RepositoryDefinition.RepositoryLifecycleState.ACTIVE, 60000L));

        TypeManager typeMgr = repositoryManager.getDefaultRepository().getTypeManager();
        FieldType fieldType1 = typeMgr.createFieldType("STRING", new QName("test", "field1"), Scope.NON_VERSIONED);
View Full Code Here

    @Test
    public void testBasicTableManagement() throws Exception {
        String repositoryName = "tablemgmttest";
        RepositoryModel repositoryModel = repoSetup.getRepositoryModel();
        repositoryModel.create(repositoryName);
        assertTrue(repositoryModel.waitUntilRepositoryInState(repositoryName, RepositoryDefinition.RepositoryLifecycleState.ACTIVE, 60000L));

        LRepository repository = repositoryManager.getRepository(repositoryName);
        TableManager tableManager = repository.getTableManager();
View Full Code Here

        TestListener model2Listener = new TestListener();
        assertEquals(1, repositoryModel2.getRepositories(model2Listener).size());

        repositoryModel1.create("repo1");
        repositoryModel1.create("repo2");
        repositoryModel2.create("repo3");
        repositoryModel2.create("repo4");

        model2Listener.waitForEvents(4);
        model1Listener.waitForEvents(4);
View Full Code Here

        assertEquals(1, repositoryModel2.getRepositories(model2Listener).size());

        repositoryModel1.create("repo1");
        repositoryModel1.create("repo2");
        repositoryModel2.create("repo3");
        repositoryModel2.create("repo4");

        model2Listener.waitForEvents(4);
        model1Listener.waitForEvents(4);

        assertEquals(5, repositoryModel1.getRepositories().size());
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.