Package org.apache.vysper.xmpp.delivery

Examples of org.apache.vysper.xmpp.delivery.RecordingStanzaRelay$Triple


        EntityImpl serverEntity = new EntityImpl(null, serverDomain, null);

        AccountManagement accountManagement = (AccountManagement) storageProviderRegistry.retrieve(AccountManagement.class);
        DeliveringInboundStanzaRelay internalStanzaRelay = new DeliveringInboundStanzaRelay(serverEntity, resourceRegistry, accountManagement);
        RecordingStanzaRelay externalStanzaRelay = new RecordingStanzaRelay();

        StanzaRelayBroker stanzaRelayBroker = new StanzaRelayBroker();
        stanzaRelayBroker.setInternalRelay(internalStanzaRelay);
        stanzaRelayBroker.setExternalRelay(externalStanzaRelay);
View Full Code Here


    }

    public TestSessionContext(SessionStateHolder sessionStateHolder) {
        this(new DefaultServerRuntimeContext(
                new EntityImpl(null, "test", null),
                new RecordingStanzaRelay(),
                new MemoryStorageProviderRegistry()),
             sessionStateHolder);
    }
View Full Code Here

        relay.setServerRuntimeContext(serverContext);
        return new TestSessionContext(serverContext, sessionStateHolder);
    }

    public TestSessionContext(SessionStateHolder sessionStateHolder) {
        this(new DefaultServerRuntimeContext(new EntityImpl(null, "test", null), new RecordingStanzaRelay(),
                new MemoryStorageProviderRegistry()), sessionStateHolder);
    }
View Full Code Here

        AccountManagement accountManagement = (AccountManagement) storageProviderRegistry
                .retrieve(AccountManagement.class);
        DeliveringInboundStanzaRelay internalStanzaRelay = new DeliveringInboundStanzaRelay(serverEntity,
                resourceRegistry, accountManagement);
        RecordingStanzaRelay externalStanzaRelay = new RecordingStanzaRelay();

        StanzaRelayBroker stanzaRelayBroker = new StanzaRelayBroker();
        stanzaRelayBroker.setInternalRelay(internalStanzaRelay);
        stanzaRelayBroker.setExternalRelay(externalStanzaRelay);
View Full Code Here

        relay.setServerRuntimeContext(serverContext);
        return new TestSessionContext(serverContext, sessionStateHolder);
    }

    public TestSessionContext(SessionStateHolder sessionStateHolder) {
        this(new DefaultServerRuntimeContext(new EntityImpl(null, "test", null), new RecordingStanzaRelay(),
                new MemoryStorageProviderRegistry()), sessionStateHolder);
    }
View Full Code Here

        relay.setServerRuntimeContext(serverContext);
        return new TestSessionContext(serverContext, sessionStateHolder);
    }

    public TestSessionContext(SessionStateHolder sessionStateHolder) {
        this(new DefaultServerRuntimeContext(new EntityImpl(null, "test", null), new RecordingStanzaRelay(),
                new MemoryStorageProviderRegistry()), sessionStateHolder);
    }
View Full Code Here

        relay.setServerRuntimeContext(serverContext);
        return new TestSessionContext(serverContext, sessionStateHolder);
    }

    public TestSessionContext(SessionStateHolder sessionStateHolder) {
        this(new DefaultServerRuntimeContext(new EntityImpl(null, "test", null), new RecordingStanzaRelay(),
                new MemoryStorageProviderRegistry()), sessionStateHolder);
    }
View Full Code Here

        relay.setServerRuntimeContext(serverContext);
        return new TestSessionContext(serverContext, sessionStateHolder);
    }

    public TestSessionContext(SessionStateHolder sessionStateHolder) {
        this(new DefaultServerRuntimeContext(new EntityImpl(null, "test", null), new RecordingStanzaRelay(),
                new MemoryStorageProviderRegistry()), sessionStateHolder);
    }
View Full Code Here

    private static final String BODY = "Hello world";
    private static final String ERROR_TEXT = "Error!";
   
    @SpecCompliant(spec = "draft-ietf-xmpp-3920bis-22", section = "10.4.3", status = SpecCompliant.ComplianceStatus.FINISHED, coverage = SpecCompliant.ComplianceCoverage.COMPLETE)
    public void testSmartDeliveryException() throws Exception {
        RecordingStanzaRelay relay = new RecordingStanzaRelay();
        ReturnErrorToSenderFailureStrategy strategy = new ReturnErrorToSenderFailureStrategy(relay);
       
        Stanza stanza = XMPPCoreStanza.getWrapper(StanzaBuilder.createMessageStanza(FROM, TO, LANG, BODY).build());
       
        strategy.process(stanza, Arrays.asList((DeliveryException)new RemoteServerNotFoundException(ERROR_TEXT)));
       
        Iterator<Triple> triples = relay.iterator();
        Triple triple = triples.next();
        Assert.assertEquals(FROM, triple.getEntity());
        MessageStanza errorStanza = (MessageStanza) XMPPCoreStanza.getWrapper(triple.getStanza());
        Assert.assertEquals("error", errorStanza.getType());
        Assert.assertEquals(FROM, errorStanza.getTo());
View Full Code Here

       
        Assert.assertFalse(triples.hasNext());
    }

    public void testNoException() throws Exception {
        RecordingStanzaRelay relay = new RecordingStanzaRelay();
        ReturnErrorToSenderFailureStrategy strategy = new ReturnErrorToSenderFailureStrategy(relay);
       
        Stanza stanza = XMPPCoreStanza.getWrapper(StanzaBuilder.createMessageStanza(FROM, TO, LANG, BODY).build());
       
        strategy.process(stanza, null);
       
        Iterator<Triple> triples = relay.iterator();
        Triple triple = triples.next();
        Assert.assertEquals(FROM, triple.getEntity());
        MessageStanza errorStanza = (MessageStanza) XMPPCoreStanza.getWrapper(triple.getStanza());
        Assert.assertEquals("error", errorStanza.getType());
        Assert.assertEquals(FROM, errorStanza.getTo());
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.delivery.RecordingStanzaRelay$Triple

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.