Пример #1
0
  public void testCapsChanged() {
    String nodeVerBefore = EntityCapsManager.getNodeVersionByJid(con1.getUser());
    sdm1.addFeature(DISCOVER_TEST_FEATURE);
    String nodeVerAfter = EntityCapsManager.getNodeVersionByJid(con1.getUser());

    assertFalse(nodeVerBefore.equals(nodeVerAfter));
  }
Пример #2
0
  public void testEntityCaps() throws XMPPException, InterruptedException {
    dropWholeEntityCapsCache();
    sdm1.addFeature(DISCOVER_TEST_FEATURE);

    Thread.sleep(3000);

    DiscoverInfo info = sdm0.discoverInfo(con1.getUser());
    assertTrue(info.containsFeature(DISCOVER_TEST_FEATURE));

    String u1ver = EntityCapsManager.getNodeVersionByJid(con1.getUser());
    assertNotNull(u1ver);

    DiscoverInfo entityInfo = EntityCapsManager.caps.get(u1ver);
    assertNotNull(entityInfo);

    assertEquals(info.toXML(), entityInfo.toXML());
  }