/** * Enters the room. * * @param nick The nickname. * @return The async result with the self-presence returned by the chat room. */ public AsyncResult<Presence> enter(String nick) { return enter(nick, null, null); }
/** * Enters the room with a password. * * @param nick The nickname. * @param password The password. * @return The async result with the self-presence returned by the chat room. */ public AsyncResult<Presence> enter(String nick, String password) { return enter(nick, password, null); }
/** * Enters the room and requests history messages. * * @param nick The nickname. * @param history The history. * @return The async result with the self-presence returned by the chat room. */ public AsyncResult<Presence> enter(String nick, DiscussionHistory history) { return enter(nick, null, history); }
@Override public boolean run() { final ServiceDiscoveryManager serviceDiscoveryManager = client.getManager(ServiceDiscoveryManager.class); final MultiUserChatManager multiUserChatManager = client.getManager(MultiUserChatManager.class); try { List<ChatService> chatServices = multiUserChatManager.discoverChatServices().getResult(); if (chatServices.size() < 1) { LOGGER.debug("Unable to find a MUC service"); return false; } final ChatService chatService = chatServices.get(0); final ChatRoom room = chatService.createRoom(generateConversationsLikePronounceableName()); room.enter("test").getResult(); final Set<String> features = serviceDiscoveryManager.discoverInformation(room.getAddress()).getResult().getFeatures(); room.destroy().getResult(); return features.contains(VCard.NAMESPACE); } catch (XmppException e) { LOGGER.debug(e.getMessage()); } return false; } }
@Override public Result run() { final ServiceDiscoveryManager serviceDiscoveryManager = client.getManager(ServiceDiscoveryManager.class); final MultiUserChatManager multiUserChatManager = client.getManager(MultiUserChatManager.class); try { List<ChatService> chatServices = multiUserChatManager.discoverChatServices().getResult(); if (chatServices.size() < 1) { return Result.FAILED; } final ChatService chatService = chatServices.get(0); final ChatRoom room = chatService.createRoom(UUID.randomUUID().toString()); room.enter("test"); try { final DataForm.Field mam = room.getConfigurationForm().get().findField("mam"); if (mam != null) { return Result.PASSED; } } catch (ExecutionException | InterruptedException e) { //ignore } final Set<String> features = serviceDiscoveryManager.discoverInformation(room.getAddress()).getResult().getFeatures(); final boolean mam = TestUtils.hasAnyone(MAM.NAMESPACES,features); room.destroy().getResult(); return mam ? Result.PASSED : Result.FAILED; } catch (XmppException e) { return Result.FAILED; } }
room.enter("test").getResult(); boolean hasFormField = false; try {