Beispiel #1
0
 public String getTestXML(TestCaseList tcList) {
   StringBuffer xml = new StringBuffer();
   for (int i = 0; i < tcList.getList().size(); i++) {
     xml.append("\n");
     xml.append(getTestXML((Testable) tcList.getList().get(i)));
   }
   xml.append("\n");
   return xml.toString();
 }
Beispiel #2
0
 public String getTestXML(TestCase testCase) {
   Geometry[] geom = testCase.getGeometries();
   StringBuffer xml = new StringBuffer();
   xml.append("<case>\n");
   xml.append(getDescriptionForXml(testCase));
   if (geom[0] != null) {
     String wkt0 = wktWriter.writeFormatted(geom[0]);
     xml.append("  <a> " + wkt0 + "\n    </a>\n");
   }
   if (geom[1] != null) {
     String wkt1 = wktWriter.writeFormatted(geom[1]);
     xml.append("  <b> " + wkt1 + "\n    </b>\n");
   }
   if (testCase.getExpectedIntersectionMatrix() != null) {
     xml.append("  <test>\n");
     xml.append(
         "    <op name=\"relate\" arg1=\"A\" arg2=\"B\" arg3=\""
             + testCase.getExpectedIntersectionMatrix()
             + "\">true</op>\n");
     xml.append("  </test>\n");
   }
   if (testCase.getExpectedBoundary() != null) {
     xml.append(getTestXML(testCase.getExpectedBoundary(), "getboundary", new String[] {}));
   }
   if (testCase.getExpectedConvexHull() != null) {
     xml.append(getTestXML(testCase.getExpectedConvexHull(), "convexhull", new String[] {}));
   }
   if (testCase.getExpectedIntersection() != null) {
     xml.append(
         getTestXML(testCase.getExpectedIntersection(), "intersection", new String[] {"B"}));
   }
   if (testCase.getExpectedUnion() != null) {
     xml.append(getTestXML(testCase.getExpectedUnion(), "union", new String[] {"B"}));
   }
   if (testCase.getExpectedDifference() != null) {
     xml.append(getTestXML(testCase.getExpectedDifference(), "difference", new String[] {"B"}));
   }
   if (testCase.getExpectedSymDifference() != null) {
     xml.append(
         getTestXML(testCase.getExpectedSymDifference(), "symdifference", new String[] {"B"}));
   }
   xml.append("</case>\n");
   return xml.toString();
 }