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


      last = iterator.next();
      actual ++;
    }
   
    if(actual < expected) {
      throw new ComparisonFailure(reason==null?"Expected were less":reason, ""+expected, ""+actual);
    }
   
    if(actual > expected) {
      throw new ComparisonFailure((reason==null?"Expected were higher":reason)+", Last: " + last, ""+expected, ""+actual);
    }   
  }
View Full Code Here

      String actual) {
    if (expected == null && actual == null)
      return;
    if (expected != null && expected.equals(actual))
      return;
    throw new ComparisonFailure(message, expected, actual);
  }
View Full Code Here

        "Expected:" + NL + expected + NL
        + "Actual:" + NL + actual + NL;
    if (java) {
      message += "Actual java:" + NL + toJavaString(actual) + NL;
    }
    throw new ComparisonFailure(message, expected, actual);
  }
View Full Code Here

        }

        if ( expectedKeys.length != actualResults.size() )
        {
            dumpResults( actualResults );
            throw new ComparisonFailure( "Results count", String.valueOf( expectedKeys.length ), String
                .valueOf( actualResults.size() ) );
        }

        assertEquals( "Results count", expectedKeys.length, actualResults.size() );
View Full Code Here

        "unchunked", expectedNormalizedOutput, outUnchunked.toString());
  }

  private static void assertContextsEqual(String msg, int want, int got) {
    if (want != got) {
      throw new ComparisonFailure(
          msg, Context.toString(want), Context.toString(got));
    }
  }
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

     * 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

    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

   */
  private static void assertDouble(double a, double b) {
    long bitsA = Double.doubleToLongBits(a);
    long bitsB = Double.doubleToLongBits(b);
    if (bitsA != bitsB) {
      throw new ComparisonFailure("value different to expected",
          new String(HexDump.longToHex(bitsA)), new String(HexDump.longToHex(bitsB)));
    }
  }
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.