assertEquals("data111", dataLibAHandle.getName()); assertEquals("par111", parameterLibAHandle.getName()); assertEquals("text111", textLibAHandle.getName()); assertEquals("label111", labelLibAHandle.getName()); assertEquals("table111", tableLibAHandle.getName()); assertEquals("pic111", imageLibAHandle.getName()); assertEquals("list111", listLibAHandle.getName()); assertEquals("grid111", gridLibAHandle.getName());
assertEquals("data11", dataLibAHandle.getName()); assertEquals("par11", parameterLibAHandle.getName()); assertEquals("text11", textLibAHandle.getName()); assertEquals("label11", labelLibAHandle.getName()); assertEquals("table11", tableLibAHandle.getName()); assertEquals("pic11", imageLibAHandle.getName()); assertEquals("list11", listLibAHandle.getName()); assertEquals("grid11", gridLibAHandle.getName());
	public void testDesignIncludeLibrary() throws Exception {		openDesign(fileName);		// Inclued LibA		designHandle.includeLibrary(inputLibrary, "LibA"); //$NON-NLS-1$		LibraryHandle libAHandle = designHandle.getLibrary("LibA"); //$NON-NLS-1$		// Find element in LibA		TextItemHandle textLibA = (TextItemHandle) libAHandle				.findElement("text1"); //$NON-NLS-1$		assertNotNull("Text should not be null", textLibA); //$NON-NLS-1$		TableHandle tableLibA = (TableHandle) libAHandle.findElement("table1"); //$NON-NLS-1$		assertNotNull("Table should not be null", tableLibA); //$NON-NLS-1$		ParameterHandle parameterLibA = (ParameterHandle) libAHandle				.findParameter("par1"); //$NON-NLS-1$		assertNotNull("Parameter should not be null", parameterLibA); //$NON-NLS-1$		LabelHandle labelLibA = (LabelHandle) libAHandle.findElement("label1"); //$NON-NLS-1$		assertNotNull("Label should not be null", labelLibA); //$NON-NLS-1$		ImageHandle imageLibA = (ImageHandle) libAHandle.findElement("pic1"); //$NON-NLS-1$		assertNotNull("Image should not be null", imageLibA); //$NON-NLS-1$		DataItemHandle dataLibA = (DataItemHandle) libAHandle				.findElement("data1"); //$NON-NLS-1$		assertNotNull("Data should not be null", dataLibA); //$NON-NLS-1$		DataSourceHandle dataSourceLibA = (DataSourceHandle) libAHandle				.findDataSource("sqlds1"); //$NON-NLS-1$		assertNotNull("Datasource should not be null", dataSourceLibA); //$NON-NLS-1$		DataSetHandle dataSetLibA = (DataSetHandle) libAHandle				.findDataSet("sqldst1"); //$NON-NLS-1$		assertNotNull("Dataset should not be null", dataSetLibA); //$NON-NLS-1$		ListHandle listLibA = (ListHandle) libAHandle.findElement("list1"); //$NON-NLS-1$		assertNotNull("List should not be null", listLibA); //$NON-NLS-1$		GridHandle gridLibA = (GridHandle) libAHandle.findElement("grid1"); //$NON-NLS-1$		assertNotNull("Grid should not be null", gridLibA); //$NON-NLS-1$		// New the element in Design and extends element in LibA		TextItemHandle textLibAHandle = (TextItemHandle) designHandle				.getElementFactory().newElementFrom(textLibA, "text1"); //$NON-NLS-1$		TableHandle tableLibAHandle = (TableHandle) designHandle				.getElementFactory().newElementFrom(tableLibA, "table1"); //$NON-NLS-1$		ParameterHandle parameterLibAHandle = (ParameterHandle) designHandle				.getElementFactory().newElementFrom(parameterLibA, "par1"); //$NON-NLS-1$		LabelHandle labelLibAHandle = (LabelHandle) designHandle				.getElementFactory().newElementFrom(labelLibA, "label1"); //$NON-NLS-1$		ImageHandle imageLibAHandle = (ImageHandle) designHandle				.getElementFactory().newElementFrom(imageLibA, "pic1"); //$NON-NLS-1$		DataItemHandle dataLibAHandle = (DataItemHandle) designHandle				.getElementFactory().newElementFrom(dataLibA, "data1"); //$NON-NLS-1$		DataSourceHandle dataSourceLibAHandle = (DataSourceHandle) designHandle				.getElementFactory().newOdaDataSource("sqlds1"); //$NON-NLS-1$		DataSetHandle dataSetLibAHandle = (DataSetHandle) designHandle				.getElementFactory().newOdaDataSet("sqldst1"); //$NON-NLS-1$			ListHandle listLibAHandle = (ListHandle) designHandle				.getElementFactory().newElementFrom(listLibA, "list1"); //$NON-NLS-1$		GridHandle gridLibAHandle = (GridHandle) designHandle				.getElementFactory().newElementFrom(gridLibA, "grid1"); //$NON-NLS-1$		// Add Body in Design		designHandle.getDataSources().add(dataSourceLibAHandle);		designHandle.getDataSets().add(dataSetLibAHandle);		designHandle.getBody().add(dataLibAHandle);		designHandle.getParameters().add(parameterLibAHandle);		designHandle.getBody().add(textLibAHandle);		designHandle.getBody().add(labelLibAHandle);		designHandle.getBody().add(tableLibAHandle);		designHandle.getBody().add(imageLibAHandle);		designHandle.getBody().add(listLibAHandle);		designHandle.getBody().add(gridLibAHandle);		// Cheack the element name extends in LibA		assertEquals("sqlds11", dataSourceLibAHandle.getName()); //$NON-NLS-1$		assertEquals("sqldst11", dataSetLibAHandle.getName()); //$NON-NLS-1$		assertEquals("data111", dataLibAHandle.getName()); //$NON-NLS-1$		assertEquals("par111", parameterLibAHandle.getName()); //$NON-NLS-1$		assertEquals("text111", textLibAHandle.getName()); //$NON-NLS-1$		assertEquals("label111", labelLibAHandle.getName()); //$NON-NLS-1$		assertEquals("table111", tableLibAHandle.getName()); //$NON-NLS-1$		assertEquals("pic111", imageLibAHandle.getName()); //$NON-NLS-1$		assertEquals("list111", listLibAHandle.getName()); //$NON-NLS-1$		assertEquals("grid111", gridLibAHandle.getName()); //$NON-NLS-1$		// Check the style of design label before remove design style		LabelHandle labelDesignHandle = (LabelHandle) designHandle				.findElement("designlabel");		assertNotNull("designlabel should not be null", labelDesignHandle);		assertEquals("#FFA500", labelDesignHandle.getStringProperty("color"));		assertEquals("#0000FF", labelDesignHandle				.getStringProperty("backgroundColor"));		// Extends the LibA style in design		StyleHandle styleLibA = (StyleHandle) libAHandle.findStyle("style1"); //$NON-NLS-1$		assertNotNull("Style should not be null", styleLibA); //$NON-NLS-1$		StyleHandle styleLibAHandle = (StyleHandle) designHandle				.getElementFactory().newStyle("style1"); //$NON-NLS-1$		designHandle.getStyles().add(styleLibAHandle);		assertEquals("#FFA500", labelDesignHandle.getStringProperty("color"));		assertEquals("#0000FF", labelDesignHandle				.getStringProperty("backgroundColor"));		// Remove the style of design and Check the style of design label		StyleHandle styleDesignHandle = (StyleHandle) designHandle				.findStyle("style1");		assertNotNull("style1 shoule not be null", styleDesignHandle);		styleDesignHandle.drop();		assertEquals("black", labelDesignHandle.getStringProperty("color"));		assertEquals(null, labelDesignHandle				.getStringProperty("backgroundColor"));		designHandle.saveAs(outFileName); //$NON-NLS-1$	}