public abstract class TestWriter<S extends TestSource,T extends TestTarget> extends Object
Modifier | Constructor and Description |
---|---|
protected |
TestWriter(TestCaseWriter testCaseWriter)
Creates a new TestWriter instance.
|
Modifier and Type | Method and Description |
---|---|
protected File |
getTargetFile(T target,
String testName)
Returns the target file defined by the given target.
|
protected String |
getTestBaseName(S source,
T target)
Returns the base test name defined by the given source and target.
|
protected TestCaseWriter |
getTestCaseWriter()
Returns the
TestCaseWriter for this test. |
File |
getTestFile(S source,
T target)
Returns the test file written for the given source and target.
|
String |
getTestName(S source,
T target)
Returns the test name derived from the given source and target.
|
protected abstract String |
getTestName(String baseName)
Returns the test name derived from the given base name.
|
protected File |
getTestResourceDir(File targetFile,
File resourceDir)
Returns the resource directory derived from the given target file and resource directory options.
|
File |
getTestResourceDir(S source,
T target)
Returns the resource directory derived from the given source and target
|
protected URI |
getTestServer(RequestCase requestCase)
Returns a URI for the API server used by the given test case.
|
protected void |
prepareTestCases(List<RequestCase> requestCases)
Prepare this writer to handle the given request cases.
|
String |
toString() |
protected abstract void |
writeClosing(T target,
String testName,
IndentedWriter targetWriter)
Writes the target test closing to the given stream.
|
protected abstract void |
writeDeclarations(T target,
String testName,
IndentedWriter targetWriter)
Writes the target test declarations to the given stream.
|
protected abstract void |
writeDependencies(T target,
String testName,
IndentedWriter targetWriter)
Writes the target test dependencies to the given stream.
|
protected void |
writeEpilog(T target,
String testName,
IndentedWriter targetWriter)
Writes the target test epilog to the given stream.
|
protected abstract void |
writeOpening(T target,
String testName,
IndentedWriter targetWriter)
Writes the target test opening to the given stream.
|
protected void |
writeProlog(T target,
String testName,
IndentedWriter targetWriter)
Writes the target test prolog to the given stream.
|
protected void |
writeResponsesDef(ResponsesDef responses,
File targetFile,
File resourceDir)
Writes the given responses definitions to a resource file associated with the test target file.
|
void |
writeTest(S source,
T target)
|
protected void |
writeTestCase(T target,
String testName,
RequestCase requestCase,
IndentedWriter targetWriter)
Writes a target test case to the given stream.
|
protected void |
writeTestCases(T target,
String testName,
List<RequestCase> requestCases,
IndentedWriter targetWriter)
Writes the target test cases to the given stream.
|
protected TestWriter(TestCaseWriter testCaseWriter)
public File getTestFile(S source, T target)
public String getTestName(S source, T target)
protected abstract String getTestName(String baseName)
protected String getTestBaseName(S source, T target)
public File getTestResourceDir(S source, T target)
protected File getTestResourceDir(File targetFile, File resourceDir)
protected File getTargetFile(T target, String testName)
protected void prepareTestCases(List<RequestCase> requestCases)
protected void writeProlog(T target, String testName, IndentedWriter targetWriter)
protected abstract void writeOpening(T target, String testName, IndentedWriter targetWriter)
protected abstract void writeDependencies(T target, String testName, IndentedWriter targetWriter)
protected abstract void writeDeclarations(T target, String testName, IndentedWriter targetWriter)
protected void writeTestCases(T target, String testName, List<RequestCase> requestCases, IndentedWriter targetWriter)
protected void writeTestCase(T target, String testName, RequestCase requestCase, IndentedWriter targetWriter)
protected void writeEpilog(T target, String testName, IndentedWriter targetWriter)
protected abstract void writeClosing(T target, String testName, IndentedWriter targetWriter)
protected void writeResponsesDef(ResponsesDef responses, File targetFile, File resourceDir)
protected TestCaseWriter getTestCaseWriter()
TestCaseWriter
for this test.protected URI getTestServer(RequestCase requestCase)
request case
.Copyright © 2024 The Cornutum Project. All rights reserved.