mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 23:42:06 +01:00
Changed #testCreateReservedRoom to set the default value as the answer of the form fields and also to specify the JID of the room owner.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2392 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
4815fbbb7f
commit
b7bf4ad782
1 changed files with 8 additions and 7 deletions
|
@ -94,15 +94,14 @@ public class MultiUserChatCreationTest extends SmackTestCase {
|
||||||
FormField field = (FormField) fields.next();
|
FormField field = (FormField) fields.next();
|
||||||
if (!FormField.TYPE_HIDDEN.equals(field.getType())
|
if (!FormField.TYPE_HIDDEN.equals(field.getType())
|
||||||
&& field.getVariable() != null) {
|
&& field.getVariable() != null) {
|
||||||
// Add the field values to a List
|
// Sets the default value as the answer
|
||||||
List values = new ArrayList();
|
submitForm.setDefaultAnswer(field.getVariable());
|
||||||
for (Iterator it = field.getValues(); it.hasNext();) {
|
|
||||||
values.add((String) it.next());
|
|
||||||
}
|
|
||||||
// Sets the new answer to form to submit
|
|
||||||
submitForm.setAnswer(field.getVariable(), values);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List owners = new ArrayList();
|
||||||
|
owners.add(getBareJID(0));
|
||||||
|
submitForm.setAnswer("muc#owner_roomowners", owners);
|
||||||
|
|
||||||
// Update the new room's configuration
|
// Update the new room's configuration
|
||||||
muc.sendConfigurationForm(submitForm);
|
muc.sendConfigurationForm(submitForm);
|
||||||
|
|
||||||
|
@ -111,6 +110,7 @@ public class MultiUserChatCreationTest extends SmackTestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (XMPPException e) {
|
catch (XMPPException e) {
|
||||||
|
e.printStackTrace();
|
||||||
fail(e.getMessage());
|
fail(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,7 @@ public class MultiUserChatCreationTest extends SmackTestCase {
|
||||||
muc.destroy("The room has almost no activity...", null);
|
muc.destroy("The room has almost no activity...", null);
|
||||||
}
|
}
|
||||||
catch (XMPPException e) {
|
catch (XMPPException e) {
|
||||||
|
e.printStackTrace();
|
||||||
fail(e.getMessage());
|
fail(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue