Package junit.framework

Examples of junit.framework.ComparisonFailure


     * is correctly reported as a failure and not as an error in the Test
     * Runner when Cactus is used.
     */
    public void testComparisonFailure()
    {
        throw new ComparisonFailure("test comparison failure", "some value",
            "other value");
    }
View Full Code Here


public class ComparisonFailureTest extends TestCase {

    // Most of the tests are in ComparisonCompactorTest
    public void testConnection() {
        ComparisonFailure failure = new ComparisonFailure("warning", "Mary had a little lamb", "Mary had the little lamb");
        assertEquals("warning expected:<Mary had [a] little lamb> but was:<Mary had [the] little lamb>", failure.getMessage());
    }
View Full Code Here

public class ComparisonFailureTest extends TestCase {
 
  // Most of the tests are in ComparisonCompactorTest
  public void testConnection() {
    ComparisonFailure failure= new ComparisonFailure("warning", "Mary had a little lamb", "Mary had the little lamb");
    assertEquals("warning expected:<Mary had [a] little lamb> but was:<Mary had [the] little lamb>", failure.getMessage());
  }
View Full Code Here

     * is correctly reported as a failure and not as an error in the Test
     * Runner when Cactus is used.
     */
    public void testComparisonFailure()
    {
        throw new ComparisonFailure("test comparison failure", "some value",
            "other value");
    }
View Full Code Here

                + "] not found");
        }

        if (value instanceof String) {
            if (!paramValue.equals(value)) {
                throw new ComparisonFailure("Incorrect value found",
                    paramValue, (String) value);
            }
        } else if (value instanceof String[]) {
            // see if our value is among those in the array
            String[] values = (String[]) value;
View Full Code Here

   
    private static void nullCheck(String message, Node expected, Node actual) {
       
        if (expected == null) {
            throw new ComparisonFailure(message, null, actual.toXML());
        }
        else if (actual == null) {
            throw new ComparisonFailure(message, expected.toXML(), null);
        }
       
    }
View Full Code Here

                  + expected.getClass().getName()
                );
            }
        }
        catch (ClassCastException ex) {
            throw new ComparisonFailure(message
              + "; Mismatched node types: "
              + expected.getClass().getName() + " != "
              + actual.getClass().getName(),
              expected.toXML(), actual.toXML());
        }
View Full Code Here

      _errorsOccurred = true;
      if (ONLY_LOG_ERRORS) {
        logErr(3, "Value mismatch " + new String(exp) + " - " + new String(act));
        return;
      }
      throw new ComparisonFailure("Value mismatch", new String(exp), new String(act));
    }
View Full Code Here

      if (ONLY_LOG_ERRORS) {
        logErr(2, "Data mismatch " + HexDump.toHex(expData) + " - "
            + HexDump.toHex(actData));
        return;
      }
      throw new ComparisonFailure("Data mismatch", HexDump.toHex(expData), HexDump.toHex(actData));
    }
View Full Code Here

  public void testCreateKeyDigest() {
    byte[] docIdData = fromHex("17 F6 D1 6B 09 B1 5F 7B 4C 9D 03 B4 81 B5 B4 4A");
    byte[] keyDigest = Biff8RC4Key.createKeyDigest("MoneyForNothing", docIdData);
    byte[] expResult = fromHex("C2 D9 56 B2 6B");
    if (!Arrays.equals(expResult, keyDigest)) {
      throw new ComparisonFailure("keyDigest mismatch", HexDump.toHex(expResult), HexDump.toHex(keyDigest));
    }
  }
View Full Code Here

TOP

Related Classes of junit.framework.ComparisonFailure

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.