Skip to content

Commit

Permalink
Fixes #487.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdogan committed May 27, 2013
1 parent 44a27ec commit 76c71f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Expand Up @@ -180,7 +180,7 @@ public String generate(Config config) {
xml.append("</asymmetric-encryption>");
xml.append("</network>");
final PartitionGroupConfig pg = config.getPartitionGroupConfig();
if (pg != null) {
if (pg != null && pg.getGroupType() != null) {
xml.append("<partition-group enabled=\"").append(pg.isEnabled())
.append("\" group-type=\"").append(pg.getGroupType()).append("\" />");
}
Expand Down
Expand Up @@ -110,9 +110,18 @@ public void readSemaphoreConfig() {
}

@Test
public void testConfig2Xml2Config() {
final Config config = new ClasspathXmlConfig("hazelcast-fullconfig.xml");
final String xml = new ConfigXmlGenerator().generate(config);
public void testConfig2Xml2DefaultConfig() {
testConfig2Xml2Config("hazelcast-default.xml");
}

@Test
public void testConfig2Xml2FullConfig() {
testConfig2Xml2Config("hazelcast-fullconfig.xml");
}

private void testConfig2Xml2Config(String fileName) {
final Config config = new ClasspathXmlConfig(fileName);
final String xml = new ConfigXmlGenerator(true).generate(config);
final Config config2 = new InMemoryXmlConfig(xml);
assertTrue(config.isCompatible(config2));
assertTrue(config2.isCompatible(config));
Expand Down

0 comments on commit 76c71f0

Please sign in to comment.