1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 package complex.connectivity; 24 25 import complex.connectivity.dbase.DBaseDateFunctions; 26 import complex.connectivity.dbase.DBaseStringFunctions; 27 import complex.connectivity.dbase.DBaseSqlTests; 28 import complex.connectivity.dbase.DBaseNumericFunctions; 29 import com.sun.star.lang.XMultiServiceFactory; 30 import com.sun.star.uno.UnoRuntime; 31 32 import org.junit.After; 33 import org.junit.AfterClass; 34 import org.junit.Before; 35 import org.junit.BeforeClass; 36 import org.junit.Test; 37 import static org.junit.Assert.*; 38 import org.openoffice.test.Argument; 39 import org.openoffice.test.OfficeConnection; 40 41 public class DBaseDriverTest 42 { 43 private static final OfficeConnection connection = new OfficeConnection(); 44 45 @BeforeClass beforeClass()46 public static void beforeClass() throws Exception { 47 connection.setUp(); 48 } 49 50 @AfterClass afterClass()51 public static void afterClass() throws Exception { 52 connection.tearDown(); 53 } 54 55 @Test Functions()56 public void Functions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException 57 { 58 XMultiServiceFactory xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); 59 60 DBaseStringFunctions aStringTest = new DBaseStringFunctions(xMSF); 61 aStringTest.testFunctions(); 62 63 DBaseNumericFunctions aNumericTest = new DBaseNumericFunctions(xMSF); 64 aNumericTest.testFunctions(); 65 66 DBaseDateFunctions aDateTest = new DBaseDateFunctions(xMSF); 67 aDateTest.testFunctions(); 68 69 DBaseSqlTests aSqlTest = new DBaseSqlTests(xMSF); 70 aSqlTest.testFunctions(); 71 } 72 } 73