diff --git a/json-path-web-test/src/main/java/com/jayway/jsonpath/web/bench/Bench.java b/json-path-web-test/src/main/java/com/jayway/jsonpath/web/bench/Bench.java index e1de1dad..d3912d33 100644 --- a/json-path-web-test/src/main/java/com/jayway/jsonpath/web/bench/Bench.java +++ b/json-path-web-test/src/main/java/com/jayway/jsonpath/web/bench/Bench.java @@ -1,6 +1,8 @@ package com.jayway.jsonpath.web.bench; +import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.Option; import com.jayway.jsonpath.internal.spi.json.JacksonProvider; import com.jayway.jsonpath.spi.json.JsonProviderFactory; import io.gatling.jsonpath.JsonPath$; @@ -32,14 +34,23 @@ public class Bench { String error = null; long time; Object res = null; - long now = System.currentTimeMillis(); + //Configuration configuration = Configuration.defaultConfiguration(); + Configuration configuration = Configuration.defaultConfiguration().options(Option.ALWAYS_RETURN_LIST); + if(!value){ + configuration = configuration.options(Option.AS_PATH_LIST); + } + + long now = System.currentTimeMillis(); try { + + res = JsonPath.using(configuration).parse(json).read(path); + /* if(value) { res = JsonPath.parse(json).read(path); } else { res = JsonPath.parse(json).readPathList(path); - } + }*/ } catch (Exception e){ error = getError(e); diff --git a/json-path/src/main/java/com/jayway/jsonpath/Configuration.java b/json-path/src/main/java/com/jayway/jsonpath/Configuration.java index 1bfd945c..7fb70bc9 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/Configuration.java +++ b/json-path/src/main/java/com/jayway/jsonpath/Configuration.java @@ -26,7 +26,6 @@ import static com.jayway.jsonpath.internal.Utils.notNull; public class Configuration { - private final JsonProvider provider; private final Set