|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.common.mycontainer.MyContainer
public class MyContainer
An embedded gCore container for integration testing.
The container is partially embedded, in that it requires an installation on the local file system. It can be configured with the following properties:
Utils.CONTAINER_LOCATION_PROPERTY: the path to the local installation of the container. For test
automation, the container installation should be treated as a test resource and its path ought to be relative to the
working directory..
Utils.PORT_PROPERTY: the port at which the container will be running. The default port is
Utils.DEFAULT_PORT.
Utils.STARTUP_TIMEOUT_PROPERTY: the time in millisecond within which a started container must reach a
ready or certified state (depending on weather services have been deployed in it). The default startup timeout is
Utils.DEFAULT_STARTUP_TIMEOUT.
| Constructor Summary | |
|---|---|
MyContainer(Gar... gars)
Creates an instance configured with: the properties found in a Utils.PROPERTY_FILE
zero or more Gars
Note that: |
|
MyContainer(Properties properties,
boolean merge,
Gar... gars)
An overload of MyContainer(Properties, Gar...) where the configuration properties passed in input can
augment or override those in a Utils.PROPERTY_FILE. |
|
MyContainer(Properties properties,
Gar... gars)
Creates an instance configured with: given properties zero or more Gars
Note that the Gars are deployed when the container is started. |
|
MyContainer(String location,
Gar... gars)
Creates an instance configured: a given location default properties zero or more Gars
Note that the Gars are deployed when the container is started. |
|
| Method Summary | ||
|---|---|---|
URI |
address(String wsddName)
Returns the address of a service running in the container started at the default port. |
|
URI |
address(String name,
int port)
Returns the address of a service running in a container started at a given port. |
|
void |
cleanState()
|
|
File |
configLocation()
Returns the container's configuration folder. |
|
File |
deploymentsLocation()
Returns the container's deployment folders. |
|
|
endpoint(String name,
Class<T> clazz)
Returns the implementation of service deployed in the container with application
scope. |
|
boolean |
isRunning()
|
|
File |
libLocation()
Returns the container's library folder. |
|
File |
location()
Returns the location of the container's installation. |
|
org.apache.axis.message.addressing.EndpointReferenceType |
reference(String name)
Returns a reference to a service running in the container on the default port. |
|
org.apache.axis.message.addressing.EndpointReferenceType |
reference(String name,
int port)
Returns a reference to a service running in the container started at a given port. |
|
org.apache.axis.message.addressing.EndpointReferenceType |
reference(String name,
String namespace,
String key)
Returns a reference to an instance of a service running in the container started at the default port. |
|
org.apache.axis.message.addressing.EndpointReferenceType |
reference(String name,
String namespace,
String key,
int port)
Returns a reference to an instance of a service running in the container started at a given port. |
|
void |
setEndpoint(String name,
Object endpoint)
|
|
void |
start()
Starts the container, deploying the GARs with which it was configured. |
|
void |
stop()
Stops the container. |
|
File |
storageLocation()
Returns the container's storage folder. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MyContainer(Gar... gars)
throws IllegalStateException,
IllegalArgumentException
Utils.PROPERTY_FILE
Gars
Utils.PROPERTY_FILE is delegated to Utils.findContainerProperties()
gars - the Gars
IllegalStateException - if the Utils.PROPERTY_FILE cannot be found
IllegalArgumentException - if the Utils.PROPERTY_FILE is found but contains invalid properties
public MyContainer(String location,
Gar... gars)
throws IllegalStateException,
IllegalArgumentException
Gars
location - the location of the container's installation.gars - the Gars
IllegalStateException - if the Utils.PROPERTY_FILE cannot be found
IllegalArgumentException - if the Utils.PROPERTY_FILE is found but contains invalid properties
public MyContainer(Properties properties,
Gar... gars)
throws IllegalArgumentException
Gars
properties - the propertiesgars - the Gars
IllegalArgumentException - if the the properties are invalid.
public MyContainer(Properties properties,
boolean merge,
Gar... gars)
throws IllegalArgumentException,
IllegalStateException
MyContainer(Properties, Gar...) where the configuration properties passed in input can
augment or override those in a Utils.PROPERTY_FILE.
properties - the propertiesmerge - true if the properties are to augment or override those in a
Utils.PROPERTY_FILE. The discovery of Utils.PROPERTY_FILE is delegated to
Utils.findContainerProperties()gars - the Gars.
IllegalArgumentException - if the properties are invalid
IllegalStateException - if the properties cannot be merged because Utils.PROPERTY_FILE cannot be
found| Method Detail |
|---|
public File location()
public File storageLocation()
public File configLocation()
public File deploymentsLocation()
public File libLocation()
public <T> T endpoint(String name,
Class<T> clazz)
throws IllegalStateException
application
scope.
T - the type of the implementationname - the WSDD name of the serviceclazz - the runtime representation of the implementation type
IllegalStateException - if the container is not running or a service with the WSDD name
is not running in the container
ClassCastException - if the port-type implementation cannot be cast to the given type
public void setEndpoint(String name,
Object endpoint)
throws IllegalStateException
IllegalStateException
public URI address(String wsddName)
throws IllegalStateException
wsddName - the WSDD name of the service
IllegalStateException - if the container is not running or a service with a the given WSDD name
is not running in the container
public URI address(String name,
int port)
throws IllegalStateException
name - the WSDD name of the serviceport - the port
IllegalStateException - if the container is not running or a service with a the given WSDD name
is not running in the container
public org.apache.axis.message.addressing.EndpointReferenceType reference(String name)
throws IllegalStateException
name - the WSDD name of the service
IllegalStateException - if the container is not running or a service with the given WSDD name
is not running in the container
public org.apache.axis.message.addressing.EndpointReferenceType reference(String name,
int port)
throws IllegalStateException
name - the WSDD name of the serviceport - the port
IllegalStateException - if the container is not running or a service with the given WSDD name
is not running in the container
public org.apache.axis.message.addressing.EndpointReferenceType reference(String name,
String namespace,
String key)
throws IllegalStateException
name - the WSDD name of the servicekey - the namespace of the servicekey - the key of the service instance
IllegalStateException - if the container is not running or a service with a given WSDD name
is not running in the container
public org.apache.axis.message.addressing.EndpointReferenceType reference(String name,
String namespace,
String key,
int port)
throws IllegalStateException
name - the WSDD name of the servicenamespace - the namespace of the servicekey - the key of the service instanceport - the port
IllegalStateException - if the container is not running or a service with the given WSDD name
is not running in the containerpublic boolean isRunning()
public void start()
public void stop()
public void cleanState()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||