Package org.spockframework.builder

Examples of org.spockframework.builder.DelegatingScript


    this.classPathLocation = classPathLocation;
    this.fileSystemLocation = fileSystemLocation;
  }

  public @Nullable DelegatingScript loadAutoDetectedScript() {
    DelegatingScript script = loadScriptFromSystemPropertyInducedLocation(configPropertyKey);
    if (script != null) return script;

    script = loadScriptFromClassPathLocation(classPathLocation);
    if (script != null) return script;
View Full Code Here


    return null;
  }

  public DelegatingScript loadClosureBasedScript(final Closure<?> closure) {
    return new DelegatingScript() {
      @Override
      public Object run() {
        GroovyRuntimeUtil.invokeClosure(closure);
        return null;
      }
View Full Code Here

  private @Nullable DelegatingScript loadScriptFromSystemPropertyInducedLocation(String propertyKey) {
    String location = System.getProperty(propertyKey);
    if (location == null || location.length() == 0) return null;

    DelegatingScript script = loadScriptFromClassPathLocation(location);
    if (script != null) return script;

    script = loadScriptFromFileSystemLocation(location);
    if (script != null) return script;
View Full Code Here

  // has finished, but the JUnit Runner SPI doesn't provide an adequate hook.
  // That said, since most environments fork a new JVM for each test run,
  // this shouldn't be much of a problem in practice.
  private static RunContext createBottomContext() {
    File spockUserHome = new File(env("spock.user.home", "SPOCK_USER_HOME", System.getProperty("user.home") + "/.spock"));
    DelegatingScript script = new ConfigurationScriptLoader(spockUserHome).loadAutoDetectedScript();
    List<Class<?>> classes = new ExtensionClassesLoader().loadClassesFromDefaultLocation();
    return new RunContext("default", spockUserHome, script, classes);
  }
View Full Code Here

TOP

Related Classes of org.spockframework.builder.DelegatingScript

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.