<div dir="ltr">Hi Christophe,<div><br></div><div><div>&gt; I am new to Java and Maven so I followed instructions from</div><div>&gt; <a href="http://loci.wisc.edu/bio-formats/developing-bio-formats">http://loci.wisc.edu/bio-formats/developing-bio-formats</a>. Using Eclipse</div>

<div>&gt; (3.7 Indigo) I am unable to run the tests. I guess I haven&#39;t set up</div><div>&gt; the project properly.</div></div><div><br></div><div style>Actually, the probelm is that the Eclipse support was recently broken on the develop branch. There is a PR in progress to make it work again [1]. For stability, you may want to consider developing your reader against the v4.4.7 release tag [2] instead of using develop.</div>

<div style><br></div><div style><div>&gt; Where is the correct place to put a unit test case for the new reader</div><div>&gt; class?</div><div><br></div><div style>The Bio-Formats convention is to use the same package name as the reader class, but in the test/ subtree rather than src/.</div>

<div style><br></div><div style>But really, you can develop your own reader however you want outside of the core Bio-Formats source. You can even instantiate an ImageReader that includes your reader in addition to the normal ones [4]. What you cannot do at the moment -- although it is one of the benefits of the SCIFIO refactoring [3] -- is have your reader get automatically discovered and used when it is present on the classpath. Of course, if you are planning to contribute your reader to the core Bio-Formats distribution, this is a non-issue.</div>

<div><br></div></div><div style>Regards,</div><div style>Curtis</div><div style><br></div><div style>[1] <a href="https://github.com/openmicroscopy/bioformats/pull/480">https://github.com/openmicroscopy/bioformats/pull/480</a></div>

<div class="gmail_extra">[2] <a href="https://github.com/openmicroscopy/bioformats/tree/v4.4.7">https://github.com/openmicroscopy/bioformats/tree/v4.4.7</a></div><div class="gmail_extra">[3] <a href="https://github.com/hinerm/bioformats">https://github.com/hinerm/bioformats</a></div>

<div class="gmail_extra"><br></div><div class="gmail_extra">[4] For example:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">import java.io.IOException;</div><div class="gmail_extra">

import loci.formats.ClassList;</div><div class="gmail_extra">import loci.formats.FormatException;</div><div class="gmail_extra">import loci.formats.FormatReader;</div><div class="gmail_extra">import loci.formats.IFormatReader;</div>

