Package com.proofpoint.testing.EquivalenceTester

Examples of com.proofpoint.testing.EquivalenceTester.PairCheckFailure


    public void testCheckFailure()
    {
        Object o1 = new Object();
        Object o2 = new Object();
        assertEquals(new ElementCheckFailure(EQUAL, 0, 0, o1), new ElementCheckFailure(EQUAL, 0, 0, o1));
        assertEquals(new PairCheckFailure(EQUAL, 0, 0, o1, 1, 0, o2), new PairCheckFailure(EQUAL, 0, 0, o1, 1, 0, o2));
    }
View Full Code Here


        }
        catch (EquivalenceAssertionError e) {
            assertEqualsIgnoreOrder(
                    e.getFailures(),
                    newArrayList(
                            new PairCheckFailure(EQUAL, 0, 0, "foo", 1, 0, "foo"),
                            new PairCheckFailure(EQUAL, 1, 0, "foo", 0, 0, "foo"),
                            new PairCheckFailure(COMPARE_EQUAL, 0, 0, "foo", 1, 0, "foo"),
                            new PairCheckFailure(COMPARE_EQUAL, 1, 0, "foo", 0, 0, "foo")
                    )
            );
        }
    }
View Full Code Here

                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(NOT_EQUAL, 0, 0, o1, 0, 1, o3),
                    new PairCheckFailure(NOT_EQUAL, 0, 0, o1, 0, 2, o2),
                    new PairCheckFailure(NOT_EQUAL, 0, 2, o2, 0, 1, o3));
        }
    }
View Full Code Here

                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(COMPARE_NOT_EQUAL, 0, 0, o1, 0, 1, o3),
                    new PairCheckFailure(COMPARE_NOT_EQUAL, 0, 0, o1, 0, 2, o2),
                    new PairCheckFailure(COMPARE_NOT_EQUAL, 0, 2, o2, 0, 1, o3));
        }
    }
View Full Code Here

                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(COMPARE_CLASS_CAST_EXCEPTION, 0, 1, "Hello", 0, 0, notComparable),
                    new PairCheckFailure(NOT_EQUAL, 0, 0, notComparable, 0, 1, "Hello"),
                    new PairCheckFailure(NOT_EQUAL, 0, 1, "Hello", 0, 0, notComparable),
                    new PairCheckFailure(HASH_CODE_NOT_SAME, 0, 0, notComparable, 0, 1, "Hello")
            );
        }

        try {
            equivalenceTester()
                    .addEquivalentGroup("Hello", notComparable)
                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(COMPARE_CLASS_CAST_EXCEPTION, 0, 0, "Hello", 0, 1, notComparable),
                    new PairCheckFailure(NOT_EQUAL, 0, 0, "Hello", 0, 1, notComparable),
                    new PairCheckFailure(NOT_EQUAL, 0, 1, notComparable, 0, 0, "Hello"),
                    new PairCheckFailure(HASH_CODE_NOT_SAME, 0, 0, "Hello", 0, 1, notComparable)
            );
        }

        try {
            equivalenceTester()
                    .addEquivalentGroup(notComparable)
                    .addEquivalentGroup("Hello")
                    .check();
            fail("EquivalenceTester should have throw an EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(COMPARE_CLASS_CAST_EXCEPTION, 1, 0, "Hello", 0, 0, notComparable)
            );
        }

        try {
            equivalenceTester()
                    .addEquivalentGroup("Hello")
                    .addEquivalentGroup(notComparable)
                    .check();
            fail("EquivalenceTester should have throw an EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(COMPARE_CLASS_CAST_EXCEPTION, 0, 0, "Hello", 1, 0, notComparable)
            );
        }
    }
View Full Code Here

                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(NOT_LESS_THAN, 0, 0, 1, 1, 0, 0),
                    new PairCheckFailure(NOT_GREATER_THAN, 1, 0, 0, 0, 0, 1)
            );
        }
        try {
            comparisonTester()
                    .addLesserGroup("bob")
                    .addGreaterGroup("alice")
                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(NOT_LESS_THAN, 0, 0, "bob", 1, 0, "alice"),
                    new PairCheckFailure(NOT_GREATER_THAN, 1, 0, "alice", 0, 0, "bob")
            );
        }
        try {
            comparisonTester()
                    .addLesserGroup(1)
                    .addGreaterGroup(0, 0)
                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(NOT_LESS_THAN, 0, 0, 1, 1, 0, 0),
                    new PairCheckFailure(NOT_GREATER_THAN, 1, 0, 0, 0, 0, 1),
                    new PairCheckFailure(NOT_LESS_THAN, 0, 0, 1, 1, 1, 0),
                    new PairCheckFailure(NOT_GREATER_THAN, 1, 1, 0, 0, 0, 1)
            );
        }
        try {
            comparisonTester()
                    .addLesserGroup("bob")
                    .addGreaterGroup("alice", "alice")
                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(NOT_LESS_THAN, 0, 0, "bob", 1, 0, "alice"),
                    new PairCheckFailure(NOT_GREATER_THAN, 1, 0, "alice", 0, 0, "bob"),
                    new PairCheckFailure(NOT_LESS_THAN, 0, 0, "bob", 1, 1, "alice"),
                    new PairCheckFailure(NOT_GREATER_THAN, 1, 1, "alice", 0, 0, "bob")
            );
        }
    }
View Full Code Here

                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(NOT_EQUAL, 1, 0, 1, 1, 1, 2),
                    new PairCheckFailure(NOT_EQUAL, 1, 1, 2, 1, 0, 1),
                    new PairCheckFailure(COMPARE_NOT_EQUAL, 1, 0, 1, 1, 1, 2),
                    new PairCheckFailure(COMPARE_NOT_EQUAL, 1, 1, 2, 1, 0, 1),
                    new PairCheckFailure(HASH_CODE_NOT_SAME, 1, 0, 1, 1, 1, 2)
            );
        }
        try {
            comparisonTester()
                    .addLesserGroup("alice")
                    .addGreaterGroup("bob", "charlie")
                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(NOT_EQUAL, 1, 0, "bob", 1, 1, "charlie"),
                    new PairCheckFailure(NOT_EQUAL, 1, 1, "charlie", 1, 0, "bob"),
                    new PairCheckFailure(COMPARE_NOT_EQUAL, 1, 0, "bob", 1, 1, "charlie"),
                    new PairCheckFailure(COMPARE_NOT_EQUAL, 1, 1, "charlie", 1, 0, "bob"),
                    new PairCheckFailure(HASH_CODE_NOT_SAME, 1, 0, "bob", 1, 1, "charlie")
            );
        }

    }
View Full Code Here

                    .check();
            fail("Expected EquivalenceAssertionError");
        }
        catch (EquivalenceAssertionError e) {
            assertExpectedFailures(e,
                    new PairCheckFailure(COMPARE_CLASS_CAST_EXCEPTION, 0, 0, 5, 1, 0, "string"),
                    new PairCheckFailure(COMPARE_CLASS_CAST_EXCEPTION, 1, 0, "string", 0, 0, 5)
            );
        }
    }
View Full Code Here

TOP

Related Classes of com.proofpoint.testing.EquivalenceTester.PairCheckFailure

Copyright © 2018 www.massapicom. 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.