Exemple #1
0
 public String getDescriptionForXml(TestCase testCase) {
   if (isGdbcTestCase(testCase)) {
     return getDescriptionForXmlFromGdbcTestCase(testCase);
   }
   if (testCase.getDescription() != null && testCase.getDescription().length() > 0) {
     return "<desc>" + StringUtil.escapeHTML(testCase.getDescription()) + "</desc>\n";
   }
   if (testCase.getName() != null && testCase.getName().length() > 0) {
     return "<desc>" + StringUtil.escapeHTML(testCase.getName()) + "</desc>\n";
   }
   return "<desc> " + getGeometryArgPairCode(testCase.getGeometries()) + " </desc>\n";
 }
Exemple #2
0
 private String getTestXML(TestCase testCase, boolean useWKT) {
   Geometry[] geom = testCase.getGeometries();
   StringBuffer xml = new StringBuffer();
   xml.append("<case>\n");
   xml.append(getDescriptionForXml(testCase));
   if (geom[0] != null) {
     String wkt0 = getWKTorWKB(geom[0], useWKT);
     xml.append("  <a>\n" + wkt0 + "\n    </a>\n");
   }
   if (geom[1] != null) {
     String wkt1 = getWKTorWKB(geom[1], useWKT);
     xml.append("  <b>\n" + 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();
 }