Package com.eviware.soapui.impl.rest

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


    public Object getValueAt( int rowIndex, int columnIndex )
    {
      if( updatingService )
        return "<updating>";

      RestResource operation = restService.getOperationAt( rowIndex );

      switch( columnIndex )
      {
      case 0 :
        return operation.getName();
      case 1 :
        return operation.getPath();
      }

      return null;
    }
View Full Code Here


    }
    options.put( "<Delete TestRequest>", null );

    String message = "Select a new REST Resource to place TestRequest \"" + requestStep.getName() + "\" under.";
    Object op = UISupport.prompt( message, "Missing REST Resource for TestRequest", options.keySet().toArray() );
    RestResource resource = options.get( op );

    return resource;
  }
View Full Code Here

      service.setWadlUrl( wadlUrl );
      service.getConfig().setWadlVersion( isWADL11 ? Constants.WADL11_NS : Constants.WADL10_NS );

      for( Resources resources : resourcesList )
      {
        RestResource baseResource = null;
        if( resourcesList.size() > 1 )
        {
          String path = resources.getBase();
          baseResource = service.addNewResource( path, path );
        }
        for( Resource resource : resources.getResourceList() )
        {
          String name = getFirstTitle( resource.getDocList(), resource.getPath() );
          String path = resource.getPath();

          RestResource newResource = null;

          if( baseResource != null )
          {
            for( RestResource res : baseResource.getChildResourceList() )
            {
View Full Code Here

    for( Resource res : resource.getResourceList() )
    {
      String name = getFirstTitle( res.getDocList(), res.getPath() );
      String path = res.getPath();

      RestResource newRes = null;

      for( RestResource child : newResource.getChildResourceList() )
      {
        if( child.getPath().equals( path ) )
        {
View Full Code Here

    String name = UISupport.prompt( "Specify name of cloned Resource", "Clone Resource",
        "Copy of " + resource.getName() );
    if( name == null )
      return;

    RestResource newResource = resource.getResourceContainer().cloneResource( resource, name );
    UISupport.selectAndShow( newResource );
  }
View Full Code Here

    super( messages.get( "title" ), messages.get( "description" ) );
  }

  protected RestResource createRestResource( RestResource parentResource, String path, XFormDialog dialog )
  {
    RestResource possibleParent = null;
    String p = parentResource.getFullPath() + path;

    for( RestResource resource : parentResource.getAllChildResources() )
    {
      if( p.startsWith( resource.getFullPath() ) )
      {
        int c = 0;
        for( ; c < resource.getChildResourceCount(); c++ )
        {
          if( p.startsWith( resource.getChildResourceAt( c ).getFullPath() ) )
            break;
        }

        // found subresource?
        if( c != resource.getChildResourceCount() )
          continue;

        possibleParent = resource;
        break;
      }
    }

    RestResource resource;

    if( possibleParent != null
        && UISupport.confirm( "Create resource as child to [" + possibleParent.getName() + "]",
            "New Child Resource" ) )
    {
View Full Code Here

        + File.separatorChar + "wadl" + File.separatorChar + "YahooSearch.wadl" ).toURI().toURL().toString() );

    assertEquals( 1, service.getOperationCount() );
    assertEquals( "/NewsSearchService/V1/", service.getBasePath() );

    RestResource resource = service.getOperationAt( 0 );

    assertEquals( 1, resource.getPropertyCount() );
    assertEquals( "appid", resource.getPropertyAt( 0 ).getName() );
    assertNotNull( resource.getProperty( "appid" ) );
    assertEquals( 1, resource.getRequestCount() );

    RestRequest request = resource.getRequestAt( 0 );
    assertEquals( RestRequestInterface.RequestMethod.GET, request.getMethod() );
    assertEquals( 9, request.getPropertyCount() );
  }
View Full Code Here

      resourceCombo.addActionListener( new ActionListener()
      {
        public void actionPerformed( ActionEvent e )
        {
          RestResource resource = ( RestResource )resourceCombo.getSelectedItem();
          methodCombo.removeAllItems();
          if( resource != null )
          {
            methodCombo.setEnabled( true );
            for( RestMethod method : resource.getRestMethodList() )
              methodCombo.addItem( method );
          }
          else
          {
            methodCombo.setEnabled( false );
View Full Code Here

    public void operationAdded( Operation operation )
    {
      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

    super( messages.get( "title" ), messages.get( "description" ) );
  }

  protected RestResource createRestResource( RestService service, String path, XFormDialog dialog )
  {
    RestResource possibleParent = null;
    String p = service.getBasePath() + path;

    for( RestResource resource : service.getAllResources() )
    {
      if( p.startsWith( resource.getFullPath() ) )
      {
        int c = 0;
        for( ; c < resource.getChildResourceCount(); c++ )
        {
          if( p.startsWith( resource.getChildResourceAt( c ).getFullPath() ) )
            break;
        }

        // found subresource?
        if( c != resource.getChildResourceCount() )
          continue;

        possibleParent = resource;
        break;
      }
    }

    RestResource resource;

    if( possibleParent != null
        && UISupport.confirm( "Create resource as child to [" + possibleParent.getName() + "]",
            "New Child Resource" ) )
    {
View Full Code Here

TOP

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

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.