Hello,

 

In the static block of the class org.geotools.util.logging.Logging a new
ImagingListener is registered to JAI.

Unfortunately, this causes problems especially in unit level tests.

The newly registered listener behaves differently as the default JAI
listener (ImagingListenerImpl). RuntimeExceptions are not rethrown but only
logged. 

 

This leads to the situation that a NullPointerException occurs where
actually a certain RuntimeException is expected.

 

This caused some trouble in unit level tests. Depending on the execution
order tests can fail. In one test (TestA) the GeoTools
LoggingImagingListener is registered because GeoTools is used. 

Another test (TestB), which does not use GeoTools, fails if it runs after
TestA and works if it runs before TestA.

 

Does someone have a suggestion how to deal with it?

Currently, I changed TestB to initialise GeoTools Logging too and to expect
the NullPointerException. But I this is not ideal.

I think that it would be better to rethrow RuntimeExceptions as the
ImagingListenerImpl does, but maybe there is a reason not to do it.

 

Ciao

  Marco

 

 

_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to