summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java
diff options
context:
space:
mode:
authorTaras Hupalo <taras.hupalo@gmail.com>2014-08-12 15:28:41 +0300
committerLeif Åstrand <leif@vaadin.com>2014-08-26 09:51:15 +0000
commitf2551a9fc03636deb5fcd3f30c761dca946c8341 (patch)
treeb59bc2c5ea1f7471dec4ef59826614b4f6d0adbf /uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java
parentc8d58261954de18ef67eaf9043bd93360202cf06 (diff)
downloadvaadin-framework-f2551a9fc03636deb5fcd3f30c761dca946c8341.tar.gz
vaadin-framework-f2551a9fc03636deb5fcd3f30c761dca946c8341.zip
replaced all org.json.* usages with elemental.json.* (#8942)
Change-Id: I4809fbbdb48f3e36c8e1da8552ff3fa734714105
Diffstat (limited to 'uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java')
-rw-r--r--uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java b/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java
index b89e16d755..4807bb9029 100644
--- a/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java
+++ b/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java
@@ -16,16 +16,15 @@
package com.vaadin.tests.extensions;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.JavaScript;
import com.vaadin.ui.JavaScriptFunction;
+import elemental.json.JsonArray;
+import elemental.json.JsonNull;
+
public class JavascriptManagerTest extends AbstractTestUI {
private Log log = new Log(5);
@@ -36,14 +35,14 @@ public class JavascriptManagerTest extends AbstractTestUI {
final JavaScript js = JavaScript.getCurrent();
js.addFunction("testing.doTest", new JavaScriptFunction() {
@Override
- public void call(JSONArray arguments) throws JSONException {
+ public void call(JsonArray arguments) {
log.log("Got " + arguments.length() + " arguments");
- log.log("Argument 1 as a number: " + arguments.getInt(0));
+ log.log("Argument 1 as a number: " + (int) arguments.getNumber(0));
log.log("Argument 2 as a string: " + arguments.getString(1));
log.log("Argument 3.p as a boolean: "
- + arguments.getJSONObject(2).getBoolean("p"));
+ + arguments.getObject(2).getBoolean("p"));
log.log("Argument 4 is JSONObject.NULL: "
- + (arguments.get(3) == JSONObject.NULL));
+ + (arguments.get(3) instanceof JsonNull));
js.removeFunction("testing.doTest");
}
});