Package gherkin.deps.com.google.gson

Examples of gherkin.deps.com.google.gson.Gson


                "      \"a_byte\":5\n" +
                "    }\n" +
                "  ]\n" +
                "}\n";

        Gson gson = new Gson();
        String actual = gson.toJson(map);
        assertEquals(gson.fromJson(new StringReader(expected), Map.class), gson.fromJson(new StringReader(actual), Map.class));
    }
View Full Code Here


        JSONPrettyFormatter f = new JSONPrettyFormatter(io);
        JSONParser p = new JSONParser(f, f);
        p.parse(json);
        f.done();

        Gson gson = new Gson();

        List expected = gson.fromJson(new StringReader(json), List.class);
        List actual = gson.fromJson(new StringReader(io.toString()), List.class);
        assertEquals(expected, actual);
    }
View Full Code Here

        jsonFormatter.eof();
        jsonFormatter.done();
        jsonFormatter.close();

        Gson gson = new Gson();
        List result = gson.fromJson(stringBuilder.toString(), List.class);

        Map featureJson = (Map) result.get(0);
        assertEquals(feature.getName(), featureJson.get("name"));

        Map scenarioJson = (Map) ((List) featureJson.get("elements")).get(0);
View Full Code Here

        jsonFormatter.eof();
        jsonFormatter.done();
        jsonFormatter.close();

        Gson gson = new Gson();
        List result = gson.fromJson(stringBuilder.toString(), List.class);

        Map featureJson = (Map) result.get(0);
        assertEquals(feature.getName(), featureJson.get("name"));

        Map scenarioJson = (Map) ((List) featureJson.get("elements")).get(0);
View Full Code Here

        jsonFormatter.eof();
        jsonFormatter.done();
        jsonFormatter.close();

        Gson gson = new Gson();
        List result = gson.fromJson(stringBuilder.toString(), List.class);

        Map featureJson = (Map) result.get(0);
        assertEquals(feature.getName(), featureJson.get("name"));

        Map scenarioJson = (Map) ((List) featureJson.get("elements")).get(0);
View Full Code Here

            public String map(I18n i18n) {
                return i18n.getIsoCode();
            }
        });
        Map<String, Map<String, String>> i18nContent =
                new Gson().fromJson(new InputStreamReader(I18n.class.getResourceAsStream("/gherkin/i18n.json"), "UTF-8"), new TypeToken<Map<String, Map<String, String>>>() {}.getType());
        List<String> i18nContentKeys = extractSortedListOfMapKeys(i18nContent);

        assertEquals(i18nContentKeys, isoCodes);
        assertThat(isoCodes, hasItem("ar"));
        assertThat(isoCodes, hasItem("en"));
View Full Code Here

TOP

Related Classes of gherkin.deps.com.google.gson.Gson

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.