Package com.eviware.soapui.impl.rest

Examples of com.eviware.soapui.impl.rest.RestMethod


        if( restResource == null )
          return null;
        getRequestStepConfig().setService( restResource.getInterface().getName() );
        getRequestStepConfig().setResourcePath( restResource.getFullPath() );
      }
      RestMethod method = RestRequestConverter.getMethod( getResource(), getRequestStepConfig().getRestRequest()
          .selectAttribute( null, "method" ).newCursor().getTextValue(), getRequestStepConfig().getRestRequest()
          .getName() );
      restRequestStepConfig.setMethodName( method.getName() );
      return method;
    }
    else if( getResource() == null )
    {
      restResource = RestRequestConverter.resolveResource( this );
      if( restResource == null )
        return null;
      getRequestStepConfig().setService( restResource.getInterface().getName() );
      getRequestStepConfig().setResourcePath( restResource.getFullPath() );

      RestMethod m = ( RestMethod )getWsdlModelItemByName( getResource().getRestMethodList(), getRequestStepConfig()
          .getMethodName() );
      if( m == null )
      {
        String mn = null;
        while( mn == null )
View Full Code Here


  public void setRestMethod( RestMethod method )
  {
    if( restMethod == method )
      return;

    RestMethod oldMethod = restMethod;
    restMethod = method;

    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 );

      restResource = res;

      restResource.getService().addInterfaceListener( interfaceListener );
      restResource.getService().addPropertyChangeListener( this );
      restResource.addPropertyChangeListener( this );
    }

    if( oldMethod != null )
      oldMethod.removePropertyChangeListener( this );

    restMethod.addPropertyChangeListener( this );
    getTestRequest().setRestMethod( restMethod );
  }
View Full Code Here

          new RemoveTestStepResolver( this ), new ImportInterfaceResolver( this )
          {
            @Override
            protected boolean update()
            {
              RestMethod restMethod = findRestMethod();
              if( restMethod == null )
                return false;

              setRestMethod( restMethod );
              initRestTestRequest();
              setDisabled( false );
              return true;
            }

          }, new ChangeRestMethodResolver( this )
          {
            @Override
            public boolean update()
            {
              RestMethod restMethod = getSelectedRestMethod();
              if( restMethod == null )
                return false;

              setRestMethod( restMethod );
              initRestTestRequest();
View Full Code Here

                if (restMethod.getMethod() == requestMethod) {
                    return restMethod;
                }
            }
        }
        RestMethod restMethod = restResource.addNewMethod(restResource.getName());
        restMethod.setMethod(requestMethod);
        return restMethod;
    }
View Full Code Here

        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
                                                      boolean cellHasFocus) {
            Component result = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

            if (value instanceof RestMethod) {
                RestMethod item = (RestMethod) value;
                setIcon(item.getIcon());
                setText(item.getResource().getName() + " -> " + item.getName());
            }

            return result;
        }
View Full Code Here

    public RestRequest makeRestRequest(RestResource restResource) throws SoapUIException {
        return new RestRequest(makeRestMethod(restResource), RestRequestConfig.Factory.newInstance(), false);
    }

    private RestMethod makeRestMethod(RestResource restResource) {
        return new RestMethod(restResource, RestMethodConfig.Factory.newInstance());
    }
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 static RestRequest makeRestRequest(RestResource restResource) throws SoapUIException {
        return new RestRequest(makeRestMethod(restResource), RestRequestConfig.Factory.newInstance(), false);
    }

    private static RestMethod makeRestMethod(RestResource restResource) {
        return new RestMethod(restResource, RestMethodConfig.Factory.newInstance());
    }
View Full Code Here

        return new RestMethod(restResource, RestMethodConfig.Factory.newInstance());
    }

    public static RestMethod makeRestMethod() throws SoapUIException {

        RestMethod restMethod = new RestMethod(makeRestResource(), RestMethodConfig.Factory.newInstance());
        restMethod.setMethod(RestRequestInterface.HttpMethod.GET);
        return restMethod;
    }
View Full Code Here

                                                    + "introducing a new REST Method item in-between each REST Resource and Request.\r\n"
                                                    + "Any existing REST Request must now be placed under either an existing Method or a new one, "
                                                    + "either automatically or manually.\r\n\r\nWould You like SoapUI to do this automatically using the default values?",
                                            "Update REST model for project: " + project.getName()));
        }
        RestMethod method = null;
        List<String> options = new ArrayList<String>();
        for (int c = 0; c < resource.getRestMethodCount(); c++) {
            RestMethod restMethod = resource.getRestMethodAt(c);
            if (restMethod.getMethod().toString().equals(methodType)) {
                options.add(restMethod.getName());
            }
        }
        if (autoConvert.get(project)) {
            if (options.size() > 0) {
                method = resource.getRestMethodByName(options.get(0));
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.rest.RestMethod

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.