1761727 converted unit test programs to JUnit tests and updated the build targets

This commit is contained in:
clay_shooter
2007-07-27 03:28:44 +00:00
parent bfdc36ad30
commit 78c7ddf199
71 changed files with 1459 additions and 1257 deletions

View File

@@ -1,7 +1,11 @@
package com.jacob.test.events;
import com.jacob.com.*;
import com.jacob.activeX.*;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.DispatchEvents;
import com.jacob.com.Variant;
import com.jacob.test.BaseTestCase;
/**
* This test runs fine against jdk 1.4 and 1.5
*
@@ -15,10 +19,9 @@ import com.jacob.activeX.*;
* Look in the docs area at the Jacob usage document for command line options.
*/
class IETest
{
public static void main(String[] args)
{
public class IETest extends BaseTestCase {
public void testRunIE() {
// this line starts the pump but it runs fine without it
ComThread.startMainSTA();
// remove this line and it dies
@@ -39,6 +42,10 @@ class IETest
ComThread.quitMainSTA();
System.out.println("Main: did quit main sta in thread "
+Thread.currentThread().getName());
if (aThread.threadFailedWithException != null){
fail("caught an unexpected exception "+aThread.threadFailedWithException);
}
}
}
@@ -46,6 +53,11 @@ class IETestThread extends Thread
{
public static boolean quitHandled = false;
/**
* holds any caught exception so the main/test case can see them
*/
public Throwable threadFailedWithException = null;
public IETestThread(){
super();
}
@@ -80,8 +92,10 @@ class IETestThread extends Thread
System.out.println("IETestThread: Did call navigate to yahoo");
try { Thread.sleep(delay); } catch (Exception e) {}
} catch (Exception e) {
threadFailedWithException = e;
e.printStackTrace();
} catch (Throwable re){
threadFailedWithException = re;
re.printStackTrace();
} finally {
System.out.println("IETestThread: About to send Quit");