Examples of VerifyRule


Examples of com.asakusafw.testdriver.core.VerifyRule

     * {@link ValueConditionKind} - keys.
     * @throws Exception if occur
     */
    @Test
    public void value_keys() throws Exception {
        VerifyRule rule = rule("verify/value_keys.xls");
        assertThat(rule.getKey(obj(1, "a")), equalTo(rule.getKey(obj(1, "a"))));
        assertThat(rule.getKey(obj(2, "b")), equalTo(rule.getKey(obj(2, "b"))));
        assertThat(rule.getKey(obj(1, "a")), not(equalTo(rule.getKey(obj(2, "a")))));
        assertThat(rule.getKey(obj(1, "a")), not(equalTo(rule.getKey(obj(1, "b")))));

        assertThat(rule.verify(obj(1, "a"), obj(1, "a")), is(nullValue()));
        assertThat(rule.verify(obj(1, "a"), obj(2, "b")), is(nullValue()));
        assertThat(rule.verify(null, obj(1, "a")), not(nullValue()));
        assertThat(rule.verify(obj(1, "a"), null), not(nullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     * {@link ValueConditionKind} - equals.
     * @throws Exception if occur
     */
    @Test
    public void value_equal() throws Exception {
        VerifyRule rule = rule("verify/value_equal.xls");
        assertThat(rule.verify(obj(1, "a"), obj(1, "a")), is(nullValue()));
        assertThat(rule.verify(obj(2, "b"), obj(2, "b")), is(nullValue()));
        assertThat(rule.verify(obj(1, "a"), obj(1, "b")), not(nullValue()));
        assertThat(rule.verify(obj(1, "a"), obj(2, "a")), not(nullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     * {@link ValueConditionKind} - contain.
     * @throws Exception if occur
     */
    @Test
    public void value_contain() throws Exception {
        VerifyRule rule = rule("verify/value_contain.xls");
        assertThat(rule.verify(obj(0, "ab"), obj(0, "ab")), is(nullValue()));
        assertThat(rule.verify(obj(0, "ab"), obj(0, "aba")), is(nullValue()));
        assertThat(rule.verify(obj(0, "ab"), obj(0, "aca")), not(nullValue()));
        assertThat(rule.verify(obj(0, "ab"), obj(0, "a")), not(nullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     */
    @Test
    public void value_today() throws Exception {
        // 2011/03/31 23:00:00 -> 23:30:00
        VerifyContext context = context(30);
        VerifyRule rule = rule("verify/value_today.xls", context);

        Calendar calendar = Calendar.getInstance();
        calendar.clear();
        calendar.set(2011, 2, 30);
        assertThat(rule.verify(obj(0, ""), date(calendar)), not(nullValue()));
        calendar.set(2011, 2, 31);
        assertThat(rule.verify(obj(0, ""), date(calendar)), is(nullValue()));
        calendar.set(2011, 3, 1);
        assertThat(rule.verify(obj(0, ""), date(calendar)), not(nullValue()));
        calendar.set(2011, 3, 2);
        assertThat(rule.verify(obj(0, ""), date(calendar)), not(nullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     */
    @Test
    public void value_today_started_yesterday() throws Exception {
        // 2011/03/31 23:00:00 -> 2011/04/01 0:30:00
        VerifyContext context = context(90);
        VerifyRule rule = rule("verify/value_today.xls", context);

        Calendar calendar = Calendar.getInstance();
        calendar.clear();
        calendar.set(2011, 2, 30);
        assertThat(rule.verify(obj(0, ""), date(calendar)), not(nullValue()));
        calendar.set(2011, 2, 31);
        assertThat(rule.verify(obj(0, ""), date(calendar)), is(nullValue()));
        calendar.set(2011, 3, 1);
        assertThat(rule.verify(obj(0, ""), date(calendar)), is(nullValue()));
        calendar.set(2011, 3, 2);
        assertThat(rule.verify(obj(0, ""), date(calendar)), not(nullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     */
    @Test
    public void value_now() throws Exception {
        // 2011/03/31 23:00:00 -> 23:30:00
        VerifyContext context = context(30);
        VerifyRule rule = rule("verify/value_now.xls", context);

        Calendar calendar = Calendar.getInstance();
        calendar.clear();
        calendar.set(2011, 2, 31, 0, 0, 0);
        assertThat(rule.verify(obj(0, ""), datetime(calendar)), not(nullValue()));
        calendar.set(2011, 2, 31, 22, 59, 59);
        assertThat(rule.verify(obj(0, ""), datetime(calendar)), not(nullValue()));
        calendar.set(2011, 2, 31, 2300);
        assertThat(rule.verify(obj(0, ""), datetime(calendar)), is(nullValue()));
        calendar.set(2011, 2, 31, 23, 150);
        assertThat(rule.verify(obj(0, ""), datetime(calendar)), is(nullValue()));
        calendar.set(2011, 2, 31, 23, 30, 00);
        assertThat(rule.verify(obj(0, ""), datetime(calendar)), is(nullValue()));
        calendar.set(2011, 2, 31, 23, 30, 01);
        assertThat(rule.verify(obj(0, ""), datetime(calendar)), not(nullValue()));
        calendar.set(2011, 2, 31, 23, 45, 00);
        assertThat(rule.verify(obj(0, ""), datetime(calendar)), not(nullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     * @throws Exception if occur
     */
    @Test
    public void value_expr() throws Exception {
        ExcelSheetRuleProvider provider = new ExcelSheetRuleProvider();
        VerifyRule rule = provider.get(SIMPLE, context(10), uri("verify/value_approx.xls", ":0"));
        assertThat(rule, not(nullValue()));

        assertThat(rule.verify(num(1, 1.0), num(1, 1.0)), is(nullValue()));
        assertThat(rule.verify(num(1, 1.0), num(1, 1.49)), is(nullValue()));
        assertThat(rule.verify(num(1, 1.0), num(1, 1.51)), is(notNullValue()));
        assertThat(rule.verify(num(1, 1.0), num(1, 0.51)), is(nullValue()));
        assertThat(rule.verify(num(1, 1.0), num(1, 0.49)), is(notNullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     * {@link NullityConditionKind} - normal checking.
     * @throws Exception if occur
     */
    @Test
    public void nullity_normal() throws Exception {
        VerifyRule rule = rule("verify/nullity_normal.xls");
        assertThat(rule.verify(obj(0, "a"), obj(0, "a")), is(nullValue()));
        assertThat(rule.verify(obj(null, "a"), obj(null, "a")), is(nullValue()));
        assertThat(rule.verify(obj(0, null), obj(0, null)), is(nullValue()));
        assertThat(rule.verify(obj(0, "a"), obj(null, "a")), not(nullValue()));
        assertThat(rule.verify(obj(0, "a"), obj(0, null)), is(nullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     * {@link NullityConditionKind} - accept absent.
     * @throws Exception if occur
     */
    @Test
    public void nullity_AA() throws Exception {
        VerifyRule rule = rule("verify/nullity_AA.xls");
        assertThat(rule.verify(obj(0, "a"), obj(0, "a")), not(nullValue()));
        assertThat(rule.verify(obj(0, null), obj(0, "a")), not(nullValue()));
        assertThat(rule.verify(obj(0, "a"), obj(0, null)), is(nullValue()));
        assertThat(rule.verify(obj(0, null), obj(0, null)), is(nullValue()));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.VerifyRule

     * {@link NullityConditionKind} - accept present.
     * @throws Exception if occur
     */
    @Test
    public void nullity_AP() throws Exception {
        VerifyRule rule = rule("verify/nullity_AP.xls");
        assertThat(rule.verify(obj(0, "a"), obj(0, "a")), is(nullValue()));
        assertThat(rule.verify(obj(0, null), obj(0, "a")), is(nullValue()));
        assertThat(rule.verify(obj(0, "a"), obj(0, null)), not(nullValue()));
        assertThat(rule.verify(obj(0, null), obj(0, null)), not(nullValue()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.