Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

FileUtilTest failure on OSX #72

Closed
Raptor399 opened this issue Jul 30, 2012 · 7 comments
Closed

FileUtilTest failure on OSX #72

Raptor399 opened this issue Jul 30, 2012 · 7 comments
Assignees

Comments

@Raptor399
Copy link
Member

I'm getting test failures on OSX for FileUtilTest.java on line 190 and line 201.
The test report is below:

-------------------------------------------------------------------------------
Test set: net.pms.util.FileUtilTest
-------------------------------------------------------------------------------
Tests run: 23, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.056 sec <<< FAILURE!
testConvertFileFromUtf16ToUtf8_inputFileIsUTF16LE(net.pms.util.FileUtilTest)  Time elapsed: 0.009 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<[tru]e> but was:<[fals]e>
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.fest.assertions.ConstructorInvoker.newInstance(ConstructorInvoker.java:36)
        at org.fest.assertions.ComparisonFailureFactory.newComparisonFailure(ComparisonFailureFactory.java:60)
        at org.fest.assertions.ComparisonFailureFactory.comparisonFailure(ComparisonFailureFactory.java:46)
        at org.fest.assertions.Fail.comparisonFailed(Fail.java:83)
        at org.fest.assertions.Fail.failIfNotEqual(Fail.java:71)
        at org.fest.assertions.GenericAssert.isEqualTo(GenericAssert.java:217)
        at org.fest.assertions.BooleanAssert.isEqualTo(BooleanAssert.java:73)
        at org.fest.assertions.BooleanAssert.isTrue(BooleanAssert.java:55)
        at net.pms.util.FileUtilTest.testConvertFileFromUtf16ToUtf8_inputFileIsUTF16LE(FileUtilTest.java:190)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:234)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:114)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:101)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
testConvertFileFromUtf16ToUtf8_inputFileIsUTF16BE(net.pms.util.FileUtilTest)  Time elapsed: 0.01 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<[tru]e> but was:<[fals]e>
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.fest.assertions.ConstructorInvoker.newInstance(ConstructorInvoker.java:36)
        at org.fest.assertions.ComparisonFailureFactory.newComparisonFailure(ComparisonFailureFactory.java:60)
        at org.fest.assertions.ComparisonFailureFactory.comparisonFailure(ComparisonFailureFactory.java:46)
        at org.fest.assertions.Fail.comparisonFailed(Fail.java:83)
        at org.fest.assertions.Fail.failIfNotEqual(Fail.java:71)
        at org.fest.assertions.GenericAssert.isEqualTo(GenericAssert.java:217)
        at org.fest.assertions.BooleanAssert.isEqualTo(BooleanAssert.java:73)
        at org.fest.assertions.BooleanAssert.isTrue(BooleanAssert.java:55)
        at net.pms.util.FileUtilTest.testConvertFileFromUtf16ToUtf8_inputFileIsUTF16BE(FileUtilTest.java:201)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:234)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:114)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:101)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
@ghost ghost assigned ikarsokolov Jul 30, 2012
@ikarsokolov
Copy link
Member

what happens if you change line 200 to

File file_utf8 = FileUtils.toFile(CLASS.getResource("russian-utf8-without-bom.srt"));

?

@Raptor399
Copy link
Member Author

Exactly the same errors.

@ikarsokolov
Copy link
Member

Strange. Please upload russian-utf16-be.srt and output-utf8-from-utf16-be.srt (comment line 202 out) from your machine. Maybe git somehow messed file encodings.

@Raptor399
Copy link
Member Author

Sorry, took a while to find, upload and link the files. Here they are.

From testConvertFileFromUtf16ToUtf8_inputFileIsUTF16LE():

From testConvertFileFromUtf16ToUtf8_inputFileIsUTF16BE():

Hope that helps!

@ikarsokolov
Copy link
Member

Like I thought files are different from ones on my machine. I don't know how to make github treat them as binary files.

@ikarsokolov
Copy link
Member

Ok, I tried to change git configuration. Please test if last commit fixes this issue for you.

@Raptor399
Copy link
Member Author

Ah, great.
Yes, most recent version works now, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants