当前位置: 首页>>代码示例>>Java>>正文


Java EngineException.printStackTrace方法代码示例

本文整理汇总了Java中org.eclipse.birt.report.engine.api.EngineException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java EngineException.printStackTrace方法的具体用法?Java EngineException.printStackTrace怎么用?Java EngineException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.birt.report.engine.api.EngineException的用法示例。


在下文中一共展示了EngineException.printStackTrace方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: existPageScript

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
public static boolean existPageScript( Report report,
		ExecutionContext context )
{
	String javaClass = report.getJavaClass( );
	if ( javaClass == null )
	{
		return false;
	}
	Class<?> clazz = null;
	try
	{
		clazz = EventHandlerManager.loadClass( javaClass, context );
		return checkPageScriptMethod( "onPageStart", (Class<?>) clazz,
				IReportEventHandler.class, IPageInstance.class,
				ReportEventAdapter.class )
				|| checkPageScriptMethod( "onPageEnd", (Class<?>) clazz,
						IReportEventHandler.class, IPageInstance.class,
						ReportEventAdapter.class );

	}
	catch ( EngineException e )
	{
		e.printStackTrace( );
		return false;
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:ReportScriptExecutor.java

示例2: testCancel

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
public void testCancel( )
{
	report_design = INPUT + "pages9.rptdesign";
	copyResource_INPUT( "pages9.rptdesign", "pages9.rptdesign" );
	String fileDocument = OUTPUT + "cancel_pages9.rptdocument";
	long bTime, eTime, timeSpan1, timeSpan2, timeSpan3;
	try
	{
		runnable = engine.openReportDesign( report_design );
		IRunTask task = engine.createRunTask( runnable );
		CancelTask cancelThread = new CancelTask( "cancelThread", task );
		cancelThread.start( );
		bTime = System.currentTimeMillis( );
		task.run( fileDocument );
		eTime = System.currentTimeMillis( );
		task.close( );
		timeSpan1 = eTime - bTime;

		task = engine.createRunTask( runnable );
		bTime = System.currentTimeMillis( );
		task.run( fileDocument );
		eTime = System.currentTimeMillis( );
		task.close( );
		timeSpan3 = eTime - bTime;

		removeFile( fileDocument );

		assertTrue( "RunTask.cancel() failed!", ( timeSpan3 > timeSpan1 ) );
	}
	catch ( EngineException ee )
	{
		ee.printStackTrace( );
		fail( "RunTask.cancel() failed!" );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:36,代码来源:RunTaskTest.java

示例3: runReport

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
private void runReport( String report )
{
	report_design = INPUT + report + ".rptdesign";
	copyResource_INPUT( report + ".rptdesign", report + ".rptdesign" );
	String fileDocument = OUTPUT + report + ".rptdocument";
	String folderDocument = OUTPUT + "runtask_folderdocument_" + report
			+ separator;
	try
	{
		runnable = engine.openReportDesign( report_design );
		IRunTask task = engine.createRunTask( runnable );
		task.run( fileDocument );
		task.close( );

		task = engine.createRunTask( runnable );
		task.run( folderDocument );
		task.close( );

		assertTrue(
				"Fail to generate file archive for " + report,
				new File( fileDocument ).exists( ) );
		assertTrue(
				"Fail to generate folder archive for " + report,
				new File( folderDocument ).exists( ) );
	}
	catch ( EngineException ee )
	{
		ee.printStackTrace( );
		assertTrue( "Failed to generate document for " + report
				+ ee.getLocalizedMessage( ), false );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:33,代码来源:RunTaskTest.java

示例4: checkGetResultSetList

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
private void checkGetResultSetList( IDataExtractionTask task )
{

	ArrayList results;
	try
	{
		results = (ArrayList) task.getResultSetList( );
		assertEquals( 1, results.size( ) );
	}
	catch ( EngineException e )
	{
		e.printStackTrace( );
		fail( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:16,代码来源:DataExtractionTaskTest.java

示例5: testOpenReportDesign

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
/**
 * Test openReportDesign(string)
 * 
 * @throws EngineException
 */
public void testOpenReportDesign( ) throws EngineException
{
	EngineConfig config = new EngineConfig( );
	IReportRunnable reportRunner;
	config.setTempDir( "tempdir" );
	ReportEngine engine = new ReportEngine( config );
	/*
	 * String input =
	 * PLUGIN_PATH+System.getProperty("file.separator")+RESOURCE_BUNDLE
	 * .getString("CASE_INPUT"); input +=
	 * System.getProperty("file.separator") ; String
	 * designName=input+"report_engine.rptdesign";
	 */
	String designName = this.genInputFile( "report_engine.rptdesign" );

	try
	{
		reportRunner = engine.openReportDesign( designName );
		designName = "file:" + designName;
		designName = designName.replace( '/', '\\' );
		String reportName = reportRunner.getReportName( ).replace(
				'/',
				'\\' );
		assertEquals( "openReportDesign(String) fail", designName
				.substring( designName.indexOf( "org" ), designName
						.length( ) ), reportName.substring( reportName
				.indexOf( "org" ), reportName.length( ) ) );
		assertNotNull( "openReportDesign(String) fail", reportRunner
				.getImage( "23.gif" ) );
	}
	catch ( EngineException ee )
	{
		ee.printStackTrace( );
		fail( "openReportDesign(String) fail" );
	}
	engine.destroy( );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:44,代码来源:ReportEngineTest.java

示例6: testOpenReportDesign1

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
/**
 * Test openReportDesign(inputStream)
 */
public void testOpenReportDesign1( )
{
	EngineConfig config = new EngineConfig( );
	IReportRunnable reportRunner;
	config.setTempDir( "tempdir" );
	ReportEngine engine = new ReportEngine( config );
	/*
	 * String input =
	 * PLUGIN_PATH+System.getProperty("file.separator")+RESOURCE_BUNDLE
	 * .getString("CASE_INPUT"); input +=
	 * System.getProperty("file.separator") ; String
	 * designName=input+"report_engine.rptdesign";
	 */

	String designName = this.genInputFile( "report_engine.rptdesign" );

	try
	{
		File file = new File( designName );
		FileInputStream fis = new FileInputStream( file );
		reportRunner = engine.openReportDesign( fis );
		assertEquals(
				"openReportDesign(InputStream) fail",
				"<stream>",
				reportRunner.getReportName( ) );
		assertNotNull( "openReportDesign(InputStream) fail", reportRunner
				.getImage( "23.gif" ) );
	}
	catch ( EngineException ee )
	{
		ee.printStackTrace( );
	}
	catch ( FileNotFoundException fe )
	{
		fe.printStackTrace( );
	}
	engine.destroy( );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:43,代码来源:ReportEngineTest.java

示例7: testCreateGetParameterDefinitionTask

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
/**
 * Test createGetParameterDefinitionTask()
 */
public void testCreateGetParameterDefinitionTask( )
{
	EngineConfig config = new EngineConfig( );
	IReportRunnable reportRunner;
	ReportEngine engine = new ReportEngine( config );
	/*
	 * String input =
	 * PLUGIN_PATH+System.getProperty("file.separator")+RESOURCE_BUNDLE
	 * .getString("CASE_INPUT"); input +=
	 * System.getProperty("file.separator") ; String
	 * designName=input+"parameter.rptdesign";
	 */
	String designName = this.genInputFile( "parameter.rptdesign" );

	try
	{
		reportRunner = engine.openReportDesign( designName );
		IGetParameterDefinitionTask getParamTask = engine
				.createGetParameterDefinitionTask( reportRunner );
		getParamTask.evaluateDefaults( );
		IParameterDefnBase paramDefn = getParamTask.getParameterDefn( "p1" );
		System.err.println( paramDefn.getTypeName( ) );
		System.err.println( paramDefn instanceof ScalarParameterDefn );
		assertEquals(
				"creatGetParameterDefinitionTask() fail",
				"abc",
				getParamTask.getDefaultValue( paramDefn ) );
	}
	catch ( EngineException ee )
	{
		ee.printStackTrace( );
	}

}
 
开发者ID:eclipse,项目名称:birt,代码行数:38,代码来源:ReportEngineTest.java

示例8: testRender_unfinished_Document

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
public void testRender_unfinished_Document( )
{
	try
	{
		String inputFile = this.getFullQualifiedClassName( )
				+ "/" + INPUT_FOLDER + "/" + INPUT; //$NON-NLS-1$ //$NON-NLS-2$ 
		String outputDoc = this.genOutputFile( REPORT_DOCUMENT_OUTPUT ); //$NON-NLS-1$

		// open the report runnable to execute.
		IReportRunnable report;
		report = engine.openReportDesign( inputFile );

		// create an IRunTask
		IRunTask task = engine.createRunTask( report );
		task.setAppContext( new HashMap( ) );

		// execute the report to create the report document.
		task.setPageHandler( new PageHandler( ) );
		task.run( outputDoc );

		// close the task, release the resource.
		task.close( );

		File html = new File( outputHtml );
		assertTrue( html.exists( ) );
	}
	catch ( EngineException e )
	{
		e.printStackTrace( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:32,代码来源:RenderUnfinishedReportDoc.java

示例9: renderFolderDocument

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
/**
 * render output html from folder-based document
 * 
 * @param docName
 *            . The value must be "folderdocument_reportname"
 */
private void renderFolderDocument( String docName )
{

	String designName, report_design;
	designName = docName.substring( 15 );
	report_design = inputFolder + designName + ".rptdesign";
	copyResource_INPUT( designName + ".rptdesign", designName
			+ ".rptdesign" );

	folderArchive = outputFolder + docName + separator;
	htmlOutput = outputFolder + docName + ".html";
	new File( outputFolder ).mkdirs( );
	try
	{
		createFolderDocument( report_design, folderArchive );

		FolderArchiveReader reader = new FolderArchiveReader( folderArchive );
		reportDoc = engine.openReportDocument( folderArchive );
		renderTask = engine.createRenderTask( reportDoc );

		htmlOption.setOutputFileName( htmlOutput );
		HTMLRenderContext renderContext = new HTMLRenderContext( );
		renderContext.setImageDirectory( "image" );
		HashMap appContext = new HashMap( );
		appContext.put(
				EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
				renderContext );

		renderTask.setRenderOption( htmlOption );
		renderTask.setAppContext( appContext );
		renderTask.setLocale( Locale.ENGLISH );
		renderTask.setPageRange( "All" );
		renderTask.render( );
		renderTask.close( );

		assertNotNull(
				docName
						+ ".html failed to render from folder-based document",
				htmlOutput );

		reader.close( );

	}
	catch ( IOException ioe )
	{
		ioe.printStackTrace( );
		assertTrue( "IOException (when create and render " + docName
				+ " folder-based document)", false );
	}
	catch ( EngineException ee )
	{
		ee.printStackTrace( );
		assertTrue( "EngineException (when create and render " + docName
				+ " folder-based document)", false );
	}

}
 
开发者ID:eclipse,项目名称:birt,代码行数:64,代码来源:RenderFolderDocumentTest.java

示例10: needOnPageBreak

import org.eclipse.birt.report.engine.api.EngineException; //导入方法依赖的package包/类
public static boolean needOnPageBreak( ReportItemDesign design,
        ExecutionContext context )
{
	if ( design == null )
	{
		return false;
	}
	if ( design instanceof ExtendedItemDesign )
	{
		return false;
	}
	if ( design.getOnPageBreak( ) != null )
	{
		return true;
	}
	String javaClass = design.getJavaClass( );
	if ( javaClass == null )
	{
		return false;
	}
	Object extensionData = design.getExtensionData( );
	if ( extensionData != null )
	{
		return (Boolean) extensionData;
	}
	// design.getJavaClass() must not be null here.
	EventHandlerManager eventHandlerManager = context
	        .getEventHandlerManager( );
	Class<?> clazz = null;
	boolean result = false;
	try
	{
		clazz = eventHandlerManager.loadClass( javaClass, context );
		result = (Boolean) design.accept( scriptChecker, clazz );
	}
	catch ( EngineException e )
	{
		e.printStackTrace( );
	}
	design.setExtensionData( result );
	return result;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:43,代码来源:ScriptExecutor.java


注:本文中的org.eclipse.birt.report.engine.api.EngineException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。