Forum Discussion

Marc_Ludwig's avatar
Marc_Ludwig
Occasional Contributor
16 years ago

Database Date Setup and TearDown - Regression

Hi again!
Within our core product we use DBUnit to setup, teardown and perform database comparrisons within our suite of integration tests.
I can see that within SOAPUI Pro there are various techniques available for communicating with a database (e.g. Groovy, DataSink etc.) but the usage of these aoppears to be to access or update properties that are going to be used within the SOAPUI test suites.
Is there a recommended method for setting up Database test data prior to test execution (i.e. getting a database to aknown point), and comparing post Web Service execution?

Many Thanks
Marc

5 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    It seems to me that you could put corresponding setup/tearDown functionality in the TestCase or TestSuite setup/tearDown scripts (available in the TestCase or TestSuite editors). Does that seem correct for your needs?

    regards!

    /Ole
    eviware.com
  • Marc_Ludwig's avatar
    Marc_Ludwig
    Occasional Contributor
    OK. I'm implementing now.
    Thanks for the pointer.

    One further question.

    I am wanting to execute the SoapUI Pro Test Suites both within the tool, and as part of our build/junit test suite.

    I've wrapped a suite up within a JUnit Test as follows:

    SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();
    runner.setPassword(ApiTestParameter.getSenderPassword());
    runner.setUsername(ApiTestParameter.getSenderUsername());
    runner.setWssPasswordType("Text");

    runner.setProjectFile("C:/blah/blah/blah/soapui/Search Integration Tests-soapui-project.xml");
           
    runner.setEndpoint(ApiTestParameter.getWebServicesUrl() + SearchEndpointIntTest.RELATIVE_ENDPOINT);
    runner.runRunner();


    I can't however find away of providing the Project File without a fully qualified path, regardless of where I place the file.

    Is there a way round this.

    Many Thanks
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    hmm.. if you don't specify an absolute path, I guess it will be resolved relatively to your current working directory..

    How do you need it to work?

    regards!

    /Ole
    eviware.com
  • Marc_Ludwig's avatar
    Marc_Ludwig
    Occasional Contributor
    Hi
    I've tried just specifying the file name which exists within the working directory of the test (i.e. the compiled directiry) but it does not load the file, or report an error.
    Marc
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    the working directory is probably not the same as the directory of your testcase.. try

    System.out.println( new File(".").getAbsolutePath() );

    to find the current working directory..

    regards!

    /Ole
    eviware.com