public abstract class CronExpressionValidatorTest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected CronExpressionValidator |
validator |
| Constructor and Description |
|---|
CronExpressionValidatorTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertError(String cronExpression,
ErrorCode errorCode,
String message,
String value,
int errorOffset) |
protected void |
assertErrorQuartzExempt(String cronExpression,
ErrorCode errorCode,
String message,
String value,
int pos,
String whyQuartzIsWrong)
Assert that the given cron expression is invalid, but that the Quartz implementations will incorrectly
say it is valid.
|
protected void |
assertInvalidFlagL(String cronExpression,
int errorOffset) |
protected void |
assertInvalidName(String cronExpression,
String name,
int errorOffset) |
protected void |
assertInvalidNameDayOfWeek(String cronExpression,
String name,
int errorOffset) |
protected void |
assertInvalidNameField(String cronExpression,
String name,
int errorOffset) |
protected void |
assertInvalidNameRange(String cronExpression,
int errorOffset) |
protected void |
assertValid(String cronExpression) |
protected org.hamcrest.Matcher<CronSyntaxException> |
exception(String cronExpression,
ErrorCode errorCode,
String message,
String value,
int errorOffset) |
protected static String |
stackTrace(Throwable e) |
void |
testBadDayOfMonthExpressions() |
void |
testCronDoesNotGrokThatCharacter() |
void |
testEmptyString() |
void |
testHashOption() |
void |
testInvalidIncrements() |
void |
testLastFlagSpecifiedForUnsupportedField() |
void |
testLastFlagWithHyphenW() |
void |
testMisplacedCommas() |
void |
testMissingFields() |
void |
testNameRanges() |
void |
testNameRangesWrongLength() |
void |
testNumericValueOutOfRange() |
void |
testQuestionMarkInBothDayFields() |
void |
testQuestionMarkInNonDayField() |
void |
testQuestionMarkWithNonWhitespaceAfterIt() |
void |
testRealWorldErrorsFromCloud() |
void |
testSupportForLastMinusNumberForDayOfMonth() |
void |
testTrailingGarbageIgnoredIfYearsArePresent() |
void |
testTruncatedExpression() |
void |
testWeekdayFlagSpecifiedForUnsupportedField() |
protected boolean |
verifyErrorOffset(int expected,
CronSyntaxException cse)
Factored out into its own method because the Quartz implementations frequently return
-1 instead
of the correct error offset. |
protected CronExpressionValidator validator
public void testEmptyString()
public void testMissingFields()
public void testTruncatedExpression()
public void testNameRanges()
public void testNameRangesWrongLength()
public void testCronDoesNotGrokThatCharacter()
public void testQuestionMarkWithNonWhitespaceAfterIt()
public void testQuestionMarkInNonDayField()
public void testQuestionMarkInBothDayFields()
public void testMisplacedCommas()
public void testSupportForLastMinusNumberForDayOfMonth()
public void testBadDayOfMonthExpressions()
public void testLastFlagWithHyphenW()
public void testLastFlagSpecifiedForUnsupportedField()
public void testWeekdayFlagSpecifiedForUnsupportedField()
public void testHashOption()
public void testTrailingGarbageIgnoredIfYearsArePresent()
public void testNumericValueOutOfRange()
public void testInvalidIncrements()
public void testRealWorldErrorsFromCloud()
protected void assertValid(String cronExpression)
protected void assertError(String cronExpression, ErrorCode errorCode, String message, String value, int errorOffset)
protected boolean verifyErrorOffset(int expected,
CronSyntaxException cse)
-1 instead
of the correct error offset.expected - the expected error offsetcse - the actual exceptionprotected void assertErrorQuartzExempt(String cronExpression, ErrorCode errorCode, String message, String value, int pos, String whyQuartzIsWrong)
It's really sad that this is necessary, but there are just so many places where Quartz is just plain wrong that doing this any other way would be even more confusing.
cronExpression - the invalid cron expressionerrorCode - the expected error codemessage - the expected error messagevalue - the expected token valuepos - the expected error offsetwhyQuartzIsWrong - an explanation as to what Quartz does instead and why it is wrongprotected void assertInvalidFlagL(String cronExpression, int errorOffset)
protected void assertInvalidName(String cronExpression, String name, int errorOffset)
protected void assertInvalidNameField(String cronExpression, String name, int errorOffset)
protected void assertInvalidNameRange(String cronExpression, int errorOffset)
protected void assertInvalidNameDayOfWeek(String cronExpression, String name, int errorOffset)
protected org.hamcrest.Matcher<CronSyntaxException> exception(String cronExpression, ErrorCode errorCode, String message, String value, int errorOffset)
Copyright © 2017 Atlassian. All rights reserved.