1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-27 00:32:07 +01:00

Fixed bug with setting the form value in ConfigureForm.setChildrenAssociationPolicy. It was trying to set a single string value instead of a list.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@12213 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2011-03-30 02:34:21 +00:00
parent 2c55c2ac65
commit 750cfa64b0
2 changed files with 19 additions and 1 deletions

View file

@ -161,7 +161,9 @@ public class ConfigureForm extends Form
public void setChildrenAssociationPolicy(ChildrenAssociationPolicy policy) public void setChildrenAssociationPolicy(ChildrenAssociationPolicy policy)
{ {
addField(ConfigureNodeFields.children_association_policy, FormField.TYPE_LIST_SINGLE); addField(ConfigureNodeFields.children_association_policy, FormField.TYPE_LIST_SINGLE);
setAnswer(ConfigureNodeFields.children_association_policy.getFieldName(), policy.toString()); List<String> values = new ArrayList<String>(1);
values.add(policy.toString());
setAnswer(ConfigureNodeFields.children_association_policy.getFieldName(), values);
} }
/** /**

View file

@ -0,0 +1,16 @@
package org.jivesoftware.smackx.pubsub;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class ConfigureFormTest
{
@Test
public void checkChildrenAssocPolicy()
{
ConfigureForm form = new ConfigureForm(FormType.submit);
form.setChildrenAssociationPolicy(ChildrenAssociationPolicy.owners);
assertEquals(ChildrenAssociationPolicy.owners, form.getChildrenAssociationPolicy());
}
}