Martin Desruisseaux wrote:
> Jody Garnett a écrit :
>> Jesse was talking to me about that the other day, apparently the 
>> change to use the sample-data module as the
>> source of all resources has slowed down the shapefile tests a lot.  
>> Apparenlty he needs to copy the files out of the
>> sample data module and into a temp file again and again and again ...
> I think that he need to copy the files because the shapefile module 
> uses java.nio and cant't work with a java.io.InputStream.
Indeed, nio (and memory mapped files) is often where the pain was.
> But if the copy is performed using org.geotools.TestData.copy(...), 
> then the copy should be performed only if the file does not already 
> exists. If a copy is required, the copied file is stored in the 
> "<module_to_be_tested>/target/classes" directory. This means that the 
> copies is performed again only after a "mvn clean".
very cool! it could be that changing to this method will fix the problem 
for shapefile testing.
> Looking again in the source code, just realized that my previous 
> paragraph is not quite true because there is a "deleteOnExit" call at 
> TestData:163. If we remove that line, my previous paragraph should 
> become true.
Interesting tradeoff - if we remove it then we get a speed improvement. 
But we lose test isolation. Wonder if we can make an additional method 
called "TestData.temp( ... ) that has the deleteOnExit call. This can be 
used when writing tests that modify the data set.

In terms of usability we may also wish to do some helpful magic of the 
form ...
TestData.temp( "foo.shp" ); // copies foo.* in one go ... foo.prj,  
food.dbf etc...

>> A different way to look at the problem would be how can we slurp all 
>> the resources out of sample-data once, and take this
>> responsibility away from those testing plug-ins?
> Not sure I understand what you means... You means move back the test 
> files in the modules that use them? But we centralized them in 
> sample-data because we had a fair amount of duplication. The same 
> files are used in many modules.
What you describe above with Test.copy( ... ) is better then what I had 
in mind. I was thinking of extracting the all the resources in 
sample-data once, and then letting the tests go to town (and let them 
take responsibility for making temp copies that delete on exit if they 
are making modifications.

Jody

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to