blob: 2f98d3e23e1128a87871defeaf3e9aff75f2cd82 [file] [log] [blame]
/*******************************************************************************
*Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
*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:
* David Carver (STAR) - bug 249716 - initial API and implementation
*******************************************************************************/
package org.eclipse.wst.xsl.ui.tests.style;
import java.util.Map;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.eclipse.wst.xsl.ui.internal.style.IStyleConstantsXSL;
import org.eclipse.wst.xsl.ui.internal.style.XSLRegionMap;
import junit.framework.TestCase;
public class TestXSLRegionMap extends TestCase {
public void testXSLTagOpenContentRegion() throws Exception {
XSLRegionMap xslRegionMap = XSLRegionMap.getInstance();
Map<String, String> regionMap = xslRegionMap.getRegionMap();
assertNotNull("Region Not Found", regionMap.get(DOMRegionContext.XML_TAG_OPEN));
assertEquals("Incorrect value", IStyleConstantsXSL.TAG_BORDER, regionMap.get(DOMRegionContext.XML_TAG_OPEN));
}
public void testXSLEndTagOpenContentRegion() throws Exception {
XSLRegionMap xslRegionMap = XSLRegionMap.getInstance();
Map<String, String> regionMap = xslRegionMap.getRegionMap();
assertNotNull("Region Not Found", regionMap.get(DOMRegionContext.XML_END_TAG_OPEN));
assertEquals("Incorrect value", IStyleConstantsXSL.TAG_BORDER, regionMap.get(DOMRegionContext.XML_END_TAG_OPEN));
}
public void testXSLTagCloseContentRegion() throws Exception {
XSLRegionMap xslRegionMap = XSLRegionMap.getInstance();
Map<String, String> regionMap = xslRegionMap.getRegionMap();
assertNotNull("Region Not Found", regionMap.get(DOMRegionContext.XML_TAG_CLOSE));
assertEquals("Incorrect value", IStyleConstantsXSL.TAG_BORDER, regionMap.get(DOMRegionContext.XML_TAG_CLOSE));
}
public void testXSLEmptyTagCloseRegion() throws Exception {
XSLRegionMap xslRegionMap = XSLRegionMap.getInstance();
Map<String, String> regionMap = xslRegionMap.getRegionMap();
assertNotNull("Region Not Found", regionMap.get(DOMRegionContext.XML_EMPTY_TAG_CLOSE));
assertEquals("Incorrect value", IStyleConstantsXSL.TAG_BORDER, regionMap.get(DOMRegionContext.XML_EMPTY_TAG_CLOSE));
}
public void testXSLTagAttributeNameRegion() throws Exception {
XSLRegionMap xslRegionMap = XSLRegionMap.getInstance();
Map<String, String> regionMap = xslRegionMap.getRegionMap();
assertNotNull("Region Not Found", regionMap.get(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME));
assertEquals("Incorrect value", IStyleConstantsXSL.TAG_ATTRIBUTE_NAME, regionMap.get(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME));
}
public void testXSLTagNameRegion() throws Exception {
XSLRegionMap xslRegionMap = XSLRegionMap.getInstance();
Map<String, String> regionMap = xslRegionMap.getRegionMap();
assertNotNull("Region Not Found", regionMap.get(DOMRegionContext.XML_TAG_NAME));
assertEquals("Incorrect value", IStyleConstantsXSL.TAG_NAME, regionMap.get(DOMRegionContext.XML_TAG_NAME));
}
public void testXSLTagAttributeValueRegion() throws Exception {
XSLRegionMap xslRegionMap = XSLRegionMap.getInstance();
Map<String, String> regionMap = xslRegionMap.getRegionMap();
assertNotNull("Region Not Found", regionMap.get(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE));
assertEquals("Incorrect value", IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE, regionMap.get(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE));
}
}