From 2180bc73114572b1de22ee8d361db9cfa4466bcb Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 16:21:53 +0530 Subject: [PATCH 1/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a300dd7..0542cc3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.3 + 1.2.4-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.2.3 + HEAD From ffd6c00d7cd9a9509696f63c6d4615d3a8d2a615 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 16:27:23 +0530 Subject: [PATCH 2/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0807ba2..272e441 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ See https://www.semantics3.com for more information. ``` -* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.2/Sem3Java-1.2.2-jar-with-dependencies.jar) is also available as a fat jar. +* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.3/Sem3Java-1.2.3-jar-with-dependencies.jar) is also available as a fat jar. ## Getting Started From 30efd6c141897a873f9550a5065480180639ce7a Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 16:28:40 +0530 Subject: [PATCH 3/9] Update version number in mvn install. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 272e441..69e5764 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ See https://www.semantics3.com for more information. com.semantics3 Sem3Java - 1.2.2 + 1.2.3 ``` From dfdf78a86f75f1c61f92ec28b2a602eb9efc87e8 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:08:24 +0530 Subject: [PATCH 4/9] Fix failing test case. --- src/test/java/com/semantics3/api/ProductsTest.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/test/java/com/semantics3/api/ProductsTest.java b/src/test/java/com/semantics3/api/ProductsTest.java index c14de75..c195143 100644 --- a/src/test/java/com/semantics3/api/ProductsTest.java +++ b/src/test/java/com/semantics3/api/ProductsTest.java @@ -68,13 +68,7 @@ public void TestCategoryIDQuery() throws OAuthExpectationFailedException, OAuthC Properties property = TestUtils.getConfig("api.config"); Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); products - .categoriesField("cat_id", 4992); - JSONObject results = products.getCategories(); - JSONArray resultsArray = (JSONArray) results.get("results"); - assertThat(resultsArray.length() > 0, is(true)); - } - - @Test + .categoriesField("cat_id", 4992); JSONObject results = products.getCategories(); JSONArray resultsArray = (JSONArray) results.get("results"); assertThat(resultsArray.length() > 0, is(true)); } @Test public void TestSKUQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException, URISyntaxException { Properties property = TestUtils.getConfig("api.config"); Semantics3Request semantics3Request = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); From aeaa551a8cc18e55ded3af56c20ab63ad465a964 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:08:54 +0530 Subject: [PATCH 5/9] Add error code to exception. --- .../com/semantics3/api/Semantics3Request.java | 22 ++++++++++++++----- .../java/com/semantics3/api/ProductsTest.java | 9 ++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/semantics3/api/Semantics3Request.java b/src/main/java/com/semantics3/api/Semantics3Request.java index c5cce25..f3c3b87 100644 --- a/src/main/java/com/semantics3/api/Semantics3Request.java +++ b/src/main/java/com/semantics3/api/Semantics3Request.java @@ -99,7 +99,13 @@ protected JSONObject fetch(String endpoint, String params) throws catch (IOException e) { InputStream error = ((HttpURLConnection) request).getErrorStream(); JSONObject json = new JSONObject(new JSONTokener(error)); - json.put("code", "Error"); + if (!json.has("code")) { + json.put("code", "Error"); + } + else { + Object value = json.get("code"); + json.put("code", value.toString()); + } return json; } } @@ -145,7 +151,13 @@ protected JSONObject fetch(String endpoint, String method, HashMap 0, is(true)); } + @Test(expected = Semantics3Exception.class) + public void TestSiteQuery() throws IOException, OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, URISyntaxException { + Properties property = TestUtils.getConfig("api.config"); + Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + products .productsField("url", "zsdfseobn.com/sdgeafg"); + JSONObject results = products.getProducts(); + } + @Ignore public void TestPagination() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException, URISyntaxException { Properties property = TestUtils.getConfig("api.config"); From 8b1e4f3b130f71622eae41aac8b2458f18e46fdc Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:10:58 +0530 Subject: [PATCH 6/9] [maven-release-plugin] prepare release Sem3Java-1.2.4 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0542cc3..34faf84 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.4-SNAPSHOT + 1.2.4 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.2.4 From 26f267c547dfb650e554bfc0f505981f90825aab Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:11:08 +0530 Subject: [PATCH 7/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 34faf84..cea89bf 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.4 + 1.2.5-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.2.4 + HEAD From 4b3eda08a51b076b05260245d1ebd6c70d037c6c Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:21:04 +0530 Subject: [PATCH 8/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 69e5764..fef66c4 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ See https://www.semantics3.com for more information. com.semantics3 Sem3Java - 1.2.3 + 1.2.4 ``` -* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.3/Sem3Java-1.2.3-jar-with-dependencies.jar) is also available as a fat jar. +* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.4/Sem3Java-1.2.4-jar-with-dependencies.jar) is also available as a fat jar. ## Getting Started From 5ccbab5721b0b2d049a98f9f88bba78b8754741a Mon Sep 17 00:00:00 2001 From: Amarnath Ravikumar Date: Fri, 14 Apr 2017 17:48:46 +0530 Subject: [PATCH 9/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fef66c4..79cbf36 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://www.semantics3.com for more information. In order to use the client, you must have both an API key and an API secret. To obtain your key and secret, you need to first create an account at https://www.semantics3.com/ -You can access your API access credentials from the user dashboard at https://www.semantics3.com/dashboard/applications +You can access your API access credentials from the user dashboard at https://dashboard.semantics3.com. ### Setup Work