|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.latka.junit.JUnitTestAdapter
public class 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(File file)
Create a Test from a Java file |
static junit.framework.Test |
createTestFromFile(String fileName)
Create a Test from a Latka file |
static junit.framework.Test |
createTestFromResource(String resourceName)
Create a Test from a resource accessible via the class loader |
static junit.framework.Test |
createTestFromURL(String url)
Create a Test from a String containing a URL whose contents are in Latka's XML format |
static junit.framework.Test |
createTestFromURL(URL url)
Create a Test from a URL whose contents are in Latka's XML format |
protected static int |
parse(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(String fileName)
fileName
- The name of a readable file in Latka's XML format
public static junit.framework.Test createTestFromFile(File file)
Java file
file
- A readable java file containing Latka's XML format
public static junit.framework.Test createTestFromResource(String resourceName)
class loader
resourceName
- A resource accessible by the class loader in Latka's
XML format
public static junit.framework.Test createTestFromURL(String url)
url
- the URL
to fetch
public static junit.framework.Test createTestFromURL(URL url)
url
- the URL
to fetch
protected static int parse(InputSource xml) throws IOException, SAXException, FactoryConfigurationError, ParserConfigurationException
xml
- The inputsource to parse
IOException
- When an IO occurs reading the document
SAXException
- When the document is invalid XML
FactoryConfigurationError
- When the SAX Parser factory can't be
configured correctly
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 |