@Test
public void shouldAllowCreatingWorkspaces() throws Exception {

    shutdownDefaultRepository();
    RepositoryConfiguration config = null;
    config = RepositoryConfiguration.read("{ \"name\" : \"repoName\", \"workspaces\" : { \"allowCreation\" : true } }");
    config = new RepositoryConfiguration(config.getDocument(), "repoName", new TestingEnvironment());
    repository = new JcrRepository(config);
    repository.start();
    // Create several sessions ...
    Session session2 = null;
    Session session3 = null;
    try {
        session = createSession();
        session2 = createSession();
        // Create a new workspace ...
        String newWorkspaceName = "MyCarWorkspace";
        session.getWorkspace().createWorkspace(newWorkspaceName);
        assertAccessibleWorkspace(session, newWorkspaceName);
        assertAccessibleWorkspace(session2, newWorkspaceName);
        session.logout();
        session3 = createSession();
        assertAccessibleWorkspace(session2, newWorkspaceName);
        assertAccessibleWorkspace(session3, newWorkspaceName);
        // Create a session for this new workspace ...
        session = createSession(newWorkspaceName);
    } finally {
        try {
            if (session2 != null) session2.logout();
        } finally {
            if (session3 != null) session3.logout();
        }
    }
}