/** * Destroys the room. * * @return The async result. * @see <a href="https://xmpp.org/extensions/xep-0045.html#destroyroom">10.9 Destroying a Room</a> */ public final AsyncResult<IQ> destroy() { return destroy(null); }
@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.destroy().getResult(); return (hasFeature || hasFormField); } catch (XmppException e) {