org.junit.ComparisonFailure

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Attached test case, InheritedAttributeOverridingTest.java, has 3 tests. The first 2 tests are able to pass by a fix of HHH-9485 (introduced between Hibernate ORM 5.0.8 and 5.0.9), while the 3rd test still fails with the following error. {code} org.junit.ComparisonFailure: expected:<...ibuteOverridingTest$[D]> but was:<...ibuteOverridingTest$[C]> at org.junit.Assert.assertEquals(Assert.java:115) at org.junit.Assert.assertEquals(Assert.java:144) at org.hibernate.test.annotations.override.InheritedAttributeOverridingTest.testInheritedAttributeOverridingTargetEntity(InheritedAttributeOverridingTest.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) {code} Where subclass {{D}} is expected while its superclass {{C}} is actually returned. {code} 185 @Entity( name = "F" ) 186 public static class F extends E { 187 @ManyToOne(targetEntity=D.class) 188 public C getTarget() { 189 return super.getTarget(); 190 } 191 } {code}
    via by Osamu Nagano,
  • Attached test case, InheritedAttributeOverridingTest.java, has 3 tests. The first 2 tests are able to pass by a fix of HHH-9485 (introduced between Hibernate ORM 5.0.8 and 5.0.9), while the 3rd test still fails with the following error. {code} org.junit.ComparisonFailure: expected:<...ibuteOverridingTest$[D]> but was:<...ibuteOverridingTest$[C]> at org.junit.Assert.assertEquals(Assert.java:115) at org.junit.Assert.assertEquals(Assert.java:144) at org.hibernate.test.annotations.override.InheritedAttributeOverridingTest.testInheritedAttributeOverridingTargetEntity(InheritedAttributeOverridingTest.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) {code} Where subclass {{D}} is expected while its superclass {{C}} is actually returned. {code} 185 @Entity( name = "F" ) 186 public static class F extends E { 187 @ManyToOne(targetEntity=D.class) 188 public C getTarget() { 189 return super.getTarget(); 190 } 191 } {code}
    via by Osamu Nagano,
  • Cookies tests are flaky
    via GitHub by seato
    ,
  • Cutting on stack call
    via GitHub by stanl3y
    ,
  • src/README.md issues
    via GitHub by grosu
    ,
    • org.junit.ComparisonFailure: expected:<...ibuteOverridingTest$[D]> but was:<...ibuteOverridingTest$[C]> at org.junit.Assert.assertEquals(Assert.java:115) at org.junit.Assert.assertEquals(Assert.java:144) at org.hibernate.test.annotations.override.InheritedAttributeOverridingTest.testInheritedAttributeOverridingTargetEntity(InheritedAttributeOverridingTest.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)

    Users with the same issue

    jf-ast
    2 times, last one,
    jokester
    2 times, last one,
    osvzs
    8 times, last one,
    pulse00
    8 times, last one,
    mauritius
    3 times, last one,
    22 more bugmates