Package com.eviware.soapui.support.scripting

Examples of com.eviware.soapui.support.scripting.SoapUIScriptEngine.run()


    {
      scriptEngine.setScript( name );
      for( String key : objects.keySet() )
        scriptEngine.setVariable( key, objects.get( key ) );

      Object result = scriptEngine.run();
      return result == null ? null : result.toString();
    }
    catch( Throwable e )
    {
      log.error( "Error evaluating script", e );
View Full Code Here


        scriptEngine.setVariable( "mockRequest", request );
        scriptEngine.setVariable( "mockOperation", getMockOperation() );
        scriptEngine.setVariable( "log", SoapUI.ensureGroovyLog() );

        scriptEngine.setScript( dispatchScript );
        Object retVal = scriptEngine.run();
        return getMockOperation().getMockResponseByName( String.valueOf( retVal ) );
      }
      catch( Throwable e )
      {
        SoapUI.logError( e );
View Full Code Here

    {
      scriptEngine.setVariable( "context", runContext );
      scriptEngine.setVariable( "mockRequest", mockRequest );
      scriptEngine.setVariable( "mockRunner", runner );
      scriptEngine.setVariable( "log", SoapUI.ensureGroovyLog() );
      return scriptEngine.run();
    }
    finally
    {
      onRequestScriptEnginePool.returnScriptEngine( scriptEngine );
    }
View Full Code Here

    {
      scriptEngine.setVariable( "context", runContext );
      scriptEngine.setVariable( "mockResult", mockResult );
      scriptEngine.setVariable( "mockRunner", runner );
      scriptEngine.setVariable( "log", SoapUI.ensureGroovyLog() );
      return scriptEngine.run();
    }
    finally
    {
      afterRequestScriptEnginePool.returnScriptEngine( scriptEngine );
    }
View Full Code Here

      scriptEngine.setVariable( "mockContext", context );
      scriptEngine.setVariable( "mockRequest", request );
      scriptEngine.setVariable( "mockResponse", this );
      scriptEngine.setVariable( "log", SoapUI.ensureGroovyLog() );

      scriptEngine.run();
    }
    catch( RuntimeException e )
    {
      throw new Exception( e.getMessage(), e );
    }
View Full Code Here

            scriptEngine.setVariable("mockContext", context);
            scriptEngine.setVariable("mockRequest", request);
            scriptEngine.setVariable("mockResponse", this);
            scriptEngine.setVariable("log", SoapUI.ensureGroovyLog());

            scriptEngine.run();
        } catch (RuntimeException e) {
            throw new Exception(e.getMessage(), e);
        } finally {
            scriptEnginePool.returnScriptEngine(scriptEngine);
        }
View Full Code Here

        try {
            scriptEngine.setVariable("context", runContext);
            scriptEngine.setVariable("mockRequest", mockRequest);
            scriptEngine.setVariable("mockRunner", getMockRunner());
            scriptEngine.setVariable("log", SoapUI.ensureGroovyLog());
            return scriptEngine.run();
        } finally {
            onRequestScriptEnginePool.returnScriptEngine(scriptEngine);
        }
    }
View Full Code Here

        try {
            scriptEngine.setVariable("context", runContext);
            scriptEngine.setVariable("mockResult", mockResult);
            scriptEngine.setVariable("mockRunner", getMockRunner());
            scriptEngine.setVariable("log", SoapUI.ensureGroovyLog());
            return scriptEngine.run();
        } finally {
            afterRequestScriptEnginePool.returnScriptEngine(scriptEngine);
        }
    }
View Full Code Here

        SoapUI.setSoapUICore(soapUICore, true);
        GroovyScriptEngineFactory scriptEngineFactory = new GroovyScriptEngineFactory();
        SoapUIScriptEngine scriptEngine = scriptEngineFactory.createScriptEngine(ModelItemFactory.makeWsdlProject());
        // binary literals are new to Groovy 2
        scriptEngine.setScript("assert 0b10 == 2");
        scriptEngine.run();

    }
}
View Full Code Here

                scriptEngine.setVariable("mockRequest", request);
                scriptEngine.setVariable("mockOperation", getMockOperation());
                scriptEngine.setVariable("log", SoapUI.ensureGroovyLog());

                scriptEngine.setScript(dispatchScript);
                Object retVal = scriptEngine.run();
                return getMockOperation().getMockResponseByName(String.valueOf(retVal));
            } catch (Throwable e) {
                SoapUI.logError(e);
                throw new DispatchException("Failed to dispatch using script; " + e);
            } finally {
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.