Skip to content

Commit d6d04a1

Browse files
committed
result toString
1 parent 5f49261 commit d6d04a1

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

src/main/java/net/apnic/rdap/conformance/Application.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private static Result getDocRefProto(String document,
8888
return proto;
8989
}
9090

91-
private static void runNonRdapTests(List<Test> tests)
91+
private static void runNonRdapTests(Context c, List<Test> tests)
9292
{
9393
/* Relative URI in the HTTP request. */
9494
Result relative = new Result();
@@ -204,7 +204,7 @@ public X509Certificate[] getAcceptedIssuers() {
204204
* are fairly niche, and in many cases can't easily be fixed
205205
* by implementers anyway. See e.g.
206206
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=414636. */
207-
// runNonRdapTests(tests);
207+
// runNonRdapTests(c, tests);
208208

209209
/* application/json content-type. This is deliberately using
210210
* an invalid status code with inverted sense, because so long

src/main/java/net/apnic/rdap/conformance/Result.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public String toString() {
343343
for (int i = 0; i < slen; i++) {
344344
char c = path.charAt(i);
345345
if (Character.isISOControl(c)) {
346-
epath.append("{\\x" + ((int) c) + "}");
346+
epath.append("{" + ((int) c) + "}");
347347
} else {
348348
epath.append(c);
349349
}
@@ -354,16 +354,21 @@ public String toString() {
354354
nodeMapped.add(nodeToString(n));
355355
}
356356

357-
return
358-
Joiner.on(",").join(
359-
Arrays.asList(getTestName(),
360-
epath.toString(),
361-
getStatusAsString(),
362-
getCode(),
363-
getInfo(),
364-
Joiner.on(":").join(nodeMapped),
365-
getDocument(),
366-
getReference())
367-
);
357+
List<String> elements =
358+
Arrays.asList(getTestName(),
359+
epath.toString(),
360+
getStatusAsString(),
361+
getCode(),
362+
getInfo(),
363+
Joiner.on(":").join(nodeMapped),
364+
getDocument(),
365+
getReference());
366+
367+
List<String> elementsEscaped = new ArrayList<String>();
368+
for (String n : elements) {
369+
elementsEscaped.add(n.replaceAll(",", "{44}"));
370+
}
371+
372+
return Joiner.on(",").join(elementsEscaped);
368373
}
369374
}

0 commit comments

Comments
 (0)