public class XML
extends java.lang.Object
XML utility methods for the JUnit tests.
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
HAVE_JAXP
Determine whether or not the classpath with which we're
running has the JAXP API classes required for use of
the Derby XML operators.
|
private static boolean |
HAVE_JAXP_IMPL
Determine whether or not the classpath with which we're
running has a JAXP implementation.
|
private static boolean |
HAVE_XPATH
Determine if we have support evaluating XPath queries.
|
private static java.lang.String |
HELPER_FILE_LOCATION
The filepath for the directory that holds the XML "helper" files
(i.e. the files to insert and their schema documents).
|
| Constructor and Description |
|---|
XML() |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
checkJAXPImplementation() |
private static boolean |
checkXPathSupport()
Determine whether or not the classpath with which we're
running contains a JAXP implementation that supports
evaluating XPath queries.
|
static boolean |
classpathHasJAXP()
Return true if the classpath contains JAXP and
an implementation of the JAXP interfaces, for example the
Xalan classes (this method doesn't care about
support for XPath queries).
|
static boolean |
classpathMeetsXMLReqs()
Return true if the classpath meets all of the requirements
for use of the SQL/XML operators.
|
protected static java.lang.String |
getJAXPParserLocation()
Return the string form of the URL for the jar file that contains
whichever JAXP parser implementation is picked up from the user's
classpath.
|
static void |
insertDocWithDTD(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String colName,
java.lang.String fName,
java.lang.String dtdName,
int numRows)
Insert an XML document into the received column of the received
test table using setString.
|
static void |
insertFile(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String colName,
java.lang.String fName,
int numRows)
Insert the contents of a file into the received column of
the received table using "setCharacterStream".
|
private static final boolean HAVE_JAXP
private static final boolean HAVE_JAXP_IMPL
private static final boolean HAVE_XPATH
private static final java.lang.String HELPER_FILE_LOCATION
public static boolean classpathHasJAXP()
public static boolean classpathMeetsXMLReqs()
public static void insertFile(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String colName,
java.lang.String fName,
int numRows)
throws java.io.IOException,
java.sql.SQLException,
java.security.PrivilegedActionException
conn - Connection on which to perform the insert.tableName - Table into which we want to insert.colName - Column in tableName into which we want to insert.fName - Name of the file whose content we want to insert.numRows - Number of times we should insert the received
file's content.java.io.IOExceptionjava.sql.SQLExceptionjava.security.PrivilegedActionExceptionpublic static void insertDocWithDTD(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String colName,
java.lang.String fName,
java.lang.String dtdName,
int numRows)
throws java.io.IOException,
java.sql.SQLException,
java.security.PrivilegedActionException
conn - Connection on which to perform the insert.tableName - Table into which we want to insert.colName - Column in tableName into which we want to insert.fName - Name of the file whose content we want to insert.dtdName - Name of the DTD file that the received file uses.numRows - Number of times we should insert the received
file's content.java.io.IOExceptionjava.sql.SQLExceptionjava.security.PrivilegedActionExceptionprivate static boolean checkXPathSupport()
Determine whether or not the classpath with which we're running contains a JAXP implementation that supports evaluating XPath queries.
Assumption is that we only get to this method if we already know that there *is* an implementation of JAXP in the classpath.
private static boolean checkJAXPImplementation()
protected static java.lang.String getJAXPParserLocation()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.