@@ -0,0 +1,2822 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.jackrabbit.test.api;%0A%0Aimport javax.jcr.Repository;%0Aimport javax.jcr.RepositoryException;%0Aimport javax.jcr.UnsupportedRepositoryOperationException;%0Aimport javax.jcr.Workspace;%0Aimport javax.jcr.NoSuchWorkspaceException;%0A%0Aimport org.apache.jackrabbit.test.AbstractJCRTest;%0A%0A/**%0A * %3Ccode%3EWorkspaceManagementTest%3C/code%3E...%0A */%0Apublic class WorkspaceManagementTest extends AbstractJCRTest %7B%0A%0A    private Workspace workspace;%0A%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A%0A        super.checkSupportedOption(Repository.OPTION_WORKSPACE_MANAGEMENT_SUPPORTED);%0A%0A        workspace = superuser.getWorkspace();%0A    %7D%0A%0A    /**%0A     * Tests %7B@link javax.jcr.Workspace#createWorkspace(String)%7D and%0A     * %7B@link javax.jcr.Workspace#createWorkspace(String, String)%7D.%0A     *%0A     * @throws javax.jcr.RepositoryException%0A     */%0A    public void testCreateWorkspace() throws RepositoryException %7B%0A%0A        try %7B%0A            workspace.createWorkspace(workspaceName);%0A            fail(%22creating a new workspace with the name of an already existing one must fail%22);%0A        %7D catch (RepositoryException e) %7B%0A            // excepted%0A        %7D%0A%0A        // create empty workspace%0A        workspace.createWorkspace(%22tmp%22 + System.currentTimeMillis());%0A%0A        // create pre-initialized workspace, specifying unknwon src workspace%0A        try %7B%0A            workspace.createWorkspace(%22tmp%22 + System.currentTimeMillis(), %22unknownworkspace%22);%0A            fail(%22NoSuchWorkspaceException expected%22);%0A        %7D catch (NoSuchWorkspaceException e) %7B%0A            // excepted%0A        %7D%0A    %7D%0A%0A%0A    /**%0A     * Tests %7B@link javax.jcr.Workspace#deleteWorkspace(String)%7D.%0A     *%0A     * @throws javax.jcr.RepositoryException%0A     */%0A    public void testDeleteWorkspace() throws RepositoryException %7B%0A%0A        try %7B%0A            workspace.deleteWorkspace(%22unknownworkspace%22);%0A            fail(%22NoSuchWorkspaceException expected%22);%0A        %7D catch (NoSuchWorkspaceException e) %7B%0A            // excepted%0A        %7D%0A    %7D%0A%7D

test case (TCK) maintenance for JCR 2.0