Package com.proofpoint.discovery.client.announce

Examples of com.proofpoint.discovery.client.announce.ServiceAnnouncement


    @Test
    public void testJsonEncode()
            throws Exception
    {
        ServiceAnnouncement serviceAnnouncement = serviceAnnouncement("foo")
                .addProperty("http", "http://localhost:8080")
                .addProperty("jmx", "jmx://localhost:1234")
                .build();
        Map<String, Object> actual = objectCodec.fromJson(serviceAnnouncementCodec.toJson(serviceAnnouncement));

        String json = Resources.toString(Resources.getResource("service-announcement.json"), Charsets.UTF_8);
        Map<String, Object> expected = objectCodec.fromJson(json);

        // set id in expected
        expected.put("id", serviceAnnouncement.getId().toString());

        assertEquals(actual, expected);
    }
View Full Code Here


                null
        );

        Injector injector = createInjector(httpServerInfo);

        ServiceAnnouncement announcement = serviceAnnouncement("apple")
                .addProperty("http", httpServerInfo.getHttpUri().toASCIIString())
                .addProperty("http-external", httpServerInfo.getHttpExternalUri().toASCIIString())
                .build();

        Set<ServiceAnnouncement> announcements = injector.getInstance(Key.get(new TypeLiteral<Set<ServiceAnnouncement>>()
View Full Code Here

                URI.create("https://example.com:4444")
        );

        Injector injector = createInjector(httpServerInfo);

        ServiceAnnouncement announcement = serviceAnnouncement("apple")
                .addProperty("https", httpServerInfo.getHttpsUri().toASCIIString())
                .build();

        Set<ServiceAnnouncement> announcements = injector.getInstance(Key.get(new TypeLiteral<Set<ServiceAnnouncement>>()
        {
View Full Code Here

                URI.create("https://example.com:4444")
        );

        Injector injector = createInjector(httpServerInfo);

        ServiceAnnouncement announcement = serviceAnnouncement("apple")
                .addProperty("http", httpServerInfo.getHttpUri().toASCIIString())
                .addProperty("http-external", httpServerInfo.getHttpExternalUri().toASCIIString())
                .addProperty("https", httpServerInfo.getHttpsUri().toASCIIString())
                .build();
View Full Code Here

                        DiscoveryBinder.discoveryBinder(binder).bindHttpAnnouncement("apple").addProperty("a", "apple");
                    }
                }
        );

        ServiceAnnouncement announcement = serviceAnnouncement("apple")
                .addProperty("a", "apple")
                .addProperty("http", httpServerInfo.getHttpUri().toASCIIString())
                .addProperty("http-external", httpServerInfo.getHttpExternalUri().toASCIIString())
                .addProperty("https", httpServerInfo.getHttpsUri().toASCIIString())
                .build();
View Full Code Here

    private void assertAnnouncement(Set<ServiceAnnouncement> actualAnnouncements, ServiceAnnouncement expected)
    {
        Assert.assertNotNull(actualAnnouncements);
        Assert.assertEquals(actualAnnouncements.size(), 1);
        ServiceAnnouncement announcement = Iterables.getOnlyElement(actualAnnouncements);
        Assert.assertEquals(announcement.getType(), expected.getType());
        Assert.assertEquals(announcement.getProperties(), expected.getProperties());
    }
View Full Code Here

TOP

Related Classes of com.proofpoint.discovery.client.announce.ServiceAnnouncement

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.