Skip to content

Commit 662c801

Browse files
committed
reference for application/json request
1 parent 14846cd commit 662c801

File tree

7 files changed

+38
-3551
lines changed

7 files changed

+38
-3551
lines changed

asdf

Lines changed: 0 additions & 3542 deletions
This file was deleted.

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,16 @@ public X509Certificate[] getAcceptedIssuers() {
199199
* an invalid status code with inverted sense, because so long
200200
* as the request is 'successful', it's fine. */
201201
c.setContentType("application/json");
202+
Result ctres = new Result();
203+
ctres.setTestName("common.application-json");
204+
ctres.setDocument("draft-ietf-weirds-using-http-08");
205+
ctres.setReference("4.1");
202206
tests.add(new net.apnic.rdap.conformance.test.common.BasicRequest(
203207
0,
204208
"/domain/example.com",
205209
"common.application-json",
206-
true
210+
true,
211+
ctres
207212
));
208213
c.setContentType(null);
209214

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public enum Status { Success, Notification, Warning, Failure };
2121

2222
private Status status = Status.Notification;
2323
private String path = "";
24-
private String testName = "";
24+
private String testName = "";
2525
private String code = "";
2626
private String info = "";
2727
private String document = "";

src/main/java/net/apnic/rdap/conformance/test/common/BasicRequest.java

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public final class BasicRequest implements net.apnic.rdap.conformance.Test {
3838
private String testName;
3939
private String urlPath;
4040
private boolean invertStatusTest;
41+
private Result proto;
4142

4243
/**
4344
* <p>Constructor for BasicRequest.</p>
@@ -46,15 +47,18 @@ public final class BasicRequest implements net.apnic.rdap.conformance.Test {
4647
* @param argUrlPath a {@link java.lang.String} object.
4748
* @param argTestName a {@link java.lang.String} object.
4849
* @param argInvertStatusTest a boolean.
50+
* @param argProto a {@link Result} object.
4951
*/
5052
public BasicRequest(final int argExpectedStatus,
5153
final String argUrlPath,
5254
final String argTestName,
53-
final boolean argInvertStatusTest) {
55+
final boolean argInvertStatusTest,
56+
final Result argProto) {
5457
expectedStatus = argExpectedStatus;
5558
testName = argTestName;
5659
urlPath = argUrlPath;
5760
invertStatusTest = argInvertStatusTest;
61+
proto = argProto;
5862

5963
if (testName == null) {
6064
testName = "common." +
@@ -65,16 +69,36 @@ public BasicRequest(final int argExpectedStatus,
6569
}
6670
}
6771

72+
/**
73+
* <p>Constructor for BasicRequest.</p>
74+
*
75+
* @param argExpectedStatus a int.
76+
* @param argUrlPath a {@link java.lang.String} object.
77+
* @param argTestName a {@link java.lang.String} object.
78+
* @param argInvertStatusTest a boolean.
79+
*/
80+
public BasicRequest(final int argExpectedStatus,
81+
final String argUrlPath,
82+
final String argTestName,
83+
final boolean argInvertStatusTest) {
84+
this(argExpectedStatus, argUrlPath, argTestName,
85+
argInvertStatusTest, null);
86+
}
87+
6888
/** {@inheritDoc} */
6989
public boolean run(final Context context) {
7090
List<Result> results = context.getResults();
7191

7292
String bu = context.getSpecification().getBaseUrl();
7393
String path = bu + urlPath;
7494

75-
Result proto = new Result(Status.Notification, path,
76-
testName,
77-
"", "", "", "");
95+
if (proto == null) {
96+
proto = new Result(Status.Notification, path, testName,
97+
"", "", "", "");
98+
} else {
99+
proto = new Result(proto);
100+
proto.setPath(path);
101+
}
78102
Result r = new Result(proto);
79103
r.setCode("response");
80104

src/main/java/net/apnic/rdap/conformance/valuetest/Algorithm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* <p>Algorithm class.</p>
1111
*
1212
* See RFC 4034 [A.1] and the documents that update it. The registry
13-
* is available at
13+
* is available at
1414
* http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xml.
1515
*
1616
* @author Tom Harrison <[email protected]>

src/main/java/net/apnic/rdap/conformance/valuetest/KeyTag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public boolean run(final Context context, final Result proto,
3232

3333
if (value != null) {
3434
Result cvr = new Result(proto);
35-
boolean res =
35+
boolean res =
3636
cvr.setDetails(((value >= 0) && (value <= MAX_16BIT)),
3737
"valid", "invalid");
3838
context.addResult(cvr);

src/main/java/net/apnic/rdap/conformance/valuetest/StringSet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public boolean run(final Context context, final Result proto,
3737
if (value != null) {
3838
Result cvr = new Result(proto);
3939
boolean res = cvr.setDetails(members.contains(value),
40-
"valid",
40+
"valid",
4141
"invalid: " + value);
4242
context.addResult(cvr);
4343
return res;

0 commit comments

Comments
 (0)