mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +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:
parent
2c55c2ac65
commit
750cfa64b0
2 changed files with 19 additions and 1 deletions
|
@ -161,7 +161,9 @@ public class ConfigureForm extends Form
|
|||
public void setChildrenAssociationPolicy(ChildrenAssociationPolicy policy)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue