xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shootist <kwilson4...@gmail.com>
Subject Re: Batik and JUnit
Date Wed, 15 Dec 2010 19:09:15 GMT

I may have discovered the problem.  It appears that JUnit creates a separate
instance of the class you are testing for each method that begins with the
word test.  The problem I'm having is because I broadcast test data that
each of those instances are listening for.

Something in batik is not thread safe, I think it's the CSS engine...anyway
something with building the GVT tree (I'm not familiar enough with batik to
know everything that is going on behind the scenes).  When all the instances
of the same document are told to rebuild some elements, they fight for
resources.  That type of race condition might explain me getting null
pointers inside the batik removeChild call on lines such as.  

Element e = svgDoc.getElementById(id);
if (e != null) {

When I switched to a single test everything worked exactly as expected.  All
of these calls are made on the canvas' update manager queue and I haven't
seen this problem outside of the unit test.  

View this message in context: http://batik.2283329.n4.nabble.com/Batik-and-JUnit-tp3087741p3089680.html
Sent from the Batik - Users mailing list archive at Nabble.com.

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message