Package net.mindengine.galen.suite.reader

Examples of net.mindengine.galen.suite.reader.Context


        assertThat(realText, is(expectedText));
    }

    @Test
    public void shouldAllowTo_loadCustomJavascript() {
        Context context = new Context();
        VarsParser template = new VarsParser(context, EMPTY_PROPERTIES, new VarsParserJsProcessor(context, jsFunctions));
        String realText = template.parse("${load('/specs/customFunction.js')} got it from js: ${customFunction('qwe', 'ert')}");

        assertThat(realText, is(" got it from js: qwe-ert"));
    }
View Full Code Here


    }
   
   
    @DataProvider public Object[][] provideGoodSamples() {
        return new Object[][] {
            {1, new Context().withParameter("name", "John"), "Hi my name is ${name}", "Hi my name is John"},
            {2, new Context().withParameter("name", "John"), "Hi my name is ${name} Connor", "Hi my name is John Connor"},
            {3, new Context().withParameter("name", "John"), "Hi my name is \\${name} Connor", "Hi my name is ${name} Connor"},
            {4, new Context().withParameter("name", "John"), "Hi my name is \\\\${name} Connor", "Hi my name is \\${name} Connor"},
            {5, new Context().withParameter("name", "John"), "Hi my name is ${ name } Connor", "Hi my name is John Connor"},
            {6, new Context(), "Hi my name is ${name} Connor", "Hi my name is  Connor"},
            {7, new Context().withParameter("name", "John").withParameter("surname", "Connor"), "Hi my name is ${name} ${surname}", "Hi my name is John Connor"},
            {8, new Context(), "I have some money $30", "I have some money $30"},
            {9, new Context(), "I have some money $30$", "I have some money $30$"},
            {10, new Context(), "I have some money ${ 30", "I have some money "},
            {11, new Context(), "There are ${count('testval1')} objects", "There are 12 objects"},
            {12, new Context(), "There are ${count(\"sdvdv\")*2 - 1} objects", "There are 29 objects"},
            {13, new Context().withParameter("qwe", 123), "Hi my age is ${qwe - 1}", "Hi my age is 122"},
        };
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.suite.reader.Context

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.