public class SVGOnLoadExceptionTest extends AbstractTest
Modifier and Type | Field and Description |
---|---|
static String |
ENTRY_KEY_EXPECTED_ERROR_CODE
Entry describign the expected error code
|
static String |
ENTRY_KEY_EXPECTED_EXCEPTION
Entry describing the expected exception
|
static String |
ENTRY_KEY_UNEXPECTED_ERROR_CODE
Entry describing the unexpected error code
|
static String |
ENTRY_KEY_UNEXPECTED_EXCEPTION
Entry describing the unexpected exception
|
static String |
ENTRY_KEY_UNEXPECTED_RESULT
Entry describing the unexpected exception
|
static String |
ERROR_CODE_NO_CHECK
Value used to disable error code check on BridgeExceptions
|
static String |
ERROR_EXCEPTION_DID_NOT_OCCUR
Error when the expected exception did not occur
|
static String |
ERROR_SCRIPT_DID_NOT_RUN
Error when the script does not run as expected.
|
static String |
ERROR_UNEXPECTED_ERROR_CODE
Error when a BridgeException occured, as expected, but
with an unexpected error code
|
static String |
ERROR_UNEXPECTED_EXCEPTION
Error when an exception occured, but not of the expected
class
|
protected String |
expectedErrorCode
Expected error code (for BridgeExceptions)
|
protected String |
expectedExceptionClass
Name of the expected exception class
|
protected String |
fileName
The name of the test file
|
static String |
RAN
Value for the script having successfully run.
|
protected String |
resourceOrigin
The allowed external resource origin
|
protected boolean |
restricted
Controls whether on not the document should be processed from
a 'restricted' context, one with no createClassLoader permission.
|
protected String |
scriptOrigin
The allowed script origin
|
protected String |
scripts
The allowed script types
|
protected boolean |
secure
True if the scripts are run securely (i.e., with a security manager)
|
protected String |
svgURL
The URL for the input SVG document to be tested
|
static String |
testNS
Test Namespace
|
protected Boolean |
validate
Controls whether or not the input SVG document should be validated
|
id, name, parent
Constructor and Description |
---|
SVGOnLoadExceptionTest()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.batik.test.svg.SVGOnLoadExceptionTest.TestUserAgent |
buildUserAgent()
Give subclasses a chance to build their own UserAgent
|
String |
getExpectedErrorCode() |
String |
getExpectedExceptionClass() |
String |
getResourceOrigin() |
boolean |
getRestricted() |
String |
getScriptOrigin() |
String |
getScripts() |
boolean |
getSecure() |
Boolean |
getValidate() |
protected TestReport |
handleException(Exception e)
Compares the input exception with the expected exception
If they match, then the test passes.
|
protected boolean |
isMatch(Class cl,
String name)
Check if the input class' name (or one of its base classes) matches
the input name.
|
protected String |
resolveURL(String url)
Resolves the input string as follows.
|
TestReport |
runImpl()
Run this test and produce a report.
|
void |
setExpectedErrorCode(String expectedErrorCode) |
void |
setExpectedExceptionClass(String expectedExceptionClass) |
void |
setId(String id)
Set this
Test 's id. |
void |
setResourceOrigin(String resourceOrigin) |
void |
setRestricted(boolean restricted) |
void |
setScriptOrigin(String scriptOrigin) |
void |
setScripts(String scripts) |
void |
setSecure(boolean secure) |
void |
setValidate(Boolean validate) |
protected TestReport |
testImpl()
Implementation helper
|
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getName, getParent, getQualifiedId, reportError, reportException, reportSuccess, run, runImplBasic, setName, setParent
public static final String RAN
public static final String ERROR_EXCEPTION_DID_NOT_OCCUR
public static final String ERROR_UNEXPECTED_EXCEPTION
public static final String ERROR_UNEXPECTED_ERROR_CODE
public static final String ERROR_SCRIPT_DID_NOT_RUN
public static final String ENTRY_KEY_UNEXPECTED_EXCEPTION
public static final String ENTRY_KEY_UNEXPECTED_ERROR_CODE
public static final String ENTRY_KEY_EXPECTED_ERROR_CODE
public static final String ENTRY_KEY_EXPECTED_EXCEPTION
public static final String ENTRY_KEY_UNEXPECTED_RESULT
public static final String ERROR_CODE_NO_CHECK
public static final String testNS
protected String svgURL
protected String scripts
protected String expectedExceptionClass
protected String expectedErrorCode
protected String scriptOrigin
protected String resourceOrigin
protected boolean secure
protected Boolean validate
protected String fileName
protected boolean restricted
public boolean getRestricted()
public void setRestricted(boolean restricted)
public void setScripts(String scripts)
public String getScripts()
public void setScriptOrigin(String scriptOrigin)
public String getScriptOrigin()
public void setResourceOrigin(String resourceOrigin)
public String getResourceOrigin()
public void setSecure(boolean secure)
public boolean getSecure()
public void setExpectedExceptionClass(String expectedExceptionClass)
public String getExpectedExceptionClass()
public void setExpectedErrorCode(String expectedErrorCode)
public String getExpectedErrorCode()
public Boolean getValidate()
public void setValidate(Boolean validate)
public void setId(String id)
AbstractTest
Test
's id. Null is not allowed.setId
in interface Test
setId
in class AbstractTest
protected String resolveURL(String url)
public TestReport runImpl() throws Exception
runImpl
in class AbstractTest
Exception
protected TestReport testImpl()
protected TestReport handleException(Exception e)
protected boolean isMatch(Class cl, String name)
protected org.apache.batik.test.svg.SVGOnLoadExceptionTest.TestUserAgent buildUserAgent()
Copyright © 2000–2023 Apache Software Foundation. All rights reserved.