This is an automated email from the git hooks/post-receive script. tmancill pushed a commit to branch master in repository unirest-java.
commit c1049026ef4b0fc574a8f9e7955b64ea59fbcc4c Author: tony mancill <[email protected]> Date: Mon Nov 14 21:36:23 2016 -0800 Import Debian patch 1.4.8-1 --- debian/README.source | 9 + debian/changelog | 5 + debian/compat | 1 + debian/control | 34 ++ debian/copyright | 32 ++ debian/libunirest-java-java.poms | 28 ++ debian/maven.cleanIgnoreRules | 1 + debian/maven.ignoreRules | 7 + debian/maven.properties | 5 + debian/maven.publishedRules | 3 + debian/maven.rules | 7 + debian/patches/disable_external_web_tests.patch | 340 ++++++++++++++++ debian/patches/json_lib.patch | 518 ++++++++++++++++++++++++ debian/patches/json_lib.patch.0 | 89 ++++ debian/patches/series | 2 + debian/rules | 7 + debian/source/format | 1 + 17 files changed, 1089 insertions(+) diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..3a4dc35 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,9 @@ +Information about unirest-java +------------------------------ + +This package was debianized using the mh_make command +from the maven-debian-helper package. + +The build system uses Maven but prevents it from downloading +anything from the Internet, making the build compliant with +the Debian policy. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..58c45c5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +unirest-java (1.4.8-1) unstable; urgency=medium + + * Initial release (Closes: #819672) + + -- tony mancill <[email protected]> Mon, 14 Nov 2016 21:36:23 -0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..87760d0 --- /dev/null +++ b/debian/control @@ -0,0 +1,34 @@ +Source: unirest-java +Section: java +Priority: optional +Maintainer: Debian Java Maintainers <[email protected]> +Uploaders: tony mancill <[email protected]> +Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper (>= 2.1) +Build-Depends-Indep: libandroid-json-java, libhttpasyncclient-java, libhttpclient-java, + libhttpmime-java, junit4, libcommons-io-java, libjackson2-databind-java +Standards-Version: 3.9.8 +Vcs-Git: https://anonscm.debian.org/git/pkg-java/unirest-java.git +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/unirest-java.git +Homepage: http://unirest.io/ + +Package: libunirest-java-java +Architecture: all +Depends: ${misc:Depends}, ${maven:Depends} +Suggests: ${maven:OptionalDepends} +Description: Simplified, lightweight HTTP client library + Unirest is a set of lightweight HTTP libraries + available in multiple languages + . + Features: + . + * Make GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS requests + * Both synchronous and asynchronous (non-blocking) requests + * It supports form parameters, file uploads and custom body entities + * Easily add route parameters without ugly string concatenations + * Supports gzip + * Supports Basic Authentication natively + * Customizable timeout, concurrency levels and proxy settings + * Customizable default headers for every request (DRY) + * Customizable HttpClient and HttpAsyncClient implementation + * Automatic JSON parsing into a native object for JSON responses + * Customizable binding, with mapping from response body to java Object diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..33413d0 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,32 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: unirest-java +Source: https://github.com/Mashape/unirest-java + +Files: * +Copyright: 2016, Mashape <[email protected]> +License: MIT + +Files: debian/* +Copyright: 2016, tony mancill <[email protected]> + 2016, Oliver Kopp <[email protected]> +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/debian/libunirest-java-java.poms b/debian/libunirest-java-java.poms new file mode 100644 index 0000000..5ad70f2 --- /dev/null +++ b/debian/libunirest-java-java.poms @@ -0,0 +1,28 @@ +# List of POM files for the package +# Format of this file is: +# <path to pom file> [option]* +# where option can be: +# --ignore: ignore this POM and its artifact if any +# --ignore-pom: don't install the POM. To use on POM files that are created +# temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms] +# --no-parent: remove the <parent> tag from the POM +# --package=<package>: an alternative package to use when installing this POM +# and its artifact +# --has-package-version: to indicate that the original version of the POM is the same as the upstream part +# of the version for the package. +# --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM +# during a clean operation with mh_cleanpom or mh_installpom +# --artifact=<path>: path to the build artifact associated with this POM, +# it will be installed when using the command mh_install. [mh_install] +# --java-lib: install the jar into /usr/share/java to comply with Debian +# packaging guidelines +# --usj-name=<name>: name to use when installing the library in /usr/share/java +# --usj-version=<version>: version to use when installing the library in /usr/share/java +# --no-usj-versionless: don't install the versionless link in /usr/share/java +# --dest-jar=<path>: the destination for the real jar. +# It will be installed with mh_install. [mh_install] +# --classifier=<classifier>: Optional, the classifier for the jar. Empty by default. +# --site-xml=<location>: Optional, the location for site.xml if it needs to be installed. +# Empty by default. [mh_install] +# +pom.xml --no-parent --has-package-version diff --git a/debian/maven.cleanIgnoreRules b/debian/maven.cleanIgnoreRules new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/debian/maven.cleanIgnoreRules @@ -0,0 +1 @@ + diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules new file mode 100644 index 0000000..28b06bd --- /dev/null +++ b/debian/maven.ignoreRules @@ -0,0 +1,7 @@ + +#com.fasterxml.jackson.core jackson-databind * * * * +#commons-io commons-io * * * * +#junit junit * * * * +org.apache.maven.plugins maven-assembly-plugin * * * * +org.apache.maven.plugins maven-javadoc-plugin * * * * +org.apache.maven.plugins maven-source-plugin * * * * diff --git a/debian/maven.properties b/debian/maven.properties new file mode 100644 index 0000000..507de12 --- /dev/null +++ b/debian/maven.properties @@ -0,0 +1,5 @@ +# Include here properties to pass to Maven during the build. + +# disabling the tests, which make HTTP requests to external networks +#maven.test.skip=true + diff --git a/debian/maven.publishedRules b/debian/maven.publishedRules new file mode 100644 index 0000000..3b60dff --- /dev/null +++ b/debian/maven.publishedRules @@ -0,0 +1,3 @@ + +com.mashape.unirest unirest-java jar * * * +com.mashape.unirest unirest-java jar s/.*/debian/ * * diff --git a/debian/maven.rules b/debian/maven.rules new file mode 100644 index 0000000..f1dab1a --- /dev/null +++ b/debian/maven.rules @@ -0,0 +1,7 @@ + +com.fasterxml.jackson.core jackson-databind bundle s/2\..*/2.x/ * * +com.fasterxml.jackson.core jackson-databind jar s/2\..*/2.x/ * * +com.fasterxml.jackson.core jackson-core jar s/2\..*/2.x/ * * +junit junit jar s/4\..*/4.x/ * * +s/org.json/com.android/ json jar s/.*/debian/ * * +org.apache.httpcomponents httpasyncclient jar s/.*/debian/ * * diff --git a/debian/patches/disable_external_web_tests.patch b/debian/patches/disable_external_web_tests.patch new file mode 100644 index 0000000..f165369 --- /dev/null +++ b/debian/patches/disable_external_web_tests.patch @@ -0,0 +1,340 @@ +Description: Disable unit-tests that query external sites (httpbin.org). +Author: tony mancill <[email protected]> +Forwarded: not-needed + +--- a/src/test/java/com/mashape/unirest/test/http/UnirestTest.java ++++ b/src/test/java/com/mashape/unirest/test/http/UnirestTest.java +@@ -42,6 +42,7 @@ + import org.json.JSONException; + import org.json.JSONObject; + import org.junit.Before; ++import org.junit.Ignore; + import org.junit.Test; + + import java.io.*; +@@ -76,6 +77,7 @@ + throw new RuntimeException("Couldn't find an available IP address in the range of 192.168.0.100-255"); + } + ++ @Ignore + @Test + public void testRequests() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post").header("accept", "application/json").field("param1", "value1").field("param2", "bye").asJson(); +@@ -93,6 +95,7 @@ + assertNotNull(json.getArray().get(0)); + } + ++ @Ignore + @Test + public void testGet() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get?name=mark").asJson(); +@@ -102,6 +105,7 @@ + assertEquals(response.getBody().getObject().getJSONObject("args").getString("name"), "mark2"); + } + ++ @Ignore + @Test + public void testGetUTF8() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("param3", "こんにちは").asJson(); +@@ -109,6 +113,7 @@ + assertEquals(response.getBody().getObject().getJSONObject("args").getString("param3"), "こんにちは"); + } + ++ @Ignore + @Test + public void testPostUTF8() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("param3", "こんにちは").asJson(); +@@ -116,6 +121,7 @@ + assertEquals(response.getBody().getObject().getJSONObject("form").getString("param3"), "こんにちは"); + } + ++ @Ignore + @Test + public void testPostBinaryUTF8() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("param3", "こんにちは").field("file", new File(getClass().getResource("/test").toURI())).asJson(); +@@ -124,6 +130,7 @@ + assertEquals("こんにちは", response.getBody().getObject().getJSONObject("form").getString("param3")); + } + ++ @Ignore + @Test + public void testPostRawBody() throws Exception { + String sourceString = "'\"@こんにちは-test-123-" + Math.random(); +@@ -134,6 +141,7 @@ + assertEquals(sourceString, response.getBody().getObject().getString("data")); + } + ++ @Ignore + @Test + public void testCustomUserAgent() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get?name=mark").header("user-agent", "hello-world").asJson(); +@@ -146,6 +154,7 @@ + + } + ++ @Ignore + @Test + public void testGetMultiple() throws Exception { + for (int i = 1; i <= 20; i++) { +@@ -154,6 +163,7 @@ + } + } + ++ @Ignore + @Test + public void testGetFields() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("name", "mark").queryString("nick", "thefosk").asJson(); +@@ -161,12 +171,14 @@ + assertEquals(response.getBody().getObject().getJSONObject("args").getString("nick"), "thefosk"); + } + ++ @Ignore + @Test + public void testGetFields2() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("email", "[email protected]").asJson(); + assertEquals("[email protected]", response.getBody().getObject().getJSONObject("args").getString("email")); + } + ++ @Ignore + @Test + public void testQueryStringEncoding() throws Exception { + String testKey = "email2=someKey&email"; +@@ -175,6 +187,7 @@ + assertEquals(testValue, response.getBody().getObject().getJSONObject("args").getString(testKey)); + } + ++ @Ignore + @Test + public void testDelete() throws Exception { + HttpResponse<JsonNode> response = Unirest.delete("http://httpbin.org/delete").asJson(); +@@ -184,6 +197,7 @@ + assertEquals("mark", response.getBody().getObject().getJSONObject("form").getString("name")); + } + ++ @Ignore + @Test + public void testDeleteBody() throws Exception { + String body = "{\"jsonString\":{\"members\":\"members1\"}}"; +@@ -192,12 +206,14 @@ + assertEquals(body, response.getBody().getObject().getString("data")); + } + ++ @Ignore + @Test + public void testBasicAuth() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/headers").basicAuth("user", "test").asJson(); + assertEquals("Basic dXNlcjp0ZXN0", response.getBody().getObject().getJSONObject("headers").getString("Authorization")); + } + ++ @Ignore + @Test + public void testAsync() throws Exception { + Future<HttpResponse<JsonNode>> future = Unirest.post("http://httpbin.org/post").header("accept", "application/json").field("param1", "value1").field("param2", "bye").asJsonAsync(); +@@ -218,6 +234,7 @@ + assertNotNull(json.getArray().get(0)); + } + ++ @Ignore + @Test + public void testAsyncCallback() throws Exception { + Unirest.post("http://httpbin.org/post").header("accept", "application/json").field("param1", "value1").field("param2", "bye").asJsonAsync(new Callback<JsonNode>() { +@@ -258,6 +275,7 @@ + assertTrue(status); + } + ++ @Ignore + @Test + public void testMultipart() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new File(getClass().getResource("/test").toURI())).asJson(); +@@ -278,6 +296,7 @@ + assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); + } + ++ @Ignore + @Test + public void testMultipartContentType() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new File(getClass().getResource("/image.jpg").toURI()), "image/jpeg").asJson(); +@@ -298,6 +317,7 @@ + assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); + } + ++ @Ignore + @Test + public void testMultipartInputStreamContentType() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new FileInputStream(new File(getClass().getResource("/image.jpg").toURI())), ContentType.APPLICATION_OCTET_STREAM, "image.jpg").asJson(); +@@ -318,6 +338,7 @@ + assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); + } + ++ @Ignore + @Test + public void testMultipartInputStreamContentTypeAsync() throws Exception { + Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new FileInputStream(new File(getClass().getResource("/test").toURI())), ContentType.APPLICATION_OCTET_STREAM, "test").asJsonAsync(new Callback<JsonNode>() { +@@ -360,6 +381,7 @@ + assertTrue(status); + } + ++ @Ignore + @Test + public void testMultipartByteContentType() throws Exception { + final InputStream stream = new FileInputStream(new File(getClass().getResource("/image.jpg").toURI())); +@@ -384,6 +406,7 @@ + assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); + } + ++ @Ignore + @Test + public void testMultipartByteContentTypeAsync() throws Exception { + final InputStream stream = new FileInputStream(new File(getClass().getResource("/test").toURI())); +@@ -429,6 +452,7 @@ + assertTrue(status); + } + ++ @Ignore + @Test + public void testMultipartAsync() throws Exception { + Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new File(getClass().getResource("/test").toURI())).asJsonAsync(new Callback<JsonNode>() { +@@ -469,6 +493,7 @@ + assertTrue(status); + } + ++ @Ignore + @Test + public void testGzip() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.get("http://httpbin.org/gzip").asJson(); +@@ -482,6 +507,7 @@ + assertTrue(json.getObject().getBoolean("gzipped")); + } + ++ @Ignore + @Test + public void testGzipAsync() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.get("http://httpbin.org/gzip").asJsonAsync().get(); +@@ -495,6 +521,7 @@ + assertTrue(json.getObject().getBoolean("gzipped")); + } + ++ @Ignore + @Test + public void testDefaultHeaders() throws Exception { + Unirest.setDefaultHeader("X-Custom-Header", "hello"); +@@ -545,6 +572,7 @@ + } + } + ++ @Ignore + @Test + public void testPathParameters() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.get("http://httpbin.org/{method}").routeParam("method", "get").queryString("name", "Mark").asJson(); +@@ -553,6 +581,7 @@ + assertEquals(jsonResponse.getBody().getObject().getJSONObject("args").getString("name"), "Mark"); + } + ++ @Ignore + @Test + public void testQueryAndBodyParameters() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/{method}").routeParam("method", "post").queryString("name", "Mark").field("wot", "wat").asJson(); +@@ -562,6 +591,7 @@ + assertEquals(jsonResponse.getBody().getObject().getJSONObject("form").getString("wot"), "wat"); + } + ++ @Ignore + @Test + public void testPathParameters2() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.patch("http://httpbin.org/{method}").routeParam("method", "patch").field("name", "Mark").asJson(); +@@ -571,6 +601,7 @@ + assertEquals(jsonResponse.getBody().getObject().getJSONObject("form").getString("name"), "Mark"); + } + ++ @Ignore + @Test + public void testMissingPathParameter() throws Exception { + try { +@@ -581,6 +612,7 @@ + } + } + ++ @Ignore + @Test + public void parallelTest() throws Exception { + Unirest.setConcurrency(10, 5); +@@ -616,6 +648,7 @@ + newFixedThreadPool.awaitTermination(10, TimeUnit.MINUTES); + } + ++ @Ignore + @Test + public void testAsyncCustomContentType() throws Exception { + Unirest.post("http://httpbin.org/post").header("accept", "application/json").header("Content-Type", "application/json").body("{\"hello\":\"world\"}").asJsonAsync(new Callback<JsonNode>() { +@@ -646,6 +679,7 @@ + assertTrue(status); + } + ++ @Ignore + @Test + public void testAsyncCustomContentTypeAndFormParams() throws Exception { + Unirest.post("http://httpbin.org/post").header("accept", "application/json").header("Content-Type", "application/x-www-form-urlencoded").field("name", "Mark").field("hello", "world").asJsonAsync(new Callback<JsonNode>() { +@@ -676,6 +710,7 @@ + assertTrue(status); + } + ++ @Ignore + @Test + public void testGetQuerystringArray() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("name", "Mark").queryString("name", "Tom").asJson(); +@@ -687,6 +722,7 @@ + assertEquals("Tom", names.getString(1)); + } + ++ @Ignore + @Test + public void testPostMultipleFiles() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("param3", "wot").field("file1", new File(getClass().getResource("/test").toURI())).field("file2", new File(getClass().getResource("/test").toURI())).asJson(); +@@ -700,6 +736,7 @@ + assertEquals("wot", response.getBody().getObject().getJSONObject("form").getString("param3")); + } + ++ @Ignore + @Test + public void testGetArray() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("name", Arrays.asList("Mark", "Tom")).asJson(); +@@ -711,6 +748,7 @@ + assertEquals("Tom", names.getString(1)); + } + ++ @Ignore + @Test + public void testPostArray() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("name", "Mark").field("name", "Tom").asJson(); +@@ -722,6 +760,7 @@ + assertEquals("Tom", names.getString(1)); + } + ++ @Ignore + @Test + public void testPostCollection() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("name", Arrays.asList("Mark", "Tom")).asJson(); +@@ -733,6 +772,7 @@ + assertEquals("Tom", names.getString(1)); + } + ++ @Ignore + @Test + public void testCaseInsensitiveHeaders() throws Exception { + GetRequest request = Unirest.get("http://httpbin.org/headers").header("Name", "Marco"); +@@ -787,6 +827,7 @@ + } + } + ++ @Ignore + @Test + public void testObjectMapperRead() throws Exception { + Unirest.setObjectMapper(new JacksonObjectMapper()); +@@ -800,6 +841,7 @@ + assertEquals(getResponse.getBody().getUrl(), getResponseMock.getUrl()); + } + ++ @Ignore + @Test + public void testObjectMapperWrite() throws Exception { + Unirest.setObjectMapper(new JacksonObjectMapper()); diff --git a/debian/patches/json_lib.patch b/debian/patches/json_lib.patch new file mode 100644 index 0000000..35c0a52 --- /dev/null +++ b/debian/patches/json_lib.patch @@ -0,0 +1,518 @@ +Description: Update UnirestTest to compile with android-json +Author: Oliver Kopp <[email protected]> +Date: Wed, 2 Nov 2016 14:33:45 +0100 +Subject: [PATCH] Replace org.json JSON library by Android SDK's cleanroom + implementation + +--- +diff --git a/src/test/java/com/mashape/unirest/test/http/UnirestTest.java b/src/test/java/com/mashape/unirest/test/http/UnirestTest.java +index e7145a7..e7f61da 100644 +Author: Oliver Kopp <[email protected]> + +--- a/src/test/java/com/mashape/unirest/test/http/UnirestTest.java ++++ b/src/test/java/com/mashape/unirest/test/http/UnirestTest.java +@@ -65,7 +65,7 @@ public void setUp() { + status = false; + } + +- private String findAvailableIpAddress() throws UnknownHostException, IOException { ++ private String findAvailableIpAddress() throws Exception { + for (int i = 100; i <= 255; i++) { + String ip = "192.168.1." + i; + if (!InetAddress.getByName(ip).isReachable(1000)) { +@@ -77,7 +77,7 @@ private String findAvailableIpAddress() throws UnknownHostException, IOException + } + + @Test +- public void testRequests() throws JSONException, UnirestException { ++ public void testRequests() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post").header("accept", "application/json").field("param1", "value1").field("param2", "bye").asJson(); + + assertTrue(jsonResponse.getHeaders().size() > 0); +@@ -94,7 +94,7 @@ public void testRequests() throws JSONException, UnirestException { + } + + @Test +- public void testGet() throws JSONException, UnirestException { ++ public void testGet() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get?name=mark").asJson(); + assertEquals(response.getBody().getObject().getJSONObject("args").getString("name"), "mark"); + +@@ -103,21 +103,21 @@ public void testGet() throws JSONException, UnirestException { + } + + @Test +- public void testGetUTF8() throws UnirestException { ++ public void testGetUTF8() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("param3", "こんにちは").asJson(); + + assertEquals(response.getBody().getObject().getJSONObject("args").getString("param3"), "こんにちは"); + } + + @Test +- public void testPostUTF8() throws UnirestException { ++ public void testPostUTF8() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("param3", "こんにちは").asJson(); + + assertEquals(response.getBody().getObject().getJSONObject("form").getString("param3"), "こんにちは"); + } + + @Test +- public void testPostBinaryUTF8() throws UnirestException, URISyntaxException { ++ public void testPostBinaryUTF8() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("param3", "こんにちは").field("file", new File(getClass().getResource("/test").toURI())).asJson(); + + assertEquals("This is a test file", response.getBody().getObject().getJSONObject("files").getString("file")); +@@ -125,7 +125,7 @@ public void testPostBinaryUTF8() throws UnirestException, URISyntaxException { + } + + @Test +- public void testPostRawBody() throws UnirestException, URISyntaxException, IOException { ++ public void testPostRawBody() throws Exception { + String sourceString = "'\"@こんにちは-test-123-" + Math.random(); + byte[] sentBytes = sourceString.getBytes(); + +@@ -135,7 +135,7 @@ public void testPostRawBody() throws UnirestException, URISyntaxException, IOExc + } + + @Test +- public void testCustomUserAgent() throws JSONException, UnirestException { ++ public void testCustomUserAgent() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get?name=mark").header("user-agent", "hello-world").asJson(); + assertEquals("hello-world", response.getBody().getObject().getJSONObject("headers").getString("User-Agent")); + +@@ -147,7 +147,7 @@ public void testCustomUserAgent() throws JSONException, UnirestException { + } + + @Test +- public void testGetMultiple() throws JSONException, UnirestException { ++ public void testGetMultiple() throws Exception { + for (int i = 1; i <= 20; i++) { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get?try=" + i).asJson(); + assertEquals(response.getBody().getObject().getJSONObject("args").getString("try"), ((Integer) i).toString()); +@@ -155,20 +155,20 @@ public void testGetMultiple() throws JSONException, UnirestException { + } + + @Test +- public void testGetFields() throws JSONException, UnirestException { ++ public void testGetFields() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("name", "mark").queryString("nick", "thefosk").asJson(); + assertEquals(response.getBody().getObject().getJSONObject("args").getString("name"), "mark"); + assertEquals(response.getBody().getObject().getJSONObject("args").getString("nick"), "thefosk"); + } + + @Test +- public void testGetFields2() throws JSONException, UnirestException { ++ public void testGetFields2() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("email", "[email protected]").asJson(); + assertEquals("[email protected]", response.getBody().getObject().getJSONObject("args").getString("email")); + } + + @Test +- public void testQueryStringEncoding() throws JSONException, UnirestException { ++ public void testQueryStringEncoding() throws Exception { + String testKey = "email2=someKey&email"; + String testValue = "[email protected]"; + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString(testKey, testValue).asJson(); +@@ -176,7 +176,7 @@ public void testQueryStringEncoding() throws JSONException, UnirestException { + } + + @Test +- public void testDelete() throws JSONException, UnirestException { ++ public void testDelete() throws Exception { + HttpResponse<JsonNode> response = Unirest.delete("http://httpbin.org/delete").asJson(); + assertEquals(200, response.getStatus()); + +@@ -185,7 +185,7 @@ public void testDelete() throws JSONException, UnirestException { + } + + @Test +- public void testDeleteBody() throws JSONException, UnirestException { ++ public void testDeleteBody() throws Exception { + String body = "{\"jsonString\":{\"members\":\"members1\"}}"; + HttpResponse<JsonNode> response = Unirest.delete("http://httpbin.org/delete").body(body).asJson(); + assertEquals(200, response.getStatus()); +@@ -193,13 +193,13 @@ public void testDeleteBody() throws JSONException, UnirestException { + } + + @Test +- public void testBasicAuth() throws JSONException, UnirestException { ++ public void testBasicAuth() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/headers").basicAuth("user", "test").asJson(); + assertEquals("Basic dXNlcjp0ZXN0", response.getBody().getObject().getJSONObject("headers").getString("Authorization")); + } + + @Test +- public void testAsync() throws JSONException, InterruptedException, ExecutionException { ++ public void testAsync() throws Exception { + Future<HttpResponse<JsonNode>> future = Unirest.post("http://httpbin.org/post").header("accept", "application/json").field("param1", "value1").field("param2", "bye").asJsonAsync(); + + assertNotNull(future); +@@ -219,7 +219,7 @@ public void testAsync() throws JSONException, InterruptedException, ExecutionExc + } + + @Test +- public void testAsyncCallback() throws JSONException, InterruptedException, ExecutionException { ++ public void testAsyncCallback() throws Exception { + Unirest.post("http://httpbin.org/post").header("accept", "application/json").field("param1", "value1").field("param2", "bye").asJsonAsync(new Callback<JsonNode>() { + + public void failed(UnirestException e) { +@@ -237,10 +237,13 @@ public void completed(HttpResponse<JsonNode> jsonResponse) { + assertNotNull(json.getObject()); + assertNotNull(json.getArray()); + assertEquals(1, json.getArray().length()); +- assertNotNull(json.getArray().get(0)); +- +- assertEquals("value1", json.getObject().getJSONObject("form").getString("param1")); +- assertEquals("bye", json.getObject().getJSONObject("form").getString("param2")); ++ try { ++ assertNotNull(json.getArray().get(0)); ++ assertEquals("value1", json.getObject().getJSONObject("form").getString("param1")); ++ assertEquals("bye", json.getObject().getJSONObject("form").getString("param2")); ++ } catch (JSONException e) { ++ fail(); ++ } + + status = true; + lock.countDown(); +@@ -256,7 +259,7 @@ public void cancelled() { + } + + @Test +- public void testMultipart() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException { ++ public void testMultipart() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new File(getClass().getResource("/test").toURI())).asJson(); + assertTrue(jsonResponse.getHeaders().size() > 0); + assertTrue(jsonResponse.getBody().toString().length() > 0); +@@ -276,7 +279,7 @@ public void testMultipart() throws JSONException, InterruptedException, Executio + } + + @Test +- public void testMultipartContentType() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException { ++ public void testMultipartContentType() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new File(getClass().getResource("/image.jpg").toURI()), "image/jpeg").asJson(); + assertTrue(jsonResponse.getHeaders().size() > 0); + assertTrue(jsonResponse.getBody().toString().length() > 0); +@@ -296,7 +299,7 @@ public void testMultipartContentType() throws JSONException, InterruptedExceptio + } + + @Test +- public void testMultipartInputStreamContentType() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException, FileNotFoundException { ++ public void testMultipartInputStreamContentType() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new FileInputStream(new File(getClass().getResource("/image.jpg").toURI())), ContentType.APPLICATION_OCTET_STREAM, "image.jpg").asJson(); + assertTrue(jsonResponse.getHeaders().size() > 0); + assertTrue(jsonResponse.getBody().toString().length() > 0); +@@ -316,7 +319,7 @@ public void testMultipartInputStreamContentType() throws JSONException, Interrup + } + + @Test +- public void testMultipartInputStreamContentTypeAsync() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException, FileNotFoundException { ++ public void testMultipartInputStreamContentTypeAsync() throws Exception { + Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new FileInputStream(new File(getClass().getResource("/test").toURI())), ContentType.APPLICATION_OCTET_STREAM, "test").asJsonAsync(new Callback<JsonNode>() { + + public void failed(UnirestException e) { +@@ -334,10 +337,14 @@ public void completed(HttpResponse<JsonNode> response) { + assertNotNull(json.getObject()); + assertNotNull(json.getArray()); + assertEquals(1, json.getArray().length()); +- assertNotNull(json.getArray().get(0)); ++ try { ++ assertNotNull(json.getArray().get(0)); ++ assertEquals("This is a test file", json.getObject().getJSONObject("files").getString("file")); ++ assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); ++ } catch (JSONException e) { ++ fail(); ++ } + +- assertEquals("This is a test file", json.getObject().getJSONObject("files").getString("file")); +- assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); + + status = true; + lock.countDown(); +@@ -354,7 +361,7 @@ public void cancelled() { + } + + @Test +- public void testMultipartByteContentType() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException, IOException { ++ public void testMultipartByteContentType() throws Exception { + final InputStream stream = new FileInputStream(new File(getClass().getResource("/image.jpg").toURI())); + final byte[] bytes = new byte[stream.available()]; + stream.read(bytes); +@@ -378,7 +385,7 @@ public void testMultipartByteContentType() throws JSONException, InterruptedExce + } + + @Test +- public void testMultipartByteContentTypeAsync() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException, IOException { ++ public void testMultipartByteContentTypeAsync() throws Exception { + final InputStream stream = new FileInputStream(new File(getClass().getResource("/test").toURI())); + final byte[] bytes = new byte[stream.available()]; + stream.read(bytes); +@@ -400,10 +407,13 @@ public void completed(HttpResponse<JsonNode> response) { + assertNotNull(json.getObject()); + assertNotNull(json.getArray()); + assertEquals(1, json.getArray().length()); +- assertNotNull(json.getArray().get(0)); +- +- assertEquals("This is a test file", json.getObject().getJSONObject("files").getString("file")); +- assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); ++ try { ++ assertNotNull(json.getArray().get(0)); ++ assertEquals("This is a test file", json.getObject().getJSONObject("files").getString("file")); ++ assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); ++ } catch (JSONException e) { ++ fail(); ++ } + + status = true; + lock.countDown(); +@@ -420,7 +430,7 @@ public void cancelled() { + } + + @Test +- public void testMultipartAsync() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException { ++ public void testMultipartAsync() throws Exception { + Unirest.post("http://httpbin.org/post").field("name", "Mark").field("file", new File(getClass().getResource("/test").toURI())).asJsonAsync(new Callback<JsonNode>() { + + public void failed(UnirestException e) { +@@ -438,11 +448,13 @@ public void completed(HttpResponse<JsonNode> response) { + assertNotNull(json.getObject()); + assertNotNull(json.getArray()); + assertEquals(1, json.getArray().length()); +- assertNotNull(json.getArray().get(0)); +- +- assertEquals("This is a test file", json.getObject().getJSONObject("files").getString("file")); +- assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); +- ++ try { ++ assertNotNull(json.getArray().get(0)); ++ assertEquals("This is a test file", json.getObject().getJSONObject("files").getString("file")); ++ assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); ++ } catch (JSONException e) { ++ fail(); ++ } + status = true; + lock.countDown(); + } +@@ -458,7 +470,7 @@ public void cancelled() { + } + + @Test +- public void testGzip() throws UnirestException, JSONException { ++ public void testGzip() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.get("http://httpbin.org/gzip").asJson(); + assertTrue(jsonResponse.getHeaders().size() > 0); + assertTrue(jsonResponse.getBody().toString().length() > 0); +@@ -471,7 +483,7 @@ public void testGzip() throws UnirestException, JSONException { + } + + @Test +- public void testGzipAsync() throws UnirestException, JSONException, InterruptedException, ExecutionException { ++ public void testGzipAsync() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.get("http://httpbin.org/gzip").asJsonAsync().get(); + assertTrue(jsonResponse.getHeaders().size() > 0); + assertTrue(jsonResponse.getBody().toString().length() > 0); +@@ -484,7 +496,7 @@ public void testGzipAsync() throws UnirestException, JSONException, InterruptedE + } + + @Test +- public void testDefaultHeaders() throws UnirestException, JSONException { ++ public void testDefaultHeaders() throws Exception { + Unirest.setDefaultHeader("X-Custom-Header", "hello"); + Unirest.setDefaultHeader("user-agent", "foobar"); + +@@ -512,7 +524,7 @@ public void testDefaultHeaders() throws UnirestException, JSONException { + } + + @Test +- public void testSetTimeouts() throws UnknownHostException, IOException { ++ public void testSetTimeouts() throws Exception { + String address = "http://" + findAvailableIpAddress() + "/"; + long start = System.currentTimeMillis(); + try { +@@ -534,7 +546,7 @@ public void testSetTimeouts() throws UnknownHostException, IOException { + } + + @Test +- public void testPathParameters() throws UnirestException { ++ public void testPathParameters() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.get("http://httpbin.org/{method}").routeParam("method", "get").queryString("name", "Mark").asJson(); + + assertEquals(200, jsonResponse.getStatus()); +@@ -542,7 +554,7 @@ public void testPathParameters() throws UnirestException { + } + + @Test +- public void testQueryAndBodyParameters() throws UnirestException { ++ public void testQueryAndBodyParameters() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.post("http://httpbin.org/{method}").routeParam("method", "post").queryString("name", "Mark").field("wot", "wat").asJson(); + + assertEquals(200, jsonResponse.getStatus()); +@@ -551,7 +563,7 @@ public void testQueryAndBodyParameters() throws UnirestException { + } + + @Test +- public void testPathParameters2() throws UnirestException { ++ public void testPathParameters2() throws Exception { + HttpResponse<JsonNode> jsonResponse = Unirest.patch("http://httpbin.org/{method}").routeParam("method", "patch").field("name", "Mark").asJson(); + + assertEquals(200, jsonResponse.getStatus()); +@@ -560,7 +572,7 @@ public void testPathParameters2() throws UnirestException { + } + + @Test +- public void testMissingPathParameter() throws UnirestException { ++ public void testMissingPathParameter() throws Exception { + try { + Unirest.get("http://httpbin.org/{method}").routeParam("method222", "get").queryString("name", "Mark").asJson(); + fail(); +@@ -570,7 +582,7 @@ public void testMissingPathParameter() throws UnirestException { + } + + @Test +- public void parallelTest() throws InterruptedException { ++ public void parallelTest() throws Exception { + Unirest.setConcurrency(10, 5); + + long start = System.currentTimeMillis(); +@@ -585,7 +597,7 @@ public void parallelTest() throws InterruptedException { + assertTrue(higherConcurrencyTime < smallerConcurrencyTime); + } + +- private void makeParallelRequests() throws InterruptedException { ++ private void makeParallelRequests() throws Exception { + ExecutorService newFixedThreadPool = Executors.newFixedThreadPool(10); + final AtomicInteger counter = new AtomicInteger(0); + for (int i = 0; i < 200; i++) { +@@ -605,7 +617,7 @@ public void run() { + } + + @Test +- public void testAsyncCustomContentType() throws InterruptedException { ++ public void testAsyncCustomContentType() throws Exception { + Unirest.post("http://httpbin.org/post").header("accept", "application/json").header("Content-Type", "application/json").body("{\"hello\":\"world\"}").asJsonAsync(new Callback<JsonNode>() { + + public void failed(UnirestException e) { +@@ -614,8 +626,12 @@ public void failed(UnirestException e) { + + public void completed(HttpResponse<JsonNode> jsonResponse) { + JsonNode json = jsonResponse.getBody(); +- assertEquals("{\"hello\":\"world\"}", json.getObject().getString("data")); +- assertEquals("application/json", json.getObject().getJSONObject("headers").getString("Content-Type")); ++ try { ++ assertEquals("{\"hello\":\"world\"}", json.getObject().getString("data")); ++ assertEquals("application/json", json.getObject().getJSONObject("headers").getString("Content-Type")); ++ } catch (JSONException e) { ++ fail(); ++ } + + status = true; + lock.countDown(); +@@ -631,7 +647,7 @@ public void cancelled() { + } + + @Test +- public void testAsyncCustomContentTypeAndFormParams() throws InterruptedException { ++ public void testAsyncCustomContentTypeAndFormParams() throws Exception { + Unirest.post("http://httpbin.org/post").header("accept", "application/json").header("Content-Type", "application/x-www-form-urlencoded").field("name", "Mark").field("hello", "world").asJsonAsync(new Callback<JsonNode>() { + + public void failed(UnirestException e) { +@@ -640,11 +656,13 @@ public void failed(UnirestException e) { + + public void completed(HttpResponse<JsonNode> jsonResponse) { + JsonNode json = jsonResponse.getBody(); +- assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); +- assertEquals("world", json.getObject().getJSONObject("form").getString("hello")); +- +- assertEquals("application/x-www-form-urlencoded", json.getObject().getJSONObject("headers").getString("Content-Type")); +- ++ try { ++ assertEquals("Mark", json.getObject().getJSONObject("form").getString("name")); ++ assertEquals("world", json.getObject().getJSONObject("form").getString("hello")); ++ assertEquals("application/x-www-form-urlencoded", json.getObject().getJSONObject("headers").getString("Content-Type")); ++ } catch (JSONException e) { ++ fail(); ++ } + status = true; + lock.countDown(); + } +@@ -659,7 +677,7 @@ public void cancelled() { + } + + @Test +- public void testGetQuerystringArray() throws JSONException, UnirestException { ++ public void testGetQuerystringArray() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("name", "Mark").queryString("name", "Tom").asJson(); + + JSONArray names = response.getBody().getObject().getJSONObject("args").getJSONArray("name"); +@@ -670,7 +688,7 @@ public void testGetQuerystringArray() throws JSONException, UnirestException { + } + + @Test +- public void testPostMultipleFiles() throws JSONException, UnirestException, URISyntaxException { ++ public void testPostMultipleFiles() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("param3", "wot").field("file1", new File(getClass().getResource("/test").toURI())).field("file2", new File(getClass().getResource("/test").toURI())).asJson(); + + JSONObject names = response.getBody().getObject().getJSONObject("files"); +@@ -683,7 +701,7 @@ public void testPostMultipleFiles() throws JSONException, UnirestException, URIS + } + + @Test +- public void testGetArray() throws JSONException, UnirestException { ++ public void testGetArray() throws Exception { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("name", Arrays.asList("Mark", "Tom")).asJson(); + + JSONArray names = response.getBody().getObject().getJSONObject("args").getJSONArray("name"); +@@ -694,7 +712,7 @@ public void testGetArray() throws JSONException, UnirestException { + } + + @Test +- public void testPostArray() throws JSONException, UnirestException { ++ public void testPostArray() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("name", "Mark").field("name", "Tom").asJson(); + + JSONArray names = response.getBody().getObject().getJSONObject("form").getJSONArray("name"); +@@ -705,7 +723,7 @@ public void testPostArray() throws JSONException, UnirestException { + } + + @Test +- public void testPostCollection() throws JSONException, UnirestException { ++ public void testPostCollection() throws Exception { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("name", Arrays.asList("Mark", "Tom")).asJson(); + + JSONArray names = response.getBody().getObject().getJSONObject("form").getJSONArray("name"); +@@ -716,7 +734,7 @@ public void testPostCollection() throws JSONException, UnirestException { + } + + @Test +- public void testCaseInsensitiveHeaders() throws UnirestException { ++ public void testCaseInsensitiveHeaders() throws Exception { + GetRequest request = Unirest.get("http://httpbin.org/headers").header("Name", "Marco"); + assertEquals(1, request.getHeaders().size()); + assertEquals("Marco", request.getHeaders().get("name").get(0)); +@@ -770,7 +788,7 @@ public void setTimeoutsAndCustomClient() { + } + + @Test +- public void testObjectMapperRead() throws UnirestException, IOException { ++ public void testObjectMapperRead() throws Exception { + Unirest.setObjectMapper(new JacksonObjectMapper()); + + GetResponse getResponseMock = new GetResponse(); +@@ -783,7 +801,7 @@ public void testObjectMapperRead() throws UnirestException, IOException { + } + + @Test +- public void testObjectMapperWrite() throws UnirestException, IOException { ++ public void testObjectMapperWrite() throws Exception { + Unirest.setObjectMapper(new JacksonObjectMapper()); + + GetResponse postResponseMock = new GetResponse(); +@@ -796,7 +814,7 @@ public void testObjectMapperWrite() throws UnirestException, IOException { + } + + @Test +- public void testPostProvidesSortedParams() throws IOException { ++ public void testPostProvidesSortedParams() throws Exception { + // Verify that fields are encoded into the body in sorted order. + HttpRequest httpRequest = Unirest.post("test").field("z", "Z").field("y", "Y").field("x", "X").getHttpRequest(); + diff --git a/debian/patches/json_lib.patch.0 b/debian/patches/json_lib.patch.0 new file mode 100644 index 0000000..109115f --- /dev/null +++ b/debian/patches/json_lib.patch.0 @@ -0,0 +1,89 @@ +Description: <short summary of the patch> + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + unirest-java (1.4.8-1) UNRELEASED; urgency=medium + . + * Initial release (Closes: #819692) +Author: tony mancill <[email protected]> +Bug-Debian: https://bugs.debian.org/819692 + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: <vendor|upstream|other>, <url of original patch> +Bug: <url in upstream bugtracker> +Bug-Debian: https://bugs.debian.org/<bugnumber> +Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> +Forwarded: <no|not-needed|url proving that it has been forwarded> +Reviewed-By: <name and email of someone who approved the patch> +Last-Update: 2016-09-21 + +--- a/src/test/java/com/mashape/unirest/test/http/UnirestTest.java ++++ b/src/test/java/com/mashape/unirest/test/http/UnirestTest.java +@@ -103,21 +103,21 @@ + } + + @Test +- public void testGetUTF8() throws UnirestException { ++ public void testGetUTF8() throws UnirestException, JSONException { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("param3", "こんにちは").asJson(); + + assertEquals(response.getBody().getObject().getJSONObject("args").getString("param3"), "こんにちは"); + } + + @Test +- public void testPostUTF8() throws UnirestException { ++ public void testPostUTF8() throws UnirestException, JSONException { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("param3", "こんにちは").asJson(); + + assertEquals(response.getBody().getObject().getJSONObject("form").getString("param3"), "こんにちは"); + } + + @Test +- public void testPostBinaryUTF8() throws UnirestException, URISyntaxException { ++ public void testPostBinaryUTF8() throws UnirestException, URISyntaxException, JSONException { + HttpResponse<JsonNode> response = Unirest.post("http://httpbin.org/post").field("param3", "こんにちは").field("file", new File(getClass().getResource("/test").toURI())).asJson(); + + assertEquals("This is a test file", response.getBody().getObject().getJSONObject("files").getString("file")); +@@ -125,7 +125,7 @@ + } + + @Test +- public void testPostRawBody() throws UnirestException, URISyntaxException, IOException { ++ public void testPostRawBody() throws UnirestException, URISyntaxException, IOException, JSONException { + String sourceString = "'\"@こんにちは-test-123-" + Math.random(); + byte[] sentBytes = sourceString.getBytes(); + +@@ -135,7 +135,7 @@ + } + + @Test +- public void testCustomUserAgent() throws JSONException, UnirestException { ++ public void testCustomUserAgent() throws JSONException, UnirestException, JSONException { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get?name=mark").header("user-agent", "hello-world").asJson(); + assertEquals("hello-world", response.getBody().getObject().getJSONObject("headers").getString("User-Agent")); + +@@ -147,7 +147,7 @@ + } + + @Test +- public void testGetMultiple() throws JSONException, UnirestException { ++ public void testGetMultiple() throws JSONException, UnirestException, JSONException { + for (int i = 1; i <= 20; i++) { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get?try=" + i).asJson(); + assertEquals(response.getBody().getObject().getJSONObject("args").getString("try"), ((Integer) i).toString()); +@@ -155,7 +155,7 @@ + } + + @Test +- public void testGetFields() throws JSONException, UnirestException { ++ public void testGetFields() throws JSONException, UnirestException, JSONException { + HttpResponse<JsonNode> response = Unirest.get("http://httpbin.org/get").queryString("name", "mark").queryString("nick", "thefosk").asJson(); + assertEquals(response.getBody().getObject().getJSONObject("args").getString("name"), "mark"); + assertEquals(response.getBody().getObject().getJSONObject("args").getString("nick"), "thefosk"); diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..e33457b --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +json_lib.patch +disable_external_web_tests.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..aba914b --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=maven + +get-orig-source: + uscan --download-current-version --force-download --no-symlink diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/unirest-java.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

