Package junit.framework

Examples of junit.framework.ComparisonFailure


    assertEquals(originalPtgs.length, convertedPtgs.length);
    for (int i = 0; i < convertedPtgs.length; i++) {
      Ptg originalPtg = originalPtgs[i];
      Ptg convertedPtg = convertedPtgs[i];
      if (originalPtg.getPtgClass() != convertedPtg.getPtgClass()) {
        throw new ComparisonFailure("Different operand class for token[" + i + "]",
            String.valueOf(originalPtg.getPtgClass()), String.valueOf(convertedPtg.getPtgClass()));
      }
    }
  }
View Full Code Here


        if (!example.getExcelRendering().equals(actual)) {
          failureCount++;
          String msg = "Error rendering for examples[" + i + "] "
              + formatExample(example) + " "
              + " bad-result='" + actual + "' "
              + new ComparisonFailure(null, example.getExcelRendering(), actual).getMessage();
          System.err.println(msg);
          continue;
        }
      } catch (RuntimeException e) {
        failureCount++;
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

      actualValue = YearFracCalculator.calculate(startDate, endDate, basis);
    } catch (EvaluationException e) {
      throw new RuntimeException(e);
    }
    if (expectedValue != actualValue) {
      throw new ComparisonFailure("Direct calculate failed - row " + (row.getRowNum()+1),
          String.valueOf(expectedValue), String.valueOf(actualValue));
    }
    actualValue = formulaEvaluator.evaluate(cell).getNumberValue();
    if (expectedValue != actualValue) {
      throw new ComparisonFailure("Formula evaluate failed - row " + (row.getRowNum()+1),
          String.valueOf(expectedValue), String.valueOf(actualValue));
    }
  }
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

    byte[] actEncr = origText.getBytes();
    new RC4(k.getBytes()).encrypt(actEncr);
    byte[] expEncr = HexRead.readFromString(expEncrHex);

    if (!Arrays.equals(expEncr, actEncr)) {
      throw new ComparisonFailure("Data mismatch", HexDump.toHex(expEncr), HexDump.toHex(actEncr));
    }


    Cipher cipher;
    try {
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 = Biff8EncryptionKey.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

    assertEquals(originalPtgs.length, convertedPtgs.length);
    for (int i = 0; i < convertedPtgs.length; i++) {
      Ptg originalPtg = originalPtgs[i];
      Ptg convertedPtg = convertedPtgs[i];
      if (originalPtg.getPtgClass() != convertedPtg.getPtgClass()) {
        throw new ComparisonFailure("Different operand class for token[" + i + "]",
            String.valueOf(originalPtg.getPtgClass()), String.valueOf(convertedPtg.getPtgClass()));
      }
    }
  }
View Full Code Here

      actualValue = YearFracCalculator.calculate(startDate, endDate, basis);
    } catch (EvaluationException e) {
      throw new RuntimeException(e);
    }
    if (expectedValue != actualValue) {
      throw new ComparisonFailure("Direct calculate failed - row " + (row.getRowNum()+1),
          String.valueOf(expectedValue), String.valueOf(actualValue));
    }
    actualValue = formulaEvaluator.evaluate(cell).getNumberValue();
    if (expectedValue != actualValue) {
      throw new ComparisonFailure("Formula evaluate failed - row " + (row.getRowNum()+1),
          String.valueOf(expectedValue), String.valueOf(actualValue));
    }
  }
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

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.