Package com.eviware.soapui.model.mock

Examples of com.eviware.soapui.model.mock.MockRunContext


  public String resolveProperty( PropertyExpansionContext context, String propertyName, boolean globalOverride )
  {
    if( propertyName.charAt( 0 ) != PropertyExpansion.SCOPE_PREFIX || !( context instanceof MockRunContext ) )
      return null;

    MockRunContext mrc = ( MockRunContext )context;

    // explicit item reference?
    String value = ResolverUtils.checkForExplicitReference( propertyName, PropertyExpansion.PROJECT_REFERENCE, mrc
        .getMockService().getProject(), mrc, globalOverride );
    if( value != null )
      return value;

    value = ResolverUtils.checkForExplicitReference( propertyName, PropertyExpansion.MOCKSERVICE_REFERENCE,
        mrc.getMockService(), mrc, globalOverride );
    if( value != null )
      return value;

    return ResolverUtils.checkForExplicitReference( propertyName, PropertyExpansion.MOCKRESPONSE_REFERENCE,
        mrc.getMockResponse(), mrc, globalOverride );
  }
View Full Code Here


      try
      {
        WsdlMockService mockService = getMockOperation().getMockService();
        WsdlMockRunner mockRunner = mockService.getMockRunner();
        MockRunContext context = mockRunner == null ? new WsdlMockRunContext( mockService, null ) : mockRunner
            .getMockContext();

        scriptEngine.setVariable( "context", context );
        scriptEngine.setVariable( "requestContext", request == null ? null : request.getRequestContext() );
        scriptEngine.setVariable( "mockRequest", request );
View Full Code Here

    if( script == null || script.trim().length() == 0 )
      return;

    WsdlMockService mockService = getMockOperation().getMockService();
    WsdlMockRunner mockRunner = mockService.getMockRunner();
    MockRunContext context = mockRunner == null ? new WsdlMockRunContext( mockService, null ) : mockRunner
        .getMockContext();

    context.setMockResponse( this );

    SoapUIScriptEngine scriptEngine = scriptEnginePool.getScriptEngine();

    try
    {
View Full Code Here

            return;
        }

        MockService mockService = getMockOperation().getMockService();
        MockRunner mockRunner = mockService.getMockRunner();
        MockRunContext context =
                mockRunner == null ? new WsdlMockRunContext(mockService, null) : mockRunner.getMockContext();

        context.setMockResponse(this);

        SoapUIScriptEngine scriptEngine = scriptEnginePool.getScriptEngine();

        try {
            scriptEngine.setVariable("context", context);
View Full Code Here

            SoapUIScriptEngine scriptEngine = scriptEnginePool.getScriptEngine();

            try {
                MockService mockService = getMockOperation().getMockService();
                MockRunner mockRunner = mockService.getMockRunner();
                MockRunContext context = mockRunner == null ? new WsdlMockRunContext(mockService, null) : mockRunner
                        .getMockContext();

                scriptEngine.setVariable("context", context);
                scriptEngine.setVariable("requestContext", request == null ? null : request.getRequestContext());
                scriptEngine.setVariable("mockRequest", request);
View Full Code Here

    public class LogListener extends MockRunListenerAdapter {
        private int responseCount;

        public void onMockRunnerStart(MockRunner mockRunner) {
            MockRunContext mockContext = mockRunner.getMockContext();
            log.info("MockService started on port " + mockContext.getMockService().getPort() + " at path ["
                    + mockContext.getMockService().getPath() + "]");
        }
View Full Code Here

    public String resolveProperty(PropertyExpansionContext context, String propertyName, boolean globalOverride) {
        if (propertyName.charAt(0) != PropertyExpansion.SCOPE_PREFIX || !(context instanceof MockRunContext)) {
            return null;
        }

        MockRunContext mrc = (MockRunContext) context;

        // explicit item reference?
        String value = ResolverUtils.checkForExplicitReference(propertyName, PropertyExpansion.PROJECT_REFERENCE, mrc
                .getMockService().getProject(), mrc, globalOverride);
        if (value != null) {
            return value;
        }

        value = ResolverUtils.checkForExplicitReference(propertyName, PropertyExpansion.MOCKSERVICE_REFERENCE,
                mrc.getMockService(), mrc, globalOverride);
        if (value != null) {
            return value;
        }

        return ResolverUtils.checkForExplicitReference(propertyName, PropertyExpansion.MOCKRESPONSE_REFERENCE,
                mrc.getMockResponse(), mrc, globalOverride);
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.mock.MockRunContext

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.