Package org.jboss.aerogear.android.unifiedpush

Examples of org.jboss.aerogear.android.unifiedpush.Registrations


   
    private static final String PUSH = "push";
   
    @Test
    public void testDefaultConfig() throws URISyntaxException {
        Registrations reg = new Registrations();
        PushConfig config = new PushConfig(new URI("http://testreg.com"), "TestID");
        reg.push(PUSH, config);
        PushRegistrar registrar = reg.get(PUSH);
        assertNotNull(registrar);
        assertTrue(registrar instanceof AeroGearGCMPushRegistrar);        
    }
View Full Code Here


        assertTrue(registrar instanceof AeroGearGCMPushRegistrar);        
    }
   
    @Test(expected = IllegalArgumentException.class)
    public void testFailsOnUnsupportedType() throws URISyntaxException {
        Registrations reg = new Registrations();
        PushConfig config = new PushConfig(new URI("http://testreg.com"), "TestID");
        config.setType(new PushType() {

            @Override
            public String getName() {
                return "FAIL_TYPE";
            }
        });
        reg.push(PUSH, config);
       
    }
View Full Code Here

       
    }

    @Test
    public void testCustomFactoryType() throws URISyntaxException {
        Registrations reg = new Registrations(new PushRegistrarFactory() {

            @Override
            public PushRegistrar createPushRegistrar(PushConfig config) {
                if (config.getType().getName().equals("CUSTOM_TYPE")) {
                    return Mockito.mock(PushRegistrar.class);
                }
                else {
                    return null;
                }
            }
        });
        PushConfig config = new PushConfig(new URI("http://testreg.com"), "TestID");
        config.setType(new PushType() {

            @Override
            public String getName() {
                return "CUSTOM_TYPE";
            }
        });
        assertNotNull(reg.push(PUSH, config));
       
    }
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.android.unifiedpush.Registrations

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.