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:
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.samples.outlook;
|
||||
|
||||
/**
|
||||
* JACOB Outlook sample contributed by
|
||||
1
unittest/com/jacob/com/README.txt
Normal file
1
unittest/com/jacob/com/README.txt
Normal file
@@ -0,0 +1 @@
|
||||
This package exists in case folks need to test the Jacob COM objects and need access to protected methods
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test.MathProj;
|
||||
package com.jacob.test.MathProj;
|
||||
|
||||
import com.jacob.activeX.ActiveXComponent;
|
||||
import com.jacob.com.*;
|
||||
@@ -2,4 +2,4 @@ A Simple VB COM DLL that exposes two methods and raises events.
|
||||
|
||||
The dll must be registered with your system
|
||||
|
||||
Run --> regsvr32 <path>\com\jacob\samples\test\MathProj\MathTest.dll
|
||||
Run --> regsvr32 <path>\com\jacob\test\MathProj\MathTest.dll
|
||||
@@ -1,56 +1,56 @@
|
||||
/* this file contains the actual definitions of */
|
||||
/* the IIDs and CLSIDs */
|
||||
|
||||
/* link this file in with the server and any clients */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 5.01.0164 */
|
||||
/* at Sun Nov 05 01:12:47 2000
|
||||
*/
|
||||
/* Compiler settings for D:\jacob_15\samples\test\atl\MultiFace\MultiFace.idl:
|
||||
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
*/
|
||||
//@@MIDL_FILE_HEADING( )
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __IID_DEFINED__
|
||||
#define __IID_DEFINED__
|
||||
|
||||
typedef struct _IID
|
||||
{
|
||||
unsigned long x;
|
||||
unsigned short s1;
|
||||
unsigned short s2;
|
||||
unsigned char c[8];
|
||||
} IID;
|
||||
|
||||
#endif // __IID_DEFINED__
|
||||
|
||||
#ifndef CLSID_DEFINED
|
||||
#define CLSID_DEFINED
|
||||
typedef IID CLSID;
|
||||
#endif // CLSID_DEFINED
|
||||
|
||||
const IID IID_IFace1 = {0x9BF2440F,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
const IID IID_IFace2 = {0x9BF24410,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
const IID IID_IFace3 = {0x9BF24411,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
const IID LIBID_MULTIFACELib = {0x9BF24403,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
const CLSID CLSID_Face = {0x9BF24412,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* this file contains the actual definitions of */
|
||||
/* the IIDs and CLSIDs */
|
||||
|
||||
/* link this file in with the server and any clients */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 5.01.0164 */
|
||||
/* at Sun Nov 05 01:12:47 2000
|
||||
*/
|
||||
/* Compiler settings for D:\jacob_15\samples\test\atl\MultiFace\MultiFace.idl:
|
||||
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
*/
|
||||
//@@MIDL_FILE_HEADING( )
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __IID_DEFINED__
|
||||
#define __IID_DEFINED__
|
||||
|
||||
typedef struct _IID
|
||||
{
|
||||
unsigned long x;
|
||||
unsigned short s1;
|
||||
unsigned short s2;
|
||||
unsigned char c[8];
|
||||
} IID;
|
||||
|
||||
#endif // __IID_DEFINED__
|
||||
|
||||
#ifndef CLSID_DEFINED
|
||||
#define CLSID_DEFINED
|
||||
typedef IID CLSID;
|
||||
#endif // CLSID_DEFINED
|
||||
|
||||
const IID IID_IFace1 = {0x9BF2440F,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
const IID IID_IFace2 = {0x9BF24410,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
const IID IID_IFace3 = {0x9BF24411,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
const IID LIBID_MULTIFACELib = {0x9BF24403,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
const CLSID CLSID_Face = {0x9BF24412,0xB2E0,0x11D4,{0xA6,0x95,0x00,0x10,0x4B,0xFF,0x32,0x41}};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,16 @@
|
||||
|
||||
MultiFaceps.dll: dlldata.obj MultiFace_p.obj MultiFace_i.obj
|
||||
link /dll /out:MultiFaceps.dll /def:MultiFaceps.def /entry:DllMain dlldata.obj MultiFace_p.obj MultiFace_i.obj \
|
||||
kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \
|
||||
|
||||
.c.obj:
|
||||
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \
|
||||
$<
|
||||
|
||||
clean:
|
||||
@del MultiFaceps.dll
|
||||
@del MultiFaceps.lib
|
||||
@del MultiFaceps.exp
|
||||
@del dlldata.obj
|
||||
@del MultiFace_p.obj
|
||||
@del MultiFace_i.obj
|
||||
|
||||
MultiFaceps.dll: dlldata.obj MultiFace_p.obj MultiFace_i.obj
|
||||
link /dll /out:MultiFaceps.dll /def:MultiFaceps.def /entry:DllMain dlldata.obj MultiFace_p.obj MultiFace_i.obj \
|
||||
kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \
|
||||
|
||||
.c.obj:
|
||||
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \
|
||||
$<
|
||||
|
||||
clean:
|
||||
@del MultiFaceps.dll
|
||||
@del MultiFaceps.lib
|
||||
@del MultiFaceps.exp
|
||||
@del dlldata.obj
|
||||
@del MultiFace_p.obj
|
||||
@del MultiFace_i.obj
|
||||
@@ -1,38 +1,38 @@
|
||||
/*********************************************************
|
||||
DllData file -- generated by MIDL compiler
|
||||
|
||||
DO NOT ALTER THIS FILE
|
||||
|
||||
This file is regenerated by MIDL on every IDL file compile.
|
||||
|
||||
To completely reconstruct this file, delete it and rerun MIDL
|
||||
on all the IDL files in this DLL, specifying this file for the
|
||||
/dlldata command line option
|
||||
|
||||
*********************************************************/
|
||||
|
||||
#define PROXY_DELEGATION
|
||||
|
||||
#include <rpcproxy.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EXTERN_PROXY_FILE( MultiFace )
|
||||
|
||||
|
||||
PROXYFILE_LIST_START
|
||||
/* Start of list */
|
||||
REFERENCE_PROXY_FILE( MultiFace ),
|
||||
/* End of list */
|
||||
PROXYFILE_LIST_END
|
||||
|
||||
|
||||
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
|
||||
/* end of generated dlldata file */
|
||||
/*********************************************************
|
||||
DllData file -- generated by MIDL compiler
|
||||
|
||||
DO NOT ALTER THIS FILE
|
||||
|
||||
This file is regenerated by MIDL on every IDL file compile.
|
||||
|
||||
To completely reconstruct this file, delete it and rerun MIDL
|
||||
on all the IDL files in this DLL, specifying this file for the
|
||||
/dlldata command line option
|
||||
|
||||
*********************************************************/
|
||||
|
||||
#define PROXY_DELEGATION
|
||||
|
||||
#include <rpcproxy.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EXTERN_PROXY_FILE( MultiFace )
|
||||
|
||||
|
||||
PROXYFILE_LIST_START
|
||||
/* Start of list */
|
||||
REFERENCE_PROXY_FILE( MultiFace ),
|
||||
/* End of list */
|
||||
PROXYFILE_LIST_END
|
||||
|
||||
|
||||
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
|
||||
/* end of generated dlldata file */
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test.atl;
|
||||
package com.jacob.test.atl;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.jacob.com;
|
||||
package com.jacob.test.events;
|
||||
|
||||
import com.jacob.activeX.ActiveXComponent;
|
||||
import com.jacob.com.ComException;
|
||||
import com.jacob.com.Dispatch;
|
||||
import com.jacob.com.DispatchEvents;
|
||||
import com.jacob.com.InvocationProxy;
|
||||
import com.jacob.com.Variant;
|
||||
|
||||
/**
|
||||
* This test was lifted from a forum posting and shows how you can't listen to
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.events;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
/**
|
||||
* It looks like this test is broken again on the cleanup
|
||||
*
|
||||
* This demonstrates the new event handling code in jacob 1.7
|
||||
* This example will open up IE and print out some of the events
|
||||
* it listens to as it havigates to web sites.
|
||||
@@ -48,7 +50,8 @@ class IETestThread extends Thread
|
||||
|
||||
public void run()
|
||||
{
|
||||
int delay = 5000; // msec
|
||||
// this used to be 5 seconds but sourceforge is slow
|
||||
int delay = 10000; // msec
|
||||
// paired with statement below that blows up
|
||||
ComThread.InitMTA();
|
||||
ActiveXComponent ie = new ActiveXComponent("InternetExplorer.Application");
|
||||
@@ -63,7 +66,7 @@ class IETestThread extends Thread
|
||||
Variant optional = new Variant();
|
||||
optional.noParam();
|
||||
|
||||
Dispatch.call(ie, "Navigate", new Variant("http://www.danadler.com/jacob"));
|
||||
Dispatch.call(ie, "Navigate", new Variant("http://sourceforge.net/projects/jacob-project"));
|
||||
try { Thread.sleep(delay); } catch (Exception e) {}
|
||||
Dispatch.call(ie, "Navigate", new Variant("http://groups.yahoo.com/group/jacob-project"));
|
||||
try { Thread.sleep(delay); } catch (Exception e) {}
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.jacob.com;
|
||||
package com.jacob.test.events;
|
||||
|
||||
import com.jacob.activeX.ActiveXComponent;
|
||||
import com.jacob.com.ComException;
|
||||
import com.jacob.com.DispatchEvents;
|
||||
import com.jacob.com.InvocationProxy;
|
||||
import com.jacob.com.Variant;
|
||||
|
||||
/**
|
||||
* This test was lifted from a forum posting and shows how you can't listen to
|
||||
* Excel events (added post 1.9.1 Eclipse Settings.) This also uses the 1.9.1
|
||||
* Excel events (added post 1.9.1 Eclipse Settings.)
|
||||
* That test was modified make this a MSWord event listener to demonstrate
|
||||
* that the InvocationProxy code works with MS Word Events
|
||||
* This also uses the 1.10
|
||||
* InvocationProxy to receive the events.
|
||||
* <p> supported command line options with default values are
|
||||
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false
|
||||
@@ -15,7 +20,7 @@ import com.jacob.com.DispatchEvents;
|
||||
public class WordEventTest extends InvocationProxy {
|
||||
|
||||
/**
|
||||
* load up excel, register for events and make stuff happen
|
||||
* load up word, register for events and make stuff happen
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String args[]) {
|
||||
@@ -57,6 +62,10 @@ public class WordEventTest extends InvocationProxy {
|
||||
+ cfe.getMessage());
|
||||
|
||||
}
|
||||
System.out.println(
|
||||
"Someone needs to add some MSWord commands to this to " +
|
||||
"make some on screen stuff happens so the tester " +
|
||||
"thinks we tested something");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.jacob.samples.test.powerpoint;
|
||||
package com.jacob.test.powerpoint;
|
||||
|
||||
/*
|
||||
* $Id: PowerpointTest.java,v 1.2 2005/07/07 01:19:06 clay_shooter Exp $
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* This is really more of a multi threaded tester
|
||||
*
|
||||
* run with
|
||||
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=false
|
||||
*/
|
||||
import com.jacob.activeX.ActiveXComponent;
|
||||
import com.jacob.com.ComThread;
|
||||
@@ -19,7 +24,7 @@ public class PowerpointTest extends Thread {
|
||||
protected static final int NUM_ITERATIONS = 50;
|
||||
|
||||
private static String POWERPOINT_TEST_PATH =
|
||||
"D:\\jacob\\samples\\com\\jacob\\samples\\test\\powerpoint\\test";
|
||||
"D:\\jacob\\samples\\com\\jacob\\test\\powerpoint";
|
||||
//"c:\\PowerpointTest\test";
|
||||
|
||||
private int threadID;
|
||||
@@ -44,7 +49,7 @@ public class PowerpointTest extends Thread {
|
||||
Dispatch comPresentations = Dispatch.get(comPowerpoint,"Presentations").toDispatch();
|
||||
Dispatch comPresentation = Dispatch.call(comPresentations,
|
||||
"Open",
|
||||
POWERPOINT_TEST_PATH+threadID+".ppt",
|
||||
POWERPOINT_TEST_PATH+"\\test"+threadID+".ppt",
|
||||
new Integer(0),
|
||||
new Integer(0),
|
||||
new Integer(0)).toDispatch();
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.safearray;
|
||||
|
||||
import com.jacob.com.*;
|
||||
|
||||
class test
|
||||
class SafeArrayContents
|
||||
{
|
||||
|
||||
public static void printArray(boolean a[])
|
||||
@@ -1,4 +1,8 @@
|
||||
package com.jacob.com;
|
||||
package com.jacob.test.safearray;
|
||||
|
||||
import com.jacob.com.ComThread;
|
||||
import com.jacob.com.SafeArray;
|
||||
import com.jacob.com.Variant;
|
||||
|
||||
/**
|
||||
* run with -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=false
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.safearray;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.safearray;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.safearray;
|
||||
|
||||
import com.jacob.com.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.vbscript;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.vbscript;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.vbscript;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.vbscript;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.vbscript;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.vbscript;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.vbscript;
|
||||
|
||||
import com.jacob.com.Variant;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.jacob.samples.test;
|
||||
package com.jacob.test.vbscript;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
28
unittest/com/jacob/test/windowsmedia/WMPlayer.java
Normal file
28
unittest/com/jacob/test/windowsmedia/WMPlayer.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.jacob.test.windowsmedia;
|
||||
|
||||
/**
|
||||
* partial test program from the sourceforge bug report 1453161
|
||||
* that says you get a random "can't map name to dispid" when
|
||||
* getting the URL from the player
|
||||
*
|
||||
* I run with options
|
||||
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=true
|
||||
*/
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
public class WMPlayer {
|
||||
|
||||
public static void main(String[] args){
|
||||
ActiveXComponent wmp = null;
|
||||
wmp = new ActiveXComponent("WMPlayer.OCX");
|
||||
|
||||
// the sourceforge posting didn't post all the code so this is all we have
|
||||
// we need some other information on how to set the document
|
||||
// so that we have a url to open
|
||||
for ( int i= 0 ; i < 1000 ; i++){
|
||||
System.out.println("the wmp url is "+ wmp.getProperty("URL").toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
This directory will eventually contain the junit automated tests.
|
||||
This directory contains junit tests and other/older tests for
|
||||
specific functions. Sometimes tests in this directory migrate
|
||||
to the samples directory as they are updated to show more functionality.
|
||||
Reference in New Issue
Block a user