Class TriggerServiceDemoTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.cronjob.TriggerServiceDemoTest
-
- All Implemented Interfaces:
JaloSessionHolder
@DemoTest public class TriggerServiceDemoTest extends ServicelayerBaseTest
-
-
Field Summary
Fields Modifier and Type Field Description protected static long
HOUR
protected static long
MINUTE
protected static long
SECOND
-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description TriggerServiceDemoTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
protected ComposedType
createType(java.lang.Class<? extends Item> parentJaloClass, java.lang.String typeCode, java.lang.Class<? extends Item> jaloClass)
Create a new Jalo type and register it with the type system.protected boolean
setTypeAttributeWritable(java.lang.String typeCode, java.lang.Class<? extends AbstractItemModel> modelClass, java.lang.String attributeQualifier, boolean writable)
Set the writable status of a type attribute.void
setUp()
void
testActivationOldWay()
void
testActivationWithCronExpression()
void
testJobCreationWithNonWritableJobAttribute()
Mapping of cron job to cron job model may not be possible when some attributes of the cron job model are not writable.-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getApplicationContext, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Field Detail
-
SECOND
protected static final long SECOND
- See Also:
- Constant Field Values
-
MINUTE
protected static final long MINUTE
- See Also:
- Constant Field Values
-
HOUR
protected static final long HOUR
- See Also:
- Constant Field Values
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
cleanUp
public void cleanUp()
-
createType
protected ComposedType createType(java.lang.Class<? extends Item> parentJaloClass, java.lang.String typeCode, java.lang.Class<? extends Item> jaloClass) throws JaloTypeException
Create a new Jalo type and register it with the type system. If a type with the same type code and Jalo class already exists, it is returned instead.- Parameters:
parentJaloClass
- The Jalo class of the parent type.typeCode
- Type code of the new type. Must be unique.jaloClass
- The Jalo class of the new type.- Returns:
- The new type instance.
- Throws:
JaloTypeException
- Thrown if the code is not unique in the type system.java.lang.IllegalStateException
- If a type with the same type code and a different Jalo class already exists in the type system.
-
setTypeAttributeWritable
protected boolean setTypeAttributeWritable(java.lang.String typeCode, java.lang.Class<? extends AbstractItemModel> modelClass, java.lang.String attributeQualifier, boolean writable)
Set the writable status of a type attribute.- Parameters:
typeCode
- The type code.modelClass
- Model class for the type.attributeQualifier
- Qualifier to identify the attribute.writable
- New writable status.- Returns:
- Original writable status of the given attribute.
-
testJobCreationWithNonWritableJobAttribute
public void testJobCreationWithNonWritableJobAttribute() throws JaloTypeException, ConsistencyCheckException
Mapping of cron job to cron job model may not be possible when some attributes of the cron job model are not writable. This test validates that the corresponding exception is caught (and logged) and does not cause failure of the cron job creation and execution.
-
testActivationWithCronExpression
public void testActivationWithCronExpression()
-
testActivationOldWay
public void testActivationOldWay()
-
-