| 1 | The LuceneSail and SesameJenaAdapter something create cases where your junit tests will not terminate. The usual cause of this is a deadlocking problem with the sesame repositories. Some tips for diagnosing and fixing this: |
| 2 | |
| 3 | Diagnose: |
| 4 | * To check if this is indeed the case, you can "debug" the stopping junit test ... |
| 5 | * ... then pause the main thread. If it's waiting in Object.wait() and the MultiReadSingleWriteLockManager:getWriteLock is just above it in the stack trace, you know your problem. |
| 6 | |
| 7 | * The problem often happens when some code that uses an iterator throws an error, JUnit catches this, but will call the tearDown method first - and there it hangs. |
| 8 | |
| 9 | Fixing: |
| 10 | * In gnowsis-server there is a jar called DEBUG-openrdf-utils.jar - change your project to use this jar instead of the normal one. |
| 11 | * this jar adds a _locks vector to MultiRead..Manager, which keeps track of all unreleased locks, and each lock object has a stacktrace object that stores the stacktrace from when the lock was created. |
| 12 | |
| 13 | All in all though - these problems suck, and debugging them sucks even more. |