Search in sources :

Example 6 with DbDateFieldRule

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));
}
Also used : DbDateFieldRule(com.axway.ats.rbv.db.rules.DbDateFieldRule) Timestamp(java.sql.Timestamp) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 7 with DbDateFieldRule

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));
}
Also used : DbDateFieldRule(com.axway.ats.rbv.db.rules.DbDateFieldRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 8 with DbDateFieldRule

use of com.axway.ats.rbv.db.rules.DbDateFieldRule in project ats-framework by Axway.

the class Test_DbDateFieldRule method isMatchRelationExactDatePositive.

@Test
public void isMatchRelationExactDatePositive() throws RbvException {
    testMetaData.putProperty("test", "2007-10-09 15:00:00");
    DbDateFieldRule rule = new DbDateFieldRule("test", "1191942000", MatchRelation.EXACT, "yyyy-MM-dd HH:mm:ss", "isMatchRelationExactDatePositive", true);
    assertTrue(rule.isMatch(testMetaData));
}
Also used : DbDateFieldRule(com.axway.ats.rbv.db.rules.DbDateFieldRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 9 with DbDateFieldRule

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));
}
Also used : DbDateFieldRule(com.axway.ats.rbv.db.rules.DbDateFieldRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 10 with DbDateFieldRule

use of com.axway.ats.rbv.db.rules.DbDateFieldRule in project ats-framework by Axway.

the class Test_DbDateFieldRule method isMatchNullActualValueNegative.

@Test
public void isMatchNullActualValueNegative() throws RbvException {
    testMetaData.putProperty("test", null);
    DbDateFieldRule rule = new DbDateFieldRule("test", "1191941800", MatchRelation.AFTER_DATE, "yyyy-MM-dd HH:mm:ss", "isMatchNullActualValue", true);
    assertFalse(rule.isMatch(testMetaData));
}
Also used : DbDateFieldRule(com.axway.ats.rbv.db.rules.DbDateFieldRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

DbDateFieldRule (com.axway.ats.rbv.db.rules.DbDateFieldRule)15 BaseTest (com.axway.ats.rbv.BaseTest)11 Test (org.junit.Test)11 PublicAtsApi (com.axway.ats.common.PublicAtsApi)3 Timestamp (java.sql.Timestamp)2 DbMetaData (com.axway.ats.rbv.db.DbMetaData)1 Calendar (java.util.Calendar)1 BeforeClass (org.junit.BeforeClass)1