Package org.raml.model

Examples of org.raml.model.Raml


    @Test
    @Ignore //TODO unify template and mediaType resolvers into ramlPreprocessor
    public void emitter()
    {
        RamlDocumentBuilder builder1 = new RamlDocumentBuilder();
        Raml raml1 = parseRaml(ramlSource, builder1);
        String emitted1 = YamlDocumentBuilder.dumpFromAst(builder1.getRootNode());

        RamlDocumentBuilder builder2 = new RamlDocumentBuilder();
        Raml raml2 = builder2.build(emitted1);

        assertThat(raml2.getResources().get("/simple").getAction(PUT).getBody().size(),
                   is(raml1.getResources().get("/simple").getAction(PUT).getBody().size()));
    }
View Full Code Here


    }

    @Test
    public void testSingleLineString()
    {
        Raml raml = parseRaml("org/raml/include/include-non-yaml-single-line.yaml");
        assertThat(raml.getTitle(), is("included title"));
    }
View Full Code Here


    @Test
    public void testMultiLineString() throws Exception
    {
        Raml raml = parseRaml("org/raml/include/include-non-yaml-multi-line.yaml");
        String multiLine = IOUtils.toString(this.getClass().getClassLoader().getResourceAsStream("org/raml/include/include-non-yaml-multi-line.txt"));
        assertThat(raml.getTitle(), is(multiLine));
    }
View Full Code Here

    }

    @Test
    public void testYaml()
    {
        Raml raml = parseRaml("org/raml/include/include-yaml.yaml");
        assertThat(raml.getDocumentation().size(), is(2));
        assertThat(raml.getDocumentation().get(0).getTitle(), is("Home"));
        assertThat(raml.getDocumentation().get(0).getContent(), startsWith("Lorem ipsum"));
        assertThat(raml.getDocumentation().get(1).getTitle(), is("Section"));
        assertThat(raml.getDocumentation().get(1).getContent(), is("section content"));
    }
View Full Code Here

    }

    @Test
    public void testRaml()
    {
        Raml raml = parseRaml("org/raml/include/include-raml.raml");
        assertThat(raml.getDocumentation().size(), is(2));
        assertThat(raml.getDocumentation().get(0).getTitle(), is("Home"));
        assertThat(raml.getDocumentation().get(0).getContent(), startsWith("Lorem ipsum"));
        assertThat(raml.getDocumentation().get(1).getTitle(), is("Section"));
        assertThat(raml.getDocumentation().get(1).getContent(), is("section content"));
    }
View Full Code Here

    }

    @Test
    public void includeWithResourceTypeParam()
    {
        Raml raml = parseRaml("org/raml/include/include-with-params.yaml");
        assertThat(raml.getResources().get("/simple").getAction(GET).getDescription(), is("included title"));
    }
View Full Code Here

    }

    @Test
    public void includeResourceTypeSequence()
    {
        Raml raml = parseRaml("org/raml/include/include-resource-type-sequence.yaml");
        assertThat(raml.getResources().get("/simple").getActions().size(), is(1));
        assertThat(raml.getResources().get("/simple").getAction(GET).getDescription(), is("super"));
    }
View Full Code Here

    }

    @Test
    public void includeResourceType()
    {
        Raml raml = parseRaml("org/raml/include/include-resource-types.yaml");
        assertThat(raml.getResources().get("/simple").getActions().size(), is(1));
        assertThat(raml.getResources().get("/simple").getAction(GET).getDescription(), is("super"));
    }
View Full Code Here

    @Test
    @Ignore //use local http server
    public void testHttpScalarResource()
    {
        Raml raml = parseRaml("org/raml/include/include-http-non-yaml.yaml");
        assertThat(raml.getDocumentation().size(), is(1));
        assertThat(raml.getDocumentation().get(0).getTitle(), is("Home"));
        assertThat(raml.getDocumentation().get(0).getContent(), startsWith("Stop the point-to-point madness"));
    }
View Full Code Here

    }

    @Test
    public void includeAction()
    {
        Raml raml = parseRaml("org/raml/include/include-action.yaml");
        assertThat(raml.getResources().get("/simple").getAction(GET).getDescription(), is("get something"));
    }
View Full Code Here

TOP

Related Classes of org.raml.model.Raml

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.