Examples of startInnerElement()


Examples of org.apache.vysper.xml.fragment.XMLElementBuilder.startInnerElement()

  }

  public void testRenderInnerNamespacedElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
    builder.addNamespaceAttribute("pr", "http://other.com");
    builder.startInnerElement("bar", "http://other.com");
    assertRendering("<foo xmlns:pr=\"http://other.com\" xmlns=\"http://example.com\"><pr:bar></pr:bar></foo>", builder.build());
  }

  public void testRenderInnerInheritedDefaultNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementBuilder.startInnerElement()

    assertRendering("<foo xmlns:pr=\"http://other.com\" xmlns=\"http://example.com\"><pr:bar></pr:bar></foo>", builder.build());
  }

  public void testRenderInnerInheritedDefaultNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
    builder.startInnerElement("bar", "http://example.com");
    assertRendering("<foo xmlns=\"http://example.com\"><bar></bar></foo>", builder.build());
  }

  public void testRenderInnerInheritedNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementBuilder.startInnerElement()

    assertRendering("<foo xmlns=\"http://example.com\"><bar></bar></foo>", builder.build());
  }

  public void testRenderInnerInheritedNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
    builder.startInnerElement("bar", "http://other.com");
    assertRendering("<foo xmlns=\"http://example.com\"><bar xmlns=\"http://other.com\"></bar></foo>", builder.build());
  }

 
  public void testRenderInnerNoNamespaceElement() {
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementBuilder.startInnerElement()

  }

 
  public void testRenderInnerNoNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
    builder.startInnerElement("bar");
    assertRendering("<foo xmlns=\"http://example.com\"><bar xmlns=\"\"></bar></foo>", builder.build());
  }
 
  public void testRenderSimpleText() {
    XMLElement elm = new XMLElement(null, "foo", null, null, new XMLFragment[]{
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.startInnerElement()

    private static Entity JID = TestUtil.parseUnchecked("jid1@vysper.org");

    public void testFromStanza() {
        StanzaBuilder builder = StanzaBuilder.createMessageStanza(JID, JID, null, "Foo");
        builder.startInnerElement("x", NamespaceURIs.XEP0045_MUC);
        builder.startInnerElement("password").addText("secret").endInnerElement();
        builder.endInnerElement();
       
        X x = X.fromStanza(builder.build());
       
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.startInnerElement()

    private static Entity JID = TestUtil.parseUnchecked("jid1@vysper.org");

    public void testFromStanza() {
        StanzaBuilder builder = StanzaBuilder.createMessageStanza(JID, JID, null, "Foo");
        builder.startInnerElement("x", NamespaceURIs.XEP0045_MUC);
        builder.startInnerElement("password").addText("secret").endInnerElement();
        builder.endInnerElement();
       
        X x = X.fromStanza(builder.build());
       
        assertNotNull(x);
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.startInnerElement()

    protected Stanza sendMessage(Entity from, Entity to, MessageStanzaType type,
            String body, X x, String subject) throws ProtocolException {
        StanzaBuilder stanzaBuilder = StanzaBuilder.createMessageStanza(from,
                to, type, null, body);
        if(subject != null) {
            stanzaBuilder.startInnerElement("subject").addText(subject).endInnerElement();
        }
        if(x != null) {
            stanzaBuilder.addPreparedElement(x);
        }
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.startInnerElement()

*/
public class MUCPresenceHandlerChangeNickTestCase extends AbstractMUCHandlerTestCase {

    private Stanza changeNick(Entity occupantJid, Entity roomWithNickJid) throws ProtocolException {
        StanzaBuilder stanzaBuilder = StanzaBuilder.createPresenceStanza(occupantJid, roomWithNickJid, null, null, null, null);
        stanzaBuilder.startInnerElement("x", NamespaceURIs.XEP0045_MUC);
       
        stanzaBuilder.endInnerElement();
        Stanza presenceStanza = stanzaBuilder.build();
        ResponseStanzaContainer container = handler.execute(presenceStanza, sessionContext.getServerRuntimeContext(), true, sessionContext, null);
        if(container != null) {
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.startInnerElement()

        */

        if (languageCode == null) languageCode = "en_US";
        StanzaBuilder stanzaBuilder = new StanzaBuilder("error");

        stanzaBuilder.startInnerElement(definedErrorCondition.value())
            .addNamespaceAttribute(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STREAMS)
            .endInnerElement();

        if (descriptiveText != null) {
            stanzaBuilder.startInnerElement("text")
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.startInnerElement()

        stanzaBuilder.startInnerElement(definedErrorCondition.value())
            .addNamespaceAttribute(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STREAMS)
            .endInnerElement();

        if (descriptiveText != null) {
            stanzaBuilder.startInnerElement("text")
                .addNamespaceAttribute(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STREAMS)
                .addAttribute(NamespaceURIs.XML, "lang", languageCode)
                .addText(descriptiveText)
                .endInnerElement();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.