use of com.axway.ats.rbv.db.rules.DbDateFieldRule in project ats-framework by Axway.
the class Test_DbDateFieldRule method isMatchWrongActualDateFormat.
@Test(expected = RbvException.class)
public void isMatchWrongActualDateFormat() throws RbvException {
testMetaData.putProperty("test", "test123");
DbDateFieldRule rule = new DbDateFieldRule("test", "1191941800", MatchRelation.BEFORE_DATE, "yyyy-MM-dd HH:mm:ss", "isMatchWrongActualDateFormat", true);
rule.isMatch(testMetaData);
}
use of com.axway.ats.rbv.db.rules.DbDateFieldRule in project ats-framework by Axway.
the class Test_DbDateFieldRule method isMatchNullExpectedValueNegative.
@Test
public void isMatchNullExpectedValueNegative() throws RbvException {
testMetaData.putProperty("test", "1191941800");
DbDateFieldRule rule = new DbDateFieldRule("test", null, MatchRelation.AFTER_DATE, "yyyy-MM-dd HH:mm:ss", "isMatchNullActualValue", true);
assertFalse(rule.isMatch(testMetaData));
}
use of com.axway.ats.rbv.db.rules.DbDateFieldRule in project ats-framework by Axway.
the class Test_DbDateFieldRule method isMatchDatePositiveBefore.
@Test
public void isMatchDatePositiveBefore() throws RbvException {
DbDateFieldRule rule = new DbDateFieldRule("test", tomorrow, MatchRelation.BEFORE_DATE, "isMatchWrongActualDateFormat", true);
testMetaData.putProperty("test", new Timestamp(today.getTime()));
assertTrue(rule.isMatch(testMetaData));
}
use of com.axway.ats.rbv.db.rules.DbDateFieldRule in project ats-framework by Axway.
the class Test_DbDateFieldRule method setUpTest_DbDateFieldRule.
@BeforeClass
public static void setUpTest_DbDateFieldRule() {
testMetaData = new DbMetaData();
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
today = calendar.getTime();
timestampRule = new DbDateFieldRule("test", calendar.getTime(), MatchRelation.EXACT, "isMatchTimestamp", true);
// go to tomorrow
calendar.add(Calendar.DAY_OF_YEAR, 1);
tomorrow = calendar.getTime();
}
use of com.axway.ats.rbv.db.rules.DbDateFieldRule in project ats-framework by Axway.
the class Test_DbDateFieldRule method isMatchNullActualValuePositive.
@Test
public void isMatchNullActualValuePositive() throws RbvException {
testMetaData.putProperty("test", null);
DbDateFieldRule rule = new DbDateFieldRule("test", null, MatchRelation.AFTER_DATE, "yyyy-MM-dd HH:mm:ss", "isMatchNullActualValue", true);
assertTrue(rule.isMatch(testMetaData));
}
Aggregations