Examples of RegisterMessageImpl


Examples of org.jboss.aerogear.simplepush.protocol.impl.RegisterMessageImpl

    @Test
    public void handleNotification() throws ChannelNotFoundException {
        final String channelId = UUID.randomUUID().toString();
        final String uaid = UUIDUtil.newUAID();
        final RegisterResponse registerResponse = server.handleRegister(new RegisterMessageImpl(channelId), uaid);
        final String endpointToken = extractEndpointToken(registerResponse.getPushEndpoint());
        Notification notification = server.handleNotification(endpointToken, "version=1");
        assertThat(notification.ack(), equalTo((Ack)new AckImpl(channelId, 1L)));
        assertThat(server.getChannel(channelId).getVersion(), is(1L));
        server.handleNotification(endpointToken, "version=2");
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.impl.RegisterMessageImpl

    @Test (expected = VersionException.class)
    public void handleNotificationWithVersionLessThanCurrentVersion() throws ChannelNotFoundException {
        final String channelId = UUID.randomUUID().toString();
        final String uaid = UUIDUtil.newUAID();
        final RegisterResponse registerResponse = server.handleRegister(new RegisterMessageImpl(channelId), uaid);
        final String endpointToken = extractEndpointToken(registerResponse.getPushEndpoint());
        server.handleNotification(endpointToken, "version=10");
        server.handleNotification(endpointToken, "version=2");
    }
View Full Code Here

Examples of org.jboss.aerogear.simplepush.protocol.impl.RegisterMessageImpl

    @Test
    public void handleAck() throws ChannelNotFoundException {
        final String channelId_1 = UUID.randomUUID().toString();
        final String channelId_2 = UUID.randomUUID().toString();
        final String uaid = UUIDUtil.newUAID();
        final RegisterResponse registerResponse1 = server.handleRegister(new RegisterMessageImpl(channelId_1), uaid);
        final String endpointToken1 = extractEndpointToken(registerResponse1.getPushEndpoint());
        final RegisterResponse registerResponse2 = server.handleRegister(new RegisterMessageImpl(channelId_2), uaid);
        final String endpointToken2 = extractEndpointToken(registerResponse2.getPushEndpoint());
        server.handleNotification(endpointToken1, "version=10");
        server.handleNotification(endpointToken2, "version=23");

        final Ack ackChannel_1 = new AckImpl(channelId_1, 10L);
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.