/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed 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.
*
* CVS $Id: IntegrationEmbedTests.java,v 1.7 2004/02/08 03:57:16 vgritsenko Exp $
*/
package org.apache.xindice;
import org.apache.xindice.integration.IntegrationTests;
import org.apache.xindice.integration.client.XmlDbClient;
import org.apache.xindice.integration.client.XmlDbClientSetup;
import org.xmldb.api.DatabaseManager;
import org.xmldb.api.base.Database;
import junit.framework.Test;
import junitx.extensions.TestSetup;
/**
* @version CVS $Revision: 1.7 $, $Date: 2004/02/08 03:57:16 $
* @author Vladimir R. Bossicard <vladimir@apache.org>
*/
public class IntegrationEmbedTests {
public static Test suite() throws Exception {
return new TestSetup(
new XmlDbClientSetup(
IntegrationTests.testSuite("Embed client integration tests"),
new XmlDbClient("xmldb:xindice-embed://"))) {
private Database database;
public void setUp() throws Exception {
String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
Class cls = Class.forName(driver);
database = (Database) cls.newInstance();
DatabaseManager.registerDatabase(database);
}
public void tearDown() throws Exception {
if (database != null) {
DatabaseManager.deregisterDatabase(database);
}
}
};
}
}