JUnitExtension.getFile(".") results in a call to
ClassLoader.getResource("."), which seems odd to me.  Since the
classpath is a sequence of directories/jars, what do you get when you
ask for "."?  Just whatever happens to be first in the classpath?  It
seems unsafe to assume that this will always return you the directory
containing the test resources.  I think I would prefer:

String workingDir =
JUnitExtension.getFile("TypeSystemDescriptionImplTest").getParentFile().getAbsolutePath();

-Adam


On 12/22/06, Thilo Goetz (JIRA) <uima-dev@incubator.apache.org> wrote:
     [ http://issues.apache.org/jira/browse/UIMA-137?page=all ]

Thilo Goetz resolved UIMA-137.
------------------------------

    Resolution: Fixed
      Assignee: Adam Lally

For some reason that I don't pretend to understand,

String workingDir = JUnitExtension.getFile("");

does not work on the command line (or I should probably say, I don't understand 
why it works in Eclipse ;-).  Changing this to

String workingDir = JUnitExtension.getFile(".");

fixes the issue.  I hope this is platform/JDK independent.

Assigning to Adam to review.

> Import_implTest fails on mvn package
> ------------------------------------
>
>                 Key: UIMA-137
>                 URL: http://issues.apache.org/jira/browse/UIMA-137
>             Project: UIMA
>          Issue Type: Bug
>          Components: Build, Packaging and Test
>         Environment: IBM Java 1.4.2 and Sun Java 1.5
>            Reporter: Thilo Goetz
>         Assigned To: Adam Lally
>            Priority: Minor
>
> Running org.apache.uima.resource.metadata.impl.Import_implTest
> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< 
FAILURE!
> Unfortunately, this is all the information I get.  Test runs fine in Eclipse. 
 Modifying the working directory in Eclipse does not make the test fail, either.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



Reply via email to