Package rocks.xmpp.core

Examples of rocks.xmpp.core.MockServer


        xmppSession1.send(new Presence(Presence.Show.AWAY));
    }

    @Test
    public void testLastActivityInChatPresence() {
        TestXmppSession xmppSession1 = new TestXmppSession(ROMEO, new MockServer());
        xmppSession1.getExtensionManager(AvatarManager.class).setEnabled(false);
        xmppSession1.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                Assert.assertFalse(e.getPresence().getExtension(LastActivity.class) != null);
View Full Code Here


        xmppSession1.send(new Presence(Presence.Show.CHAT));
    }

    @Test
    public void testLastActivityInDndPresence() {
        TestXmppSession xmppSession1 = new TestXmppSession(ROMEO, new MockServer());
        xmppSession1.getExtensionManager(AvatarManager.class).setEnabled(false);
        xmppSession1.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                Assert.assertFalse(e.getPresence().getExtension(LastActivity.class) != null);
View Full Code Here

        xmppSession1.send(new Presence(Presence.Show.DND));
    }

    @Test
    public void testLastActivityInInitialPresence() {
        TestXmppSession xmppSession1 = new TestXmppSession(ROMEO, new MockServer());
        xmppSession1.getExtensionManager(AvatarManager.class).setEnabled(false);
        xmppSession1.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                Assert.assertFalse(e.getPresence().getExtension(LastActivity.class) != null);
View Full Code Here

*/
public class EntityTimeManagerTest extends ExtensionTest {

    @Test
    public void testEntityTimeManager() throws XmppException {
        MockServer mockServer = new MockServer();
        TestXmppSession connection1 = new TestXmppSession(ROMEO, mockServer);
        new TestXmppSession(JULIET, mockServer);
        EntityTimeManager entityTimeManager = connection1.getExtensionManager(EntityTimeManager.class);
        EntityTime entityTime = entityTimeManager.getEntityTime(JULIET);
        Assert.assertNotNull(entityTime);
View Full Code Here

        Assert.assertNotNull(entityTime.getTimezone());
    }

    @Test
    public void testEntityTimeIfDisabled() throws XmppException {
        MockServer mockServer = new MockServer();
        TestXmppSession connection1 = new TestXmppSession(ROMEO, mockServer);
        TestXmppSession connection2 = new TestXmppSession(JULIET, mockServer);
        connection2.getExtensionManager(EntityTimeManager.class).setEnabled(false);
        EntityTimeManager entityTimeManager = connection1.getExtensionManager(EntityTimeManager.class);
        try {
View Full Code Here

*/
public class PingManagerTest extends ExtensionTest {

    @Test
    public void testPing() throws XmppException {
        MockServer mockServer = new MockServer();
        TestXmppSession connection1 = new TestXmppSession(ROMEO, mockServer);
        new TestXmppSession(JULIET, mockServer);
        PingManager pingManager = connection1.getExtensionManager(PingManager.class);
        pingManager.ping(JULIET);
    }
View Full Code Here

        pingManager.ping(JULIET);
    }

    @Test(expectedExceptions = StanzaException.class)
    public void testPingIfDisabled() throws XmppException {
        MockServer mockServer = new MockServer();
        TestXmppSession connection1 = new TestXmppSession(ROMEO, mockServer);
        TestXmppSession connection2 = new TestXmppSession(JULIET, mockServer);
        connection2.getExtensionManager(PingManager.class).setEnabled(false);
        PingManager pingManager = connection1.getExtensionManager(PingManager.class);
        pingManager.ping(JULIET);
View Full Code Here

public class TestXmppSession extends XmppSession {

    private MockServer mockServer;

    public TestXmppSession() {
        this(Jid.valueOf("test@domain/resource"), new MockServer());
    }
View Full Code Here

        Assert.assertTrue(serviceDiscoveryManager.getIdentities().contains(new Identity("conference", "text", "name2", "en")));
    }

    @Test
    public void testInfoDiscovery() throws XmppException {
        MockServer mockServer = new MockServer();
        TestXmppSession connection1 = new TestXmppSession(ROMEO, mockServer);
        new TestXmppSession(JULIET, mockServer);
        ServiceDiscoveryManager serviceDiscoveryManager = connection1.getExtensionManager(ServiceDiscoveryManager.class);
        InfoNode result = serviceDiscoveryManager.discoverInformation(JULIET);
        Assert.assertNotNull(result);
View Full Code Here

TOP

Related Classes of rocks.xmpp.core.MockServer

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.