summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Robbings <tim.robbings@isode.com>2014-10-22 09:06:10 (GMT)
committerSwift Review <review@swift.im>2014-10-28 10:00:39 (GMT)
commit47cad5fd7883b8c7273ea11073643aa585b485c6 (patch)
tree1d7bc39fc1c847e0bbe88716257a9a0710ac8745 /test/com/isode/stroke/elements/FormTest.java
parent244aff320257d178bbe35d87b0e09d939bd2f893 (diff)
downloadstroke-47cad5fd7883b8c7273ea11073643aa585b485c6.zip
stroke-47cad5fd7883b8c7273ea11073643aa585b485c6.tar.bz2
Stroke FormField refactoring
Changes to catch up with Swiften changes to FormField in commit 00284e5, also adds <reported/> and <item/> elements, added to Swiften in commit 83afa3d. Changes include refactoring of the FormField class, changes to Form parser and serializer classes and updates to JUnit tests. Test-information: Tested using updated JUnit tests, all tests complete successfully. Change-Id: Ic91ad4a11a335fb3d2b2a2c4a1865f836e2af70b Reviewer: Alex Clayton <alex.clayton@isode.com> Reviewer: Gurmeen Bindra <gurmeen.bindra@isode.com>
Diffstat (limited to 'test/com/isode/stroke/elements/FormTest.java')
-rw-r--r--test/com/isode/stroke/elements/FormTest.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/test/com/isode/stroke/elements/FormTest.java b/test/com/isode/stroke/elements/FormTest.java
index 1d37c86..f270976 100644
--- a/test/com/isode/stroke/elements/FormTest.java
+++ b/test/com/isode/stroke/elements/FormTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Isode Limited, London, England.
+ * Copyright (c) 2012-2014 Isode Limited, London, England.
* All rights reserved.
*/
/*
@@ -14,8 +14,7 @@ import static org.junit.Assert.assertEquals;
import org.junit.BeforeClass;
import org.junit.Test;
-import com.isode.stroke.elements.FormField.FixedFormField;
-import com.isode.stroke.elements.FormField.HiddenFormField;
+import com.isode.stroke.elements.FormField.Type;
public class FormTest {
@BeforeClass
@@ -26,13 +25,13 @@ public class FormTest {
public void testGetFormType() {
Form form = new Form();
- form.addField(FixedFormField.create("Foo"));
+ form.addField(new FormField(Type.FIXED_TYPE, "Foo"));
- FormField field = HiddenFormField.create("jabber:bot");
+ FormField field = new FormField(Type.HIDDEN_TYPE, "jabber:bot");
field.setName("FORM_TYPE");
form.addField(field);
- form.addField(FixedFormField.create("Bar"));
+ form.addField(new FormField(Type.FIXED_TYPE, "Bar"));
assertEquals("jabber:bot", form.getFormType());
}
@@ -41,7 +40,7 @@ public class FormTest {
public void testGetFormType_InvalidFormType() {
Form form = new Form();
- FormField field = FixedFormField.create("jabber:bot");
+ FormField field = new FormField(Type.FIXED_TYPE, "jabber:bot");
field.setName("FORM_TYPE");
form.addField(field);
@@ -52,7 +51,7 @@ public class FormTest {
public void testGetFormType_NoFormType() {
Form form = new Form();
- form.addField(FixedFormField.create("Foo"));
+ form.addField(new FormField(Type.FIXED_TYPE, "Foo"));
assertEquals("", form.getFormType());
}