📄 comtestbase.java
字号:
/*
* COMTestBase.java -
*
* This file is part of the Jawin Project: http://jawinproject.sourceforge.net/
*
* Please consult the LICENSE file in the project root directory,
* or at the project site before using this software.
*/
/* $Id: COMTestBase.java,v 1.2 2004/07/18 15:12:35 arosii_moa Exp $ */
package org.jawin;
import junit.framework.TestCase;
import org.jawin.win32.COINIT;
import org.jawin.win32.Ole32;
/**
* base testcase class for all COM vtable or dispatch based tests. Handles the
* CoInitialize() and CoUninitialize() calls.
*
* @version $Revision: 1.2 $
* @author Stuart Halloway, http://www.relevancellc.com/halloway/weblog/
*/
public abstract class COMTestBase extends TestCase {
// some arrays used in several of the tests.
protected static String[] stringArgs = { "one", "two" };
protected static Object[] expectedArgs = { "one", new Integer(2),
new Float(3.0f), new Short((short)4), Boolean.TRUE };
protected static int[] intArgs = { 1, 2, 3, 4, 5 };
protected static short[] shortArgs = { -1, -2, -3, -4, -5 };
protected static boolean[] boolArgs = { true, true, false, false, true };
// the CLSID for the DualTest object in CallCOMUnitTestD.dll (see the CallCOMUnitTest cpp project)
public static final GUID DUAL_TEST_CLSID = new GUID("{F420726D-905D-4D69-A225-A908152B2951}");
protected void setUp(COINIT threadModel) throws Exception {
super.setUp();
Ole32.CoInitialize(threadModel);
}
protected void tearDown() throws Exception {
Ole32.CoUninitialize();
super.tearDown();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -