java.lang.AssertionError: expected SQLGrammarException

Hibernate JIRA | Carsten Hammer | 1 year ago
  1. 0

    According to http://hsqldb.org/doc/guide/dataaccess-chapt.html#dac_aggregate_funcs such queries are valid: SELECT COUNT(DISTINCT firstname, lastname) FROM customer SELECT COUNT(DISTINCT (firstname, lastname)) FROM customer Because of that org.hibernate.test.cid.CompositeIdTest.testDistinctCountOfEntityWithCompositeId() fails with a java.lang.AssertionError: expected SQLGrammarException at org.junit.Assert.fail(Assert.java:88) at org.hibernate.test.cid.CompositeIdTest.testDistinctCountOfEntityWithCompositeId(CompositeIdTest.java:101) 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) as soon as you try to run the tests using hsqldb instead of h2. So it looks like the hsqldb dialect is wrong for latest versions of hsqldb.

    Hibernate JIRA | 1 year ago | Carsten Hammer
    java.lang.AssertionError: expected SQLGrammarException
  2. 0

    According to http://hsqldb.org/doc/guide/dataaccess-chapt.html#dac_aggregate_funcs such queries are valid: SELECT COUNT(DISTINCT firstname, lastname) FROM customer SELECT COUNT(DISTINCT (firstname, lastname)) FROM customer Because of that org.hibernate.test.cid.CompositeIdTest.testDistinctCountOfEntityWithCompositeId() fails with a java.lang.AssertionError: expected SQLGrammarException at org.junit.Assert.fail(Assert.java:88) at org.hibernate.test.cid.CompositeIdTest.testDistinctCountOfEntityWithCompositeId(CompositeIdTest.java:101) 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) as soon as you try to run the tests using hsqldb instead of h2. So it looks like the hsqldb dialect is wrong for latest versions of hsqldb.

    Hibernate JIRA | 1 year ago | Carsten Hammer
    java.lang.AssertionError: expected SQLGrammarException
  3. 0

    Test failures on OSX 10.10.1 / Java 1.8.0_40-ea

    GitHub | 2 years ago | xpe
    java.lang.AssertionError: Failed to convert correctly at position: 30 result (str): "/timestampAfterFeb2036,t�WP" answer (str): "/timestampAfterFeb2036,t��" result (raw): "{ 47, 116, 105, 109, 101, 115, 116, 97, 109, 112, 65, 102, 116, 101, 114, 70, 101, 98, 50, 48, 51, 54, 0, 0, 44, 116, 0, 0, 1, -80, 87, 80, 0, 0, 0, 0 };" answer (raw): "{ 47, 116, 105, 109, 101, 115, 116, 97, 109, 112, 65, 102, 116, 101, 114, 70, 101, 98, 50, 48, 51, 54, 0, 0, 44, 116, 0, 0, 1, -80, 2, -16, 0, 0, 0, 0 };"
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JAX-RS Declarative Security tests are failing

    GitHub | 2 years ago | bartoszmajsak
    java.lang.AssertionError: Basic authentication required: {realm="file"}
  6. 0

    Soften Graph Generator Tests

    GitHub | 2 years ago | spmallette
    java.lang.AssertionError: Cross community percentage should not be less than zero

  1. andyglick 7 times, last 3 months ago
  2. tfr 4 times, last 5 months ago
9 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.AssertionError

    expected SQLGrammarException

    at org.junit.Assert.fail()
  2. JUnit
    Assert.fail
    1. org.junit.Assert.fail(Assert.java:88)
    1 frame
  3. org.hibernate.test
    CompositeIdTest.testDistinctCountOfEntityWithCompositeId
    1. org.hibernate.test.cid.CompositeIdTest.testDistinctCountOfEntityWithCompositeId(CompositeIdTest.java:101)
    1 frame
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:497)
    4 frames
  5. JUnit
    FrameworkMethod.invokeExplosively
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    3 frames
  6. A Hibernate O/RM Module
    ExtendedFrameworkMethod.invokeExplosively
    1. org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45)
    1 frame
  7. JUnit
    FailOnTimeout$StatementThread.run
    1. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    2. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    3. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    4. org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
    4 frames