summaryrefslogtreecommitdiff
path: root/sfx2/qa/complex/sfx2/JUnitBasedTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/qa/complex/sfx2/JUnitBasedTest.java')
-rwxr-xr-xsfx2/qa/complex/sfx2/JUnitBasedTest.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/sfx2/qa/complex/sfx2/JUnitBasedTest.java b/sfx2/qa/complex/sfx2/JUnitBasedTest.java
new file mode 100755
index 000000000000..a43493712c31
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/JUnitBasedTest.java
@@ -0,0 +1,55 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package complex.sfx2;
+
+import org.openoffice.test.OfficeConnection;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XComponentContext;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+/**
+ *
+ * @author Frank
+ */
+public class JUnitBasedTest
+{
+ // -----------------------------------------------------------------------------------------------------------------
+ protected XComponentContext getContext()
+ {
+ return m_connection.getComponentContext();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ protected XMultiServiceFactory getORB()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, getContext().getServiceManager() );
+ return xMSF1;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
+ System.out.println( "--------------------------------------------------------------------------------" );
+ System.out.println( "connecting ..." );
+ m_connection.setUp();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @AfterClass
+ public static void tearDownConnection() throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println();
+ System.out.println( "tearing down connection" );
+ m_connection.tearDown();
+ System.out.println( "--------------------------------------------------------------------------------" );
+ }
+
+ private static final OfficeConnection m_connection = new OfficeConnection();
+}