merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / mod / _javavm.uno / JavaVirtualMachine.java
blob4993e6937e47f73b0afd81929d7f81a340adac58
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: JavaVirtualMachine.java,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package mod._javavm.uno;
33 import com.sun.star.lang.XMultiServiceFactory;
34 import com.sun.star.uno.XInterface;
35 import java.io.PrintWriter;
36 import lib.StatusException;
37 import lib.TestCase;
38 import lib.TestEnvironment;
39 import lib.TestParameters;
41 /**
42 * Test for object which is represented by service
43 * <code>com.sun.star.java.JavaVirtualMachine</code>. <p>
44 * Object implements the following interfaces :
45 * <ul>
46 * <li> <code>com::sun::star::java::XJavaThreadRegister_11</code></li>
47 * <li> <code>com::sun::star::java::XJavaVM</code></li>
48 * </ul>
49 * This object test <b> is NOT </b> designed to be run in several
50 * threads concurently.
51 * @see com.sun.star.java.XJavaThreadRegister_11
52 * @see com.sun.star.java.XJavaVM
53 * @see com.sun.star.java.XJavaVirtualMachine
54 * @see ifc.java._XJavaThreadRegister_11
55 * @see ifc.java._XJavaVM
57 public class JavaVirtualMachine extends TestCase {
59 /**
60 * Creating a Testenvironment for the interfaces to be tested.
61 * Creates an instance of the service
62 * <code>com.sun.star.java.JavaVirtualMachine</code>.
64 protected TestEnvironment createTestEnvironment(TestParameters tParam,
65 PrintWriter log) {
66 XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
68 try {
69 XInterface xInt = (XInterface)xMSF.createInstance(
70 "com.sun.star.java.JavaVirtualMachine");
72 return new TestEnvironment(xInt);
73 } catch (com.sun.star.uno.Exception e) {
74 e.printStackTrace(log);
75 throw new StatusException("Unexpected exception", e);