DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19275>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19275

<junit> fails when test classes load native code

           Summary: <junit> fails when test classes load native code
           Product: Ant
           Version: 1.5.3
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The following code snippet is from a build file, it tests with Junit one class
that loads a native library with JNI under Linux, so the fork="yes" attribute is
necessary: 

<junit fork="yes" haltonfailure="off" printsummary="on" dir="${test.dir}">
    <classpath>
        <path refid="test.classpath"/>
        <pathelement location="${release.dir}/ianhd-test.jar"/>
    </classpath>
    <formatter type="xml"/>
         <formatter type="plain"/>
    <test name="es.interactivity.nhd.HardDiskTest" 
        todir="${test.reports.dir}"/>
</junit>

The result I get is:
    [junit] Running es.interactivity.nhd.HardDiskTest
BUILD SUCCESSFUL

So the test did not run (the number of failed and passed tests is missing). When
I change the fork attribute to "no" the test runs:
    [junit] Tests run: 34, Failures: 0, Errors: 0, Time elapsed: 3.649 sec
BUILD SUCCESSFUL

But this is not a valid workaround because adding a second test with fork="no"
will fail when loading the native library (java.lang.UnsatisfiedLinkError:
Native Library /usr/lib/libianhd.so.1.0.0 already loaded in another 
classloader).

Reply via email to