You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2020/10/17 18:46:32 UTC
[jena] branch master updated: Migrate for JUnit 4.13.x
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jena.git
The following commit(s) were added to refs/heads/master by this push:
new 38177e3 Migrate for JUnit 4.13.x
new 44404a5 Merge pull request #812 from afs/fuseki-clean
38177e3 is described below
commit 38177e3b3bf4ecb71c1afb58a15bd7ec406f02cf
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Tue Oct 13 17:46:22 2020 +0100
Migrate for JUnit 4.13.x
---
.../jena/fuseki/servlets/ResponseResultSet.java | 6 +++---
.../test/java/org/apache/jena/fuseki/TestMetrics.java | 19 +++++++------------
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ResponseResultSet.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ResponseResultSet.java
index 9275d3f..0f3da82 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ResponseResultSet.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ResponseResultSet.java
@@ -117,7 +117,7 @@ public class ResponseResultSet
mimeType = outputField;
String serializationType = mimeType; // Choose the serializer based on this.
- String contentType = mimeType; // Set the HTTP respose header to this.
+ String contentType = mimeType; // Set the HTTP response header to this.
// -- Stylesheet - change to application/xml.
final String stylesheetURL = ResponseOps.paramStylesheet(request);
@@ -172,7 +172,7 @@ public class ResponseResultSet
charset = null;
}
- //Finally, the general case
+ // Finally, the general case
generalOutput(action, lang, contentType, charset, cxt, jsonCallback, resultSet, booleanResult);
}
@@ -215,7 +215,7 @@ public class ResponseResultSet
output(action, contentType, charset, proc);
}
- // Sett HTTP response Execute OutputContent inside
+ // Set HTTP response and execute OutputContent inside try-catch.
private static void output(HttpAction action, String contentType, String charset, OutputContent proc) {
try {
ResponseOps.setHttpResponse(action, contentType, charset);
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestMetrics.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestMetrics.java
index e6dd8dd..ed82258 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestMetrics.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestMetrics.java
@@ -28,9 +28,8 @@ import org.junit.Test;
import static org.apache.commons.lang3.StringUtils.substringAfter;
import static org.apache.commons.lang3.StringUtils.substringBefore;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
public class TestMetrics extends AbstractFusekiTest {
@@ -38,14 +37,12 @@ public class TestMetrics extends AbstractFusekiTest {
public void can_retrieve_metrics() {
RecordingResponseHandler responseHandler = new RecordingResponseHandler();
- HttpOp.execHttpGet( ServerCtl.urlRoot() + "$/metrics" ,
- "",
- responseHandler);
+ HttpOp.execHttpGet( ServerCtl.urlRoot() + "$/metrics" , "", responseHandler);
- assertThat(responseHandler.statusCode, is(HttpSC.OK_200));
- assertThat(responseHandler.contentType, is(WebContent.contentTypeTextPlain));
- assertThat(responseHandler.encoding, is(WebContent.charsetUTF8));
- assertThat(responseHandler.content, containsString("fuseki_requests_good"));
+ assertEquals(HttpSC.OK_200, responseHandler.statusCode);
+ assertEquals(WebContent.contentTypeTextPlain, responseHandler.contentType);
+ assertEquals(WebContent.charsetUTF8, responseHandler.encoding);
+ assertTrue(responseHandler.content.contains("fuseki_requests_good"));
}
static class RecordingResponseHandler implements HttpResponseHandler {
@@ -63,7 +60,5 @@ public class TestMetrics extends AbstractFusekiTest {
encoding = substringAfter(rawContentType, "charset=");
content = IOUtils.toString( response.getEntity().getContent(), encoding);
}
-
}
-
}