lundi 29 juin 2015

Any way to conditionally deal with a java UnsatisfiedLinkError?

I have a unit test that is running code for an embedded machine. One of the parts of the class I am testing, but not actively using is a call to some native code for drivers that are only able to be installed on the embedded machine.

Due to this, I get UnsatisfiedLinkError. Each time I try to unit test the program and complains its missing the drivers that are only on the embedded machine.

I suspect the native code is trying to get loaded in the Dynamic Linking part of the JVM initialization.

Since this part is not compiled into the program and instead linked during attempting program execution, can there be any condtional statement added to either the class or the unit test that says basically "hey i am not the embedded machine so don't try to load the native code", or is there no way around this error?

Aucun commentaire:

Enregistrer un commentaire