Package com.hazelcast.config

Examples of com.hazelcast.config.MemberAttributeConfig


        assertEquals(4, managementCenterConfig.getUpdateInterval());
    }
   
    @Test
    public void testMemberAttributesConfig() {
        MemberAttributeConfig memberAttributeConfig = config.getMemberAttributeConfig();
        assertNotNull(memberAttributeConfig);
        assertEquals("spring-group", memberAttributeConfig.getStringAttribute("cluster.group.name"));
        assertEquals(new Integer(5700), memberAttributeConfig.getIntAttribute("cluster.port.int"));
        assertEquals(new Long(5700), memberAttributeConfig.getLongAttribute("cluster.port.long"));
        assertEquals(new Short("5700"), memberAttributeConfig.getShortAttribute("cluster.port.short"));
        assertEquals(new Byte("111"), memberAttributeConfig.getByteAttribute("attribute.byte"));
        assertTrue(memberAttributeConfig.getBooleanAttribute("attribute.boolean"));
        assertEquals(0.0d, memberAttributeConfig.getDoubleAttribute("attribute.double"), 0.0001d);
        assertEquals(1234.5678, memberAttributeConfig.getFloatAttribute("attribute.float"), 0.0001);
    }
View Full Code Here


    @Test(timeout = 120000)
    public void testConfigAttributes() throws Exception {
        Config config = new Config();
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);

        MemberAttributeConfig memberAttributeConfig = config.getMemberAttributeConfig();
        memberAttributeConfig.setIntAttribute("Test", 123);

        HazelcastInstance h1 = factory.newHazelcastInstance(config);
        Member m1 = h1.getCluster().getLocalMember();
        assertEquals(123, (int) m1.getIntAttribute("Test"));
View Full Code Here

    public void testConfigAttributes() throws Exception {
        Config c = new Config();
        JoinConfig join = c.getNetworkConfig().getJoin();
        join.getTcpIpConfig().addMember("127.0.0.1").setEnabled(true);
        join.getMulticastConfig().setEnabled(false);
        MemberAttributeConfig memberAttributeConfig = c.getMemberAttributeConfig();
        memberAttributeConfig.setIntAttribute("Test", 123);

        HazelcastInstance h1 = Hazelcast.newHazelcastInstance(c);
        Member m1 = h1.getCluster().getLocalMember();
        assertEquals(123, (int) m1.getIntAttribute("Test"));
View Full Code Here

TOP

Related Classes of com.hazelcast.config.MemberAttributeConfig

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.