forked from hazelcast/hazelcast
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use getAddress instead of getSocketAddress, fixes hazelcast#8463
- Loading branch information
1 parent
b2fe91c
commit 8ca6308
Showing
3 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
hazelcast/src/test/java/com/hazelcast/internal/management/PartitionServiceBeanDTOTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.hazelcast.internal.management; | ||
|
||
import com.hazelcast.config.Config; | ||
import com.hazelcast.core.Hazelcast; | ||
import com.hazelcast.core.HazelcastInstance; | ||
import com.hazelcast.internal.management.dto.PartitionServiceBeanDTO; | ||
import com.hazelcast.monitor.impl.MemberStateImpl; | ||
import com.hazelcast.test.HazelcastParallelClassRunner; | ||
import com.hazelcast.test.HazelcastTestSupport; | ||
import com.hazelcast.test.annotation.QuickTest; | ||
import org.junit.After; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
@RunWith(HazelcastParallelClassRunner.class) | ||
@Category(QuickTest.class) | ||
public class PartitionServiceBeanDTOTest extends HazelcastTestSupport { | ||
|
||
@After | ||
public void tearDown() { | ||
Hazelcast.shutdownAll(); | ||
} | ||
|
||
@Test //https://github.com/hazelcast/hazelcast/issues/8463 | ||
public void testJMXStatsWithPublicAdressHostName() { | ||
Config config = new Config(); | ||
config.getNetworkConfig().setPublicAddress("hazelcast.org"); | ||
HazelcastInstance instance = Hazelcast.newHazelcastInstance(config); | ||
MemberStateImpl memberState = new MemberStateImpl(); | ||
TimedMemberStateFactoryHelper.registerJMXBeans(getNode(instance).hazelcastInstance, memberState); | ||
PartitionServiceBeanDTO partitionServiceDTO = memberState.getMXBeans().getPartitionServiceBean(); | ||
assertEquals(partitionServiceDTO.getPartitionCount(), partitionServiceDTO.getActivePartitionCount()); | ||
} | ||
|
||
} |