@StableMinor(version="12.5", sinceVersion="5.6") public abstract class ServiceInterfaceTestCase extends Object
Generic test case for Service Interfaces.
This class provides the general structure needed to test service interfaces.
The subclasses must override getServiceId
and
getServiceInterfaceId
methods in order to provide the ids for
service and interface respectively.
The setUp creates an instance of the service interface, starts a user session and a transaction.
The tearDown cleanups the service interface instance created and ends the session and transaction.
Modifier and Type | Field and Description |
---|---|
protected IActionRequestCycle |
actionRequestCycle
Instance of IActionRequestCycle used to get request and response mocks
for processAction method.
|
protected IRenderRequestCycle |
renderRequestCycle
Instance of IRenderRequestCycle used to get request and response mocks
for render method.
|
protected ServiceInterfaceInstanceConfig |
serviceInterfaceInstanceConfig
The service interface instance created for the tests.
|
protected SessionConfig |
sessionConfig
Instance of SessionConfig, created during
setUp() . |
protected StructureHelper |
structureHelper
Instance of StructureHelper used to create service interface instances
and the needed structure (channels, pages and service instances).
|
protected ITransaction |
transaction
Transaction instance, initiated during
setUp() and
disposed in tearDown() . |
Constructor and Description |
---|
ServiceInterfaceTestCase() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getServiceId()
Return the service id to be instantiated
|
abstract String |
getServiceInterfaceId()
Return the service interface id to be instantiated
|
protected void |
initRequestCycles()
Create the render request cycle and action request cycle.
|
void |
setUp()
Provides the structure needed to test a service interface:
Creates the service interface instance Creates the render and
action invocation contexts
(needed to perform tests on render and processAction methods) Starts an user session Starts a transaction |
void |
tearDown()
This method performs the cleanup for the test: Disposes the
transaction Ends session Delete the service interface
instance created
|
protected IRenderRequestCycle renderRequestCycle
protected IActionRequestCycle actionRequestCycle
protected StructureHelper structureHelper
protected ServiceInterfaceInstanceConfig serviceInterfaceInstanceConfig
protected ITransaction transaction
setUp()
and
disposed in tearDown()
. Structure automatically created is
created within this transaction.protected SessionConfig sessionConfig
setUp()
.public void setUp() throws PortalException
Exception
- whenever an error occurPortalException
public void tearDown() throws PortalException
Exception
- whenever an error occur.PortalException
protected void initRequestCycles()
public abstract String getServiceId()
public abstract String getServiceInterfaceId()
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.