hillion 02/05/02 07:15:03
Modified: test-resources/org/apache/batik/dom/svg lengthTest.svg
unitTesting.xml
Added: test-resources/org/apache/batik/dom/svg locatableTest.svg
Log:
Committed a test for SVGLocatable.getBBox().
Revision Changes Path
1.2 +1 -5 xml-batik/test-resources/org/apache/batik/dom/svg/lengthTest.svg
Index: lengthTest.svg
===================================================================
RCS file:
/home/cvs/xml-batik/test-resources/org/apache/batik/dom/svg/lengthTest.svg,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- lengthTest.svg 2 May 2002 12:59:33 -0000 1.1
+++ lengthTest.svg 2 May 2002 14:15:03 -0000 1.2
@@ -15,7 +15,7 @@
<!-- interface return accurate values. -->
<!-- -->
<!-- @author [EMAIL PROTECTED] -->
-<!-- @version $Id: lengthTest.svg,v 1.1 2002/05/02 12:59:33 hillion Exp $
-->
+<!-- @version $Id: lengthTest.svg,v 1.2 2002/05/02 14:15:03 hillion Exp $
-->
<!-- ========================================================================= -->
<svg xmlns="http://www.w3.org/2000/svg"
@@ -62,10 +62,6 @@
result.appendChild(entry);
return;
}
-
- alert(r1.width.baseVal.value)
- alert(r2.width.baseVal.value)
- alert(r3.width.baseVal.value)
if (r1.width.baseVal.value != 20) {
result.setAttributeNS(null, "errorCode", "invalid.r1.width");
1.3 +2 -1
xml-batik/test-resources/org/apache/batik/dom/svg/unitTesting.xml
Index: unitTesting.xml
===================================================================
RCS file:
/home/cvs/xml-batik/test-resources/org/apache/batik/dom/svg/unitTesting.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- unitTesting.xml 2 May 2002 12:59:33 -0000 1.2
+++ unitTesting.xml 2 May 2002 14:15:03 -0000 1.3
@@ -8,7 +8,7 @@
<!-- ========================================================================= -->
<!-- @author [EMAIL PROTECTED] -->
-<!-- @version $Id: unitTesting.xml,v 1.2 2002/05/02 12:59:33 hillion Exp $ -->
+<!-- @version $Id: unitTesting.xml,v 1.3 2002/05/02 14:15:03 hillion Exp $ -->
<!-- ========================================================================= -->
<testSuite id="dom.svg.unitTesting"
name="org.apache.batik.dom.svg package - Unit Testing">
@@ -39,6 +39,7 @@
<testGroup id="basic" name="Basic SVG DOM Testing"
class="org.apache.batik.dom.svg.EcmaScriptSVGDOMTest">
<test id="lengthTest"/>
+ <test id="locatableTest"/>
</testGroup>
</testSuite>
1.1
xml-batik/test-resources/org/apache/batik/dom/svg/locatableTest.svg
Index: locatableTest.svg
===================================================================
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- ========================================================================= -->
<!-- Copyright (C) The Apache Software Foundation. All rights reserved. -->
<!-- -->
<!-- This software is published under the terms of the Apache Software License -->
<!-- version 1.1, a copy of which has been included with this distribution in -->
<!-- the LICENSE file. -->
<!-- ========================================================================= -->
<!-- ========================================================================= -->
<!-- This test checks that the various RGB values read from the SVGColor -->
<!-- interface return accurate values. -->
<!-- -->
<!-- @author [EMAIL PROTECTED] -->
<!-- @version $Id: locatableTest.svg,v 1.1 2002/05/02 14:15:03 hillion Exp $
-->
<!-- ========================================================================= -->
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:test="http://xml.apache.org/batik/test"
width="450" height="500" viewBox="0 0 450 500"
onload="runTest(evt)">
<test:testResult id="testResult" />
<script type="text/ecmascript"><![CDATA[
var testNS = "http://xml.apache.org/batik/test";
function runTest() {
var result = document.getElementById("testResult");
result.setAttributeNS(null, "result", "failed");
var r1 = document.getElementById("r1")
if (r1 == null){
result.setAttributeNS(null, "errorCode", "cannot.find.test.element");
var entry = document.createElementNS(testNS, "errorDescriptionEntry");
entry.setAttributeNS(null, "id", "missing.element.id");
entry.setAttributeNS(null, "value", "r1");
result.appendChild(entry);
return;
}
if (r1.getBBox().width != 100) {
result.setAttributeNS(null, "errorCode", "invalid.r1.bbox.width");
var entry = document.createElementNS(testNS,
"errorDescriptionEntry");
entry.setAttributeNS(null, "id", "r1.width.value.found");
entry.setAttributeNS(null, "value", r1.getBBox().width);
result.appendChild(entry);
return;
}
var r2 = document.getElementById("r2")
if (r2 == null){
result.setAttributeNS(null, "errorCode", "cannot.find.test.element");
var entry = document.createElementNS(testNS, "errorDescriptionEntry");
entry.setAttributeNS(null, "id", "missing.element.id");
entry.setAttributeNS(null, "value", "r2");
result.appendChild(entry);
return;
}
if (r2.getBBox().width != 100) {
result.setAttributeNS(null, "errorCode", "invalid.r2.bbox.width");
var entry = document.createElementNS(testNS,
"errorDescriptionEntry");
entry.setAttributeNS(null, "id", "r2.width.value.found");
entry.setAttributeNS(null, "value", r2.getBBox().width);
result.appendChild(entry);
return;
}
var g1 = document.getElementById("g1")
if (g1 == null){
result.setAttributeNS(null, "errorCode", "cannot.find.test.element");
var entry = document.createElementNS(testNS, "errorDescriptionEntry");
entry.setAttributeNS(null, "id", "missing.element.id");
entry.setAttributeNS(null, "value", "g1");
result.appendChild(entry);
return;
}
if (g1.getBBox().width != 120) {
result.setAttributeNS(null, "errorCode", "invalid.g1.bbox.width");
var entry = document.createElementNS(testNS,
"errorDescriptionEntry");
entry.setAttributeNS(null, "id", "g1.width.value.found");
entry.setAttributeNS(null, "value", g1.getBBox().width);
result.appendChild(entry);
return;
}
result.setAttributeNS(null, "result", "passed");
}
]]></script>
<g id="g1">
<rect id="r1" x="0" y="0" width="100" height="100"/>
<rect id="r2" x="20" y="20" width="100" height="100"/>
</g>
</svg>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]