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:
Gaston Dombiak 2004-10-22 20:53:15 +00:00 committed by gaston
parent 4815fbbb7f
commit b7bf4ad782
1 changed files with 8 additions and 7 deletions

View File

@ -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());
} }
} }