/*******************************************************************************
 * 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.metadata.MetaDataDictionary;
import org.eclipse.birt.report.tests.model.BaseTestCase;

/**
 * Regression description:
 * </p>
 * Top n, bottom n, top percent, bottom percent, match and like are not found in
 * "edit highlight" dialog.
 * </p>
 * Test description:
 * <p>
 * Check that those value are listed in highlight(map) operator choice Note:top
 * percent, bottom percent are removed
 */
public class Regression_122600 extends BaseTestCase
{

	/**
	 * 
	 */
	public void test_122600( )
	{
		MetaDataDictionary instance = MetaDataDictionary.getInstance( );

		IChoiceSet choiceset = instance.getChoiceSet( "mapOperator" ); //$NON-NLS-1$

		IChoice[] naturedSortedChoices = choiceset.getChoices( null );

		assertEquals( "top-n", naturedSortedChoices[17].getName( ) ); //$NON-NLS-1$
		assertEquals( "bottom-n", naturedSortedChoices[1].getName( ) ); //$NON-NLS-1$
		assertEquals( "like", naturedSortedChoices[10].getName( ) ); //$NON-NLS-1$
		assertEquals( "match", naturedSortedChoices[12].getName( ) ); //$NON-NLS-1$
	}
}

@@ -116,19 +116,16 @@
 oration.
-%0A *
  All rig
@@ -154,16 +154,19 @@
 gram and
+%0A *
  the acc
@@ -184,19 +184,16 @@
 aterials
-%0A *
  are mad
@@ -234,16 +234,19 @@
  Eclipse
+%0A *
  Public 
@@ -257,19 +257,16 @@
 nse v1.0
-%0A *
  which a
@@ -363,14 +363,8 @@
 html
-%0A *%0A *
  Con
@@ -373,20 +373,16 @@
 ibutors:
-%0A * 
  Actuate
@@ -398,10 +398,12 @@
 ion 
- 
 -
+%0A *
  ini
@@ -431,17 +431,16 @@
 tation%0A 
-*
 ********
@@ -1442,55 +1442,255 @@
 %0A%0A%09%09
-assertEquals( %22top-n%22, naturedSortedChoices%5B17%5D
+boolean topN = false;%0A%09%09boolean bottomN = false;%0A%09%09boolean like = false;%0A%09%09boolean match = false;%0A%0A%09%09for ( int i = 0; i %3C naturedSortedChoices.length; i++ )%0A%09%09%7B%0A%09%09%09IChoice choice = (IChoice) naturedSortedChoices%5Bi%5D;%0A%0A%09%09%09if ( %22top-n%22.equals( choice
 .get
@@ -1690,33 +1690,34 @@
 ice.getName( ) )
-;
+ )
  //$NON-NLS-1$%0A%09
@@ -1721,57 +1721,61 @@
 $%0A%09%09
-assertEquals( %22bottom-n%22, naturedSortedC
+%09%09topN = true;%0A%09%09%09else if ( %22bottom-n%22.equals( c
 hoice
-s%5B1%5D
 .get
@@ -1775,33 +1775,34 @@
 ice.getName( ) )
-;
+ )
  //$NON-NLS-1$%0A%09
@@ -1806,54 +1806,60 @@
 $%0A%09%09
-assertEquals( %22like%22, naturedSortedChoices%5B10%5D
+%09%09bottomN = true;%0A%09%09%09else if ( %22like%22.equals( choice
 .get
@@ -1859,33 +1859,34 @@
 ice.getName( ) )
-;
+ )
  //$NON-NLS-1$%0A%09
@@ -1890,55 +1890,58 @@
 $%0A%09%09
-assertEquals( %22match%22, naturedSortedChoices%5B12%5D
+%09%09like = true;%0A%09%09%09else if ( %22match%22.equals( choice
 .get
@@ -1949,17 +1949,18 @@
 ame( ) )
-;
+ )
  //$NON-
@@ -1966,13 +1966,128 @@
 -NLS-1$%0A
+%09%09%09%09match = true;%0A%0A%09%09%7D%0A%09%09assertTrue( topN );%0A%09%09assertTrue( bottomN );%0A%09%09assertTrue( like );%0A%09%09assertTrue( match );%0A
 %09%7D%0A%7D%0A

Fix a test case problem in regression test