@Before public void setUp() throws Exception { DirectoryRosterStore store = DirectoryRosterStore.init(tmpFolder.newFolder("store")); populateStore(store); Builder<?, ?> builder = DummyConnection.getDummyConfigurationBuilder(); connection = new DummyConnection(builder.build()); connection.connect(); connection.login(); rosterListener = new TestRosterListener(); roster = Roster.getInstanceFor(connection); roster.setRosterStore(store); roster.addRosterListener(rosterListener); roster.reload(); }