|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.latka.junit.JUnitTestAdapter
A JUnit Test
which is created by
wrapping a Latka Suite
Constructor Summary | |
protected |
JUnitTestAdapter(Suite suite,
int testCount)
Create a Test from a Latka suite and a number of tests |
Method Summary | |
int |
countTestCases()
Provides access, post-parsing, of the number of request elements in the Latka Suite |
static junit.framework.Test |
createTestFromFile(java.io.File file)
Create a Test from a Java file |
static junit.framework.Test |
createTestFromFile(java.lang.String fileName)
Create a Test from a Latka file |
static junit.framework.Test |
createTestFromResource(java.lang.String resourceName)
Create a Test from a resource accessible via the class loader |
static junit.framework.Test |
createTestFromURL(java.lang.String url)
Create a Test from a String containing a URL whose contents are in Latka's XML format |
static junit.framework.Test |
createTestFromURL(java.net.URL url)
Create a Test from a URL whose contents are in Latka's XML format |
protected static int |
parse(org.xml.sax.InputSource xml)
Parse the Latka XML document to count the requests |
void |
run(junit.framework.TestResult r)
Run the test, adding results to the provided TestResult |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected JUnitTestAdapter(Suite suite, int testCount)
suite
- The Latka Suite
to be run as a JUnit TesttestCount
- The number of 'request's in the Latka suiteMethod Detail |
public static junit.framework.Test createTestFromFile(java.lang.String fileName)
fileName
- The name of a readable file in Latka's XML format
public static junit.framework.Test createTestFromFile(java.io.File file)
Java file
file
- A readable java file containing Latka's XML format
public static junit.framework.Test createTestFromResource(java.lang.String resourceName)
class loader
resourceName
- A resource accessible by the class loader in Latka's
XML format
public static junit.framework.Test createTestFromURL(java.lang.String url)
url
- the URL
to fetch
public static junit.framework.Test createTestFromURL(java.net.URL url)
url
- the URL
to fetch
protected static int parse(org.xml.sax.InputSource xml) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.FactoryConfigurationError, javax.xml.parsers.ParserConfigurationException
xml
- The inputsource to parse
java.io.IOException
- When an IO occurs reading the document
org.xml.sax.SAXException
- When the document is invalid XML
javax.xml.parsers.FactoryConfigurationError
- When the SAX Parser factory can't be
configured correctly
javax.xml.parsers.ParserConfigurationException
- When the SAX Parser can't be
configured correctlypublic int countTestCases()
countTestCases
in interface junit.framework.Test
public void run(junit.framework.TestResult r)
TestResult
run
in interface junit.framework.Test
r
- TestResult to accumulate
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |