Package com.eviware.soapui.impl.rest

Examples of com.eviware.soapui.impl.rest.RestResource$PathChanger


      }
      catch( MalformedURLException e )
      {
      }

      RestResource resource = createRestResource( service, path, dialog );
      paramsTable.extractParams( resource.getParams(), ParamLocation.RESOURCE );

      // RestMethod method = createRestMethod(resource, dialog);
      // paramsTable.extractParams(method.getParams(), ParamLocation.METHOD);

      // UISupport.select(method);
View Full Code Here


  }

  private DefinitionContext<?> getWadlContext( RestMessageExchange messageExchange, SubmitContext context )
      throws Exception
  {
    RestResource operation = messageExchange.getResource();
    RestService service = operation.getService();
    if( StringUtils.isNullOrEmpty( definition )
        || definition.equals( PathUtils.expandPath( service.getDefinition(), service, context ) ) )
    {
      definitionContext = service.getWadlContext();
      ( ( WadlDefinitionContext )definitionContext ).loadIfNecessary();
View Full Code Here

    getRequestStepConfig().setService( method.getInterface().getName() );
    getRequestStepConfig().setResourcePath( method.getResource().getFullPath() );
    getRequestStepConfig().setMethodName( method.getName() );

    // new resource?
    RestResource res = findRestResource();
    if( res != getResource() )
    {
      restResource.removePropertyChangeListener( this );
      restResource.getService().removeInterfaceListener( interfaceListener );
      restResource.getService().removePropertyChangeListener( this );
View Full Code Here

        WsdlProject project = new WsdlProject();
        RestService restService1 = (RestService) project
                .addNewInterface(INTERFACE_NAME, RestServiceFactory.REST_TYPE);
        RestService restService2 = (RestService) project
                .addNewInterface(INTERFACE_NAME, RestServiceFactory.REST_TYPE);
        RestResource restResource = restService2.addNewResource(RESOURCE_NAME, PATH);
        restResource.addNewMethod(METHOD_NAME);
        Mockito.when(testCase.getParent()).thenReturn(project);

        TestStepConfig config = TestStepConfig.Factory.newInstance();
        RestRequestStepConfig configConfig = (RestRequestStepConfig) config.addNewConfig().changeType(RestRequestStepConfig.type);
        configConfig.setService(INTERFACE_NAME);
        configConfig.setResourcePath(PATH);
        configConfig.setMethodName(METHOD_NAME);
        configConfig.setRestRequest(RestRequestConfig.Factory.newInstance());

        RestTestRequestStep step = new RestTestRequestStep(testCase, config, false);
        RestResource foundResource = step.getResource();
        assertThat(foundResource, is(sameInstance(restResource)));
    }
View Full Code Here

        public void operationAdded(final Operation operation) {
            UISupport.invokeAndWaitIfNotInEDT(new Runnable() {
                @Override
                public void run() {
                    if (operation instanceof RestResource) {
                        RestResource restResource = (RestResource) operation;
                        if (restResource.getParentResource() != null) {
                            RestResourceTreeNode treeNode = (RestResourceTreeNode) getTreeModel().getTreeNode(
                                    restResource.getParentResource());
                            treeNode.addChildResource(restResource);
                            return;
                        }
                    }
View Full Code Here

    public void createRestService(WsdlProject project, String URI) throws MalformedURLException {
        if (StringUtils.isNullOrEmpty(URI)) {
            return;
        }

        RestResource restResource = createResource(ModelCreationStrategy.CREATE_NEW_MODEL, project, URI);
        RestRequest restRequest = addNewRequest(addNewMethod(ModelCreationStrategy.CREATE_NEW_MODEL, restResource, RestRequestInterface.HttpMethod.GET));
        copyParameters(extractParams(URI), restResource.getParams());
        UISupport.select(restRequest);
        UISupport.showDesktopPanel(restRequest);

    }
View Full Code Here

        if (restService == null) {
            restService = (RestService) project.addNewInterface(host, RestServiceFactory.REST_TYPE);
            restService.addEndpoint(restURIParser.getEndpoint());
        }
        if (creationStrategy == ModelCreationStrategy.REUSE_MODEL) {
            RestResource existingResource = restService.getResourceByFullPath(RestResource.removeMatrixParams(resourcePath));
            if (existingResource != null) {
                return existingResource;
            }
        }
        return restService.addNewResource(restURIParser.getResourceName(), resourcePath);
View Full Code Here

    public RestMethod makeRestMethod() throws SoapUIException {
        RestMethodConfig methodConfig = RestMethodConfig.Factory.newInstance();
        methodConfig.setName("Get");
        methodConfig.setMethod("GET");
        final RestResource restResource = makeRestResource();
        RestMethod restMethod = new RestMethod(restResource, methodConfig) {
            @Override
            public RestRequestInterface.HttpMethod getMethod() {
                return RestRequestInterface.HttpMethod.GET;
            }

            @Override
            public RestResource getOperation() {
                return restResource;
            }
        };
        restResource.getConfig().setMethodArray(new RestMethodConfig[]{restMethod.getConfig()});
        return restMethod;
    }
View Full Code Here

    public RestResource makeRestResource() throws SoapUIException {
        String serviceName = "Interface_" + UUID.randomUUID().toString();
        RestService service = (RestService) project.addNewInterface(serviceName, RestServiceFactory.REST_TYPE);
        service.setName(serviceName);
        RestResource restResource = service.addNewResource("root", "/");
        return restResource;
    }
View Full Code Here

        restMethod.setMethod(RestRequestInterface.HttpMethod.GET);
        return restMethod;
    }

    public static RestResource makeRestResource() throws SoapUIException {
        return new RestResource(makeRestService(), RestResourceConfig.Factory.newInstance());
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.rest.RestResource$PathChanger

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.