Examples of dumpAs()


Examples of org.yaml.snakeyaml.Yaml.dumpAs()

    public void testNoTags() {
        Yaml yaml2dump = new Yaml();
        yaml2dump.setBeanAccess(BeanAccess.FIELD);
        B data = createB();
        String dump = yaml2dump.dumpAs(data, Tag.MAP, FlowStyle.AUTO);
        // System.out.println(dump);
        assertEquals("meta:\n- [whatever]\n- [something, something else]\n", dump);
        //
        Constructor constr = new Constructor(B.class);
        Yaml yaml2load = new Yaml(constr);
View Full Code Here

Examples of org.yaml.snakeyaml.Yaml.dumpAs()

    }

    public void testDumperDifferentTag() {
        Yaml yaml = new Yaml();
        Bean124 bean = new Bean124();
        String output1 = yaml.dumpAs(bean, new Tag("!!foo.bar"), FlowStyle.BLOCK);
        assertEquals("!!foo.bar\na: aaa\nnumbers:\n- 1\n- 2\n- 3\n", output1);
    }

    public void testDumperFlowStyle() {
        Yaml yaml = new Yaml();
View Full Code Here

Examples of org.yaml.snakeyaml.Yaml.dumpAs()

    }

    public void testDumperFlowStyle() {
        Yaml yaml = new Yaml();
        Bean124 bean = new Bean124();
        String output1 = yaml.dumpAs(bean, new Tag("!!foo.bar"), FlowStyle.FLOW);
        assertEquals("!!foo.bar {a: aaa, numbers: [1, 2, 3]}\n", output1);
    }

    public void testDumperAutoStyle() {
        Yaml yaml = new Yaml();
View Full Code Here

Examples of org.yaml.snakeyaml.Yaml.dumpAs()

    }

    public void testDumperAutoStyle() {
        Yaml yaml = new Yaml();
        Bean124 bean = new Bean124();
        String output1 = yaml.dumpAs(bean, new Tag("!!foo.bar"), FlowStyle.AUTO);
        assertEquals("!!foo.bar\na: aaa\nnumbers: [1, 2, 3]\n", output1);
    }

    public void testDumperNullStyle() {
        Yaml yaml = new Yaml();
View Full Code Here

Examples of org.yaml.snakeyaml.Yaml.dumpAs()

    }

    public void testDumperNullStyle() {
        Yaml yaml = new Yaml();
        Bean124 bean = new Bean124();
        String output1 = yaml.dumpAs(bean, new Tag("!!foo.bar"), null);
        assertEquals("!!foo.bar\na: aaa\nnumbers: [1, 2, 3]\n", output1);
    }

    public void testDumperNullStyle2() {
        DumperOptions options = new DumperOptions();
View Full Code Here

Examples of org.yaml.snakeyaml.Yaml.dumpAs()

    public void testDumperNullStyle2() {
        DumperOptions options = new DumperOptions();
        options.setDefaultFlowStyle(FlowStyle.BLOCK);
        Yaml yaml = new Yaml(options);
        Bean124 bean = new Bean124();
        String output1 = yaml.dumpAs(bean, new Tag("!!foo2.bar2"), null);
        assertEquals("!!foo2.bar2\na: aaa\nnumbers:\n- 1\n- 2\n- 3\n", output1);
    }

    public void testDumperNullTag() {
        Yaml yaml = new Yaml();
View Full Code Here

Examples of org.yaml.snakeyaml.Yaml.dumpAs()

    }

    public void testDumperNullTag() {
        Yaml yaml = new Yaml();
        Bean124 bean = new Bean124();
        String output1 = yaml.dumpAs(bean, null, FlowStyle.BLOCK);
        assertEquals(
                "!!org.yaml.snakeyaml.issues.issue124.Bean124\na: aaa\nnumbers:\n- 1\n- 2\n- 3\n",
                output1);
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.