db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Embretsen <John.Embret...@Sun.COM>
Subject Re: [testing]-How can i run tests from source rather than jar files
Date Tue, 10 Oct 2006 11:16:48 GMT
Sean Qiu wrote:
> Hello everybody.
> 
> 
> I want to run the test from source .java files rather than from .jar
> So i can modify the code and get the result at once without build the 
> project.
> What should i do for the purpose? 

Well, you will have to do _some_ building in order to test your changes, 
but you can avoid building the jar files every time you want to test a 
local change by:

* removing the derby*.jar (derby.jar, derbyclient.jar, etc.) files from 
the classpath.
* adding the trunk/classes directory to the classpath instead.

However, the required jars that are not part of Derby itself (e.g. 
junit.jar, jakarta-oro-2.0.8.jar) must still be in the classpath.
(See trunk/java/testing/readme.htm and trunk/BUILDING.txt for details).

After making your changes to the source code, you can build the classes 
by running "ant all". Sometimes it is necessary to run "ant clobber" as 
well, prior to running "ant all", to remove old leftovers.

If you are only making test changes, "ant testing" is often sufficient, 
provided that you have run "ant all" at least once before.

There may be subtle differences between running tests with the class 
files directly and running with the jars, so I personally recommend 
running tests with the jar files before submitting a patch or using the 
code in production.


-- 
John



Mime
View raw message