Class HtmlWriter
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.model.HtmlWriter
-
public class HtmlWriter extends java.lang.Object
An object that creates an .html file describing the test cases. .gif files are also created.- Version:
- 1.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
HtmlWriter.MapAndList
-
Field Summary
Fields Modifier and Type Field Description private BusyDialog
busyDialog
private javax.swing.JFrame
frame
private GeometryEditPanel
geometryEditPanel
private static int
IMAGE_HEIGHT
private static int
IMAGE_WIDTH
private java.io.File
outputDirectory
private boolean
showingABwithSpatialFunction
private static int
STACK_TRACE_DEPTH
-
Constructor Summary
Constructors Constructor Description HtmlWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Object
actualResult(TestCaseEdit testCaseEdit, java.lang.String opName, java.lang.String first, java.lang.String second)
private void
addToListMapAndList(java.lang.String key, java.lang.Object valueItem, java.util.Map stringToList, java.util.List keyList)
private void
createGifFile(java.lang.String filenameNoPath, Geometry a, Geometry b, Geometry spatialFunction, boolean showingAB, int imageWidth, int imageHeight)
private void
createGifFile(java.lang.String filenameNoPath, Geometry a, Geometry b, Geometry result, boolean showingAB, int imageWidth, int imageHeight, boolean zoomToFullExtent)
private void
createHtmlFile(java.lang.String filename, java.lang.String html)
private java.lang.String
deleteFirstTag(java.lang.String html)
private java.lang.String
deleteLastTag(java.lang.String html)
private BooleanResult
expectedPredicateResult(TestCaseEdit testCaseEdit, java.lang.String opName, java.lang.String first, java.lang.String second)
private java.lang.String
html(Testable testable, int runSkey, int caseSkey)
private java.lang.String
htmlForAB(TestCaseEdit testCaseEdit, int runSkey, int caseSkey)
private java.lang.String
htmlForBinaryPredicates(TestCaseEdit testCaseEdit, int caseSkey)
private java.lang.String
htmlForPredicateTest(TestCaseEdit testCaseEdit, int caseSkey, java.lang.String opName, java.lang.String first, java.lang.String second)
private java.lang.String
htmlForRelateTest(TestCaseEdit testCaseEdit, int caseSkey)
private java.lang.String
htmlForSpatialFunctionTest(TestCaseEdit testCaseEdit, int runSkey, int caseSkey, java.lang.String geometryOpName, java.lang.String first, java.lang.String second)
private java.lang.String
htmlForTests(TestCaseEdit testCaseEdit, int runSkey, int caseSkey)
private java.lang.String
htmlImageHtmlTextTable(java.lang.String imageFilename, java.lang.String html, int border)
private java.lang.String
htmlImageTextTable(java.lang.String imageFilename, java.lang.String text, int border)
private java.lang.String
htmlTitle(PrecisionModel precisionModel)
private java.lang.String
indexHtml(java.util.List runs, java.util.Map runMap, PrecisionModel precisionModel)
private java.lang.String
insertParagraphs(java.lang.String intersectionMatrix)
private HtmlWriter.MapAndList
runMapAndRuns(TestCaseList testCaseList)
private java.lang.String
runName(java.lang.String runDescription, int runSkey)
void
setBusyDialog(BusyDialog busyDialog)
void
setShowingABwithSpatialFunction(boolean showingABwithSpatialFunction)
private java.lang.String
testName(Testable testable, int caseSkey)
private java.lang.String
testTopHtml()
void
write(java.io.File outputDirectory, TestCaseList testCaseList, PrecisionModel precisionModel)
-
-
-
Field Detail
-
IMAGE_WIDTH
private static final int IMAGE_WIDTH
- See Also:
- Constant Field Values
-
IMAGE_HEIGHT
private static final int IMAGE_HEIGHT
- See Also:
- Constant Field Values
-
STACK_TRACE_DEPTH
private static final int STACK_TRACE_DEPTH
- See Also:
- Constant Field Values
-
showingABwithSpatialFunction
private boolean showingABwithSpatialFunction
-
geometryEditPanel
private GeometryEditPanel geometryEditPanel
-
frame
private javax.swing.JFrame frame
-
outputDirectory
private java.io.File outputDirectory
-
busyDialog
private BusyDialog busyDialog
-
-
Method Detail
-
setShowingABwithSpatialFunction
public void setShowingABwithSpatialFunction(boolean showingABwithSpatialFunction)
-
setBusyDialog
public void setBusyDialog(BusyDialog busyDialog)
-
write
public void write(java.io.File outputDirectory, TestCaseList testCaseList, PrecisionModel precisionModel) throws java.io.IOException
- Throws:
java.io.IOException
-
html
private java.lang.String html(Testable testable, int runSkey, int caseSkey) throws java.io.IOException
- Throws:
java.io.IOException
-
deleteLastTag
private java.lang.String deleteLastTag(java.lang.String html)
-
deleteFirstTag
private java.lang.String deleteFirstTag(java.lang.String html)
-
htmlForTests
private java.lang.String htmlForTests(TestCaseEdit testCaseEdit, int runSkey, int caseSkey) throws java.io.IOException
- Throws:
java.io.IOException
-
htmlForSpatialFunctionTest
private java.lang.String htmlForSpatialFunctionTest(TestCaseEdit testCaseEdit, int runSkey, int caseSkey, java.lang.String geometryOpName, java.lang.String first, java.lang.String second)
-
htmlForRelateTest
private java.lang.String htmlForRelateTest(TestCaseEdit testCaseEdit, int caseSkey)
-
insertParagraphs
private java.lang.String insertParagraphs(java.lang.String intersectionMatrix)
-
htmlForPredicateTest
private java.lang.String htmlForPredicateTest(TestCaseEdit testCaseEdit, int caseSkey, java.lang.String opName, java.lang.String first, java.lang.String second)
-
actualResult
private java.lang.Object actualResult(TestCaseEdit testCaseEdit, java.lang.String opName, java.lang.String first, java.lang.String second) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectedPredicateResult
private BooleanResult expectedPredicateResult(TestCaseEdit testCaseEdit, java.lang.String opName, java.lang.String first, java.lang.String second)
-
htmlForAB
private java.lang.String htmlForAB(TestCaseEdit testCaseEdit, int runSkey, int caseSkey) throws java.io.IOException
- Throws:
java.io.IOException
-
htmlImageTextTable
private java.lang.String htmlImageTextTable(java.lang.String imageFilename, java.lang.String text, int border)
-
htmlImageHtmlTextTable
private java.lang.String htmlImageHtmlTextTable(java.lang.String imageFilename, java.lang.String html, int border)
-
testName
private java.lang.String testName(Testable testable, int caseSkey)
-
runName
private java.lang.String runName(java.lang.String runDescription, int runSkey)
-
htmlTitle
private java.lang.String htmlTitle(PrecisionModel precisionModel)
-
createGifFile
private void createGifFile(java.lang.String filenameNoPath, Geometry a, Geometry b, Geometry spatialFunction, boolean showingAB, int imageWidth, int imageHeight) throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
-
createGifFile
private void createGifFile(java.lang.String filenameNoPath, Geometry a, Geometry b, Geometry result, boolean showingAB, int imageWidth, int imageHeight, boolean zoomToFullExtent) throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
-
createHtmlFile
private void createHtmlFile(java.lang.String filename, java.lang.String html) throws java.io.IOException
- Throws:
java.io.IOException
-
runMapAndRuns
private HtmlWriter.MapAndList runMapAndRuns(TestCaseList testCaseList)
-
addToListMapAndList
private void addToListMapAndList(java.lang.String key, java.lang.Object valueItem, java.util.Map stringToList, java.util.List keyList)
-
indexHtml
private java.lang.String indexHtml(java.util.List runs, java.util.Map runMap, PrecisionModel precisionModel)
-
testTopHtml
private java.lang.String testTopHtml()
-
htmlForBinaryPredicates
private java.lang.String htmlForBinaryPredicates(TestCaseEdit testCaseEdit, int caseSkey)
-
-