You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by iv...@apache.org on 2015/07/17 12:39:20 UTC
[1/2] incubator-ignite git commit: #ignite-961: add javadoc for
JettyRestProcessorAbstractSelfTest.makePostRequest
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-961 e134cd979 -> 7b793af9d
#ignite-961: add javadoc for JettyRestProcessorAbstractSelfTest.makePostRequest
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3d94e849
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3d94e849
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3d94e849
Branch: refs/heads/ignite-961
Commit: 3d94e849c118aa89a108dac91c08e20bd9238e96
Parents: e134cd9
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Jul 17 13:30:02 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Jul 17 13:30:02 2015 +0300
----------------------------------------------------------------------
.../rest/JettyRestProcessorAbstractSelfTest.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d94e849/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index 04f4a2a..67913e4 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -101,7 +101,15 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
return buf.toString();
}
- private String makePostRequest(Map<String, String> params, String urlParameters) throws Exception {
+ /**
+ * Runs post request.
+ *
+ * @param params Url parameters.
+ * @param postParams Post parameters.
+ * @return Request result.
+ * @throws Exception If failed.
+ */
+ private String makePostRequest(Map<String, String> params, String postParams) throws Exception {
String addr = "http://" + LOC_HOST + ":" + restPort() + "/ignite?";
for (Map.Entry<String, String> e : params.entrySet())
@@ -109,7 +117,7 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
URL url = new URL(addr);
- byte[] data = urlParameters.getBytes(Charset.forName("UTF-8"));
+ byte[] data = postParams.getBytes(Charset.forName("UTF-8"));
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
@@ -130,7 +138,7 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
conn.setDoOutput(true);
try (PrintStream wr = new PrintStream(conn.getOutputStream())) {
- wr.print(urlParameters);
+ wr.print(postParams);
wr.flush();
wr.close();
}
[2/2] incubator-ignite git commit: #ignite-961: fix class
Posted by iv...@apache.org.
#ignite-961: fix class
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7b793af9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7b793af9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7b793af9
Branch: refs/heads/ignite-961
Commit: 7b793af9d74593abccb42b62cb5f30930a8079db
Parents: 3d94e84
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Jul 17 13:39:10 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Jul 17 13:39:10 2015 +0300
----------------------------------------------------------------------
.../http/jetty/GlassfishScriptingConverter.java | 68 --------------------
.../jetty/RestGlassFishScriptingConverter.java | 68 ++++++++++++++++++++
2 files changed, 68 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7b793af9/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GlassfishScriptingConverter.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GlassfishScriptingConverter.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GlassfishScriptingConverter.java
deleted file mode 100644
index dc56550..0000000
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GlassfishScriptingConverter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.rest.protocols.http.jetty;
-
-import org.apache.ignite.internal.processors.scripting.*;
-import org.apache.ignite.json.*;
-
-import javax.json.*;
-import java.util.*;
-
-/**
- * Converter for glassfish objects.
- */
-public class GlassFishScriptingConverter extends IgniteScriptingConverter {
- /** {@inheritDoc} */
- @Override public Object toJavaObject(Object o) {
- if (o == null)
- return null;
-
- if (o instanceof Map) {
- Map o1 = (Map)o;
-
- JSONCacheObject res = new JSONCacheObject();
-
- for (Object key : o1.keySet())
- res.put(toJavaObject(key), toJavaObject(o1.get(key)));
-
- return res;
- }
- else if (o instanceof List) {
- List o1 = (List) o;
-
- List<Object> val = new ArrayList<>();
-
- for (Object v : o1)
- val.add(toJavaObject(v));
-
- return val;
- }
- else if (o instanceof JsonString)
- return ((JsonString) o).getString();
- else if (o instanceof JsonNumber)
- return ((JsonNumber) o).intValue();
- else if (o.equals(JsonValue.FALSE))
- return false;
- else if (o.equals(JsonValue.TRUE))
- return true;
- else if (o.equals(JsonValue.NULL))
- return null;
-
- return o;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7b793af9/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestGlassFishScriptingConverter.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestGlassFishScriptingConverter.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestGlassFishScriptingConverter.java
new file mode 100644
index 0000000..87e86c0
--- /dev/null
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/RestGlassFishScriptingConverter.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.rest.protocols.http.jetty;
+
+import org.apache.ignite.internal.processors.scripting.*;
+import org.apache.ignite.json.*;
+
+import javax.json.*;
+import java.util.*;
+
+/**
+ * Converter for glassfish objects.
+ */
+public class RestGlassFishScriptingConverter extends IgniteScriptingConverter {
+ /** {@inheritDoc} */
+ @Override public Object toJavaObject(Object o) {
+ if (o == null)
+ return null;
+
+ if (o instanceof Map) {
+ Map o1 = (Map)o;
+
+ JSONCacheObject res = new JSONCacheObject();
+
+ for (Object key : o1.keySet())
+ res.put(toJavaObject(key), toJavaObject(o1.get(key)));
+
+ return res;
+ }
+ else if (o instanceof List) {
+ List o1 = (List) o;
+
+ List<Object> val = new ArrayList<>();
+
+ for (Object v : o1)
+ val.add(toJavaObject(v));
+
+ return val;
+ }
+ else if (o instanceof JsonString)
+ return ((JsonString) o).getString();
+ else if (o instanceof JsonNumber)
+ return ((JsonNumber) o).intValue();
+ else if (o.equals(JsonValue.FALSE))
+ return false;
+ else if (o.equals(JsonValue.TRUE))
+ return true;
+ else if (o.equals(JsonValue.NULL))
+ return null;
+
+ return o;
+ }
+}