|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.lptf.portal.structure.StructureHelper
@StableMinor(version="6.2", sinceVersion="5.6") public class StructureHelper
Helper class that provides common functionalities needed to perform tests with Service Interfaces.
Possible operations:
All the methods use the current session and the current transaction. The exception to this rule is the cleanup method that starts and ends its own transaction and session. So, if the client code needs to commit the current transaction during the test it is not a problem, since the cleanup will run using a new transaction.
The recommended way to use the StructureHelper is instantiate a new helper,
create and start a new transaction and session and create
the needed structure to the tests using the helper (since it uses the
current transaction and session).
When the created structure is no longer necessary, the client code
should ends the transaction and the session and call the cleanup()
method.
When using JUnit, the StructureHelper instance may be stored as an attribute,
initialized during the setUp
(or @Before
), and the
cleanup
method may be called from the tearDown
(or @After
).
Constructor Summary | |
---|---|
StructureHelper()
|
Method Summary | |
---|---|
void |
cleanup()
Deletes structure elements created by this StructureHelper, such as channels, pages and service interface instances. |
ChannelConfig |
createChannel()
Creates a channel. |
ChannelConfig |
createChannel(ChannelConfig parent)
Creates a channel within the given parent channel. |
PageConfig |
createPage()
Creates a page. |
PageConfig |
createPage(ChannelConfig channelConfig)
Creates a page. |
ServiceInstanceConfig |
createServiceInstance(ChannelConfig channelConfig,
String serviceId)
Creates a service instance. |
ServiceInstanceConfig |
createServiceInstance(String serviceId)
Creates a service instance. |
ServiceInterfaceInstanceConfig |
createServiceInterfaceInstance(PageConfig pageConfig,
ServiceInstanceConfig serviceInstanceConfig,
String serviceInterfaceId)
Creates a service interface instance. |
ServiceInterfaceInstanceConfig |
createServiceInterfaceInstance(ServiceInstanceConfig serviceInstanceConfig,
String serviceInterfaceId)
Creates a service interface instance. |
ServiceInterfaceInstanceConfig |
createServiceInterfaceInstance(String serviceId,
String serviceInterfaceId)
Creates a service interface instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StructureHelper()
Method Detail |
---|
public ChannelConfig createChannel() throws PortalException
cleanup()
will delete the created channel.
PortalException
- if the channel could not be created.public ChannelConfig createChannel(ChannelConfig parent) throws PortalException
cleanup()
will delete the created channel.
parent
- the parent channel where the newly created one will be placed.
PortalException
- if the channel could not be created.public PageConfig createPage(ChannelConfig channelConfig) throws PortalException
cleanup()
will delete the created page.
channelConfig
- the channel where the page will be created in.
PortalException
- if the page could not be created.public PageConfig createPage() throws PortalException
cleanup()
will delete the created page.
PortalException
- if the page could not be created.public ServiceInstanceConfig createServiceInstance(ChannelConfig channelConfig, String serviceId) throws PortalException
cleanup()
will delete the created
service instance.
channelConfig
- the channel where the service instance will be created in.serviceId
- the identifier of the service the service instance is of.
PortalException
- if the service instance could not be created.public ServiceInstanceConfig createServiceInstance(String serviceId) throws PortalException
cleanup()
will delete the created
service instance.
serviceId
- the identifier of the service the service instance is of.
PortalException
- if the service instance could not be created.public ServiceInterfaceInstanceConfig createServiceInterfaceInstance(String serviceId, String serviceInterfaceId) throws PortalException
cleanup()
will delete the
created service interface instance.
serviceId
- the identifier of the service the service interface
instance is of.serviceInterfaceId
- the identifier of the interface the service interface
instance is of. Does not include the service identifier in it.
PortalException
- if the service interface instance could not be created.public ServiceInterfaceInstanceConfig createServiceInterfaceInstance(ServiceInstanceConfig serviceInstanceConfig, String serviceInterfaceId) throws PortalException
cleanup()
will delete the
created service interface instance.
serviceInstanceConfig
- the service instance the service interface
instance is to belong to.serviceInterfaceId
- the identifier of the interface the service interface
instance is of. Does not include the service identifier in it.
PortalException
- if the service interface instance could not be created.public ServiceInterfaceInstanceConfig createServiceInterfaceInstance(PageConfig pageConfig, ServiceInstanceConfig serviceInstanceConfig, String serviceInterfaceId) throws PortalException
cleanup()
will delete the
created service interface instance.
pageConfig
- the page the service interface is to belong to.serviceInstanceConfig
- the service instance the service interface
instance is to belong to.serviceInterfaceId
- the identifier of the interface the service interface
instance is of. Does not include the service identifier in it.
PortalException
- if the service interface instance could not be created.public void cleanup()
The objects are deleted in the inverse order which they were created by this helper. This have to be taken into account if your test has some dependencies in its structure.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |