Changes:
1) Added mockito / powermockito for easier unit testing with mocks. This requires compiling at Java 1.5 level.
2) getCollection() method in JdbcPersistenceManager splits withJid into bare JID and resource (if present) and creates query to correctly set where predicates on these fields.
3) Added tests to verify correct querying with a withJID with and without resource attached.
I verified that this all works correctly with Openfire 3.6.4.
This branch is a fix for the issue2 (https://github.com/srt/openarchive/issues/2) that was filed yesterday.
Changes: 1) Added mockito / powermockito for easier unit testing with mocks. This requires compiling at Java 1.5 level. 2) getCollection() method in JdbcPersistenceManager splits withJid into bare JID and resource (if present) and creates query to correctly set where predicates on these fields. 3) Added tests to verify correct querying with a withJID with and without resource attached.
I verified that this all works correctly with Openfire 3.6.4.