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.embedding; 24 25 import com.sun.star.lang.XMultiServiceFactory; 26 import com.sun.star.lang.XMultiComponentFactory; 27 import com.sun.star.connection.XConnector; 28 import com.sun.star.connection.XConnection; 29 30 import com.sun.star.bridge.XUnoUrlResolver; 31 import com.sun.star.uno.UnoRuntime; 32 import com.sun.star.uno.XInterface; 33 import com.sun.star.uno.XNamingService; 34 import com.sun.star.uno.XComponentContext; 35 36 import com.sun.star.container.*; 37 import com.sun.star.beans.*; 38 import com.sun.star.lang.*; 39 40 import complex.embedding.*; 41 42 import java.util.*; 43 import java.io.*; 44 45 import org.junit.After; 46 import org.junit.AfterClass; 47 import org.junit.Before; 48 import org.junit.BeforeClass; 49 import org.junit.Test; 50 import static org.junit.Assert.*; 51 import org.openoffice.test.OfficeConnection; 52 53 /* This unit test for storage objects is designed to 54 * test most important statements from storage service 55 * specification. 56 * 57 * Regression tests are added to extend the tested 58 * functionalities. 59 */ 60 public class EmbeddingUnitTest 61 { 62 private static final OfficeConnection connection = new OfficeConnection(); 63 64 @BeforeClass beforeClass()65 public static void beforeClass() throws Exception 66 { 67 connection.setUp(); 68 } 69 70 @AfterClass afterClass()71 public static void afterClass() throws Exception 72 { 73 connection.tearDown(); 74 } 75 76 @Test ExecuteTest01()77 public void ExecuteTest01() 78 { 79 XMultiServiceFactory xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); 80 Test01 aTest = new Test01( xMSF ); 81 assertTrue( "Test01 failed!", aTest.test() ); 82 } 83 84 } 85 86