@@ -0,0 +1,2303 @@
+/*******************************************************************************%0A * Copyright (c) 2004 Actuate Corporation. All rights reserved. This program and%0A * the accompanying materials are made available under the terms of the Eclipse%0A * Public License v1.0 which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html Contributors: Actuate Corporation -%0A * initial API and implementation%0A ******************************************************************************/%0A%0Apackage org.eclipse.birt.report.tests.model.regression;%0A%0Aimport org.eclipse.birt.report.model.api.DesignConfig;%0Aimport org.eclipse.birt.report.model.api.DesignEngine;%0Aimport org.eclipse.birt.report.model.api.ElementFactory;%0Aimport org.eclipse.birt.report.model.api.LibraryHandle;%0Aimport org.eclipse.birt.report.model.api.SessionHandle;%0Aimport org.eclipse.birt.report.model.api.TableHandle;%0Aimport org.eclipse.birt.report.model.api.command.ContentException;%0Aimport org.eclipse.birt.report.model.api.command.NameException;%0Aimport org.eclipse.birt.report.model.elements.TableItem;%0Aimport org.eclipse.birt.report.tests.model.BaseTestCase;%0A%0Aimport com.ibm.icu.util.ULocale;%0A%0A/**%0A * %3Cb%3ERegression description:%3C/b%3E%0A * %3C/p%3E%0A * NPE throwed when I copy an empty table(no layout)%0A * %3C/p%3E%0A * %3Cb%3ETest description:%3C/b%3E%0A * %3Cp%3E%0A * %3Cb%3ESteps:%3C/b%3E%0A * %3Col%3E%0A * %3Cli%3ETableHandle table = factory.newTableItem( %22table1%22 );%0A * %3Cli%3E libHandle.getComponents( ).add( table );%0A * %3Cli%3ETableItem copiedTable = (TableItem)libHandle.findElement( %22table1%22%0A * ).copy( );%0A * %3C/ol%3E%0A * NPE throwed when executing line 3%0A * %3Cp%3E%0A * %3Cb%3ETest description:%3C/b%3E%0A * %3Cp%3E%0A * Follow the steps, ensure no exception throwed.%0A */%0Apublic class Regression_152704 extends BaseTestCase%0A%7B%0A%0A%09/**%0A%09 * @throws NameException%0A%09 * @throws ContentException%0A%09 */%0A%09public void test_112910( ) throws NameException, ContentException%0A%09%7B%0A%09%09SessionHandle sessionHandle = new DesignEngine( new DesignConfig( ) )%0A%09%09%09%09.newSessionHandle( ULocale.ENGLISH );%0A%09%09LibraryHandle libHandle = sessionHandle.createLibrary( );%0A%0A%09%09ElementFactory factory = libHandle.getElementFactory( );%0A%09%09TableHandle table = factory.newTableItem( %22table1%22 ); //$NON-NLS-1$%0A%09%09libHandle.getComponents( ).add( table );%0A%09%09libHandle.findElement( %22table1%22 ) //$NON-NLS-1$%0A%09%09%09%09.copy( );%0A%0A%09%7D%0A%7D%0A

Add regression test case for bugzilla 152704