INTEGRATION: CWS sb44 (1.2.8); FILE MERGED

2005/12/12 15:55:41 sb 1.2.8.1: #i51419# Added javanative-test.
This commit is contained in:
Kurt Zenker
2006-01-03 11:39:56 +00:00
parent f4a9c1ed28
commit e33d9d74f8

View File

@ -4,9 +4,9 @@
*
* $RCSfile: JavaMain.java,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: rt $ $Date: 2005-09-09 10:12:37 $
* last change: $Author: kz $ $Date: 2006-01-03 12:39:56 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@ -41,10 +41,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.uno.XComponentContext;
import test.types.CppTest;
import test.types.JavaTest;
import test.types.TestException;
import test.types.XTest;
import test.java.tester.Tester;
public final class JavaMain implements XMain {
public JavaMain(XComponentContext context) {
@ -52,8 +49,7 @@ public final class JavaMain implements XMain {
}
public int run(String[] arguments) {
test(CppTest.create(context), CppTest.class.getName());
test(JavaTest.create(context), JavaTest.class.getName());
Tester.test(context);
return 0;
}
@ -74,18 +70,6 @@ public final class JavaMain implements XMain {
}
}
private static final void test(XTest test, String name) {
boolean ok = false;
try {
test.throwException();
} catch (TestException e) {
ok = true;
}
if (!ok) {
throw new RuntimeException(name + ".throwException failed");
}
}
private static final String IMPLEMENTATION_NAME
= "test.java.javamain.Component";
private static final String SERVICE_NAME = "test.dummy.JavaMain";