Examples of ScriptFactory


Examples of de.saumya.mojo.ruby.script.ScriptFactory

        }
        return jRubyVersion;
    }
   
    private ScriptFactory newScriptFactory() throws MojoExecutionException {
      ScriptFactory factory = createScriptFactory();
      if( env != null ){
        for( Map.Entry<String, String> entry: env.entrySet() ){
          factory.addEnv( entry.getKey(), entry.getValue() );
        }
      }
      return factory;
    }
View Full Code Here

Examples of de.saumya.mojo.ruby.script.ScriptFactory

    }
  }

    protected ScriptFactory newScriptFactory(Artifact artifact) throws MojoExecutionException {
        try {
            final ScriptFactory factory =
                artifact == null ?
                            new ScriptFactory(this.logger,
                                    this.classRealm,
                                    null,
                                    this.project.getTestClasspathElements(),
                                    this.jrubyFork):
                  (JRUBY_CORE.equals(artifact.getArtifactId()) ?
                    new ScriptFactory(this.logger,
                            this.classRealm,
                            artifact.getFile(),
                            resolveJRubyStdlibArtifact(artifact).getFile(),
                            this.project.getTestClasspathElements(),
                            this.jrubyFork) :
                    new ScriptFactory(this.logger,
                            this.classRealm,
                            artifact.getFile(),
                            this.project.getTestClasspathElements(),
                            this.jrubyFork) );

            if(libDirectory != null && libDirectory.exists()){
                if(jrubyVerbose){
                    getLog().info("add to ruby loadpath: " + libDirectory.getAbsolutePath());
                }
                // add it to the load path for all scripts using that factory
                factory.addSwitch("-I", libDirectory.getAbsolutePath());
            }
            if(rubySourceDirectory != null && rubySourceDirectory.exists()){
                if(jrubyVerbose){
                    getLog().info("add to ruby loadpath: " + rubySourceDirectory.getAbsolutePath());
                }
                // add it to the load path for all scripts using that factory
                factory.addSwitch("-I", rubySourceDirectory.getAbsolutePath());
            }
            return factory;
        } catch (final DependencyResolutionRequiredException e) {
            throw new MojoExecutionException("could not resolve jruby", e);
        } catch (final ScriptException e) {
View Full Code Here

Examples of net.sf.sahi.playback.ScriptFactory

      String scriptPath = session.getVariable("sahi_scriptPath");
      stop(request);
      setScript(session, scriptPath);
    }
    private void setScript(Session session, String scriptPath){
        SahiScript script = new ScriptFactory().getScript(scriptPath);
        RhinoScriptRunner scriptRunner = new RhinoScriptRunner(script);
    session.setScriptRunner(scriptRunner);
        startPlayback(session, true, "1");
    }
View Full Code Here

Examples of net.sf.sahi.playback.ScriptFactory

    this.execute(session, true, true);
  }
 
  public void execute(Session session, boolean async, boolean setDefaultReporters) throws Exception {
    System.out.println("#### Running Script: " + scriptName);
        scriptRunner = new RhinoScriptRunner(new ScriptFactory().getScript(scriptName), session.getSuite(), this, setDefaultReporters);
    session.setScriptRunner(scriptRunner);
        if (!isSingleSession) {
          launchBrowser();
        }
    if (async) scriptRunner.execute();
View Full Code Here

Examples of net.sf.sahi.playback.ScriptFactory

    }

    public HttpResponse getBrowserScript(final HttpRequest request) {
        HttpResponse httpResponse;
        String scriptPath = request.getParameter("href");
        SahiScript script = new ScriptFactory().getScript(scriptPath);
    if (script != null) {
            httpResponse = new SimpleHttpResponse(LogViewer.highlight(script.getBrowserJSWithLineNumbers(), getLineNumber(request)));
        } else {
            httpResponse = new SimpleHttpResponse(
                    "No Script has been set for playback.");
View Full Code Here

Examples of org.camunda.bpm.engine.impl.scripting.ScriptFactory

    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if (processEngineConfiguration != null) {
      return processEngineConfiguration.getScriptFactory();
    }
    else {
      return new ScriptFactory();
    }
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.scripting.ScriptFactory

  }

  protected Object executeScript(String scriptSrc, VariableScope scope) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    ScriptingEnvironment scriptingEnvironment = processEngineConfiguration.getScriptingEnvironment();
    ScriptFactory scriptFactory = processEngineConfiguration.getScriptFactory();
    ExecutableScript script = scriptFactory.createScriptFromSource(ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE, scriptSrc);
    return scriptingEnvironment.execute(script, scope);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.scripting.ScriptFactory

    }
    if (scriptingEngines==null) {
      scriptingEngines = new ScriptingEngines(new ScriptBindingsFactory(resolverFactories));
    }
    if(scriptFactory == null) {
      scriptFactory = new ScriptFactory();
    }
    if(scriptEnvResolvers == null) {
      scriptEnvResolvers = new ArrayList<ScriptEnvResolver>();
    }
    if(scriptingEnvironment == null) {
View Full Code Here

Examples of org.camunda.bpm.engine.impl.scripting.ScriptFactory

    }
    if (scriptingEngines==null) {
      scriptingEngines = new ScriptingEngines(new ScriptBindingsFactory(resolverFactories));
    }
    if(scriptFactory == null) {
      scriptFactory = new ScriptFactory(scriptingEngines, enableScriptCompilation);
    }
    if(scriptEnvResolvers == null) {
      scriptEnvResolvers = new ArrayList<ScriptEnvResolver>();
    }
    if(scriptingEnvironment == null) {
View Full Code Here

Examples of org.camunda.bpm.engine.impl.scripting.ScriptFactory

  }

  protected Object executeScript(String scriptSrc, VariableScope<?> scope) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    ScriptingEnvironment scriptingEnvironment = processEngineConfiguration.getScriptingEnvironment();
    ScriptFactory scriptFactory = processEngineConfiguration.getScriptFactory();
    ExecutableScript script = scriptFactory.createScript(scriptSrc, ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE);
    return scriptingEnvironment.execute(script, scope);
  }
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.