abstractconfigurablejasperreportsviewtests.java

来自「struts+spring 源码 希望能给大家带来帮助」· Java 代码 · 共 32 行

JAVA
32
字号
package org.springframework.web.servlet.view.jasperreports;

import org.springframework.context.support.StaticApplicationContext;

/**
 * @author robh
 */
public abstract class AbstractConfigurableJasperReportsViewTests extends AbstractJasperReportsViewTests {

	public void testSetInvalidExporterClass() throws Exception {
		try {
			new ConfigurableJasperReportsView().setExporterClass(String.class);
			fail("Should not be able to set invalid view class.");
		}
		catch (IllegalArgumentException ex) {
			// success
		}
	}

	public void testNoConfiguredExporter() throws Exception {
		ConfigurableJasperReportsView view = new ConfigurableJasperReportsView();
		view.setUrl(COMPILED_REPORT);
		try {
			view.setApplicationContext(new StaticApplicationContext());
			fail("Should not be able to setup view class without an exporter class.");
		}
		catch (IllegalArgumentException e) {
			// success
		}
	}
}

⌨️ 快捷键说明

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