reorganized the samples, again. Moved the programs that were more test cases to the unit test directory and repackaged the unit test directory.

This commit is contained in:
clay_shooter
2006-03-18 16:21:28 +00:00
parent 288b2da21a
commit 4eb49215cb
61 changed files with 767 additions and 711 deletions

View File

@@ -0,0 +1,55 @@
package com.jacob.test.MathProj;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.*;
/**
* This example uses the MathTest sample VB COM DLL under
* the MathProj directory
* <pre>
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=true
* </pre>
*/
class MathTest {
public static void main(String[] args) {
MathTest me = new MathTest();
me.runTest();
}
public MathTest(){
}
public void runTest(){
// deprecated
// System.runFinalizersOnExit(true);
Dispatch test = new ActiveXComponent("MathTest.Math");
TestEvents te = new TestEvents();
DispatchEvents de = new DispatchEvents(test, te);
if (de == null) {
System.out
.println("null returned when trying to create DispatchEvents");
}
System.out.println(Dispatch.call(test, "Add", new Variant(1),
new Variant(2)));
System.out.println(Dispatch.call(test, "Mult", new Variant(2),
new Variant(2)));
Variant v = Dispatch.call(test, "Mult", new Variant(2), new Variant(2));
// this should return false
System.out.println("v.isNull=" + v.isNull());
v = Dispatch.call(test, "getNothing");
// these should return nothing
System.out.println("v.isNull=" + v.isNull());
System.out.println("v.toDispatch=" + v.toDispatch());
}
public class TestEvents {
public void DoneAdd(Variant[] args) {
System.out.println("DoneAdd called in java");
}
public void DoneMult(Variant[] args) {
System.out.println("DoneMult called in java");
}
}
}