Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. JUnitTestRunner.main() has thrown an AssertionFailedError
    Apache Ant + JUnit
    0
    0
    0
  2. JUnit fail method
    JUnit
    94
    256
    97

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
junit.framework.AssertionFailedError: Unexpected exception See build/ql/tmp/hive.log, or try "ant test ... -Dtest.silent=false" to get more logs.
    at junit.framework.Assert.fail(Assert.java:50)
    at org.apache.hadoop.hive.cli.TestNegativeCliDriver.testNegativeCliDriver_fileformat_void_input(TestNegativeCliDriver.java:5870)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
13 frames hidden

Solution

JaviRpo2 months ago

AssertionFailedError is thrown when using JUnit's internal assertions methods compare two different values and those are not equal. Also, the developer can invoke the method when the test logic fails.

The simplest code to reproduce the error is the following:

import static org.junit.Assert.fail;

public class FailTest { 

   @Test 
   public void shouldAssertStrings() { 
      ...
      if( ... ) {
         fail("Any message");
      }
   } 
}

Mind the static import. The fail is part of the JUnit API.

External results for this pattern (10)

  1. rdeltourvia GitHub1 day ago
    Outputted json isn't as expected. Values do not match(/messages[6]/message) Expected: "Error while parsing file 'The version is required in the XML declaration.'." Actual: "Error while parsing file 'XML宣言にはバージョンが必要です。'." Values do not match(/messages[7]/message) Expected: "Fatal Error while parsing file 'The version is required in the XML declaration.'." Actual: "Fatal Error while parsing file 'XML宣言にはバージョンが必要です。'." expected:<0> but was:<2>
    Show stack trace
  2. No message found for this stack trace.
    Show stack trace
  3. lewismcvia GitHub1 day ago
    Validation of file succeeded when it should have failed expected:<false> but was:<true>
    Show stack trace
  4. apupiervia GitHub1 day ago
    expected:<0> but was:<1>
    Show stack trace
  5. johnjohndoevia GitHub1 week ago
    No message found for this stack trace.
    Show stack trace
  6. Dawid Loubservia Google Groups1 week ago
    expected:<1> but was:<0>
    Show stack trace
  7. Dawid Loubservia Google Groups1 week ago
    null
    Show stack trace
  8. El Deffovia Google Groups1 week ago
    null
    Show stack trace
  9. Maxime Gréauvia JIRA1 week ago
    Expected: <null> but was: file:/srv/ciagent/workspace/target/test-classes/repo/MyClass.groovy
    Show stack trace
  10. Franz Willervia JIRA1 week ago
    Created Document not found! uid:create.test.1.3
    Show stack trace