use of com.cronutils.model.field.value.IntegerFieldValue in project cron-utils by jmrozanec.
the class ValidationFieldExpressionVisitorTest method testVisitOn.
@Test
public void testVisitOn() {
On on = new On(new IntegerFieldValue(LOW));
assertEquals(on, on.accept(strictVisitor));
assertEquals(on, on.accept(visitor));
on = new On(new IntegerFieldValue(DEFAULT_INT));
assertEquals(on, on.accept(strictVisitor));
assertEquals(on, on.accept(visitor));
on = new On(new SpecialCharFieldValue(SpecialChar.L));
assertEquals(on, on.accept(strictVisitor));
assertEquals(on, on.accept(visitor));
on = new On(new IntegerFieldValue(LOW), new SpecialCharFieldValue(SpecialChar.L), new IntegerFieldValue(HIGH));
assertEquals(on, on.accept(strictVisitor));
assertEquals(on, on.accept(visitor));
on = new On(new IntegerFieldValue(LOW), new SpecialCharFieldValue(SpecialChar.LW), new IntegerFieldValue(DEFAULT_INT));
assertEquals(on, on.accept(strictVisitor));
assertEquals(on, on.accept(visitor));
}
use of com.cronutils.model.field.value.IntegerFieldValue in project cron-utils by jmrozanec.
the class ValidationFieldExpressionVisitorTest method testStrictVisitAndBadExpression.
@Test(expected = IllegalArgumentException.class)
public void testStrictVisitAndBadExpression() {
final And and = new And();
final Between b1 = new Between(new IntegerFieldValue(LOW), new IntegerFieldValue(MIDDLE));
final Between b2 = new Between(new IntegerFieldValue(MIDDLE), new IntegerFieldValue(HIGHOOR));
final On on = new On(new IntegerFieldValue(LOW));
and.and(b1).and(b2).and(b2).and(on);
and.accept(strictVisitor);
}
use of com.cronutils.model.field.value.IntegerFieldValue in project cron-utils by jmrozanec.
the class BetweenTest method testNonNumericRangeSupported.
@Test
public void testNonNumericRangeSupported() {
final SpecialChar specialChar = SpecialChar.L;
final Between between = new Between(new SpecialCharFieldValue(specialChar), new IntegerFieldValue(to));
assertEquals(specialChar, between.getFrom().getValue());
assertEquals(to, between.getTo().getValue());
assertEquals(String.format("%s-%s", specialChar, to), between.asString());
}
Aggregations