Examples of HelloResponse


Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

        assertThat(response.getUAID(), is(notNullValue()));
    }

    @Test
    public void handleHandshakeWithNullUaid() {
        final HelloResponse response = server.handleHandshake(new HelloMessageImpl(null));
        assertThat(response.getUAID(), is(notNullValue()));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

    }

    @Test
    public void handleHandshakeWithExistingUaid() {
        final String uaid = UUIDUtil.newUAID();
        final HelloResponse response = server.handleHandshake(new HelloMessageImpl(uaid));
        assertThat(response.getUAID(), equalTo(uaid));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

    }

    @Test
    public void handleHandshakeWithInvalidUaid() {
        final String uaid = "bajja11122";
        final HelloResponse response = server.handleHandshake(new HelloMessageImpl(uaid));
        assertThat(response.getUAID(), is(notNullValue()));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

    public void handleHandshakeWithChannels() throws ChannelNotFoundException {
        final String channelId1 = UUID.randomUUID().toString();
        final String channelId2 = UUID.randomUUID().toString();
        final Set<String> channelIds = new HashSet<String>(Arrays.asList(channelId1, channelId2));
        final HelloMessage handshakeImpl = new HelloMessageImpl(UUIDUtil.newUAID(), channelIds);
        final HelloResponse response = server.handleHandshake(handshakeImpl);
        assertThat(response.getUAID(), is(notNullValue()));
        assertThat(server.getChannel(channelId1), is(notNullValue()));
        assertThat(server.getChannel(channelId2), is(notNullValue()));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

    @Test
    public void handleHandshakeWithEmptyChannels() throws ChannelNotFoundException {
        final Set<String> channelIds = Collections.emptySet();
        final String uaid = UUIDUtil.newUAID();
        final HelloMessage handshakeImpl = new HelloMessageImpl(uaid, channelIds);
        final HelloResponse response = server.handleHandshake(handshakeImpl);
        assertThat(response.getUAID(), is(notNullValue()));
        assertThat(server.hasChannel(uaid, "channel1"), is(false));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

        final String channelId1 = UUID.randomUUID().toString();
        final String channelId2 = UUID.randomUUID().toString();
        final Set<String> channelIds = new HashSet<String>(Arrays.asList(channelId1, channelId2));
        final String uaid = UUIDUtil.newUAID();
        final HelloMessage firstHello = new HelloMessageImpl(uaid, channelIds);
        final HelloResponse firstResponse = server.handleHandshake(firstHello);
        assertThat(firstResponse.getUAID(), equalTo(uaid));
        assertThat(server.hasChannel(uaid, channelId1), is(true));
        assertThat(server.hasChannel(uaid, channelId2), is(true));

        final HelloMessage nextHello = new HelloMessageImpl(uaid, Collections.<String>emptySet());
        final HelloResponse secondResponse = server.handleHandshake(nextHello);
        assertThat(secondResponse.getUAID(), equalTo(uaid));
        assertThat(server.hasChannel(secondResponse.getUAID(), channelId1), is(false));
        assertThat(server.hasChannel(secondResponse.getUAID(), channelId2), is(false));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

        final String uaid = UUIDUtil.newUAID();
        final String channelId1 = UUID.randomUUID().toString();
        final String channelId2 = UUID.randomUUID().toString();
        final Set<String> channelIds = new HashSet<String>(Arrays.asList(channelId1, channelId2));
        final HelloMessage firstHello = new HelloMessageImpl(uaid, channelIds);
        final HelloResponse firstResponse = server.handleHandshake(firstHello);
        assertThat(firstResponse.getUAID(), equalTo(uaid));
        assertThat(server.hasChannel(uaid, channelId1), is(true));
        assertThat(server.hasChannel(uaid, channelId2), is(true));

        final String channelId3 = UUID.randomUUID().toString();
        final String channelId4 = UUID.randomUUID().toString();
        final Set<String> newChannelIds = new HashSet<String>(Arrays.asList(channelId3, channelId4));
        final HelloMessage nextHello = new HelloMessageImpl(uaid, newChannelIds);
        final HelloResponse secondResponse = server.handleHandshake(nextHello);
        assertThat(secondResponse.getUAID(), equalTo(uaid));
        assertThat(server.hasChannel(uaid, channelId1), is(false));
        assertThat(server.hasChannel(uaid, channelId2), is(false));
        assertThat(server.hasChannel(uaid, channelId3), is(true));
        assertThat(server.hasChannel(uaid, channelId4), is(true));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

    @Test
    public void handleHandshakeWithChannelsButNoUaid() {
        final Set<String> channelIds = new HashSet<String>(Arrays.asList("channel1", "channel2"));
        final HelloMessage handshakeImpl = new HelloMessageImpl(null, channelIds);
        final HelloResponse response = server.handleHandshake(handshakeImpl);
        assertThat(response.getUAID(), is(notNullValue()));
        assertThat(server.hasChannel(handshakeImpl.getUAID(), "channel1"), is(false));
        assertThat(server.hasChannel(handshakeImpl.getUAID(), "channel2"), is(false));
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.HelloResponse

    public void websocketHello() {
        final EmbeddedChannel channel = createWebSocketChannel(factory);
        final String uaid = UUIDUtil.newUAID();
        sendWebSocketHttpUpgradeRequest(sessionUrl, channel);

        final HelloResponse response = sendWebSocketHelloFrame(uaid, channel);
        assertThat(response.getMessageType(), equalTo(MessageType.Type.HELLO));
        assertThat(response.getUAID(), equalTo(uaid));
        channel.close();
    }
View Full Code Here

Examples of org.something.services.hello.HelloResponse

  }
 
  private void checkHelloServiceSayHello(HelloService helloService) throws HelloFaultMessage {
    HelloRequest request = new HelloRequest();
    request.setToWho("World!");
    HelloResponse response = helloService.sayHello(request);
    assertEquals("Hello World!", response.getGreeting());
  }
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.