Hi Benjamin,
And thank you for your help and information about the unit test framework.
It took me a while to make it work, because in the same time, I tried
to use Eclipse, then Netbeans that I've never really used for a big project.
It was a horrible experience. How can Eclipse be so popular ? I'm
really wondering.
You cannot do anything without installing plugins, configuring
tens of parameters...
And I spent the whole day looking for how to declare classpath,
how to compile, how to create jar...
Netbeans is more intuitive for java developpers (includes svn natively,
better integration of ant and maven, less things to configure...)
It finally throwed an error I did not understand about maven
(I'll send another mail to ede about it).
Finally, I could optimize DeleteDuplicateItemsPlugIn and create a unit-test.
For a 50 000 building layer, it takes about 1 s instead of 2 mn !
Would also like to give a second try to IntelliJIDEA (there is a free
version which is user-friendly).
I have also used tIDE a few times (small and efficient, I liked it, but
syntax highlighting is not so good).
regards,
Michaël
Le 14/01/2012 16:29, Benjamin Gudehus a écrit :
Some more tips for testing:
- if there is nothing special with the geometries for shapefile-fixtures
just use rectagular geometries snapped to a grid (e.g. with a space
with 20 meters)
- if you want to keep the workbenchframe open, just add
Thread.sleep(Integer.MAX_VALUE); to the end of the test case method
and start
this single test method with the junit window in Eclipse. After your
inspection close the
window and stop the execution of the test.
2012/1/14 Benjamin Gudehus <hasteb...@googlemail.com
<mailto:hasteb...@googlemail.com>>
Hi Michaël!
Here are some ideas for the tests:
1. a fixture "duplicate-geometries.jml" with duplicate geometries.
2. a new test class "DeleteDuplicateGeometriesPlugInTest" copied
from UnionByAttributePlugInTests
3. change parameters to "itemlayer" and "deleteOnlyForSameAttributes"
4. write tests cases for deleteOnlyForSameAttribute set to true
and to false
5. first the cases with successful results (bounded context)
6. check (assertion) that a result layer exists after execute and
check the
result layer name and the category.
7. check (assertion) for all features that should be kept and
should be deleted
(for example by attribute value). (is there any preference which
geometry
is deleted without same attributes? first duplicate geometry in
getFeatures() always kept?)
8. check the status bar message (warn user) or the html windows
(if this plugin
uses them). I think as a best practice we should always send a
message to the status bar
if the execution was successful or failed.
9. check everything in 6, 7 and 8 for failed cases (edge cases).
--Benjamin
------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel