Skip to content

Commit

Permalink
ConfigCheck: Remove branch 3.8 compatibility branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrinot committed Feb 19, 2018
1 parent 70c3e88 commit 1124a6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.hazelcast.config.Config;
import com.hazelcast.config.GroupConfig;
import com.hazelcast.config.PartitionGroupConfig;
import com.hazelcast.internal.cluster.Versions;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
Expand Down Expand Up @@ -184,14 +183,9 @@ public int getId() {
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeUTF(groupName);

//TODO @tkountis remove in 4.0
if (clusterVersion.isUnknownOrLessThan(Versions.V3_9)) {
// Rolling upgrades support - allow 3.9 Nodes to join 3.8 cluster -
// however versions above 3.8.2 already know to ignore the password validation
out.writeUTF(groupPassword);
} else {
out.writeUTF(EMPTY_PWD);
}
out.writeUTF(EMPTY_PWD);
out.writeUTF(joinerType);
out.writeBoolean(partitionGroupEnabled);
if (partitionGroupEnabled) {
Expand Down
26 changes: 0 additions & 26 deletions hazelcast/src/test/java/com/hazelcast/cluster/ConfigCheckTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,32 +76,6 @@ public void whenGroupPasswordDifferent_thenJoin() {
assertIsCompatibleTrue(configCheck1, configCheck2);
}

@Test
public void testGroupPasswordLeak_whenVersionUnknow()
throws IOException {
final Config config = new Config();
config.getNetworkConfig().getJoin().getMulticastConfig()
.setEnabled(true).setMulticastTimeoutSeconds(3);
config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);

final AtomicBoolean leaked = new AtomicBoolean(false);

ObjectDataOutput odo = mock(ObjectDataOutput.class);

ConfigCheck configCheck = new ConfigCheck(config, "multicast");
configCheck.writeData(odo);


ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
verify(odo, times(7)).writeUTF(captor.capture());
List<String> values = captor.getAllValues();
if (values.contains(config.getGroupConfig().getPassword())) {
leaked.set(true);
}

assertEquals(true, leaked.get());
}

@Test
public void testGroupPasswordNotLeak_whenVersionAboveThreeNine() {
final Config config = new Config();
Expand Down

0 comments on commit 1124a6d

Please sign in to comment.