Continue converting unit tests. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/batik/branches/junit@1640032 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test-resources/org/apache/batik/css/engine/value/unitTesting.xml b/test-resources/org/apache/batik/css/engine/value/unitTesting.xml deleted file mode 100644 index b0a9af1..0000000 --- a/test-resources/org/apache/batik/css/engine/value/unitTesting.xml +++ /dev/null
@@ -1,537 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<!-- ====================================================================== --> -<!-- @author tkormann@ilog.fr --> -<!-- @version $Id$ --> -<!-- ====================================================================== --> - -<testSuite id="css.engine.value.unitTesting" - name="org.apache.batik.css.engine.value.ValueManager Unit Testing"> - -<testGroup id="css.engine.values" - class="org.apache.batik.css.engine.value.PropertyManagerTest"> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.alignement-baseline"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.AlignmentBaselineManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto | baseline | before-edge | text-before-edge | middle | - after-edge | text-after-edge | ideographic | alphabetic | - hanging | mathematical" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.baseline-shift"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.BaselineShiftManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="baseline" /> - <arg class="java.lang.String" value="baseline | sub | super" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.clip"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.ClipManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.clip-path"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ClipPathManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.clip-rule"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ClipRuleManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="nonzero" /> - <arg class="java.lang.String" value="nonzero | evenodd" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.color"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ColorManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="__USER_AGENT__" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.color-interpolation"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ColorInterpolationManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="sRGB" /> - <arg class="java.lang.String" value="auto | sRGB | linearRGB" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.color-interpolation-filters"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ColorInterpolationFiltersManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="linearRGB" /> - <arg class="java.lang.String" value="auto | sRGB | linearRGB" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.color-profile"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ColorProfileManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto | sRGB" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.color-rendering"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ColorRenderingManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto | optimizeSpeed | optimizeQuality" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.cursor"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.CursorManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto | crosshair | default | pointer | move | e-resize | - ne-resize | nw-resize | n-resize | se-resize | sw-resize | - s-resize | w-resize| text | wait | help " /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.direction"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.DirectionManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="ltr" /> - <arg class="java.lang.String" value="ltr | rtl" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.display"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.DisplayManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="inline" /> - <arg class="java.lang.String" value="inline | block | list-item | run-in | compact | marker | - table | inline-table | table-row-group | table-header-group | - table-footer-group | table-row | table-column-group | table-column | - table-cell | table-caption | none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.dominant-baseline"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.DominantBaselineManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto | use-script | no-change | reset-size | alphabetic | hanging | - ideographic | mathematical | central | middle | text-after-edge | - text-before-edge | text-top | text-bottom" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.enable-background"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.EnableBackgroundManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="accumulate" /> - <arg class="java.lang.String" value="accumulate" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.fill"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$FillManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="rgb(0, 0, 0)" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.fill-opacity"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$FillOpacityManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="1" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.fill-rule"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.FillRuleManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="nonzero" /> - <arg class="java.lang.String" value="nonzero | evenodd" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.filter"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.FilterManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.flood-color"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$FloodColorManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="rgb(0, 0, 0)" /> - <arg class="java.lang.String" value="currentColor" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.flood-opacity"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$FloodOpacityManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="1" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<!-- *** IGNORE *** -<test id="css.engine.value.css2.font"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.FontManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="1" /> - <arg class="java.lang.String" value="" /> -</test> ---> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.font-family"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.FontFamilyManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="__USER_AGENT__" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.font-size"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.FontSizeManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="medium" /> - <arg class="java.lang.String" value="medium" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.font-size-adjust"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.FontSizeAdjustManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.font-stretch"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.FontStretchManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="normal" /> - <arg class="java.lang.String" value="normal | wider | narrower | ultra-condensed | extra-condensed | - condensed | semi-condensed | semi-expanded | expanded | - extra-expanded | ultra-expanded" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.font-style"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.FontStyleManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="normal" /> - <arg class="java.lang.String" value="normal | italic | oblique" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.font-variant"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.FontVariantManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="normal" /> - <arg class="java.lang.String" value="normal | small-caps" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.font-weigth"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.FontWeightManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="normal" /> - <arg class="java.lang.String" value="normal | bold | bolder | lighter | - 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.glyph-orientation-horizontal"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.GlyphOrientationHorizontalManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="0deg" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.glyph-orientation-vertical"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.GlyphOrientationVerticalManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.image-rendering"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ImageRenderingManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto | optimizeSpeed | optimizeQuality" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.kerning"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.KerningManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.letter-spacing"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$LetterSpacingManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="normal" /> - <arg class="java.lang.String" value="normal" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.lighting-color"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$LightingColorManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="rgb(255, 255, 255)" /> - <arg class="java.lang.String" value="currentColor" /> -</test> - -<!-- ############################################################################## --> -<!-- *** IGNORE *** -<test id="css.engine.value.svg.marker"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.MarkerManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="" /> - <arg class="java.lang.String" value="" /> -</test> ---> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.marker-start"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$MarkerStartManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.marker-mid"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$MarkerMidManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.marker-end"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$MarkerEndManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.mask"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.MaskManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.opacity"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$DefaultOpacityManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="1" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.overflow"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.OverflowManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="visible" /> - <arg class="java.lang.String" value="visible | hidden | scroll | auto" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.pointer-events'"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.PointerEventsManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="visiblePainted" /> - <arg class="java.lang.String" value="visiblePainted | visibleFill | visibleStroke | visible | - painted | fill | stroke | all | none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.shape-rendering'"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.ShapeRenderingManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto | optimizeSpeed | crispEdges | geometricPrecision" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stop-color'"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$StopColorManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="rgb(0, 0, 0)" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stop-opacity'"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$StopOpacityManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="1" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stroke"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$StrokeManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stroke-dasharray"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.StrokeDasharrayManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stroke-dashoffset"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.StrokeDashoffsetManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="0" /> - <arg class="java.lang.String" value="0" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stroke-linecap"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.StrokeLinecapManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="butt" /> - <arg class="java.lang.String" value="butt | round | square" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stroke-linejoin"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.StrokeLinejoinManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="miter" /> - <arg class="java.lang.String" value="miter | round | bevel" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stroke-miterlimit"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.StrokeMiterlimitManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="4" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stroke-opacity"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$StrokeOpacityManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="1" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.stroke-width"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.StrokeWidthManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="1" /> - <arg class="java.lang.String" value="" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.text-anchor"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.TextAnchorManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="start" /> - <arg class="java.lang.String" value="start | middle | end" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.text-decoration"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.TextDecorationManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="none" /> - <arg class="java.lang.String" value="none | underline | overline | line-through | blink" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.text-rendering"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.TextRenderingManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="auto" /> - <arg class="java.lang.String" value="auto | optimizeSpeed | optimizeLegibility | geometricPrecision" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.svg.unicode-bidi"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.UnicodeBidiManager" /> - <arg class="java.lang.Boolean" value="false" /> - <arg class="java.lang.String" value="normal" /> - <arg class="java.lang.String" value="normal | embed | bidi-override" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.visibility"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.css2.VisibilityManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="visible" /> - <arg class="java.lang.String" value="visible | hidden | collapse" /> -</test> - - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.word-spacing"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.PropertyManagerTest$WordSpacingManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="normal" /> - <arg class="java.lang.String" value="normal" /> -</test> - -<!-- ############################################################################## --> -<test id="css.engine.value.css2.writing-mode"> - <arg class="java.lang.String" value="org.apache.batik.css.engine.value.svg.WritingModeManager" /> - <arg class="java.lang.Boolean" value="true" /> - <arg class="java.lang.String" value="lr-tb" /> - <arg class="java.lang.String" value="lr-tb | rl-tb | tb-rl | lr | rl | tb" /> -</test> - -</testGroup> - -</testSuite>
diff --git a/test-resources/org/apache/batik/parser/unitTesting.xml b/test-resources/org/apache/batik/parser/unitTesting.xml deleted file mode 100644 index 49f80ba..0000000 --- a/test-resources/org/apache/batik/parser/unitTesting.xml +++ /dev/null
@@ -1,506 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<!-- ================================================================ --> -<!-- @author stephane@hillion.org --> -<!-- @version $Id$ --> -<!-- ================================================================ --> -<testSuite id="parser.unitTesting" - name="org.apache.batik.parser package - Unit Testing"> - - <!-- ================================================================== --> - <!-- LengthParser tests --> - <!-- The first argument is the string to parse --> - <!-- The second argument is the expected string --> - <!-- ================================================================== --> - <testGroup id="lengthParser" - class="org.apache.batik.parser.LengthParserTest"> - <test id="lengthParser1"> - <arg class="java.lang.String" value="123.456" /> - <arg class="java.lang.String" value="123.456" /> - </test> - - <test id="lengthParser2"> - <arg class="java.lang.String" value="123em" /> - <arg class="java.lang.String" value="123.0em" /> - </test> - - <test id="lengthParser3"> - <arg class="java.lang.String" value=".456ex" /> - <arg class="java.lang.String" value="0.456ex" /> - </test> - - <test id="lengthParser4"> - <arg class="java.lang.String" value="-.456789in" /> - <arg class="java.lang.String" value="-0.456789in" /> - </test> - - <test id="lengthParser5"> - <arg class="java.lang.String" value="-456789.cm" /> - <arg class="java.lang.String" value="-456789.0cm" /> - </test> - - <test id="lengthParser6"> - <arg class="java.lang.String" value="-4567890.mm" /> - <arg class="java.lang.String" value="-4567890.0mm" /> - </test> - - <test id="lengthParser7"> - <arg class="java.lang.String" value="-000456789.pc" /> - <arg class="java.lang.String" value="-456789.0pc" /> - </test> - - <test id="lengthParser8"> - <arg class="java.lang.String" value="-0.00456789pt" /> - <arg class="java.lang.String" value="-0.00456789pt" /> - </test> - - <test id="lengthParser9"> - <arg class="java.lang.String" value="-0px" /> - <arg class="java.lang.String" value="0.0px" /> - </test> - - <test id="lengthParser10"> - <arg class="java.lang.String" value="0000%" /> - <arg class="java.lang.String" value="0.0%" /> - </test> - </testGroup> - - <!-- ================================================================== --> - <!-- LengthParser failure tests --> - <!-- The argument is the string to parse --> - <!-- ================================================================== --> - - <testGroup id="lengthParserFail" - class="org.apache.batik.parser.LengthParserFailureTest"> - - <test id="lengthParserFail1"> - <arg class="java.lang.String" value="123.456.7" /> - </test> - - <test id="lengthParserFail2"> - <arg class="java.lang.String" value="1e+" /> - </test> - - <test id="lengthParserFail3"> - <arg class="java.lang.String" value="+e3" /> - </test> - - <test id="lengthParserFail4"> - <arg class="java.lang.String" value="1Em" /> - </test> - - <test id="lengthParserFail5"> - <arg class="java.lang.String" value="--1" /> - </test> - - <test id="lengthParserFail6"> - <arg class="java.lang.String" value="-1E--2" /> - </test> - - <test id="lengthParserFail7"> - <arg class="java.lang.String" value="-.E+1" /> - </test> - - <test id="lengthParserFail8"> - <arg class="java.lang.String" value="-.0EE+1" /> - </test> - - <test id="lengthParserFail9"> - <arg class="java.lang.String" value="1Eem" /> - </test> - - <test id="lengthParserFail10"> - <arg class="java.lang.String" value="1em%" /> - </test> - </testGroup> - - <!-- ================================================================== --> - <!-- PathParser tests --> - <!-- The first argument is the string to parse --> - <!-- The second argument is the expected string --> - <!-- ================================================================== --> - <testGroup class="org.apache.batik.parser.PathParserTest"> - <test id="pathParser1" > - <arg class="java.lang.String" value="M1 2" /> - <arg class="java.lang.String" value="M1.0 2.0" /> - </test> - - <test id="pathParser2" > - <arg class="java.lang.String" value="m1.1 2.0" /> - <arg class="java.lang.String" value="m1.1 2.0" /> - </test> - - <test id="pathParser3" > - <arg class="java.lang.String" value="M1 2z" /> - <arg class="java.lang.String" value="M1.0 2.0Z" /> - </test> - - <test id="pathParser4" > - <arg class="java.lang.String" value="M1 2e3Z" /> - <arg class="java.lang.String" value="M1.0 2000.0Z" /> - </test> - - <test id="pathParser5" > - <arg class="java.lang.String" value="M1 2L 3,4" /> - <arg class="java.lang.String" value="M1.0 2.0L3.0 4.0" /> - </test> - - <test id="pathParser5.1" > - <arg class="java.lang.String" value="M1 2 3,4" /> - <arg class="java.lang.String" value="M1.0 2.0L3.0 4.0" /> - </test> - - <test id="pathParser5.2" > - <arg class="java.lang.String" value="M1, 2, 3,4" /> - <arg class="java.lang.String" value="M1.0 2.0L3.0 4.0" /> - </test> - - <test id="pathParser5.3" > - <arg class="java.lang.String" value="m1, 2, 3,4" /> - <arg class="java.lang.String" value="m1.0 2.0l3.0 4.0" /> - </test> - - <test id="pathParser6" > - <arg class="java.lang.String" value="M1 2H3.1" /> - <arg class="java.lang.String" value="M1.0 2.0H3.1" /> - </test> - - <test id="pathParser6.1" > - <arg class="java.lang.String" value="M1 2H3.1 4" /> - <arg class="java.lang.String" value="M1.0 2.0H3.1H4.0" /> - </test> - <test id="pathParser6.2" > - <arg class="java.lang.String" value="M1 2H3.1,4" /> - <arg class="java.lang.String" value="M1.0 2.0H3.1H4.0" /> - </test> - - <test id="pathParser7" > - <arg class="java.lang.String" value="M1 2h 3.1" /> - <arg class="java.lang.String" value="M1.0 2.0h3.1" /> - </test> - <test id="pathParser7.1" > - <arg class="java.lang.String" value="M1 2h 3.1 4" /> - <arg class="java.lang.String" value="M1.0 2.0h3.1h4.0" /> - </test> - <test id="pathParser7.2" > - <arg class="java.lang.String" value="M1 2h 3.1,4" /> - <arg class="java.lang.String" value="M1.0 2.0h3.1h4.0" /> - </test> - - <test id="pathParser8" > - <arg class="java.lang.String" value="M1 2H 3.1,4" /> - <arg class="java.lang.String" value="M1.0 2.0H3.1H4.0" /> - </test> - - <test id="pathParser9" > - <arg class="java.lang.String" value="M1 2h 3.1-4" /> - <arg class="java.lang.String" value="M1.0 2.0h3.1h-4.0" /> - </test> - - <test id="pathParser10"> - <arg class="java.lang.String" value="M1 2V3.1e-3" /> - <arg class="java.lang.String" value="M1.0 2.0V0.0031" /> - </test> - - <test id="pathParser11"> - <arg class="java.lang.String" value="M1 2V3.1" /> - <arg class="java.lang.String" value="M1.0 2.0V3.1" /> - </test> - - <test id="pathParser12"> - <arg class="java.lang.String" value="M1 2v3.1,.4" /> - <arg class="java.lang.String" value="M1.0 2.0v3.1v0.4" /> - </test> - - <test id="pathParser13"> - <arg class="java.lang.String" value="M1 2v3.1-.4" /> - <arg class="java.lang.String" value="M1.0 2.0v3.1v-0.4" /> - </test> - - <test id="pathParser14"> - <arg class="java.lang.String" value="M1 2C3 4 5 6 7 8" /> - <arg class="java.lang.String" - value="M1.0 2.0C3.0 4.0 5.0 6.0 7.0 8.0" /> - </test> - - <test id="pathParser15"> - <arg class="java.lang.String" value="M1 2c.3.4.5.6.7.8" /> - <arg class="java.lang.String" - value="M1.0 2.0c0.3 0.4 0.5 0.6 0.7 0.8" /> - </test> - - <test id="pathParser16"> - <arg class="java.lang.String" value="M1 2S3+4+5+6" /> - <arg class="java.lang.String" value="M1.0 2.0S3.0 4.0 5.0 6.0" /> - </test> - - <test id="pathParser17"> - <arg class="java.lang.String" value="M1 2s.3+.4+.5-.6" /> - <arg class="java.lang.String" value="M1.0 2.0s0.3 0.4 0.5 -0.6" /> - </test> - - <test id="pathParser18"> - <arg class="java.lang.String" value="M1 2q3. 4.+5 6" /> - <arg class="java.lang.String" value="M1.0 2.0q3.0 4.0 5.0 6.0" /> - </test> - - <test id="pathParser19"> - <arg class="java.lang.String" value="M1 2Q.3e0.4.5.6" /> - <arg class="java.lang.String" value="M1.0 2.0Q0.3 0.4 0.5 0.6" /> - </test> - - <test id="pathParser20"> - <arg class="java.lang.String" value="M1 2t+.3-.4" /> - <arg class="java.lang.String" value="M1.0 2.0t0.3 -0.4" /> - </test> - - <test id="pathParser21"> - <arg class="java.lang.String" value="M1 2T -.3+4" /> - <arg class="java.lang.String" value="M1.0 2.0T-0.3 4.0" /> - </test> - - <test id="pathParser22"> - <arg class="java.lang.String" value="M1 2a3 4 5 0,1 6 7" /> - <arg class="java.lang.String" - value="M1.0 2.0a3.0 4.0 5.0 0 1 6.0 7.0" /> - </test> - - <test id="pathParser23"> - <arg class="java.lang.String" value="M1 2A3 4 5 0,1 6 7" /> - <arg class="java.lang.String" - value="M1.0 2.0A3.0 4.0 5.0 0 1 6.0 7.0" /> - </test> - - <test id="pathParser24"> - <arg class="java.lang.String" value="M1 2t+.3-.4,5,6" /> - <arg class="java.lang.String" value="M1.0 2.0t0.3 -0.4t5.0 6.0" /> - </test> - - <test id="pathParser25"> - <arg class="java.lang.String" value="M1 2T -.3+4 5-6" /> - <arg class="java.lang.String" value="M1.0 2.0T-0.3 4.0T5.0 -6.0" /> - </test> - </testGroup> - - <!-- ================================================================== --> - <!-- PathParser failure tests --> - <!-- The argument is the string to parse --> - <!-- ================================================================== --> - - <testGroup class="org.apache.batik.parser.PathParserFailureTest"> - <test id="pathParserFail1"> - <arg class="java.lang.String" value="m 1ee2 3" /> - </test> - - <test id="pathParserFail2"> - <arg class="java.lang.String" value="m 1e4e2 3" /> - </test> - - <test id="pathParserFail3"> - <arg class="java.lang.String" value="m 1e+ 2" /> - </test> - - <test id="pathParserFail4"> - <arg class="java.lang.String" value="m 1 l 3 4" /> - </test> - - <test id="pathParserFail5"> - <arg class="java.lang.String" value="m 1.5.6.7 l 3 4" /> - </test> - - <test id="pathParserFail6"> - <arg class="java.lang.String" value="m 1.5,6.7,l 3 4" /> - </test> - - <test id="pathParserFail7"> - <arg class="java.lang.String" value="m 1.5,6.7,L 3 4" /> - </test> - - <test id="pathParserFail8"> - <arg class="java.lang.String" value="m 1.5,6.7,h 3" /> - </test> - - <test id="pathParserFail9"> - <arg class="java.lang.String" value="m 1.5,6.7,H 3" /> - </test> - - <test id="pathParserFail10"> - <arg class="java.lang.String" value="m 1.5,6.7,v 3" /> - </test> - - <test id="pathParserFail11"> - <arg class="java.lang.String" value="m 1.5,6.7,V 3" /> - </test> - - <test id="pathParserFail12"> - <arg class="java.lang.String" value="m 1.5,6.7,c 1,2 3,4 5,6" /> - </test> - <test id="pathParserFail13"> - <arg class="java.lang.String" value="m 1.5,6.7,C 1,2 3,4 5,6" /> - </test> - - <test id="pathParserFail14"> - <arg class="java.lang.String" value="m 1.5,6.7,s 1,2 3,4" /> - </test> - <test id="pathParserFail15"> - <arg class="java.lang.String" value="m 1.5,6.7,S 1,2 3,4" /> - </test> - - <test id="pathParserFail16"> - <arg class="java.lang.String" value="m 1.5,6.7,q 1,2 3,4" /> - </test> - <test id="pathParserFail17"> - <arg class="java.lang.String" value="m 1.5,6.7,Q 1,2 3,4" /> - </test> - - <test id="pathParserFail18"> - <arg class="java.lang.String" value="m 1.5,6.7,t 1,2" /> - </test> - <test id="pathParserFail19"> - <arg class="java.lang.String" value="m 1.5,6.7,T 1,2" /> - </test> - - <test id="pathParserFail20"> - <arg class="java.lang.String" value="m 1.5,6.7,a 2,2 0 1 1 2 2" /> - </test> - <test id="pathParserFail21"> - <arg class="java.lang.String" value="m 1.5,6.7,A 4,4 0 1 1 2 2" /> - </test> - - <!-- Check for double path commands --> - <test id="pathParserFail22"> - <arg class="java.lang.String" value="m m 1,2"/> - </test> - <test id="pathParserFail22.1"> - <arg class="java.lang.String" value="M M 1,2"/> - </test> - - <test id="pathParserFail23"> - <arg class="java.lang.String" value="m 1,2 l l 3,4 z"/> - </test> - <test id="pathParserFail24"> - <arg class="java.lang.String" value="m 1,2 L L 3,4 z"/> - </test> - - <test id="pathParserFail25"> - <arg class="java.lang.String" value="m 1,2 h h 3 z"/> - </test> - <test id="pathParserFail26"> - <arg class="java.lang.String" value="m 1,2 H H 3 z"/> - </test> - - <test id="pathParserFail27"> - <arg class="java.lang.String" value="m 1,2 v v 3 z"/> - </test> - <test id="pathParserFail28"> - <arg class="java.lang.String" value="m 1,2 V V 3 z"/> - </test> - - <test id="pathParserFail29"> - <arg class="java.lang.String" value="m 1,2 c c 1,2 3,4 5,6z"/> - </test> - <test id="pathParserFail30"> - <arg class="java.lang.String" value="m 1,2 C C 1,2 3,4 5,6 z"/> - </test> - - <test id="pathParserFail31"> - <arg class="java.lang.String" value="m 1,2 s s 1,2 3,4 z"/> - </test> - <test id="pathParserFail32"> - <arg class="java.lang.String" value="m 1,2 S S 1,2 3,4 z"/> - </test> - - <test id="pathParserFail33"> - <arg class="java.lang.String" value="m 1,2 q q 1,2 3,4 z"/> - </test> - <test id="pathParserFail34"> - <arg class="java.lang.String" value="m 1,2 Q Q 1,2 3,4 z"/> - </test> - - <test id="pathParserFail35"> - <arg class="java.lang.String" value="m 1,2 t t 1,2 z"/> - </test> - <test id="pathParserFail36"> - <arg class="java.lang.String" value="m 1,2 T T 1,2 z"/> - </test> - - <test id="pathParserFail37"> - <arg class="java.lang.String" value="m 1.5,6.7 a a 2,2 0 1 1 2 2" /> - </test> - <test id="pathParserFail38"> - <arg class="java.lang.String" value="m 1.5,6.7 A A 4,4 0 1 1 2 2" /> - </test> - </testGroup> - - <!-- ================================================================== --> - <!-- TransformListParser tests --> - <!-- The first argument is the string to parse --> - <!-- The second argument is the expected string --> - <!-- ================================================================== --> - - <test id="transformParser1" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="matrix(1 2 3 4 5 6)" /> - <arg class="java.lang.String" value="matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)" /> - </test> - - <test id="transformParser2" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="translate(1)" /> - <arg class="java.lang.String" value="translate(1.0)" /> - </test> - - <test id="transformParser3" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="translate(1e2 3e4)" /> - <arg class="java.lang.String" value="translate(100.0, 30000.0)" /> - </test> - - <test id="transformParser4" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="scale(1e-2)" /> - <arg class="java.lang.String" value="scale(0.01)" /> - </test> - - <test id="transformParser5" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="scale(-1e-2 -3e-4)" /> - <arg class="java.lang.String" value="scale(-0.01, -3.0E-4)" /> - </test> - - <test id="transformParser6" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="skewX(1.234)" /> - <arg class="java.lang.String" value="skewX(1.234)" /> - </test> - - <test id="transformParser7" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="skewY(.1)" /> - <arg class="java.lang.String" value="skewY(0.1)" /> - </test> - - <test id="transformParser8" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="translate(1,2) skewY(.1)" /> - <arg class="java.lang.String" value="translate(1.0, 2.0) skewY(0.1)" /> - </test> - - <test id="transformParser9" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="scale(1,2),skewX(.1e1)" /> - <arg class="java.lang.String" value="scale(1.0, 2.0) skewX(1.0)" /> - </test> - - <test id="transformParser10" class="org.apache.batik.parser.TransformListParserTest"> - <arg class="java.lang.String" value="scale(1) , skewX(2) translate(3,4)" /> - <arg class="java.lang.String" value="scale(1.0) skewX(2.0) translate(3.0, 4.0)"/> - </test> - -</testSuite>
diff --git a/test/java/org/apache/batik/parser/LengthParserFailureTestCase.java b/test/java/org/apache/batik/parser/LengthParserFailureTestCase.java index 15f811a..9a8a812 100644 --- a/test/java/org/apache/batik/parser/LengthParserFailureTestCase.java +++ b/test/java/org/apache/batik/parser/LengthParserFailureTestCase.java
@@ -18,47 +18,70 @@ */ package org.apache.batik.parser; -import java.io.*; +import java.io.StringReader; -import org.apache.batik.test.*; - -import org.junit.Ignore; import org.junit.Test; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - /** * To test the length parser. * * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ -@Ignore -public class LengthParserFailureTestCase extends AbstractTest { +public class LengthParserFailureTestCase { - protected String sourceLength; - - /** - * Creates a new LengthParserFailureTest. - * @param slength The length to parse. - */ - public LengthParserFailureTestCase(String slength) { - sourceLength = slength; + @Test(expected=ParseException.class) + public void testLengthParserFail1() throws Exception { + testLengthParserFailure("123.456.7"); } - public TestReport runImpl() throws Exception { + @Test(expected=ParseException.class) + public void testLengthParserFail2() throws Exception { + testLengthParserFailure("1e+"); + } + + @Test(expected=ParseException.class) + public void testLengthParserFail3() throws Exception { + testLengthParserFailure("+e3"); + } + + @Test(expected=ParseException.class) + public void testLengthParserFail4() throws Exception { + testLengthParserFailure("1Em"); + } + + @Test(expected=ParseException.class) + public void testLengthParserFail5() throws Exception { + testLengthParserFailure("--1"); + } + + @Test(expected=ParseException.class) + public void testLengthParserFail6() throws Exception { + testLengthParserFailure("-1E--2"); + } + + @Test(expected=ParseException.class) + public void testLengthParserFail7() throws Exception { + testLengthParserFailure("-.E+1"); + } + + @Test(expected=ParseException.class) + public void testLengthParserFail8() throws Exception { + testLengthParserFailure("-.0EE+1"); + } + + @Test(expected=ParseException.class) + public void testLengthParserFail9() throws Exception { + testLengthParserFailure("1Eem"); + } + + @Test(expected=ParseException.class) + public void testLengthParserFail10() throws Exception { + testLengthParserFailure("1em%"); + } + + private void testLengthParserFailure(String length) throws Exception { LengthParser pp = new LengthParser(); - try { - pp.parse(new StringReader(sourceLength)); - } catch (ParseException e) { - return reportSuccess(); - } - DefaultTestReport report = new DefaultTestReport(this); - report.setErrorCode("parse.without.error"); - report.addDescriptionEntry("input.text", sourceLength); - report.setPassed(false); - return report; + pp.parse(new StringReader(length)); } }
diff --git a/test/java/org/apache/batik/parser/LengthParserTestCase.java b/test/java/org/apache/batik/parser/LengthParserTestCase.java index 4a36e8d..bb40d56 100644 --- a/test/java/org/apache/batik/parser/LengthParserTestCase.java +++ b/test/java/org/apache/batik/parser/LengthParserTestCase.java
@@ -18,16 +18,11 @@ */ package org.apache.batik.parser; -import java.io.*; +import java.io.StringReader; -import org.apache.batik.test.*; - -import org.junit.Ignore; import org.junit.Test; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.assertEquals; /** * To test the length parser. @@ -35,56 +30,76 @@ * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ -@Ignore -public class LengthParserTestCase extends AbstractTest { +public class LengthParserTestCase { - protected String sourceLength; - protected String destinationLength; - - protected StringBuffer buffer; - protected String resultLength; - - /** - * Creates a new LengthParserTest. - * @param slength The length to parse. - * @param dlength The length after serialization. - */ - public LengthParserTestCase(String slength, String dlength) { - sourceLength = slength; - destinationLength = dlength; + @Test + public void testLengthParser1() throws Exception { + testLength("123.456", "123.456"); } - public TestReport runImpl() throws Exception { + @Test + public void testLengthParser2() throws Exception { + testLength("123em", "123.0em"); + } + + @Test + public void testLengthParser3() throws Exception { + testLength(".456ex", "0.456ex"); + } + + @Test + public void testLengthParser4() throws Exception { + testLength("-.456789in", "-0.456789in"); + } + + @Test + public void testLengthParser5() throws Exception { + testLength("-456789.cm", "-456789.0cm"); + } + + @Test + public void testLengthParser6() throws Exception { + testLength("-4567890.mm", "-4567890.0mm"); + } + + @Test + public void testLengthParser7() throws Exception { + testLength("-000456789.pc", "-456789.0pc"); + } + + @Test + public void testLengthParser8() throws Exception { + testLength("-0.00456789pt", "-0.00456789pt"); + } + + @Test + public void testLengthParser9() throws Exception { + testLength("-0px", "0.0px"); + } + + @Test + public void testLengthParser10() throws Exception { + testLength("0000%", "0.0%"); + } + + private void testLength(String length, String expected) throws Exception { LengthParser pp = new LengthParser(); - pp.setLengthHandler(new TestHandler()); - - try { - pp.parse(new StringReader(sourceLength)); - } catch (ParseException e) { - DefaultTestReport report = new DefaultTestReport(this); - report.setErrorCode("parse.error"); - report.addDescriptionEntry("exception.text", e.getMessage()); - report.setPassed(false); - return report; - } - - if (!destinationLength.equals(resultLength)) { - DefaultTestReport report = new DefaultTestReport(this); - report.setErrorCode("invalid.parsing.events"); - report.addDescriptionEntry("expected.text", destinationLength); - report.addDescriptionEntry("generated.text", resultLength); - report.setPassed(false); - return report; - } - - return reportSuccess(); + StringBuffer results = new StringBuffer(); + pp.setLengthHandler(new TestHandler(results)); + pp.parse(new StringReader(length)); + assertEquals(null, expected, results.toString()); } - class TestHandler extends DefaultLengthHandler { - public TestHandler() {} + private static class TestHandler extends DefaultLengthHandler { + + private StringBuffer buffer; + + public TestHandler(StringBuffer buffer) { + this.buffer = buffer; + } public void startLength() throws ParseException { - buffer = new StringBuffer(); + buffer.setLength(0); } public void lengthValue(float v) throws ParseException { @@ -128,7 +143,6 @@ } public void endLength() throws ParseException { - resultLength = buffer.toString(); } } }
diff --git a/test/java/org/apache/batik/parser/PathParserFailureTestCase.java b/test/java/org/apache/batik/parser/PathParserFailureTestCase.java index c07edba..7e2eecf 100644 --- a/test/java/org/apache/batik/parser/PathParserFailureTestCase.java +++ b/test/java/org/apache/batik/parser/PathParserFailureTestCase.java
@@ -18,47 +18,216 @@ */ package org.apache.batik.parser; -import java.io.*; +import java.io.StringReader; -import org.apache.batik.test.*; - -import org.junit.Ignore; import org.junit.Test; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - /** * To test the path parser. * * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ -@Ignore -public class PathParserFailureTestCase extends AbstractTest { +public class PathParserFailureTestCase { - protected String sourcePath; - - /** - * Creates a new PathParserFailureTest. - * @param spath The path to parse. - */ - public PathParserFailureTestCase(String spath) { - sourcePath = spath; + @Test(expected=ParseException.class) + public void testPathParserFail1() throws Exception { + testPathParserFailure("m 1ee2 3"); } - public TestReport runImpl() throws Exception { + @Test(expected=ParseException.class) + public void testPathParserFail2() throws Exception { + testPathParserFailure("m 1e4e2 3"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail3() throws Exception { + testPathParserFailure("m 1e+ 2"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail4() throws Exception { + testPathParserFailure("m 1 l 3 4"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail5() throws Exception { + testPathParserFailure("m 1.5.6.7 l 3 4"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail6() throws Exception { + testPathParserFailure("m 1.5,6.7,l 3 4"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail7() throws Exception { + testPathParserFailure("m 1.5,6.7,L 3 4"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail8() throws Exception { + testPathParserFailure("m 1.5,6.7,h 3"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail9() throws Exception { + testPathParserFailure("m 1.5,6.7,H 3"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail10() throws Exception { + testPathParserFailure("m 1.5,6.7,v 3"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail11() throws Exception { + testPathParserFailure("m 1.5,6.7,V 3"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail12() throws Exception { + testPathParserFailure("m 1.5,6.7,c 1,2 3,4 5,6"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail13() throws Exception { + testPathParserFailure("m 1.5,6.7,C 1,2 3,4 5,6"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail14() throws Exception { + testPathParserFailure("m 1.5,6.7,s 1,2 3,4"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail15() throws Exception { + testPathParserFailure("m 1.5,6.7,S 1,2 3,4"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail16() throws Exception { + testPathParserFailure("m 1.5,6.7,q 1,2 3,4"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail17() throws Exception { + testPathParserFailure("m 1.5,6.7,Q 1,2 3,4"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail18() throws Exception { + testPathParserFailure("m 1.5,6.7,t 1,2"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail19() throws Exception { + testPathParserFailure("m 1.5,6.7,T 1,2"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail20() throws Exception { + testPathParserFailure("m 1.5,6.7,a 2,2 0 1 1 2 2"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail21() throws Exception { + testPathParserFailure("m 1.5,6.7,A 4,4 0 1 1 2 2"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail22() throws Exception { + testPathParserFailure("m m 1,2"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail23() throws Exception { + testPathParserFailure("M M 1,2"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail24() throws Exception { + testPathParserFailure("m 1,2 l l 3,4 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail25() throws Exception { + testPathParserFailure("m 1,2 L L 3,4 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail26() throws Exception { + testPathParserFailure("m 1,2 h h 3 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail27() throws Exception { + testPathParserFailure("m 1,2 H H 3 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail28() throws Exception { + testPathParserFailure("m 1,2 v v 3 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail29() throws Exception { + testPathParserFailure("m 1,2 V V 3 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail30() throws Exception { + testPathParserFailure("m 1,2 c c 1,2 3,4 5,6z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail31() throws Exception { + testPathParserFailure("m 1,2 C C 1,2 3,4 5,6 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail32() throws Exception { + testPathParserFailure("m 1,2 s s 1,2 3,4 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail33() throws Exception { + testPathParserFailure("m 1,2 S S 1,2 3,4 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail34() throws Exception { + testPathParserFailure("m 1,2 q q 1,2 3,4 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail35() throws Exception { + testPathParserFailure("m 1,2 Q Q 1,2 3,4 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail36() throws Exception { + testPathParserFailure("m 1,2 t t 1,2 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail37() throws Exception { + testPathParserFailure("m 1,2 T T 1,2 z"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail38() throws Exception { + testPathParserFailure("m 1.5,6.7 a a 2,2 0 1 1 2 2"); + } + + @Test(expected=ParseException.class) + public void testPathParserFail39() throws Exception { + testPathParserFailure("m 1.5,6.7 A A 4,4 0 1 1 2 2"); + } + + private void testPathParserFailure(String path) throws Exception { PathParser pp = new PathParser(); - try { - pp.parse(new StringReader(sourcePath)); - } catch (Exception e) { - return reportSuccess(); - } - DefaultTestReport report = new DefaultTestReport(this); - report.setErrorCode("parse.without.error"); - report.addDescriptionEntry("input.text", sourcePath); - report.setPassed(false); - return report; + pp.parse(new StringReader(path)); } + }
diff --git a/test/java/org/apache/batik/parser/PathParserTestCase.java b/test/java/org/apache/batik/parser/PathParserTestCase.java index c8263e8..33c19be 100644 --- a/test/java/org/apache/batik/parser/PathParserTestCase.java +++ b/test/java/org/apache/batik/parser/PathParserTestCase.java
@@ -18,16 +18,11 @@ */ package org.apache.batik.parser; -import java.io.*; +import java.io.StringReader; -import org.apache.batik.test.*; - -import org.junit.Ignore; import org.junit.Test; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.assertEquals; /** * To test the path parser. @@ -35,56 +30,186 @@ * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ -@Ignore -public class PathParserTestCase extends AbstractTest { +public class PathParserTestCase { - protected String sourcePath; - protected String destinationPath; - - protected StringBuffer buffer; - protected String resultPath; - - /** - * Creates a new PathParserTest. - * @param spath The path to parse. - * @param dpath The path after serialization. - */ - public PathParserTestCase(String spath, String dpath) { - sourcePath = spath; - destinationPath = dpath; + @Test + public void testPathParser1() throws Exception { + testPath("M1 2", "M1.0 2.0"); } - public TestReport runImpl() throws Exception { + @Test + public void testPathParser2() throws Exception { + testPath("m1.1 2.0", "m1.1 2.0"); + } + + @Test + public void testPathParser3() throws Exception { + testPath("M1 2z", "M1.0 2.0Z"); + } + + @Test + public void testPathParser4() throws Exception { + testPath("M1 2e3Z", "M1.0 2000.0Z"); + } + + @Test + public void testPathParser5() throws Exception { + testPath("M1 2L 3,4", "M1.0 2.0L3.0 4.0"); + } + + @Test + public void testPathParser5_1() throws Exception { + testPath("M1 2 3,4", "M1.0 2.0L3.0 4.0"); + } + + @Test + public void testPathParser5_2() throws Exception { + testPath("M1, 2, 3,4", "M1.0 2.0L3.0 4.0"); + } + + @Test + public void testPathParser5_3() throws Exception { + testPath("m1, 2, 3,4", "m1.0 2.0l3.0 4.0"); + } + + @Test + public void testPathParser6() throws Exception { + testPath("M1 2H3.1", "M1.0 2.0H3.1"); + } + + @Test + public void testPathParser6_1() throws Exception { + testPath("M1 2H3.1 4", "M1.0 2.0H3.1H4.0"); + } + + @Test + public void testPathParser6_2() throws Exception { + testPath("M1 2H3.1,4", "M1.0 2.0H3.1H4.0"); + } + + @Test + public void testPathParser7() throws Exception { + testPath("M1 2h 3.1", "M1.0 2.0h3.1"); + } + + @Test + public void testPathParser7_1() throws Exception { + testPath("M1 2h 3.1 4", "M1.0 2.0h3.1h4.0"); + } + + @Test + public void testPathParser7_2() throws Exception { + testPath("M1 2h 3.1,4", "M1.0 2.0h3.1h4.0"); + } + + @Test + public void testPathParser8() throws Exception { + testPath("M1 2H 3.1,4", "M1.0 2.0H3.1H4.0"); + } + + @Test + public void testPathParser9() throws Exception { + testPath("M1 2h 3.1-4", "M1.0 2.0h3.1h-4.0"); + } + + @Test + public void testPathParser10() throws Exception { + testPath("M1 2V3.1e-3", "M1.0 2.0V0.0031"); + } + + @Test + public void testPathParser11() throws Exception { + testPath("M1 2V3.1", "M1.0 2.0V3.1"); + } + + @Test + public void testPathParser12() throws Exception { + testPath("M1 2v3.1,.4", "M1.0 2.0v3.1v0.4"); + } + + @Test + public void testPathParser13() throws Exception { + testPath("M1 2v3.1-.4", "M1.0 2.0v3.1v-0.4"); + } + + @Test + public void testPathParser14() throws Exception { + testPath("M1 2C3 4 5 6 7 8", "M1.0 2.0C3.0 4.0 5.0 6.0 7.0 8.0"); + } + + @Test + public void testPathParser15() throws Exception { + testPath("M1 2c.3.4.5.6.7.8", "M1.0 2.0c0.3 0.4 0.5 0.6 0.7 0.8"); + } + + @Test + public void testPathParser16() throws Exception { + testPath("M1 2S3+4+5+6", "M1.0 2.0S3.0 4.0 5.0 6.0"); + } + + @Test + public void testPathParser17() throws Exception { + testPath("M1 2s.3+.4+.5-.6", "M1.0 2.0s0.3 0.4 0.5 -0.6"); + } + + @Test + public void testPathParser18() throws Exception { + testPath("M1 2q3. 4.+5 6", "M1.0 2.0q3.0 4.0 5.0 6.0"); + } + + @Test + public void testPathParser19() throws Exception { + testPath("M1 2Q.3e0.4.5.6", "M1.0 2.0Q0.3 0.4 0.5 0.6"); + } + + @Test + public void testPathParser20() throws Exception { + testPath("M1 2t+.3-.4", "M1.0 2.0t0.3 -0.4"); + } + + @Test + public void testPathParser21() throws Exception { + testPath("M1 2T -.3+4", "M1.0 2.0T-0.3 4.0"); + } + + @Test + public void testPathParser22() throws Exception { + testPath("M1 2a3 4 5 0,1 6 7", "M1.0 2.0a3.0 4.0 5.0 0 1 6.0 7.0"); + } + + @Test + public void testPathParser23() throws Exception { + testPath("M1 2A3 4 5 0,1 6 7", "M1.0 2.0A3.0 4.0 5.0 0 1 6.0 7.0"); + } + + @Test + public void testPathParser24() throws Exception { + testPath("M1 2t+.3-.4,5,6", "M1.0 2.0t0.3 -0.4t5.0 6.0"); + } + + @Test + public void testPathParser25() throws Exception { + testPath("M1 2T -.3+4 5-6", "M1.0 2.0T-0.3 4.0T5.0 -6.0"); + } + + private void testPath(String path, String expected) throws Exception { PathParser pp = new PathParser(); - pp.setPathHandler(new TestHandler()); - - try { - pp.parse(new StringReader(sourcePath)); - } catch (ParseException e) { - DefaultTestReport report = new DefaultTestReport(this); - report.setErrorCode("parse.error"); - report.addDescriptionEntry("exception.text", e.getMessage()); - report.setPassed(false); - return report; - } - - if (!destinationPath.equals(resultPath)) { - DefaultTestReport report = new DefaultTestReport(this); - report.setErrorCode("invalid.parsing.events"); - report.addDescriptionEntry("expected.text", destinationPath); - report.addDescriptionEntry("generated.text", resultPath); - report.setPassed(false); - return report; - } - - return reportSuccess(); + StringBuffer results = new StringBuffer(); + pp.setPathHandler(new TestHandler(results)); + pp.parse(new StringReader(path)); + assertEquals(null, expected, results.toString()); } - class TestHandler extends DefaultPathHandler { - public TestHandler() {} + private static class TestHandler extends DefaultPathHandler { + + private StringBuffer buffer; + + public TestHandler(StringBuffer buffer) { + this.buffer = buffer; + } public void startPath() throws ParseException { - buffer = new StringBuffer(); + buffer.setLength(0); } public void movetoRel(float x, float y) throws ParseException { @@ -102,7 +227,6 @@ } public void endPath() throws ParseException { - resultPath = buffer.toString(); } public void closePath() throws ParseException {
diff --git a/test/java/org/apache/batik/parser/TransformListParserTestCase.java b/test/java/org/apache/batik/parser/TransformListParserTestCase.java index 4f9b534..3be4685 100644 --- a/test/java/org/apache/batik/parser/TransformListParserTestCase.java +++ b/test/java/org/apache/batik/parser/TransformListParserTestCase.java
@@ -17,16 +17,11 @@ package org.apache.batik.parser; -import java.io.*; +import java.io.StringReader; -import org.apache.batik.test.*; - -import org.junit.Ignore; import org.junit.Test; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.assertEquals; /** * To test the transform list parser. @@ -34,58 +29,80 @@ * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ -@Ignore -public class TransformListParserTestCase extends AbstractTest { +public class TransformListParserTestCase { - protected String sourceTransform; - protected String destinationTransform; - - protected StringBuffer buffer; - protected String resultTransform; - - /** - * Creates a new TransformListParserTest. - * @param stransform The transform to parse. - * @param dtransform The transform after serialization. - */ - public TransformListParserTestCase(String stransform, String dtransform) { - sourceTransform = stransform; - destinationTransform = dtransform; + @Test + public void testTransformParser1() throws Exception { + testTransformList("matrix(1 2 3 4 5 6)", "matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)"); } - public TestReport runImpl() throws Exception { + @Test + public void testTransformParser2() throws Exception { + testTransformList("translate(1)", "translate(1.0)"); + } + + @Test + public void testTransformParser3() throws Exception { + testTransformList("translate(1e2 3e4)", "translate(100.0, 30000.0)"); + } + + @Test + public void testTransformParser4() throws Exception { + testTransformList("scale(1e-2)", "scale(0.01)"); + } + + @Test + public void testTransformParser5() throws Exception { + testTransformList("scale(-1e-2 -3e-4)", "scale(-0.01, -3.0E-4)"); + } + + @Test + public void testTransformParser6() throws Exception { + testTransformList("skewX(1.234)", "skewX(1.234)"); + } + + @Test + public void testTransformParser7() throws Exception { + testTransformList("skewY(.1)", "skewY(0.1)"); + } + + @Test + public void testTransformParser8() throws Exception { + testTransformList("translate(1,2) skewY(.1)", "translate(1.0, 2.0) skewY(0.1)"); + } + + @Test + public void testTransformParser9() throws Exception { + testTransformList("scale(1,2),skewX(.1e1)", "scale(1.0, 2.0) skewX(1.0)"); + } + + @Test + public void testTransformParser10() throws Exception { + testTransformList("scale(1) , skewX(2) translate(3,4)", "scale(1.0) skewX(2.0) translate(3.0, 4.0)"); + } + + private void testTransformList(String path, String expected) throws Exception { TransformListParser pp = new TransformListParser(); - pp.setTransformListHandler(new TestHandler()); - - try { - pp.parse(new StringReader(sourceTransform)); - } catch (ParseException e) { - DefaultTestReport report = new DefaultTestReport(this); - report.setErrorCode("parse.error"); - report.addDescriptionEntry("exception.text", e.getMessage()); - report.setPassed(false); - return report; - } - - if (!destinationTransform.equals(resultTransform)) { - DefaultTestReport report = new DefaultTestReport(this); - report.setErrorCode("invalid.parsing.events"); - report.addDescriptionEntry("expected.text", destinationTransform); - report.addDescriptionEntry("generated.text", resultTransform); - report.setPassed(false); - return report; - } - - return reportSuccess(); + StringBuffer results = new StringBuffer(); + pp.setTransformListHandler(new TestHandler(results)); + pp.parse(new StringReader(path)); + assertEquals(null, expected, results.toString()); } - class TestHandler extends DefaultTransformListHandler { - boolean first; - public TestHandler() {} - public void startTransformList() throws ParseException { - buffer = new StringBuffer(); - first = true; + private static class TestHandler extends DefaultTransformListHandler { + + private StringBuffer buffer; + private boolean first; + + public TestHandler(StringBuffer buffer) { + this.buffer = buffer; + this.first = true; } + + public void startTransformList() throws ParseException { + buffer.setLength(0); + } + public void matrix(float a, float b, float c, float d, float e, float f) throws ParseException { if (!first) { @@ -106,18 +123,21 @@ buffer.append(f); buffer.append(")"); } + public void rotate(float theta) throws ParseException { if (!first) { buffer.append(' '); } first = false; } + public void rotate(float theta, float cx, float cy) throws ParseException { if (!first) { buffer.append(' '); } first = false; } + public void translate(float tx) throws ParseException { if (!first) { buffer.append(' '); @@ -127,6 +147,7 @@ buffer.append(tx); buffer.append(")"); } + public void translate(float tx, float ty) throws ParseException { if (!first) { buffer.append(' '); @@ -138,6 +159,7 @@ buffer.append(ty); buffer.append(")"); } + public void scale(float sx) throws ParseException { if (!first) { buffer.append(' '); @@ -147,6 +169,7 @@ buffer.append(sx); buffer.append(")"); } + public void scale(float sx, float sy) throws ParseException { if (!first) { buffer.append(' '); @@ -158,6 +181,7 @@ buffer.append(sy); buffer.append(")"); } + public void skewX(float skx) throws ParseException { if (!first) { buffer.append(' '); @@ -167,6 +191,7 @@ buffer.append(skx); buffer.append(")"); } + public void skewY(float sky) throws ParseException { if (!first) { buffer.append(' '); @@ -176,8 +201,9 @@ buffer.append(sky); buffer.append(")"); } + public void endTransformList() throws ParseException { - resultTransform = buffer.toString(); } + } }