Package rocks.xmpp.extensions.search.model

Examples of rocks.xmpp.extensions.search.model.Search$Item


                "    <nick/>\n" +
                "    <email/>\n" +
                "  </query>\n" +
                "</iq>\n";
        IQ iq = unmarshal(xml, IQ.class);
        Search search = iq.getExtension(Search.class);
        Assert.assertEquals("\n" +
                "      Fill in one or more fields to search\n" +
                "      for any matching Jabber users.\n" +
                "    ", search.getInstructions());

    }
View Full Code Here


    }

    @Test
    public void marshalSearchRequest() throws JAXBException, XMLStreamException {
        Search search = new Search(null, "Capulet", null, null);
        String xml = marshal(search);
        Assert.assertEquals("<query xmlns=\"jabber:iq:search\"><last>Capulet</last></query>", xml);
    }
View Full Code Here

                "    </item>\n" +
                "  </query>\n" +
                "</iq>\n";

        IQ iq = unmarshal(xml, IQ.class);
        Search search = iq.getExtension(Search.class);

        Assert.assertNotNull(search);
        Assert.assertEquals(search.getItems().size(), 2);
        Assert.assertEquals(search.getItems().get(0).getJid(), Jid.valueOf("juliet@capulet.com"));
        Assert.assertEquals(search.getItems().get(0).getFirst(), "Juliet");
        Assert.assertEquals(search.getItems().get(0).getLast(), "Capulet");
        Assert.assertEquals(search.getItems().get(0).getNick(), "JuliC");
        Assert.assertEquals(search.getItems().get(0).getEmail(), "juliet@shakespeare.lit");

        Assert.assertEquals(search.getItems().get(1).getJid(), Jid.valueOf("tybalt@shakespeare.lit"));
        Assert.assertEquals(search.getItems().get(1).getFirst(), "Tybalt");
        Assert.assertEquals(search.getItems().get(1).getLast(), "Capulet");
        Assert.assertEquals(search.getItems().get(1).getNick(), "ty");
        Assert.assertEquals(search.getItems().get(1).getEmail(), "tybalt@shakespeare.lit");
    }
View Full Code Here

                "    </x>\n" +
                "  </query>\n" +
                "</iq>\n";

        IQ iq = unmarshal(xml, IQ.class);
        Search search = iq.getExtension(Search.class);

        Assert.assertNotNull(search);
        Assert.assertNotNull(search.getAdditionalInformation());
        Assert.assertEquals("User Directory Search", search.getAdditionalInformation().getTitle());
        // The rest should be covered by data form test.
    }
View Full Code Here

                "      </item>\n" +
                "    </x>\n" +
                "  </query>\n" +
                "</iq>\n";
        IQ iq = unmarshal(xml, IQ.class);
        Search search = iq.getExtension(Search.class);

        Assert.assertNotNull(search);

        DataForm dataForm = search.getAdditionalInformation();
        Assert.assertNotNull(dataForm);
        Assert.assertNotNull(dataForm.getReportedFields());
        Assert.assertEquals(dataForm.getReportedFields().size(), 4);
        Assert.assertEquals(dataForm.getReportedFields().get(0).getVar(), "first");
        Assert.assertEquals(dataForm.getReportedFields().get(0).getLabel(), "Given Name");
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.search.model.Search$Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.