Testing Turmeric SOA Web Services

With the recent release of Turmeric SOA 1.1.0, I thought it was a good time to revist some of the tutorials around Turmeric.  While working on updating some these, I realised we can make testing of the web services a lot more painless.   Enter the jetty-maven-plugin.

We will use the jetty:run-war plugin.   To get started create a maven war project.  You can use the maven webapp archetype to create the project.  Once that is completed, you will need to add a dependency to your Turmeric SOA service implementation project and add a plugin entry to specify the version of jetty to use.   You will end up with something like this:


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example.test</groupId>
  <artifactId>test-hello-world</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <name>Test Hello World Web App</name>
  <packaging>war</packaging>

  <dependencies>
     <dependency>
         <groupId>org.ebayopensource.turmeric.impl</groupId>
         <artifactId>DemoHelloWorldV1</artifactId>
         <version>1.0.0</version>
     </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>7.5.4.v20111024</version>
      </plugin>
    </plugins>
  </build>

</project>

To test and deploy your web service, you just need to type run: mvn jetty:run-war

You can test that the service is deployed by point your favorite web browser to http://localhost:8080/DemoHelloWorldV1?wsdl

Remember to replace the above with the name of your service.

I typically use this for some quick testing of changes done to a service, or items that need some sort of integration testing. You could also use this to help with some automated testing, but in those cases I recommend writing your test to extend from the Turmeric SOA jetty-common-tests framework. This framework provides an embedded instance of jetty that can be used in integration tests.

Advertisements
This entry was posted in eclipse, testing, turmeric, web services, wsdl. Bookmark the permalink.

3 Responses to Testing Turmeric SOA Web Services

  1. Pingback: Testing Turmeric SOA Web Services | Eclipse | Syngu

  2. Pingback: Dave Carver: Testing Turmeric SOA Web Services

  3. Hi there, It’s really interesting to visit your blog, it has all the appropriate information about web services.I am very thankful to you for giving such kind of information.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s