Search in sources :

Example 6 with WeekDay

use of com.cronutils.mapper.WeekDay in project cron-utils by jmrozanec.

the class FieldValueGeneratorFactoryTest method testCreateDayOfWeekValueGeneratorInstanceAnd.

@Test
public void testCreateDayOfWeekValueGeneratorInstanceAnd() {
    when(mockCronField.getField()).thenReturn(CronFieldName.DAY_OF_WEEK);
    when(mockCronField.getExpression()).thenReturn(mock(And.class));
    assertEquals(AndDayOfWeekValueGenerator.class, FieldValueGeneratorFactory.createDayOfWeekValueGeneratorInstance(mockCronField, 2015, 1, new WeekDay(1, false)).getClass());
}
Also used : WeekDay(com.cronutils.mapper.WeekDay) Test(org.junit.Test)

Example 7 with WeekDay

use of com.cronutils.mapper.WeekDay in project cron-utils by jmrozanec.

the class FieldValueGeneratorFactoryTest method testCreateDayOfWeekValueGeneratorInstance.

@Test
public void testCreateDayOfWeekValueGeneratorInstance() {
    when(mockCronField.getField()).thenReturn(CronFieldName.DAY_OF_WEEK);
    when(mockCronField.getExpression()).thenReturn(mock(On.class));
    assertEquals(OnDayOfWeekValueGenerator.class, FieldValueGeneratorFactory.createDayOfWeekValueGeneratorInstance(mockCronField, 2015, 1, new WeekDay(1, false)).getClass());
}
Also used : WeekDay(com.cronutils.mapper.WeekDay) Test(org.junit.Test)

Aggregations

WeekDay (com.cronutils.mapper.WeekDay)7 Test (org.junit.Test)5 IntegerFieldValue (com.cronutils.model.field.value.IntegerFieldValue)4 CronField (com.cronutils.model.field.CronField)3 Between (com.cronutils.model.field.expression.Between)2 Before (org.junit.Before)2 FieldConstraints (com.cronutils.model.field.constraint.FieldConstraints)1 Every (com.cronutils.model.field.expression.Every)1 On (com.cronutils.model.field.expression.On)1