Ejemplo n.º 1
0
  @org.junit.Test
  public void Test() {

    idMgr = Test1083.getCommMgr().getIdManager();
    privateId = idMgr.getThisNetworkNode();

    assertNotNull(idMgr);
    assertNotNull(privateId);

    IndividualCtxEntity operator = null;

    try {
      operator = Test1083.ctxBroker.retrieveCssOperator().get();

      LOG.info("[#1859] Id from broker is " + operator.getId().getOperatorId());
      LOG.info("[#1859] Id directly from idMgr is " + privateId);

    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ExecutionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (CtxException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    assertNotNull(operator);
    assertEquals(operator.getId().getOperatorId(), privateId.getBareJid());

    LOG.info(
        "[#1859] Using equals with getOperatorId() - "
            + operator.getId().getOperatorId().equals(privateId.getBareJid()));
  }
  /** Put your functionality here if there IS a return object */
  public Object getQuery(Stanza stanza, Object messageBean) {
    SuggestedCommunityAnalyserBean scaBean = (SuggestedCommunityAnalyserBean) messageBean;
    try {
      IIdentity returnIdentity = identityManager.fromJid("XCManager.societies.local");
    } catch (InvalidFormatException e) {
    }
    switch (scaBean.getMethod()) {
      case processCSMRecommendations:
        try {
          // IIdentity owner = identityManager.fromJid(scaBean..getIdentity());
          // String serviceType = scaBean.getServiceType();
          processRelevanceRecommendations();
          break;
        } catch (RuntimeException e) {
          e.printStackTrace();
        }
    }

    return null;
  }