001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /**
018: * @author Alexey A. Ivanov
019: * @version $Revision$
020: */package javax.swing.text.html;
021:
022: import javax.swing.BasicSwingTestCase;
023:
024: public abstract class StyleSheet_ConvertAttr_BorderWidthTestCase extends
025: StyleSheet_ConvertAttr_LengthTestCase {
026:
027: protected void setUp() throws Exception {
028: super .setUp();
029: negativeValuesInvalid = true;
030: percentageValuesInvalid = true;
031: }
032:
033: public void testBorderWidthThin() {
034: ss.addCSSAttribute(simple, cssKey, "thin");
035: cssValue = simple.getAttribute(cssKey);
036: assertEquals("thin", cssValue.toString());
037: }
038:
039: public void testBorderWidthMedium() {
040: ss.addCSSAttribute(simple, cssKey, "medium");
041: cssValue = simple.getAttribute(cssKey);
042: assertEquals("medium", cssValue.toString());
043: }
044:
045: public void testBorderWidthThick() {
046: ss.addCSSAttribute(simple, cssKey, "thick");
047: cssValue = simple.getAttribute(cssKey);
048: assertEquals("thick", cssValue.toString());
049: }
050:
051: public void testBorderWidthSmall() {
052: ss.addCSSAttribute(simple, cssKey, "small");
053: cssValue = simple.getAttribute(cssKey);
054: if (!BasicSwingTestCase.isHarmony()) {
055: assertEquals(1, simple.getAttributeCount());
056: assertEquals("medium", simple.getAttribute(cssKey)
057: .toString());
058: return;
059: }
060: assertEquals(0, simple.getAttributeCount());
061: assertNull(cssValue);
062: }
063:
064: public void testLength0_75em() {
065: if (!BasicSwingTestCase.isHarmony()) {
066: ss.addCSSAttribute(simple, cssKey, "0.75em");
067: assertEquals(1, simple.getAttributeCount());
068: assertEquals("medium", simple.getAttribute(cssKey)
069: .toString());
070: return;
071: }
072: super .testLength0_75em();
073: }
074:
075: public void testLength1_25ex() {
076: if (!BasicSwingTestCase.isHarmony()) {
077: ss.addCSSAttribute(simple, cssKey, "1.25ex");
078: assertEquals(1, simple.getAttributeCount());
079: assertEquals("medium", simple.getAttribute(cssKey)
080: .toString());
081: return;
082: }
083: super .testLength1_25ex();
084: }
085:
086: public void testLengthMinus11_1pt() {
087: negativeValuesInvalid = BasicSwingTestCase.isHarmony();
088: super .testLengthMinus11_1pt();
089: }
090:
091: public void testLength11_1Percent() {
092: percentageValuesInvalid = BasicSwingTestCase.isHarmony();
093: super .testLength11_1Percent();
094: }
095:
096: public void testLengthMinus11_1Percent() {
097: negativeValuesInvalid = BasicSwingTestCase.isHarmony();
098: percentageValuesInvalid = BasicSwingTestCase.isHarmony();
099: super .testLengthMinus11_1Percent();
100: }
101:
102: public void testLengthPlus11_1Percent() {
103: percentageValuesInvalid = BasicSwingTestCase.isHarmony();
104: super.testLengthPlus11_1Percent();
105: }
106: }
|