org.junit.ComparisonFailure: Multi-line string inserted incorrectly expected:<...-line comment line 1[ -- line 2' ] /* line 3 */> but was:<...-line comment line 1[ -- line 2'] /* line 3 */>

Hibernate JIRA | Harry Cummings | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    A clean checkout on Windows results in two test failures. They're actually both the same test; it just runs twice (in a base class and a derived class): CommandExtractorServiceTest. testImportFile MultiLineImportFileTest. testImportFile The full test output is: {code} org.junit.ComparisonFailure: Multi-line string inserted incorrectly expected:<...-line comment line 1[ -- line 2' ] /* line 3 */> but was:<...-line comment line 1[ -- line 2'] /* line 3 */> at org.junit.Assert.assertEquals(Assert.java:125) at org.hibernate.test.fileimport.MultiLineImportFileTest.testImportFile(MultiLineImportFileTest.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62) {code} This isn't a problem on the CI server, but I'm not the only person to encounter it. See, for example, [this comment|https://hibernate.atlassian.net/browse/HHH-7714?focusedCommentId=50612&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-50612] I've fixed this locally myself. Pull request coming shortly...

    Hibernate JIRA | 4 years ago | Harry Cummings
    org.junit.ComparisonFailure: Multi-line string inserted incorrectly expected:<...-line comment line 1[ -- line 2' ] /* line 3 */> but was:<...-line comment line 1[ -- line 2'] /* line 3 */>
  2. 0

    A clean checkout on Windows results in two test failures. They're actually both the same test; it just runs twice (in a base class and a derived class): CommandExtractorServiceTest. testImportFile MultiLineImportFileTest. testImportFile The full test output is: {code} org.junit.ComparisonFailure: Multi-line string inserted incorrectly expected:<...-line comment line 1[ -- line 2' ] /* line 3 */> but was:<...-line comment line 1[ -- line 2'] /* line 3 */> at org.junit.Assert.assertEquals(Assert.java:125) at org.hibernate.test.fileimport.MultiLineImportFileTest.testImportFile(MultiLineImportFileTest.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62) {code} This isn't a problem on the CI server, but I'm not the only person to encounter it. See, for example, [this comment|https://hibernate.atlassian.net/browse/HHH-7714?focusedCommentId=50612&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-50612] I've fixed this locally myself. Pull request coming shortly...

    Hibernate JIRA | 4 years ago | Harry Cummings
    org.junit.ComparisonFailure: Multi-line string inserted incorrectly expected:<...-line comment line 1[ -- line 2' ] /* line 3 */> but was:<...-line comment line 1[ -- line 2'] /* line 3 */>
  3. 0

    org.hibernate.test.fileimport.CommandExtractorServiceTest > testImportFile FAILED org.junit.ComparisonFailure org.hibernate.test.fileimport.MultiLineImportFileTest > testImportFile FAILED org.junit.ComparisonFailure at MultiLineImportFileTest.java:66 <?xml version="1.0" encoding="UTF-8"?> <testsuite name="org.hibernate.test.fileimport.MultiLineImportFileTest" tests="1" skipped="0" failures="1" errors="0" timestamp="2016-07-06T09:42:26" hostname="chammer-PC" time="0.137"> <properties/> <testcase name="testImportFile" classname="org.hibernate.test.fileimport.MultiLineImportFileTest" time="0.137"> <failure message="org.junit.ComparisonFailure: Multi-line string inserted incorrectly expected:&lt;...-line comment line 1[&#13;&#10;-- line 2'&#13;]&#10;/* line 3 */&gt; but was:&lt;...-line comment line 1[&#10;-- line 2']&#10;/* line 3 */&gt;" type="org.junit.ComparisonFailure">org.junit.ComparisonFailure: Multi-line string inserted incorrectly expected:&lt;...-line comment line 1[ -- line 2' ] /* line 3 */&gt; but was:&lt;...-line comment line 1[ -- line 2'] /* line 3 */&gt; at org.junit.Assert.assertEquals(Assert.java:115) at org.hibernate.test.fileimport.MultiLineImportFileTest.testImportFile(MultiLineImportFileTest.java:66) 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) </failure> ...

    Hibernate JIRA | 9 months ago | Carsten Hammer
    org.junit.ComparisonFailure: Multi-line string inserted incorrectly expected:&lt;...-line comment line 1[ -- line 2' ] /* line 3 */&gt; but was:&lt;...-line comment line 1[ -- line 2'] /* line 3 */&gt;
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Multi-byte character support not working on Mac

    GitHub | 4 years ago | jtaylor-sfdc
    org.junit.ComparisonFailure: SELECT length('\u2026ö\u2026¶\u2026\u221e\u2026\u220f') FROM BTABLE LIMIT 1 expected:<[4]> but was:<[8]>
  6. 0

    Failed test

    GitHub | 3 years ago | tram
    org.junit.ComparisonFailure: KNXCoreTypeMapper.toDPTValue() test failed for datapoint type "19.001" expected:< 1[900-01-01 00]:00:00 > but was:< 1[899-12-31 08]:00:00 >
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. org.junit.ComparisonFailure

    Multi-line string inserted incorrectly expected:<...-line comment line 1[ -- line 2' ] /* line 3 */> but was:<...-line comment line 1[ -- line 2'] /* line 3 */>

    at org.junit.Assert.assertEquals()
  2. JUnit
    Assert.assertEquals
    1. org.junit.Assert.assertEquals(Assert.java:125)
    1 frame
  3. org.hibernate.test
    MultiLineImportFileTest.testImportFile
    1. org.hibernate.test.fileimport.MultiLineImportFileTest.testImportFile(MultiLineImportFileTest.java:83)
    1 frame
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  5. JUnit
    FrameworkMethod.invokeExplosively
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    3 frames
  6. A Hibernate O/RM Module
    ExtendedFrameworkMethod.invokeExplosively
    1. org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
    1 frame
  7. JUnit
    FailOnTimeout$StatementThread.run
    1. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    2. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    3. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
    4. org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
    4 frames