Class HtmlWriter
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.model.HtmlWriter
-
public class HtmlWriter extends java.lang.ObjectAn 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 classHtmlWriter.MapAndList
-
Field Summary
Fields Modifier and Type Field Description private BusyDialogbusyDialogprivate javax.swing.JFrameframeprivate GeometryEditPanelgeometryEditPanelprivate static intIMAGE_HEIGHTprivate static intIMAGE_WIDTHprivate java.io.FileoutputDirectoryprivate booleanshowingABwithSpatialFunctionprivate static intSTACK_TRACE_DEPTH
-
Constructor Summary
Constructors Constructor Description HtmlWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.ObjectactualResult(TestCaseEdit testCaseEdit, java.lang.String opName, java.lang.String first, java.lang.String second)private voidaddToListMapAndList(java.lang.String key, java.lang.Object valueItem, java.util.Map stringToList, java.util.List keyList)private voidcreateGifFile(java.lang.String filenameNoPath, Geometry a, Geometry b, Geometry spatialFunction, boolean showingAB, int imageWidth, int imageHeight)private voidcreateGifFile(java.lang.String filenameNoPath, Geometry a, Geometry b, Geometry result, boolean showingAB, int imageWidth, int imageHeight, boolean zoomToFullExtent)private voidcreateHtmlFile(java.lang.String filename, java.lang.String html)private java.lang.StringdeleteFirstTag(java.lang.String html)private java.lang.StringdeleteLastTag(java.lang.String html)private BooleanResultexpectedPredicateResult(TestCaseEdit testCaseEdit, java.lang.String opName, java.lang.String first, java.lang.String second)private java.lang.Stringhtml(Testable testable, int runSkey, int caseSkey)private java.lang.StringhtmlForAB(TestCaseEdit testCaseEdit, int runSkey, int caseSkey)private java.lang.StringhtmlForBinaryPredicates(TestCaseEdit testCaseEdit, int caseSkey)private java.lang.StringhtmlForPredicateTest(TestCaseEdit testCaseEdit, int caseSkey, java.lang.String opName, java.lang.String first, java.lang.String second)private java.lang.StringhtmlForRelateTest(TestCaseEdit testCaseEdit, int caseSkey)private java.lang.StringhtmlForSpatialFunctionTest(TestCaseEdit testCaseEdit, int runSkey, int caseSkey, java.lang.String geometryOpName, java.lang.String first, java.lang.String second)private java.lang.StringhtmlForTests(TestCaseEdit testCaseEdit, int runSkey, int caseSkey)private java.lang.StringhtmlImageHtmlTextTable(java.lang.String imageFilename, java.lang.String html, int border)private java.lang.StringhtmlImageTextTable(java.lang.String imageFilename, java.lang.String text, int border)private java.lang.StringhtmlTitle(PrecisionModel precisionModel)private java.lang.StringindexHtml(java.util.List runs, java.util.Map runMap, PrecisionModel precisionModel)private java.lang.StringinsertParagraphs(java.lang.String intersectionMatrix)private HtmlWriter.MapAndListrunMapAndRuns(TestCaseList testCaseList)private java.lang.StringrunName(java.lang.String runDescription, int runSkey)voidsetBusyDialog(BusyDialog busyDialog)voidsetShowingABwithSpatialFunction(boolean showingABwithSpatialFunction)private java.lang.StringtestName(Testable testable, int caseSkey)private java.lang.StringtestTopHtml()voidwrite(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.FileNotFoundExceptionjava.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.FileNotFoundExceptionjava.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)
-
-