[ 
https://issues.apache.org/jira/browse/DERBY-4089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kristian Waagan updated DERBY-4089:
-----------------------------------

    Attachment: derby-4089-1a-set_classpath.diff

Attaching patch 1a, which tries to make everyone happier :)

The classpath for the junit targets will be set automatically, with the 
following preferences:
 o if derby.junit.classpath is specified by the user, don't do anything
 o if derby.junit.classpath is unspecified
    o look for insane jars
    o look for sane jars
    o if either of them are found, set derby.junit.classpath to empty string 
and set derby.junit.test.jars to point to the directory with the jars
 o if no jars are located, set derby.junit.classpath to the classes-directory
 o additionally, ant will append the user's CLASSPATH environment variable to 
the junit classpath

I also added an informational printout telling which classpath is being used.

Patch ready for review, although it might be wise to see the outcome of the 
discussion under this issue and/or "Refactoring ant junit target to 
automatically set classpath" on derby-dev first.

> It should be possible to run unit tests right after "ant all"
> -------------------------------------------------------------
>
>                 Key: DERBY-4089
>                 URL: https://issues.apache.org/jira/browse/DERBY-4089
>             Project: Derby
>          Issue Type: Improvement
>          Components: Build tools
>    Affects Versions: 10.4.2.0
>            Reporter: Aaron Digulla
>         Attachments: derby-4089-1a-set_classpath.diff
>
>
> Right now, the property "derby.junit.classpath" is empty by default. There 
> should be an ant target which sets the correct classpath to run all tests 
> after an initial checkout and "ant all".
> The current situation is very confusing to beginners and people who try to 
> build Derby for the first time. For example, when running the tests, I got 
> this exception:
> java.lang.ClassNotFoundException: org.apache.derbyTesting.junit.EnvTest
> but that class was there, the file was there, everything was correct. 
> Googling for the error didn't turn anything up, either. It took me a while to 
> believe that build.xml just wouldn't try to setup a classpath for the tests.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to