Package com.eviware.soapui.impl

Examples of com.eviware.soapui.impl.WorkspaceImpl


      SwingUtilities.invokeLater( new Runnable()
      {
        public void run()
        {
          SoapUI.log( "Autosaving Workspace" );
          WorkspaceImpl wrkspc = ( WorkspaceImpl )SoapUI.getWorkspace();
          if( wrkspc != null )
          {
            wrkspc.save( false, true );
          }
        }
      } );
    }
View Full Code Here


    super( "Clone Interface", "Clones this Interface to another project" );
  }

  public void perform( WsdlInterface iface, Object param )
  {
    WorkspaceImpl workspace = iface.getProject().getWorkspace();
    String[] names = ModelSupport.getNames( workspace.getOpenProjectList(), new String[] { "<Create New>" } );

    List<String> asList = new ArrayList<String>( Arrays.asList( names ) );
    asList.remove( iface.getProject().getName() );

    String targetProjectName = UISupport.prompt( "Select target Project for cloned Interface", "Clone Interface",
        asList );
    if( targetProjectName == null )
      return;

    WsdlProject targetProject = ( WsdlProject )workspace.getProjectByName( targetProjectName );
    if( targetProject == null )
    {
      targetProjectName = UISupport.prompt( "Enter name for new Project", "Clone TestSuite", "" );
      if( targetProjectName == null )
        return;

      try
      {
        targetProject = workspace.createProject( targetProjectName, null );
      }
      catch( SoapUIException e )
      {
        UISupport.showErrorMessage( e );
      }
View Full Code Here

    dialog.setValue( Form.NAME, "Copy of " + testSuite.getName() );
    dialog.setBooleanValue( Form.MOVE, false );
    dialog.setBooleanValue( Form.CLONE_DESCRIPTION, true );
    dialog.getFormField( Form.DESCRIPTION ).setEnabled( false );
    dialog.setValue( Form.DESCRIPTION, testSuite.getDescription() );
    WorkspaceImpl workspace = testSuite.getProject().getWorkspace();
    dialog.setOptions( Form.PROJECT,
        ModelSupport.getNames( workspace.getOpenProjectList(), new String[] { "<Create New>" } ) );

    dialog.setValue( Form.PROJECT, testSuite.getProject().getName() );

    if( dialog.show() )
    {
View Full Code Here

  }

  public static WsdlTestSuite cloneToAnotherProject( WsdlTestSuite testSuite, String targetProjectName, String name,
      boolean move, String description )
  {
    WorkspaceImpl workspace = testSuite.getProject().getWorkspace();
    WsdlProject targetProject = ( WsdlProject )workspace.getProjectByName( targetProjectName );
    if( targetProject == null )
    {
      targetProjectName = UISupport.prompt( "Enter name for new Project", "Clone TestSuite", "" );
      if( targetProjectName == null )
        return null;

      try
      {
        targetProject = workspace.createProject( targetProjectName, null );
      }
      catch( SoapUIException e )
      {
        UISupport.showErrorMessage( e );
      }
View Full Code Here

    }

    dialog.setBooleanValue( Form.MOVE, false );
    dialog.setValue( Form.NAME, "Copy of " + testStep.getName() );
    WorkspaceImpl workspace = testStep.getTestCase().getTestSuite().getProject().getWorkspace();
    dialog.setOptions( Form.PROJECT,
        ModelSupport.getNames( workspace.getOpenProjectList(), new String[] { CREATE_NEW_OPTION } ) );

    dialog.setValue( Form.PROJECT, testStep.getTestCase().getTestSuite().getProject().getName() );

    dialog.setOptions( Form.TESTSUITE, ModelSupport.getNames( testStep.getTestCase().getTestSuite().getProject()
        .getTestSuiteList(), new String[] { CREATE_NEW_OPTION } ) );
    dialog.setValue( Form.TESTSUITE, testStep.getTestCase().getTestSuite().getName() );

    dialog.setOptions( Form.TESTCASE, ModelSupport.getNames( testStep.getTestCase().getTestSuite().getTestCaseList(),
        new String[] { CREATE_NEW_OPTION } ) );
    dialog.setValue( Form.TESTCASE, testStep.getTestCase().getName() );

    if( dialog.show() )
    {
      String targetProjectName = dialog.getValue( Form.PROJECT );
      String targetTestSuiteName = dialog.getValue( Form.TESTSUITE );
      String targetTestCaseName = dialog.getValue( Form.TESTCASE );
      String name = dialog.getValue( Form.NAME );

      WsdlProject project = testStep.getTestCase().getTestSuite().getProject();
      WsdlTestSuite targetTestSuite = null;
      WsdlTestCase targetTestCase = null;
      Set<Interface> requiredInterfaces = new HashSet<Interface>();

      // to another project project?
      if( !targetProjectName.equals( project.getName() ) )
      {
        // get required interfaces
        requiredInterfaces.addAll( testStep.getRequiredInterfaces() );

        project = ( WsdlProject )workspace.getProjectByName( targetProjectName );
        if( project == null )
        {
          targetProjectName = UISupport.prompt( "Enter name for new Project", "Clone TestStep", "" );
          if( targetProjectName == null )
            return;

          try
          {
            project = workspace.createProject( targetProjectName, null );
          }
          catch( SoapUIException e )
          {
            UISupport.showErrorMessage( e );
          }
View Full Code Here

    dialog.setBooleanValue( Form.MOVE, false );
    dialog.setBooleanValue( Form.CLONE_DESCRIPTION, true );
    dialog.getFormField( Form.DESCRIPTION ).setEnabled( false );
    dialog.setValue( Form.DESCRIPTION, testCase.getDescription() );
    dialog.setValue( Form.NAME, "Copy of " + testCase.getName() );
    WorkspaceImpl workspace = testCase.getTestSuite().getProject().getWorkspace();
    dialog.setOptions( Form.PROJECT,
        ModelSupport.getNames( workspace.getOpenProjectList(), new String[] { CREATE_NEW_OPTION } ) );

    dialog.setValue( Form.PROJECT, testCase.getTestSuite().getProject().getName() );

    dialog.setOptions( Form.TESTSUITE, ModelSupport.getNames(
        testCase.getTestSuite().getProject().getTestSuiteList(), new String[] { CREATE_NEW_OPTION } ) );

    dialog.setValue( Form.TESTSUITE, testCase.getTestSuite().getName() );

    boolean hasLoadTests = testCase.getLoadTestCount() > 0;
    dialog.setBooleanValue( Form.CLONE_LOADTESTS, hasLoadTests );
    dialog.getFormField( Form.CLONE_LOADTESTS ).setEnabled( hasLoadTests );

    boolean hasSecurityTests = testCase.getSecurityTestCount() > 0;
    dialog.setBooleanValue( Form.CLONE_SECURITYTESTS, hasSecurityTests );
    dialog.getFormField( Form.CLONE_SECURITYTESTS ).setEnabled( hasSecurityTests );

    if( dialog.show() )
    {
      String targetProjectName = dialog.getValue( Form.PROJECT );
      String targetTestSuiteName = dialog.getValue( Form.TESTSUITE );
      String name = dialog.getValue( Form.NAME );

      WsdlProject project = testCase.getTestSuite().getProject();
      WsdlTestSuite targetTestSuite = null;
      Set<Interface> requiredInterfaces = new HashSet<Interface>();

      // to another project project?
      if( !targetProjectName.equals( project.getName() ) )
      {
        // get required interfaces
        for( int y = 0; y < testCase.getTestStepCount(); y++ )
        {
          WsdlTestStep testStep = testCase.getTestStepAt( y );
          requiredInterfaces.addAll( testStep.getRequiredInterfaces() );
        }

        project = ( WsdlProject )workspace.getProjectByName( targetProjectName );
        if( project == null )
        {
          targetProjectName = UISupport.prompt( "Enter name for new Project", "Clone TestCase", "" );
          if( targetProjectName == null )
            return;

          try
          {
            project = workspace.createProject( targetProjectName, null );
          }
          catch( SoapUIException e )
          {
            UISupport.showErrorMessage( e );
          }
View Full Code Here

    } );
    dialog.setValue( Form.NAME, "Copy of " + mockService.getName() );
    dialog.setBooleanValue( Form.CLONE_DESCRIPTION, true );
    dialog.getFormField( Form.DESCRIPTION ).setEnabled( false );
    dialog.setValue( Form.DESCRIPTION, mockService.getDescription() );
    WorkspaceImpl workspace = mockService.getProject().getWorkspace();
    dialog.setOptions( Form.PROJECT,
        ModelSupport.getNames( workspace.getOpenProjectList(), new String[] { "<Create New>" } ) );

    dialog.setValue( Form.PROJECT, mockService.getProject().getName() );

    if( dialog.show() )
    {
View Full Code Here

  }

  public WsdlMockService cloneToAnotherProject( WsdlMockService mockService, String targetProjectName, String name,
      String description )
  {
    WorkspaceImpl workspace = mockService.getProject().getWorkspace();
    WsdlProject targetProject = ( WsdlProject )workspace.getProjectByName( targetProjectName );
    if( targetProject == null )
    {
      targetProjectName = UISupport.prompt( "Enter name for new Project", "Clone MockService", "" );
      if( targetProjectName == null )
        return null;

      try
      {
        targetProject = workspace.createProject( targetProjectName, null );
      }
      catch( SoapUIException e )
      {
        UISupport.showErrorMessage( e );
      }
View Full Code Here

        @Override
        public void run() {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    SoapUI.log("Autosaving Workspace");
                    WorkspaceImpl workspaceImplementation = (WorkspaceImpl) SoapUI.getWorkspace();
                    if (workspaceImplementation != null) {
                        workspaceImplementation.save(false, true);
                    }
                }
            });
        }
View Full Code Here

    public CloneInterfaceAction() {
        super("Clone Interface", "Clones this Interface to another project");
    }

    public void perform(WsdlInterface iface, Object param) {
        WorkspaceImpl workspace = iface.getProject().getWorkspace();
        String[] names = ModelSupport.getNames(workspace.getOpenProjectList(), new String[]{"<Create New>"});

        List<String> asList = new ArrayList<String>(Arrays.asList(names));
        asList.remove(iface.getProject().getName());

        String targetProjectName = UISupport.prompt("Select target Project for cloned Interface", "Clone Interface",
                asList);
        if (targetProjectName == null) {
            return;
        }

        WsdlProject targetProject = (WsdlProject) workspace.getProjectByName(targetProjectName);
        if (targetProject == null) {
            targetProjectName = UISupport.prompt("Enter name for new Project", "Clone TestSuite", "");
            if (targetProjectName == null) {
                return;
            }

            try {
                targetProject = workspace.createProject(targetProjectName, null);
            } catch (SoapUIException e) {
                UISupport.showErrorMessage(e);
            }

            if (targetProject == null) {
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.WorkspaceImpl

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.