Skip to content

Commit 85a5f98

Browse files
author
Lloyd Watkin
committed
Update search fields
1 parent 022542f commit 85a5f98

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

src/main/java/org/buddycloud/channelserver/packetprocessor/iq/namespace/search/SearchGet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ private void addFields() {
7272
author.addAttribute("label", AUTHOR_FIELD_LABEL);
7373

7474
Element rpp = x.addElement("field");
75-
rpp.addAttribute("type", "fixed-single");
75+
rpp.addAttribute("type", "fixed");
7676
rpp.addAttribute("var", "rpp");
7777
rpp.addAttribute("label", RPP_FIELD_LABEL);
7878

7979
Element page = x.addElement("field");
80-
page.addAttribute("type", "fixed-single");
80+
page.addAttribute("type", "fixed");
8181
page.addAttribute("var", "page");
8282
page.addAttribute("label", PAGE_FIELD_LABEL);
8383
}

src/main/java/org/buddycloud/channelserver/packetprocessor/iq/namespace/search/SearchSet.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private void addReportedFields(Element x) {
229229

230230
reported.addElement("field").addAttribute("var", "entry")
231231
.addAttribute("label", "Item")
232-
.addAttribute("type", "http://www.w3.org/2005/Atom");
232+
.addAttribute("type", "xml");
233233
}
234234

235235
private void extractFieldValues() {
@@ -285,11 +285,6 @@ private Integer getValueAsNumber(Element field)
285285

286286
private void sendErrorResponse(PacketError.Type type,
287287
PacketError.Condition condition) throws InterruptedException {
288-
// try {
289-
// throw new Exception();
290-
// } catch ( Exception e ) {
291-
// e.printStackTrace();
292-
// }
293288
responseIq.setType(IQ.Type.error);
294289
PacketError error = new PacketError(condition, type);
295290
responseIq.setError(error);

src/test/java/org/buddycloud/channelserver/packetprocessor/iq/namespace/search/SearchGetTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public void testReturnsDataFormResultsPerPageElement() throws Exception {
285285
.element("query")
286286
.element("x")
287287
.elements("field").get(3);
288-
Assert.assertEquals("fixed-single", formType.attributeValue("type"));
288+
Assert.assertEquals("fixed", formType.attributeValue("type"));
289289
Assert.assertEquals("rpp", formType.attributeValue("var"));
290290
Assert.assertEquals(SearchGet.RPP_FIELD_LABEL, formType.attributeValue("label"));
291291

@@ -309,7 +309,7 @@ public void testReturnsDataFormPageElement() throws Exception {
309309
.element("query")
310310
.element("x")
311311
.elements("field").get(4);
312-
Assert.assertEquals("fixed-single", formType.attributeValue("type"));
312+
Assert.assertEquals("fixed", formType.attributeValue("type"));
313313
Assert.assertEquals("page", formType.attributeValue("var"));
314314
Assert.assertEquals(SearchGet.PAGE_FIELD_LABEL, formType.attributeValue("label"));
315315
}

src/test/java/org/buddycloud/channelserver/packetprocessor/iq/namespace/search/SearchSetTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public void testReturnsDataInExpectedFormat() throws Exception {
396396

397397
Assert.assertEquals("entry", fields.get(2).attributeValue("var"));
398398
Assert.assertEquals("Item", fields.get(2).attributeValue("label"));
399-
Assert.assertEquals("http://www.w3.org/2005/Atom", fields.get(2)
399+
Assert.assertEquals("xml", fields.get(2)
400400
.attributeValue("type"));
401401

402402
List<Element> items = x.elements("item");

0 commit comments

Comments
 (0)