Package org.apache.xindice.webadmin

Source Code of org.apache.xindice.webadmin.MethodSetup

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.xindice.webadmin;

import junit.framework.TestCase;
import org.apache.xindice.webadmin.webdav.DAVRequest;
import org.apache.xindice.webadmin.webdav.DAVResponse;
import org.apache.xindice.webadmin.webdav.components.DAVComponent;
import org.apache.xindice.core.Database;
import org.apache.xindice.core.DatabaseTest;
import org.apache.xindice.core.Collection;
import org.apache.xindice.util.Configuration;
import org.apache.xindice.xml.dom.DOMParser;

public class MethodSetup extends TestCase {
    protected DAVComponent method;
    protected HttpServletRequestMockup httpRequest = new HttpServletRequestMockup();
    protected HttpServletResponseMockup httpResponse = new HttpServletResponseMockup();
    protected DAVRequest request;
    protected DAVResponse response;
    protected Database db;
    protected Collection collection;

    public void setUp() throws Exception {
        request = new DAVRequest(httpRequest);
        response = new DAVResponse(httpResponse);

        db = Database.getDatabase(new Configuration(DOMParser.toDocument(DatabaseTest.DATABASE)));

        String name = "webdav_test";
        collection = db.createCollection(name, new Configuration(
                DOMParser.toDocument(
                        "<collection compressed='true' name='" + name + "' inline-metadata='true'>" +
                        "<filer class='org.apache.xindice.core.filer.BTreeFiler' />" +
                        "</collection>"), false
        ));
    }

    public void tearDown() throws Exception {
        db.dropCollection(collection);
        db.close();
    }
}
TOP

Related Classes of org.apache.xindice.webadmin.MethodSetup

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.