public class SelfContainedSVGOnLoadTest extends AbstractTest
result
attribute of the
<testResult> element by the script embeded in the input SVG
test file.
<svg ... onload="runTest(evt)" xmlns:test="http://xml.apache.org/batik/test" >
<script type="text/ecmascript">
function runTest(evt) {
...; // do some test
var rootSvg = document.getDocumentElement();
var result = document.createElementNS("http://xml.apache.org/batik/test",
"testResult");
result.setAttributeNS(null, "result", "failed");
result.setAttributeNS(null, "errorCode", "org.apache.batik.css.dom.wrong.computed.value");
rootSvg.appendChild(result);
}
</script>
</svg>
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_KEY |
static String |
ATTRIBUTE_RESULT |
static String |
ATTRIBUTE_VALUE |
static String |
ENTRY_KEY_ERROR_DESCRIPTION
Entry describing the error
|
static String |
ENTRY_KEY_NUMBER_OF_TEST_RESULT_ELEMENTS
Entry describing the number of testResult elements found in the
document after dispatching onload.
|
static String |
ENTRY_KEY_RESULT_VALUE
Entry describing the result value (different from 'passed' or 'failed'
found in the 'result' attribute.
|
static String |
ERROR_CANNOT_LOAD_SVG_DOCUMENT
Error when the input file cannot be loaded into a
Document object
{0} = IOException message
|
static String |
ERROR_MISSING_OR_EMPTY_ERROR_CODE_ON_FAILED_TEST
The result was 'failed' but there was no 'errorCode' attribute or
it was the empty string
|
static String |
ERROR_UNEXPECTED_NUMBER_OF_TEST_RESULT_ELEMENTS
There is either 0 or more than one <testResult> elements in
the document after dispatching the onload event.
|
static String |
ERROR_UNEXPECTED_RESULT_VALUE
The 'result' attribute value is neither 'passed' nor 'failed'
|
static String |
ERROR_WHILE_PROCESSING_SVG_DOCUMENT
Error while building the GVT tree or dispatching the
'onload' event.
|
protected String |
svgURL
The URL for the input SVG document to be tested
|
static String |
TAG_ERROR_DESCRIPTION_ENTRY |
static String |
TAG_TEST_RESULT
Test Constants
|
static String |
TEST_RESULT_FAILED |
static String |
TEST_RESULT_PASSED |
static String |
testNS
Test Namespace
|
id, name, parent
Modifier | Constructor and Description |
---|---|
protected |
SelfContainedSVGOnLoadTest()
Default constructor
|
|
SelfContainedSVGOnLoadTest(String svgURL) |
Modifier and Type | Method and Description |
---|---|
protected UserAgent |
buildUserAgent()
Give subclasses a chance to build their own UserAgent
|
protected String |
resolveURL(String url)
Resolves the input string as follows.
|
TestReport |
runImpl()
Run this test and produce a report.
|
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getName, getParent, getQualifiedId, reportError, reportException, reportSuccess, run, runImplBasic, setId, setName, setParent
public static final String ERROR_CANNOT_LOAD_SVG_DOCUMENT
public static final String ERROR_WHILE_PROCESSING_SVG_DOCUMENT
public static final String ERROR_UNEXPECTED_NUMBER_OF_TEST_RESULT_ELEMENTS
public static final String ERROR_UNEXPECTED_RESULT_VALUE
public static final String ERROR_MISSING_OR_EMPTY_ERROR_CODE_ON_FAILED_TEST
public static final String ENTRY_KEY_ERROR_DESCRIPTION
public static final String ENTRY_KEY_NUMBER_OF_TEST_RESULT_ELEMENTS
public static final String ENTRY_KEY_RESULT_VALUE
public static final String testNS
public static final String TAG_TEST_RESULT
public static final String TAG_ERROR_DESCRIPTION_ENTRY
public static final String ATTRIBUTE_RESULT
public static final String ATTRIBUTE_KEY
public static final String ATTRIBUTE_VALUE
public static final String TEST_RESULT_PASSED
public static final String TEST_RESULT_FAILED
protected String svgURL
public SelfContainedSVGOnLoadTest(String svgURL)
svgURL
- the URL string for the SVG document being testedprotected SelfContainedSVGOnLoadTest()
protected String resolveURL(String url)
public TestReport runImpl() throws Exception
runImpl
in class AbstractTest
Exception
protected UserAgent buildUserAgent()
Copyright © 2000–2023 Apache Software Foundation. All rights reserved.