jokiazhang / metadata-extractor

Automatically exported from code.google.com/p/metadata-extractor
0 stars 0 forks source link

PngMetadataReadTest failure on master (with patch) #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run unit tests of the latest 2.7.0 snapshot in a different timezone.

What is the expected output? What do you see instead?
Expected: tests pass
Seen:
org.junit.ComparisonFailure: expected:<[Tue Jan 01 04:08:30 GMT 2013]> but 
was:<[Mon Dec 31 23:08:30 EST 2012]>
        at org.junit.Assert.assertEquals(Assert.java:115)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at com.drew.imaging.png.PngMetadataReaderTest.testGimpGreyscaleWithManyChunks(PngMetadataReaderTest.java:58)
        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:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        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: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: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)

Notice that the expected and actual are five hours apart, the difference 
between GMT and EST.

What version of the product are you using? On what operating system?
2.7.0 snapshot from Git. Mac OS X 10.9.1.

Please provide any additional information below.
I've attached a patch to fix the unit test.

Original issue reported on code.google.com by tnad...@anthemengineering.com on 14 Mar 2014 at 7:17

Attachments:

GoogleCodeExporter commented 9 years ago
This patch works well IF your default Locale is US. I had to change line 64 to:
final SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z 
yyyy", Locale.US);
to mak it work for me.

Original comment by bendik.j...@gmail.com on 29 Jul 2014 at 10:14

Attachments:

GoogleCodeExporter commented 9 years ago
Your latest patch worked fine for me. I cloned trunk on Ubuntu 14.04.1 LTS.

java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)

Original comment by fred...@hederstierna.com on 5 Aug 2014 at 4:17

GoogleCodeExporter commented 9 years ago
This issue has been migrated along with the project to GitHub:

https://github.com/drewnoakes/metadata-extractor/issues/6

Original comment by drewnoakes on 20 Nov 2014 at 9:31

GoogleCodeExporter commented 9 years ago
Fixed on GitHub.

Original comment by drewnoakes on 4 Dec 2014 at 11:44