j256 / ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
http://ormlite.com/
ISC License
1.59k stars 367 forks source link

Failed tests on Windows #27

Closed konmik closed 9 years ago

konmik commented 9 years ago

Looks like we have different \n at windows.

[INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.j256.ormlite:ormlite-android:jar:4.49-SNAPSHOT [WARNING] The expression ${version} is deprecated. Please use ${project.version} instead. [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building ORMLite Android 4.49-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ ormlite-android --- [INFO] [INFO] --- replacer:1.5.0:replace (validate) @ ormlite-android --- [INFO] Replacement run on 1 file. [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ormlite-android --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:2.3.1:compile (default-compile) @ ormlite-android --- [INFO] Compiling 1 source file to O:\ormlite-android-master\target\classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ormlite-android --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory O:\ormlite-android-master\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:2.3.1:testCompile (default-testCompile) @ ormlite-android --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ ormlite-android --- [INFO] Surefire report directory: O:\ormlite-android-master\target\surefire-reports


T E S T S

Running com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest Wrote config for class com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$Foo Done. Wrote config for class com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$Foo Done. Wrote config for class com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$ForeignCollectionTest Done. Wrote config for class com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$ForeignCollectionTest Wrote config for class com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$Foreign Wrote config for class com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$Foo Done. Tests run: 4, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 0.211 sec <<< FAILURE! testForeign(com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest) Time elapsed: 0.111 sec <<< FAILURE! java.lang.AssertionError: #

generated on 2014/09/22 11:30:57

--table-start--

dataClass=com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$Foo tableName=foo

--table-fields-start--

--field-start--

fieldName=id id=true

--field-end--

--field-start--

fieldName=foreign foreign=true

--field-end--

--table-fields-end--

--table-end--

at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.assertTrue(Assert.java:43)
at com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest.testForeign(OrmLiteConfigUtilTest.java:45)
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:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testBasic(com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest) Time elapsed: 0.001 sec <<< FAILURE! java.lang.AssertionError: #

generated on 2014/09/22 11:30:57

--table-start--

dataClass=com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$Foo tableName=foo

--table-fields-start--

--field-start--

fieldName=id id=true

--field-end--

--field-start--

fieldName=foreign foreign=true

--field-end--

--table-fields-end--

--table-end--

at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.assertTrue(Assert.java:43)
at com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest.testBasic(OrmLiteConfigUtilTest.java:21)
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:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testForeignCollection(com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest) Time elapsed: 0.001 sec <<< FAILURE! java.lang.AssertionError: #

generated on 2014/09/22 11:30:57

--table-start--

dataClass=com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$ForeignCollectionTest tableName=foreigncollectiontest

--table-fields-start--

--field-start--

fieldName=collection foreignCollection=true

--field-end--

--table-fields-end--

--table-end--

at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.assertTrue(Assert.java:43)
at com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest.testForeignCollection(OrmLiteConfigUtilTest.java:37)
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:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testCurrentDir(com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest) Time elapsed: 0.026 sec <<< FAILURE! java.lang.AssertionError: #

generated on 2014/09/22 11:30:57

--table-start--

dataClass=com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$ForeignCollectionTest tableName=foreigncollectiontest

--table-fields-start--

--field-start--

fieldName=collection foreignCollection=true

--field-end--

--table-fields-end--

--table-end--

--table-start--

dataClass=com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$Foreign tableName=foreign

--table-fields-start--

--field-start--

fieldName=id id=true

--field-end--

--table-fields-end--

--table-end--

--table-start--

dataClass=com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest$Foo tableName=foo

--table-fields-start--

--field-start--

fieldName=id id=true

--field-end--

--field-start--

fieldName=foreign foreign=true

--field-end--

--table-fields-end--

--table-end--

at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.assertTrue(Assert.java:43)
at com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest.testCurrentDir(OrmLiteConfigUtilTest.java:29)
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:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Results :

Failed tests: testForeign(com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest): # (..) testBasic(com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest): # (..) testForeignCollection(com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest): # (..) testCurrentDir(com.j256.ormlite.android.apptools.OrmLiteConfigUtilTest): # (..)

Tests run: 4, Failures: 4, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9.474 s [INFO] Finished at: 2014-09-22T23:30:58+04:00 [INFO] Final Memory: 16M/98M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project ormlite-android: There are test failures. [ERROR] [ERROR] Please refer to O:\ormlite-android-master\target\surefire-reports for the individual test results. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

j256 commented 9 years ago

Is this still a problem? Unfortunately, the information you provided doesn't tell me what's going on with enough detail for me to be helpful. Please reopen with a smaller unit test if possible.

NCrouther commented 9 years ago

I am seeing this also. The unit tests look for strings of the pattern "\nXXX\n" but since Windows uses \r\n as a line separator, strings like "YYY\r\nXXX\r\nZZZ" do not contain the expected character sequence and the unit tests fail.

https://github.com/j256/ormlite-android/pull/43 fixes this issue.