Now I'm testing a framework that contains some EOs. Again, this is using Ant + JUnit, and outside of Eclipse. Inside Eclipse, I don't seem to have to do much at all in the way of setting things up to get the model loaded. In fact, it seems to happen somewhat magically, and I just provide a dummy connection dictionary for the model in a @BeforeClass method, and point it at an (empty) in-memory H2 database.
Some Googling lead me to believe that this is a symptom of the main bundle not being loaded, and, indeed, NSBundle.mainBundle() returns null. Is it obvious what I'm doing wrong here? I'm using the same Ant targets (appended below) as I am for a different framework projects (i.e., neither of them are applications), the only difference here is that I am trying to load an EOModel.
<!-- JUnit testing -->
<property name="src.tests" value="Tests" />
<property name="bin.tests" value="bin-tests" />
<property name="junit.results" value="junit-results" />
<property name="junit.report" value="junit-report" />
<target name="clean.tests">
<delete dir="${bin.tests}" />
<delete dir="${junit.results}" />
<delete dir="${junit.report}" />
</target>
<typedef name="wopath" classname="org.objectstyle.woproject.ant.WOPath" />
<wopath id="testing.classpath">
<frameworks root="User" eclipse="true" />
<frameworks root="Local" eclipse="true" />
<frameworks root="System" eclipse="true" />
</wopath>
<target name="compile.tests">
<mkdir dir="${bin.tests}" />
<javac srcdir="${src.tests}" destdir="${bin.tests}">
<classpath refid="testing.classpath" />
<classpath>
<pathelement location="bin" />
</classpath>
</javac>
</target>
<target name="junit" depends="compile.tests">
<mkdir dir="junit-results" />
<junit haltonfailure="false"
printsummary="true"
failureproperty="test.failed">
<classpath refid="testing.classpath" />
<classpath>
<pathelement location="bin" />
<pathelement location="${junit.jar}" />
<pathelement location="${bin.tests}" />
</classpath>
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="${junit.results}">
<fileset dir="${bin.tests}" includes="**/ClinicalDetailsTest.class" />
</batchtest>
</junit>
<mkdir dir="${junit.report}" />
<junitreport todir="${junit.report}">
<fileset dir="${junit.results}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.report}"/>
</junitreport>
<fail if="test.failed"/>
</target>