Class ServiceInterfaceTestCase
- java.lang.Object
-
- lumis.lptf.portal.serviceinterface.ServiceInterfaceTestCase
-
- Direct Known Subclasses:
DouiServiceInterfaceTestCase
@StableMinor(version="15.0", sinceVersion="5.6") public abstract class ServiceInterfaceTestCase extends java.lang.Object
Generic test case for Service Interfaces.
This class provides the general structure needed to test service interfaces.
The subclasses must override
getServiceId
andgetServiceInterfaceId
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.
- Since:
- 5.6.0
- Version:
- $Revision: 25304 $ $Date: 2022-10-22 22:51:05 -0300 (Sat, 22 Oct 2022) $
-
-
Field Summary
Fields Modifier and Type Field 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 duringsetUp()
.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 duringsetUp()
and disposed intearDown()
.
-
Constructor Summary
Constructors Constructor Description ServiceInterfaceTestCase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.String
getServiceId()
Return the service id to be instantiatedabstract java.lang.String
getServiceInterfaceId()
Return the service interface id to be instantiatedprotected 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 transactionvoid
tearDown()
This method performs the cleanup for the test: Disposes the transaction Ends session Delete the service interface instance created
-
-
-
Field Detail
-
renderRequestCycle
protected IRenderRequestCycle renderRequestCycle
Instance of IRenderRequestCycle used to get request and response mocks for render method.- Since:
- 5.6.0
-
actionRequestCycle
protected IActionRequestCycle actionRequestCycle
Instance of IActionRequestCycle used to get request and response mocks for processAction method.- Since:
- 5.6.0
-
structureHelper
protected StructureHelper structureHelper
Instance of StructureHelper used to create service interface instances and the needed structure (channels, pages and service instances).- Since:
- 5.6.0
-
serviceInterfaceInstanceConfig
protected ServiceInterfaceInstanceConfig serviceInterfaceInstanceConfig
The service interface instance created for the tests.- Since:
- 5.6.0
-
transaction
protected ITransaction transaction
Transaction instance, initiated duringsetUp()
and disposed intearDown()
. Structure automatically created is created within this transaction.- Since:
- 5.6.0
-
sessionConfig
protected SessionConfig sessionConfig
Instance of SessionConfig, created duringsetUp()
.- Since:
- 5.6.0
-
-
Method Detail
-
setUp
public void setUp() throws PortalException
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
- Throws:
java.lang.Exception
- whenever an error occurPortalException
-
tearDown
public void tearDown() throws PortalException
This method performs the cleanup for the test:- Disposes the transaction
- Ends session
- Delete the service interface instance created
- Throws:
java.lang.Exception
- whenever an error occur.PortalException
- Since:
- 5.6.0
-
initRequestCycles
protected void initRequestCycles()
Create the render request cycle and action request cycle.- Since:
- 5.6.0
-
getServiceId
public abstract java.lang.String getServiceId()
Return the service id to be instantiated- Returns:
- service id
- Since:
- 5.6.0
-
getServiceInterfaceId
public abstract java.lang.String getServiceInterfaceId()
Return the service interface id to be instantiated- Returns:
- service interface id
- Since:
- 5.6.0
-
-