Examples of WsdlProject


Examples of com.eviware.soapui.impl.wsdl.WsdlProject

  {
    SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
    runner.setOutputFolder( "/dev/${#Project#Env}" );

    assertEquals( "/dev/", runner.getAbsoluteOutputFolder( null ) );
    WsdlProject project = new WsdlProject( "src/test-resources/sample-soapui-project.xml" );
    project.setPropertyValue( "Env", "test" );
    assertEquals( "/dev/test", runner.getAbsoluteOutputFolder( project ) );
  }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

public class WadlImporterTestCase extends TestCase
{
  public void testWadlImporter() throws Exception
  {
    WsdlProject project = new WsdlProject();
    RestService service = ( RestService )project.addNewInterface( "REST Service", RestServiceFactory.REST_TYPE );
    WadlImporter importer = new WadlImporter( service );
    importer.initFromWadl( WadlImporter.class.getResource( "/wadl/YahooSearch.wadl" ).toString() );
    assertEquals( service.getName(), "REST Service" );
    assertEquals( 1, service.getResourceList().size() );
    assertEquals( 0, service.getResourceList().get( 0 ).getChildResourceCount() );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

    assertions.clear();

    String projectFile = getProjectFile();

    WsdlProject project = ( WsdlProject )ProjectFactoryRegistry.getProjectFactory( "wsdl" ).createNew( projectFile,
        getProjectPassword() );

    if( project.isDisabled() )
      throw new Exception( "Failed to load soapUI project file [" + projectFile + "]" );

    initProject( project );
    ensureOutputFolder( project );

    log.info( "Running soapUI tests in project [" + project.getName() + "]" );

    long startTime = System.nanoTime();

    List<TestCase> testCasesToRun = new ArrayList<TestCase>();

    // validate testSuite argument
    if( testSuite != null && project.getTestSuiteByName( testSuite ) == null )
      throw new Exception( "TestSuite with name [" + testSuite + "] is missing in Project [" + project.getName()
          + "]" );

    // 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

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

    assertEquals( "test", params[1] );
  }

  public void testImportWadl() throws Exception
  {
    WsdlProject project = new WsdlProject();
    RestService service = ( RestService )project.addNewInterface( "Test", RestServiceFactory.REST_TYPE );

    new WadlImporter( service ).initFromWadl( new File( "src" + File.separatorChar + "test-resources"
        + File.separatorChar + "wadl" + File.separatorChar + "YahooSearch.wadl" ).toURI().toURL().toString() );

    assertEquals( 1, service.getOperationCount() );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

  public void testProjectRoot() throws Exception
  {
    File wsFile = new File( "test-workspace.xml" );
    WorkspaceImpl ws = new WorkspaceImpl( wsFile.getAbsolutePath(), null );

    WsdlProject project = ws.createProject( "Test Project", null );
    project.saveAs( new File( "test-project.xml" ).getAbsolutePath() );

    ws.save( false );
    ws.switchWorkspace( wsFile );
    assertEquals( 1, ws.getProjectCount() );
    assertEquals( "Test Project", ws.getProjectAt( 0 ).getName() );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

public class RestResourceTestCase extends TestCase
{
  public void testGetTemplateParams() throws Exception
  {
    WsdlProject project = new WsdlProject();
    RestService restService = ( RestService )project.addNewInterface( "Test", RestServiceFactory.REST_TYPE );
    RestResource resource = restService.addNewResource( "Resource", "/test" );

    assertEquals( resource.getDefaultParams().length, 0 );

    resource.setPath( "/{id}/test" );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

    {
      String mockServiceEndpoint = initMockServiceParameters();

      logger.info( "Loading project" );

      project = new WsdlProject( getServletContext().getRealPath( getInitParameter( "projectFile" ) ) );

      if( project == null || project.getName() == null )
        project = new WsdlProject( getServletContext().getResource( "/" + getInitParameter( "projectFile" ) )
            .toString() );

      if( project == null )
        logger.info( "Starting MockService(s)" );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

    return ( Project )modelItem;
  }

  public static String getResourceRoot( AbstractWsdlModelItem<?> testStep )
  {
    WsdlProject project = ( WsdlProject )getModelItemProject( testStep );
    if( project == null )
      return null;

    return PropertyExpander.expandProperties( project, project.getResourceRoot() );
  }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

   * @throws java.lang.Exception
   */
  @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" );

    mockService.setPort( 9081 );
    mockService.setPath( "/testmock" );

    WsdlOperation operation = ( WsdlOperation )iface.getOperationAt( 0 );
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlProject

        {
          // WsdlProject project = new WsdlProject( str, this, false,
          // !closeOnStartup &&
          // wsc.getStatus() != Status.CLOSED && wsc.getType() !=
          // Type.REMOTE, wsc.getName(), null);
          WsdlProject project = ( WsdlProject )ProjectFactoryRegistry.getProjectFactory( "wsdl" ).createNew( str,
              this, false, !closeOnStartup && wsc.getStatus() != Status.CLOSED && wsc.getType() != Type.REMOTE,
              wsc.getName(), null );

          projectList.add( project );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.