eu.planets_project.services.utils.test
Class ServiceCreator

java.lang.Object
  extended by eu.planets_project.services.utils.test.ServiceCreator

public final class ServiceCreator
extends Object

Service creation utilities for use when using testing.

Author:
Andy Jackson, Fabian Steeg

Nested Class Summary
static class ServiceCreator.Mode
          Modes for creating a service implementation instance.
 
Method Summary
static
<T> T
createTestService(QName qname, Class<T> serviceImplementation, String wsdlLoc)
          This code handles the grotty details when instanciating a Planets service class for testing.
static
<T> T
createTestService(QName qname, Class<T> serviceImplementation, String wsdlLoc, ServiceCreator.Mode mode)
          This code handles the grotty details when instanciating a Planets service class for testing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTestService

public static <T> T createTestService(QName qname,
                                      Class<T> serviceImplementation,
                                      String wsdlLoc)
This code handles the grotty details when instanciating a Planets service class for testing. It reads the environment variables and sets up the test accordingly.

Type Parameters:
T - The type of the class to be tested.
Parameters:
qname - The QName of the service interface you want to invoke.
serviceImplementation - The class of your service implementation that you wish to test.
wsdlLoc - The location of the WSDL, relative to the root server context. e.g. "/pserv-if-simple/SimpleIdentifyService?wsdl"
Returns:
A new instance of a class that implements the given interface, should be assigned using the interface, not an implementation.

createTestService

public static <T> T createTestService(QName qname,
                                      Class<T> serviceImplementation,
                                      String wsdlLoc,
                                      ServiceCreator.Mode mode)
This code handles the grotty details when instanciating a Planets service class for testing.

Type Parameters:
T - The type of the class to be tested.
Parameters:
qname - The QName of the service interface you want to invoke.
serviceImplementation - The class of your service implementation that you wish to test.
wsdlLoc - The location of the WSDL, relative to the root server context. e.g. "/pserv-if-simple/SimpleIdentifyService?wsdl"
mode - The testing mode to use, e.g. Mode.SERVER
Returns:
A new instance of a class that implements the given interface, should be assigned using the interface, not an implementation.


Copyright © 2013 Open Planets Foundation. All Rights Reserved.