joshmoore/bioformats — pull request #6 by bpindelski (2014-09-16 10:37:17+00:00)
Title: Add test and organise imports.

This should implement the test that @sbesson did in Matlab. I can still see an NPE though during the test run.

```
11:21:22.752 [main] DEBUG loci.formats.FormatHandler - FakeReader initializing /tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake
11:21:22.752 [main] DEBUG loci.formats.FormatHandler - loci.formats.in.FakeReader.initFile(/tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake)
11:21:23.041 [main] DEBUG loci.formats.Memoizer - saved to temp file: /tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/.test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake.bfmemo1290412508909367093
11:21:23.041 [main] DEBUG loci.formats.Memoizer - start[1410862882877] time[164] tag[loci.formats.Memoizer.saveMemo]
11:21:23.042 [main] DEBUG loci.formats.Memoizer - saved memo file: /tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/.test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake.bfmemo (1389 bytes)
11:21:23.042 [main] DEBUG loci.formats.Memoizer - start[1410862882656] time[386] tag[loci.formats.Memoizer.setId]
11:21:35.318 [main] WARN loci.formats.Memoizer - deleting invalid memo file: /tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/.test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake.bfmemo
com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException
Serialization trace:
core (loci.formats.in.FakeReader)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-2.24.0.jar:na]
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:528) ~[kryo-2.24.0.jar:na]
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:657) ~[kryo-2.24.0.jar:na]
at loci.formats.Memoizer$KryoDeser.loadReader(Memoizer.java:138) ~[classes/:5.1.0-SNAPSHOT]
at loci.formats.Memoizer.loadMemo(Memoizer.java:781) [classes/:5.1.0-SNAPSHOT]
at loci.formats.Memoizer.setId(Memoizer.java:580) [classes/:5.1.0-SNAPSHOT]
at loci.formats.utests.MemoizerTest.testMultipleSetIdInvocations(MemoizerTest.java:209) [test-classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_65]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_65]
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) [testng.jar:6.8.7beta-201309140723]
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) [testng.jar:6.8.7beta-201309140723]
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) [testng.jar:6.8.7beta-201309140723]
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) [testng.jar:6.8.7beta-201309140723]
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) [testng.jar:6.8.7beta-201309140723]
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) [testng.jar:6.8.7beta-201309140723]
at org.testng.TestRunner.privateRun(TestRunner.java:767) [testng.jar:6.8.7beta-201309140723]
at org.testng.TestRunner.run(TestRunner.java:617) [testng.jar:6.8.7beta-201309140723]
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) [testng.jar:6.8.7beta-201309140723]
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) [testng.jar:6.8.7beta-201309140723]
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) [testng.jar:6.8.7beta-201309140723]
at org.testng.SuiteRunner.run(SuiteRunner.java:240) [testng.jar:6.8.7beta-201309140723]
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) [testng.jar:6.8.7beta-201309140723]
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) [testng.jar:6.8.7beta-201309140723]
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) [testng.jar:6.8.7beta-201309140723]
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) [testng.jar:6.8.7beta-201309140723]
at org.testng.TestNG.run(TestNG.java:1057) [testng.jar:6.8.7beta-201309140723]
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) [testng.jar:6.8.7beta-201309140723]
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) [testng.jar:6.8.7beta-201309140723]
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175) [testng.jar:6.8.7beta-201309140723]
Caused by: java.lang.NullPointerException: null
at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:215) ~[na:1.7.0_65]
at java.util.ArrayList.ensureCapacity(ArrayList.java:199) ~[na:1.7.0_65]
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:96) ~[kryo-2.24.0.jar:na]
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:22) ~[kryo-2.24.0.jar:na]
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:679) ~[kryo-2.24.0.jar:na]
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:106) ~[kryo-2.24.0.jar:na]
... 30 common frames omitted
11:21:35.326 [main] DEBUG loci.formats.Memoizer - start[1410862895288] time[38] tag[loci.formats.Memoizer.loadMemo]
11:21:35.327 [main] DEBUG loci.formats.FormatHandler - FakeReader initializing /tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake
11:21:35.328 [main] DEBUG loci.formats.FormatHandler - loci.formats.in.FakeReader.initFile(/tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake)
11:21:35.363 [main] DEBUG loci.formats.Memoizer - saved to temp file: /tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/.test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake.bfmemo8201024293526215431
11:21:35.363 [main] DEBUG loci.formats.Memoizer - start[1410862895331] time[32] tag[loci.formats.Memoizer.saveMemo]
11:21:35.363 [main] DEBUG loci.formats.Memoizer - saved memo file: /tmp/d757e236-9a7b-4fa8-b2c2-7771051abe02/.test&pixelType=int8&sizeX=20&sizeY=20&sizeC=1&sizeZ=1&sizeT=1.fake.bfmemo (1389 bytes)
11:21:35.364 [main] DEBUG loci.formats.Memoizer - start[1410862895285] time[79] tag[loci.formats.Memoizer.setId]
```