⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dispatchvaliddispatchtest.java

📁 Very Nice library for using ActiveX controls directly from java without heavy knowledge of JNI, simp
💻 JAVA
字号:
package com.jacob.com;

import com.jacob.test.BaseTestCase;

/**
 * Test armoring of dispatch static methods
 * <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.
 */
public class DispatchValidDispatchTest extends BaseTestCase {

	/**
	 * force an IllegalArgumentException to verify the utility method throws
	 * correctly.
	 */
	public void testThrowIllegalArgumentException() {
		try {
			Dispatch.call(null, 0);
			fail("Failed to throw IllegalArgumentException");
		} catch (IllegalArgumentException iae) {
			System.out.println("Caught correct IllegalArgumentException: "
					+ iae);
		}
	}

	/**
	 * force an IllegalStateException to verify the utility method throws
	 * correctly.
	 */
	public void testThrowIllegalStateException() {
		try {
			Dispatch foo = new Dispatch();
			Dispatch.call(foo, 0);
			fail("Failed to throw IllegalStateException");
		} catch (IllegalStateException ise) {
			System.out.println("Caught correct IllegalStateException " + ise);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -