/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation. All rights reserved. This program and
 * the accompanying materials are made available under the terms of the Eclipse
 * Public License v1.0 which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: Actuate Corporation - initial API and implementation
 ******************************************************************************/

package org.eclipse.birt.report.tests.model.regression;

import org.eclipse.birt.report.model.api.metadata.IChoice;
import org.eclipse.birt.report.model.api.metadata.IChoiceSet;
import org.eclipse.birt.report.model.api.metadata.IMetaDataDictionary;
import org.eclipse.birt.report.model.metadata.MetaDataDictionary;
import org.eclipse.birt.report.tests.model.BaseTestCase;

/**
 * Regression description:
 * <p>
 * Description: "Structure" and "table" should be hidden in column data binding
 * data type choice list.
 * 
 * Steps to reproduce: In table data binding, I saw structure and table two
 * datatypes. They are not supported now, so they should be removed.
 * <p>
 * Test description:
 * <p>
 * Make sure that "columnDataType" choice set do not support "structure" and
 * "table" types.
 * <p>
 */
public class Regression_136279 extends BaseTestCase
{

	/**
	 * 
	 */
	public void test_136279( )
	{
		IMetaDataDictionary dict = MetaDataDictionary.getInstance( );
		IChoiceSet datatypes = dict.getChoiceSet( "columnDataType" ); //$NON-NLS-1$
		IChoice[] choices = datatypes.getChoices( );
		assertEquals( "any", choices[0].getName( ) );//$NON-NLS-1$
		assertEquals( "integer", choices[1].getName( ) );//$NON-NLS-1$
		assertEquals( "string", choices[2].getName( ) );//$NON-NLS-1$
		assertEquals( "date-time", choices[3].getName( ) );//$NON-NLS-1$
		assertEquals( "decimal", choices[4].getName( ) );//$NON-NLS-1$
		assertEquals( "float", choices[5].getName( ) );//$NON-NLS-1$
		assertEquals( 6, choices.length );
	}
}

@@ -359,23 +359,16 @@
 v10.html
-%0A * %0A *
  Contrib
@@ -395,16 +395,19 @@
 ration -
+%0A *
  initial
@@ -1032,15 +1032,8 @@
 ist.
-%0A * %0A *
  Ste
@@ -1077,16 +1077,19 @@
 g, I saw
+%0A *
  structu
@@ -1104,19 +1104,16 @@
 able two
-%0A *
  datatyp
@@ -1154,24 +1154,27 @@
  they should
+%0A *
  be removed.
@@ -1609,159 +1609,109 @@
  );%0A
+%0A
 %09%09
-assertEquals( %22any%22, choices%5B0%5D.getName( ) );//$NON-NLS-1$%0A%09%09assertEquals
+boolean valid = true;%0A%09%09for 
 ( 
-%22
 int
-eger%22, choices%5B1%5D.getName( ) );//$NON-NLS-1$%0A%09%09assertEquals( %22string%22,
+ i = 0; i %3C choices.length; i++ )%0A%09%09%7B%0A%09%09%09if ( %22Structure%22.equals(
  cho
@@ -1715,17 +1715,17 @@
 choices%5B
-2
+i
 %5D.getNam
@@ -1734,51 +1734,27 @@
  ) )
-;//$NON-NLS-1$%0A%09%09assertEquals( %22date-time%22,
+ %7C%7C %22table%22.equals(
  cho
@@ -1758,17 +1758,17 @@
 choices%5B
-3
+i
 %5D.getNam
@@ -1765,33 +1765,35 @@
 %5Bi%5D.getName( ) )
-;
+ ) 
 //$NON-NLS-1$%0A%09%09
@@ -1793,60 +1793,8 @@
 S-1$
-%0A%09%09assertEquals( %22decimal%22, choices%5B4%5D.getName( ) );
 //$N
@@ -1804,111 +1804,82 @@
 NLS-
-1
+2
 $%0A%09%09
-assertEquals( %22float%22, choices%5B5%5D.getName( ) );//$NON-NLS-1$%0A%09%09assertEquals( 6, choices.length
+%09%7B%0A%09%09%09%09valid = false;%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09assertTrue( valid
  );%0A
+%0A
 %09%7D%0A%7D

Fix an error