Package net.grinder.engine.process

Examples of net.grinder.engine.process.JUnitThreadContextInitializer


    initializeGrinderContext();
  }


  protected void initializeGrinderContext() {
    this.threadContextInitializer = new JUnitThreadContextInitializer();
    this.threadContextInitializer.initialize();
    this.threadContextUpdater = threadContextInitializer.getThreadContextUpdater();
    this.finalPerThreadStatement = new PerThreadStatement() {
      @Override
      void before() {
View Full Code Here


public class GroovyScriptEngineTest {

  @Test
  public void testRunGroovyScript() throws EngineException, NoSuchFieldException, IllegalAccessException {

    JUnitThreadContextInitializer init = new JUnitThreadContextInitializer();
    init.initialize();

    // for test, used to get groovy source file.
    String file = getClass().getClassLoader().getResource("org/ngrinder/TestRunner.groovy").getFile();
    GroovyScriptEngine engine = new GroovyScriptEngine(new ScriptLocation(new File(file).getAbsoluteFile()));

    init.attachWorkerThreadContext();
    GroovyScriptEngine.GroovyWorkerRunnable worker = (GroovyScriptEngine.GroovyWorkerRunnable) engine
        .createWorkerRunnable();
    assertStaticField(engine.m_groovyClass, "callCount1", 0);
    assertStaticField(engine.m_groovyClass, "callCount2", 0);
    worker.run();
View Full Code Here

TOP

Related Classes of net.grinder.engine.process.JUnitThreadContextInitializer

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.