<div class="gmail_extra">import loci.formats.ImageReader;</div><div class="gmail_extra"><br></div><div class="gmail_extra">public class CustomReader {</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span class="" style="white-space:pre">        </span>public static void main(final String[] args) throws Exception {</div>

<div class="gmail_extra"><span class="" style="white-space:pre">                </span>final ClassList&lt;IFormatReader&gt; cl = ImageReader.getDefaultReaderClasses();</div><div class="gmail_extra"><span class="" style="white-space:pre">                </span>cl.addClass(MyReader.class);</div>

<div class="gmail_extra"><span class="" style="white-space:pre">                </span>final ImageReader reader = new ImageReader(cl);</div><div class="gmail_extra"><span class="" style="white-space:pre">                </span>reader.setId(&quot;/path/to/test.data&quot;);</div>

<div class="gmail_extra"><span class="" style="white-space:pre">                </span>// etc.</div><div class="gmail_extra"><span class="" style="white-space:pre">        </span>}</div><div class="gmail_extra"><br></div><div class="gmail_extra">

<span class="" style="white-space:pre">        </span>public static class MyReader extends FormatReader {</div><div class="gmail_extra"><span class="" style="white-space:pre">                </span>public MyReader() {</div><div class="gmail_extra">

<span class="" style="white-space:pre">                        </span>super(&quot;My File Format&quot;, &quot;.mySuffix&quot;);</div><div class="gmail_extra"><span class="" style="white-space:pre">                </span>}</div><div class="gmail_extra"><br>

</div><div class="gmail_extra"><span class="" style="white-space:pre">                </span>@Override</div><div class="gmail_extra"><span class="" style="white-space:pre">                </span>public byte[] openBytes(final int no, final byte[] buf, final int x,</div>

<div class="gmail_extra"><span class="" style="white-space:pre">                        </span>final int y, final int w, final int h) throws FormatException,</div><div class="gmail_extra"><span class="" style="white-space:pre">                        </span>IOException</div>

<div class="gmail_extra"><span class="" style="white-space:pre">                </span>{</div><div class="gmail_extra"><span class="" style="white-space:pre">                        </span>// TODO Auto-generated method stub</div><div class="gmail_extra"><span class="" style="white-space:pre">                        </span>return null;</div>

<div class="gmail_extra"><span class="" style="white-space:pre">                </span>}</div><div class="gmail_extra"><span class="" style="white-space:pre">        </span>}</div><div class="gmail_extra"><br></div><div class="gmail_extra">}</div>

<div class="gmail_extra"><br></div><br><div class="gmail_quote">On Thu, Apr 25, 2013 at 8:33 AM, Christoph Sommer <span dir="ltr">&lt;<a href="mailto:christoph.sommer@imba.oeaw.ac.at" target="_blank">christoph.sommer@imba.oeaw.ac.at</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Dear Melissa,<br>
<br>
thanks for the fast reply!<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
The develop branch of <a href="https://github.com/openmicroscopy/bioformats" target="_blank">https://github.com/<u></u>openmicroscopy/bioformats</a> should compile and pass all tests. What sort of development environment are you using? How are you compiling and running tests?<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
What HDF5 library for Java would you recommend for native hdf5<br>
access? To write these files (currently from Python) I we HDF5 1.8.7<br>
</blockquote></blockquote></div>
I am new to Java and Maven so I followed instructions from <a href="http://loci.wisc.edu/bio-formats/developing-bio-formats" target="_blank">http://loci.wisc.edu/bio-<u></u>formats/developing-bio-formats</a><u></u>. Using Eclipse (3.7 Indigo) I am unable to run the tests. I guess I haven&#39;t set up the project properly... I attached the output I get in the eclipse console running &quot;maven build&quot; (eclipse_build_output.txt). Somehow Eclipse cannot resolve &quot;import loci.formats.meta.<u></u>MetadataStore;&quot;<br>


<br>
Running Maven from the command line executes the tests and it looks promising. Only 4 test in SCIFIO fail. I attached the surefire html report... here&#39;s the console output.<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
------------------------------<u></u>-------------------------<br>
 T E S T S<br>
------------------------------<u></u>-------------------------<br>
Running TestSuite<br>
[Parser] [WARN] Unknown value of attribute &#39;parallel&#39; at suite level: &#39;@PARALLEL@&#39;.<br>
Tests run: 954, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 1,302.851 sec &lt;&lt;&lt; FAILURE!<br>
<br>
Results :<br>
<br>
Failed tests: testIsDirectory(<a href="http://ome.scifio.io" target="_blank">ome.scifio.io</a>.<u></u>utests.LocationTest): bio-formats expected:&lt;true&gt; but was:&lt;false&gt;<br>
  testIsFile(<a href="http://ome.scifio.io" target="_blank">ome.scifio.io</a>.<u></u>utests.LocationTest): bio-formats expected:&lt;false&gt; but was:&lt;true&gt;<br>
  testIsHidden(<a href="http://ome.scifio.io" target="_blank">ome.scifio.io</a>.<u></u>utests.LocationTest): .<u></u>hiddenTest1218465869181829460.<u></u>tmp expected:&lt;false&gt; but was:&lt;true&gt;<br>
  testToURL(<a href="http://ome.scifio.io" target="_blank">ome.scifio.io</a>.<u></u>utests.LocationTest): validTest5911385117004500129.<u></u>tmp expected:&lt;file:/C:/Users/<u></u>sommerc/AppData/Local/Temp/<u></u>1366896587552-locat<br>


est5911385117004500129.tmp&gt; but was:&lt;file://C:/Users/sommerc/<u></u>AppData/Local/Temp/<u></u>1366896587552-location-test/<u></u>validTest5911385117004500129.<u></u>tmp&gt;<br>
<br>
Tests run: 954, Failures: 4, Errors: 0, Skipped: 0<br>
<br>
[INFO] ------------------------------<u></u>------------------------------<u></u>------------<br>
[INFO] Reactor Summary:<br>
[INFO]<br>
[INFO] Bio-Formats projects .............................. SUCCESS [1.413s]<br>
[INFO] JAI Image I/O Tools ..............................<u></u>. SUCCESS [1.720s]<br>
[INFO] MDB Tools (Java port) ............................. SUCCESS [0.450s]<br>
[INFO] SCIFIO-devel ..............................<u></u>........ FAILURE [21:43.630s]<br>
[INFO] Loci-Legacy ..............................<u></u>......... SKIPPED<br>
[INFO] Apache Jakarta POI ..............................<u></u>.. SKIPPED<br>
[INFO] Luratech LuraWave stubs ........................... SKIPPED<br>
[INFO] OME-XML Java library .............................. SKIPPED<br>
[INFO] libjpeg-turbo Java bindings ....................... SKIPPED<br>
[INFO] SCIFIO ..............................<u></u>.............. SKIPPED<br>
[INFO] Bio-Formats code generator ........................ SKIPPED<br>
[INFO] Metakit ..............................<u></u>............. SKIPPED<br>
[INFO] Bio-Formats library ..............................<u></u>. SKIPPED<br>
[INFO] LOCI Common compatibility JAR ..................... SKIPPED<br>
[INFO] LOCI Plugins for ImageJ ........................... SKIPPED<br>
[INFO] LOCI Tools bundle ..............................<u></u>... SKIPPED<br>
[INFO] OME I/O ..............................<u></u>............. SKIPPED<br>
[INFO] OME Plugins for ImageJ ............................ SKIPPED<br>
[INFO] OME Tools bundle ..............................<u></u>.... SKIPPED<br>
[INFO] SCIFIO ..............................<u></u>.............. SKIPPED<br>
[INFO] LOCI testing framework ............................ SKIPPED<br>
[INFO] XSD-FU ..............................<u></u>.............. SKIPPED<br>
[INFO] ------------------------------<u></u>------------------------------<u></u>------------<br>
[INFO] BUILD FAILURE<br>
[INFO] ------------------------------<u></u>------------------------------<u></u>------------<br>
[INFO] Total time: 21:48.070s<br>
[INFO] Finished at: Thu Apr 25 15:29:48 CEST 2013<br>
[INFO] Final Memory: 22M/440M<br>
[INFO] ------------------------------<u></u>------------------------------<u></u>------------<br>
[ERROR] Failed to execute goal org.apache.maven.plugins:<u></u>maven-surefire-plugin:2.12:<u></u>test (default-test) on project scifio-devel: There are<br>
[...]<br>
<br>
</blockquote>
Btw. Where is the correct place to put a unit test case for the new reader class?<br>
<br>
Cheers,<br>
Christoph<br>
<br>
<br>_______________________________________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a><br>
<br></blockquote></div><br></div></div>