Examples of GlobalVariables


Examples of com.consol.citrus.model.config.core.GlobalVariables

                return springBeanConverter.convert(springBeans.get(0));
            }
        }

        if (CollectionUtils.isEmpty(contexts)) {
            return new GlobalVariables();
        } else {
            return contexts.get(0);
        }
    }
View Full Code Here

Examples of com.consol.citrus.variable.GlobalVariables

        if (globalContext) {
            innerContext = context;
        } else {
            innerContext = new TestContext();
            innerContext.setFunctionRegistry(context.getFunctionRegistry());
            GlobalVariables globalVariables = new GlobalVariables();
            globalVariables.getVariables().putAll(context.getGlobalVariables());
            innerContext.setGlobalVariables(globalVariables);
            innerContext.getVariables().putAll(context.getVariables());
           
            innerContext.setMessageValidatorRegistry(context.getMessageValidatorRegistry());
            innerContext.setValidationMatcherRegistry(context.getValidationMatcherRegistry());
View Full Code Here

Examples of com.consol.citrus.variable.GlobalVariables

        Map<String, GlobalVariablesPropertyLoader> globalVariablesPropertyLoaders = beanDefinitionContext.getBeansOfType(GlobalVariablesPropertyLoader.class);

        Assert.assertEquals(globalVariables.size(), 1L);
        Assert.assertEquals(globalVariablesPropertyLoaders.size(), 1L);

        GlobalVariables globalVariablesBean = globalVariables.values().iterator().next();
        Assert.assertEquals(globalVariablesBean.getVariables().size(), 4L);
        Assert.assertEquals(globalVariablesBean.getVariables().get("var1"), "val1");
        Assert.assertEquals(globalVariablesBean.getVariables().get("var2"), "val2");
        Assert.assertEquals(globalVariablesBean.getVariables().get("var3"), "val3");
        Assert.assertEquals(globalVariablesBean.getVariables().get("property.load.test"), "Globale Variable geladen");

        GlobalVariablesPropertyLoader globalVariablesPropertyLoaderBean = globalVariablesPropertyLoaders.values().iterator().next();
        Assert.assertEquals(globalVariablesPropertyLoaderBean.getPropertyFiles().size(), 1L);
        Assert.assertEquals(globalVariablesPropertyLoaderBean.getPropertyFiles().get(0), "classpath:com/consol/citrus/variable/loadtest.properties");
    }
View Full Code Here

Examples of com.consol.citrus.variable.GlobalVariables

        beanDefinitionContext = createApplicationContext("empty");
        Map<String, GlobalVariables> globalVariables = beanDefinitionContext.getBeansOfType(GlobalVariables.class);

        Assert.assertEquals(globalVariables.size(), 1L);

        GlobalVariables globalVariablesBean = globalVariables.values().iterator().next();
        Assert.assertEquals(globalVariablesBean.getVariables().size(), 0L);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.GlobalVariables

     * @param vars map to save retrieved global variables.
     */
    public static void retrieve(RubyObject receiver, BiVariableMap vars) {
        if (vars.isLazy()) return;
       
        GlobalVariables gvars = receiver.getRuntime().getGlobalVariables();
        Set<String> names = gvars.getNames();
        for (String name : names) {
            if (isPredefined(name)) {
                continue;
            }
            IRubyObject value = gvars.get(name);
            String javaName = name.substring(1); // eliminates a preceding character, "$"
            updateLocalGlobal((RubyObject)receiver.getRuntime().getTopSelf(), vars, javaName, value);
        }
    }
View Full Code Here

Examples of org.jruby.internal.runtime.GlobalVariables

     * @param runtime Ruby runtime
     * @param vars map to save a retrieved global variable.
     * @param key name of the global variable
     */
    public static void retrieveByKey(Ruby runtime, BiVariableMap vars, String key) {
        GlobalVariables gvars = runtime.getGlobalVariables();
        // if the specified key doesn't exist, this method is called before the
        // evaluation. Don't update value in this case.
        String rubyKey = ("$" + key).intern();
        if (!gvars.getNames().contains(rubyKey)) return;

        // the specified key is found, so let's update
        IRubyObject value = gvars.get(rubyKey);
        updateLocalGlobal((RubyObject)runtime.getTopSelf(), vars, key, value);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.GlobalVariables

     * @param receiver receiver object returned when a script is evaluated.
     * @param vars map to save retrieved global variables.
     */
    public static void retrieve(IRubyObject receiver, BiVariableMap vars) {
        if (vars.isLazy()) return;
        GlobalVariables gvars = receiver.getRuntime().getGlobalVariables();
        Set<String> names = gvars.getNames();
        for (String name : names) {
            if (isPredefined(name)) {
                continue;
            }
            IRubyObject value = gvars.get(name);
            // reciever of gvar should to topSelf always
            updateGlobalVar(vars, (RubyObject)receiver.getRuntime().getTopSelf(), name, value);
        }
    }
View Full Code Here

Examples of org.jruby.internal.runtime.GlobalVariables

     * @param receiver receiver object returned when a script is evaluated.
     * @param vars map to save a retrieved global variable.
     * @param key name of the global variable
     */
    public static void retrieveByKey(Ruby runtime, BiVariableMap vars, String key) {
        GlobalVariables gvars = runtime.getGlobalVariables();
        // if the specified key doesn't exist, this method is called before the
        // evaluation. Don't update value in this case.
        if (!gvars.getNames().contains(key)) return;

        // the specified key is found, so let's update
        IRubyObject value = gvars.get(key);
        updateGlobalVar(vars, (RubyObject)runtime.getTopSelf(), key, value);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.GlobalVariables

  private class Variables extends GlobalVariables {
    private Variables(Ruby runtime) {
      super(runtime);

      //we have to copy variables from the origin one to this
      GlobalVariables vars = runtime.getGlobalVariables();
      for (Iterator it = vars.getNames().iterator(); it.hasNext();) {
        final String nm = (String)it.next();
        set(nm, vars.get(nm));
      }
    }
View Full Code Here

Examples of org.jruby.internal.runtime.GlobalVariables

        return result;
    }  

    private synchronized Node compileScript(String script, ScriptContext ctx)
                                 throws ScriptException {       
        GlobalVariables oldGlobals = runtime.getGlobalVariables()
        try {
            setGlobalVariables(ctx);
            String filename = (String) ctx.getAttribute(ScriptEngine.FILENAME);
            if (filename == null) {
                filename = "<unknown>";
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.