
package org.eclipse.birt.report.model.util;

/*******************************************************************************
 * 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
 *******************************************************************************/

import java.net.URL;

import org.eclipse.birt.report.model.api.util.MessageFileUtil;

import com.ibm.icu.util.ULocale;

/**
 * Test cases for MessageFileUtil.
 *
 */

public class MessageFileUtilTest extends BaseTestCase
{

	/**
	 * Finds the message file from default resource locator.
	 * 
	 * @throws Exception
	 */

	public void testFindMessageFiles( ) throws Exception
	{
		createDesign( );

		sessionHandle.setResourceFolder( getClassFolder( ) );

		String testFile = "input/ResourceLocator"; //$NON-NLS-1$

		URL resource = MessageFileUtil.findMessageFile( designHandle, testFile,
				ULocale.US );
		String strResource = resource.toString( );
		assertTrue( strResource.indexOf( "en_US" ) != -1 ); //$NON-NLS-1$
	}

}
