Package com.eviware.soapui.model.testsuite

Examples of com.eviware.soapui.model.testsuite.TestSuite


  {
    project.removeProjectListener( projectListener );

    for( int c = 0; c < project.getTestSuiteCount(); c++ )
    {
      TestSuite testSuite = project.getTestSuiteAt( c );
      unmonitorTestSuite( testSuite );
    }

    for( int c = 0; c < project.getMockServiceCount(); c++ )
    {
View Full Code Here


    // start by listening to all testcases.. (since one testcase can call
    // another)
    for( int c = 0; c < project.getTestSuiteCount(); c++ )
    {
      TestSuite suite = project.getTestSuiteAt( c );
      for( int i = 0; i < suite.getTestCaseCount(); i++ )
      {
        TestCase tc = suite.getTestCaseAt( i );
        if( ( testSuite == null || suite.getName().equals( testSuite ) ) && testCase != null
            && tc.getName().equals( testCase ) )
          testCasesToRun.add( tc );

        addListeners( tc );
      }
    }

    try
    {
      // validate testSuite argument
      if( testCase != null && testCasesToRun.size() == 0 )
      {
        if( testSuite == null )
          throw new Exception( "TestCase with name [" + testCase + "] is missing in Project [" + project.getName()
              + "]" );
        else
          throw new Exception( "TestCase with name [" + testCase + "] in TestSuite [" + testSuite
              + "] is missing in Project [" + project.getName() + "]" );
      }

      // decide what to run
      if( testCasesToRun.size() > 0 )
      {
        for( TestCase testCase : testCasesToRun )
          runTestCase( ( WsdlTestCase )testCase );
      }
      else if( testSuite != null )
      {
        WsdlTestSuite ts = project.getTestSuiteByName( testSuite );
        if( ts == null )
          throw new Exception( "TestSuite with name [" + testSuite + "] not found in project" );
        else
          runSuite( ts );
      }
      else
      {
        runProject( project );
      }

      long timeTaken = ( System.nanoTime() - startTime ) / 1000000;

      if( printReport )
      {
        printReport( timeTaken );
      }

      exportReports( project );

      if( saveAfterRun && !project.isRemote() )
      {
        try
        {
          project.save();
        }
        catch( Throwable t )
        {
          log.error( "Failed to save project", t );
        }
      }

      if( ( assertions.size() > 0 || failedTests.size() > 0 ) && !ignoreErrors )
      {
        throwFailureException();
      }

      return true;
    }
    finally
    {
      for( int c = 0; c < project.getTestSuiteCount(); c++ )
      {
        TestSuite suite = project.getTestSuiteAt( c );
        for( int i = 0; i < suite.getTestCaseCount(); i++ )
        {
          TestCase tc = suite.getTestCaseAt( i );
          removeListeners( tc );
        }
      }
    }
  }
View Full Code Here

  @Before
  public void setUp() throws Exception
  {
    WsdlProject project = new WsdlProject( "src" + File.separatorChar + "test-resources" + File.separatorChar
        + "sample-soapui-project.xml" );
    TestSuite testSuite = project.getTestSuiteByName( "Test Suite" );
    testCase = ( WsdlTestCase )testSuite.getTestCaseByName( "Test Conversions" );

    WsdlInterface iface = ( WsdlInterface )project.getInterfaceAt( 0 );

    mockService = ( WsdlMockService )project.addNewMockService( "MockService 1" );
View Full Code Here

    // start by listening to all testcases.. (since one testcase can call
    // another)
    for( int c = 0; c < project.getTestSuiteCount(); c++ )
    {
      TestSuite suite = project.getTestSuiteAt( c );
      for( int i = 0; i < suite.getTestCaseCount(); i++ )
      {
        TestCase tc = suite.getTestCaseAt( i );
        if( ( testSuite == null || suite.getName().equals( suite.getName() ) ) && testCase != null
            && tc.getName().equals( testCase ) )
          testCasesToRun.add( tc );

        addListeners( tc );
      }
View Full Code Here

    {
      Component result = super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus );

      if( value instanceof TestSuite )
      {
        TestSuite item = ( TestSuite )value;
        setIcon( item.getIcon() );
        setText( item.getName() );
      }

      return result;
    }
View Full Code Here

{
  public void testAssert() throws Exception
  {
    WsdlProject project = new WsdlProject( "src" + File.separatorChar + "test-resources" + File.separatorChar
        + "sample-soapui-project.xml" );
    TestSuite testSuite = project.getTestSuiteByName( "Test Suite" );
    com.eviware.soapui.model.testsuite.TestCase testCase = testSuite.getTestCaseByName( "Test Conversions" );

    WsdlTestRequestStep testStep = ( WsdlTestRequestStep )testCase.getTestStepByName( "SEK to USD Test" );

    MockTestRunner testRunner = new MockTestRunner( ( WsdlTestCase )testStep.getTestCase() );
    MockTestRunContext testRunContext = new MockTestRunContext( testRunner, ( WsdlTestStep )testStep );
View Full Code Here

      if( !cloneDescription )
      {
        description = dialog.getValue( Form.DESCRIPTION );
      }

      TestSuite result = null;

      if( targetProjectName.equals( testSuite.getProject().getName() ) )
      {
        result = cloneTestSuiteWithinProject( testSuite, name, project, description );
      }
View Full Code Here

            dialog.setOptions( Form.TESTSUITE, names );
            dialog.setValue( Form.TESTSUITE, names[0] );

            if( names.length > 1 )
            {
              TestSuite testSuite = project.getTestSuiteByName( names[0] );
              dialog.setOptions( Form.TESTCASE,
                  ModelSupport.getNames( testSuite.getTestCaseList(), new String[] { CREATE_NEW_OPTION } ) );
            }
            else
            {
              dialog.setOptions( Form.TESTCASE, new String[] { CREATE_NEW_OPTION } );
            }
          }
        }
      } );

      dialog.getFormField( Form.TESTSUITE ).addFormFieldListener( new XFormFieldListener()
      {

        public void valueChanged( XFormField sourceField, String newValue, String oldValue )
        {
          if( newValue.equals( CREATE_NEW_OPTION ) )
          {
            dialog.setOptions( Form.TESTCASE, new String[] { CREATE_NEW_OPTION } );
          }
          else
          {
            String projectName = dialog.getValue( Form.PROJECT );
            Project project = SoapUI.getWorkspace().getProjectByName( projectName );
            TestSuite testSuite = project.getTestSuiteByName( newValue );
            dialog.setOptions( Form.TESTCASE, testSuite == null ? new String[] { CREATE_NEW_OPTION }
                : ModelSupport.getNames( testSuite.getTestCaseList(), new String[] { CREATE_NEW_OPTION } ) );
          }
        }
      } );

    }
View Full Code Here

  private boolean hasRunningTests( WsdlProject project )
  {
    for( int c = 0; c < project.getTestSuiteCount(); c++ )
    {
      TestSuite testSuite = project.getTestSuiteAt( c );
      for( int i = 0; i < testSuite.getTestCaseCount(); i++ )
      {
        if( SoapUI.getTestMonitor().hasRunningTest( testSuite.getTestCaseAt( i ) ) )
        {
          return true;
        }
      }
    }
View Full Code Here

      }
      return items;
    }

    Project project = securityScan.getTestStep().getTestCase().getTestSuite().getProject();
    TestSuite targetTestSuite = project.getTestSuiteByName( targetTestSuiteName );
    TestCase targetTestCase = targetTestSuite.getTestCaseByName( targetTestCaseName );
    SecurityTest targetSecurityTest = targetTestCase.getSecurityTestByName( targetSecurityTestName );
    TestStep targetTestStep = targetTestCase.getTestStepByName( targetSecurityTestStepName );

    boolean overwrite = dialog.getBooleanValue( CloneParameterDialog.OVERWRITE );
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.testsuite.TestSuite

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.