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,16 +1,19 @@
package com.jacob.test.vbscript;
import com.jacob.com.*;
import com.jacob.test.BaseTestCase;
import com.jacob.activeX.*;
/**
* In this case the component is created and used in the same thread
* and it's an Apartment Threaded component, so we call InitSTA.
* <p>
* May need to run with some command line options (including from inside
* Eclipse). Look in the docs area at the Jacob usage document for command line
* options.
*/
class ScriptTestActiveX
{
public static void main(String args[]) throws Exception
{
public class ScriptTestActiveX extends BaseTestCase {
public void testActiveXScript() {
ComThread.InitSTA(true);
DispatchEvents de = null;
@@ -24,12 +27,12 @@ class ScriptTestActiveX
System.out.println("null returned when trying to create DispatchEvents");
}
Variant result;
result = sC.invoke("Eval",args[0]);
result = sC.invoke("Eval",getSampleVPScriptForEval());
// call it twice to see the objects reused
result = sC.invoke("Eval",args[0]);
result = sC.invoke("Eval",getSampleVPScriptForEval());
// call it 3 times to see the objects reused
result = sC.invoke("Eval",args[0]);
System.out.println("eval("+args[0]+") = "+ result);
result = sC.invoke("Eval",getSampleVPScriptForEval());
System.out.println("eval("+getSampleVPScriptForEval()+") = "+ result);
} catch (ComException e) {
e.printStackTrace();
}