Package com.eviware.soapui.model.project

Examples of com.eviware.soapui.model.project.Project


  public static String relativizeResourcePath( String path, ModelItem modelItem )
  {
    if( modelItem == null || StringUtils.isNullOrEmpty( path ) || isRelativePath( path ) || isHttpPath( path ) )
      return path;

    Project project = ModelSupport.getModelItemProject( modelItem );
    if( project == null )
      return path;

    if( StringUtils.isNullOrEmpty( project.getPath() ) && project.getResourceRoot().indexOf( "${projectDir}" ) >= 0 )
    {
      if( UISupport.confirm( "Save project before setting path?", "Project has not been saved" ) )
      {
        try
        {
          project.save();
        }
        catch( IOException e )
        {
          SoapUI.logError( e );
          UISupport.showErrorMessage( e );
          return path;
        }
      }
    }

    String projectPath = PropertyExpander.expandProperties( project, project.getResourceRoot() );
    if( StringUtils.isNullOrEmpty( projectPath ) )
      return path;

    return PathUtils.relativize( path, projectPath );
  }
View Full Code Here


    return result;
  }

  private RestResource findRestResource()
  {
    Project project = ModelSupport.getModelItemProject( this );
    RestService restService = ( RestService )project.getInterfaceByName( getRequestStepConfig().getService() );
    if( restService != null )
    {
      // get all resources with the configured path
      for( RestResource resource : restService.getResourcesByFullPath( getRequestStepConfig().getResourcePath() ) )
      {
View Full Code Here

  {
    WsdlTestCase testCase = getTestCase();
    if( testCase == null || testCase.getTestSuite() == null )
      return null;

    Project project = testCase.getTestSuite().getProject();
    WsdlOperation operation = null;
    for( int c = 0; c < project.getInterfaceCount(); c++ )
    {
      if( project.getInterfaceAt( c ).getName().equals( requestStepConfig.getInterface() ) )
      {
        WsdlInterface iface = ( WsdlInterface )project.getInterfaceAt( c );
        for( int i = 0; i < iface.getOperationCount(); i++ )
        {
          if( iface.getOperationAt( i ).getName().equals( requestStepConfig.getOperation() ) )
          {
            operation = iface.getOperationAt( i );
View Full Code Here

        super(workspace, null, treeModel);

        workspace.addWorkspaceListener(workspaceListener);

        for (int c = 0; c < workspace.getProjectCount(); c++) {
            Project project = workspace.getProjectAt(c);
            project.addPropertyChangeListener(Project.NAME_PROPERTY, propertyChangeListener);
            projectNodes.add(new ProjectTreeNode(project, this));
        }

        initOrdering(projectNodes, UISettings.ORDER_PROJECTS);
        getTreeModel().mapModelItems(projectNodes);
View Full Code Here

        FileUtils.deleteDirectory(TEMPORARY_FOLDER);
    }

    @Test
    public void projectLoadedFromInputStreamCanBeSaved() throws IOException {
        Project project = new WsdlProject(sampleProjectInputSteam, null);
        answerYesWhenTheOverwriteDialogIsShown();
        SaveStatus status = project.save();
        assertThat(status, is(SaveStatus.SUCCESS));
    }
View Full Code Here

        assertThat(status, is(SaveStatus.SUCCESS));
    }

    @Test
    public void projectLoadedFromFileCanBeSaved() throws IOException {
        Project project = new WsdlProject(SAMPLE_PROJECT_ABSOLUTE_PATH, (WorkspaceImpl) null);
        SaveStatus status = project.save();
        assertThat(status, is(SaveStatus.SUCCESS));
    }
View Full Code Here

        assertThat(status, is(SaveStatus.SUCCESS));
    }

    @Test
    public void userIsPromptedForSaveLocationWhenSavingProjectLoadedFromInputStream() throws IOException {
        Project project = new WsdlProject(sampleProjectInputSteam, null);
        answerYesWhenTheOverwriteDialogIsShown();
        project.save();
        verifyThatTheSaveAsDialogIsShown();
    }
View Full Code Here

        verifyThatTheSaveAsDialogIsShown();
    }

    @Test
    public void newlyCreatedProjectIsNotSavedIfUserOptsNotToSave() throws XmlException, IOException, SoapUIException {
        Project project = createTemporaryProject();
        cancelWhenTheSaveAsFileDialogIsShown();
        SaveStatus status = project.save();
        assertThat(status, is(not(SaveStatus.SUCCESS)));
    }
View Full Code Here

        assertThat(status, is(not(SaveStatus.SUCCESS)));
    }

    @Test
    public void projectIsNotSavedIfSaveAsDialogIsCancelled() throws IOException {
        Project project = new WsdlProject(sampleProjectInputSteam, null);
        answerYesWhenTheOverwriteDialogIsShown();
        cancelWhenTheSaveAsFileDialogIsShown();
        SaveStatus status = project.save();
        assertThat(status, is(SaveStatus.CANCELLED));
    }
View Full Code Here

    }

    @Test
    public void existingFileIsNotSavedIfNotWritableAndWeDontWantToSave() throws IOException {
        setFileWritePermission(SAMPLE_PROJECT_ABSOLUTE_PATH, false);
        Project project = new WsdlProject(SAMPLE_PROJECT_ABSOLUTE_PATH, (WorkspaceImpl) null);
        answerNoWhenTheDoYouWantToWriteToNewFileDialogIsShown();
        SaveStatus status = project.save();
        assertThat(status, is(SaveStatus.DONT_SAVE));
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.project.Project

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.