Skip to content

Commit

Permalink
Set version to 1.0.8.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Nov 7, 2018
1 parent fa384e3 commit 57563a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.jgroups.kubernetes</groupId>
<artifactId>jgroups-kubernetes</artifactId>
<version>1.0.8-SNAPSHOT</version>
<version>1.0.8.Final</version>
<packaging>jar</packaging>
<name>KUBE_PING</name>
<url>https://github.com/jgroups-extras/jgroups-kubernetes</url>
Expand Down Expand Up @@ -53,7 +53,7 @@
</scm>

<properties>
<version.jgroups>4.0.12.Final</version.jgroups>
<version.jgroups>4.0.15.Final</version.jgroups>
<version.junit>4.12</version.junit>
<version.assertj>3.8.0</version.assertj>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
26 changes: 13 additions & 13 deletions src/test/java/org/jgroups/ping/kube/test/RollingUpdateTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package org.jgroups.ping.kube.test;

import static org.jgroups.ping.kube.test.util.FreePortFinder.findFreePort;

import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import org.assertj.core.api.Assertions;
import org.jgroups.JChannel;
import org.jgroups.Message;
Expand All @@ -19,6 +11,14 @@
import org.jgroups.stack.IpAddress;
import org.junit.Test;

import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import static org.jgroups.ping.kube.test.util.FreePortFinder.findFreePort;

/**
* Tests Rolling update scenarios.
*
Expand All @@ -40,7 +40,7 @@ public void testPuttingAllNodesInTheSameClusterDuringRollingUpdate() throws Exce
.map(e -> ((IpAddress)e.getDest()).getIpAddress().getHostAddress())
.collect(Collectors.toSet());
List<String> allPodsFromKubernetesApi = testedProtocol.getPods().stream()
.map(pod -> pod.getIp())
.map(Pod::getIp)
.collect(Collectors.toList());

//then
Expand All @@ -57,21 +57,21 @@ public void testPutOnlyNodesWithTheSameParentDuringRollingUpdate() throws Except
sendInitialDiscovery(testedProtocol);
String senderParentDeployment = testedProtocol.getPods().stream()
.filter(pod -> "127.0.0.1".equals(pod.getIp()))
.map(pod -> pod.getParentDeployment())
.map(Pod::getParentDeployment)
.findFirst().get();
Set<String> membersUsedForDiscovery = testedProtocol.getCollectedMessages().stream()
.map(e -> ((IpAddress)e.getDest()).getIpAddress().getHostAddress())
.collect(Collectors.toSet());
List<String> allowedPodsFromKubernetesApi = testedProtocol.getPods().stream()
.filter(pod -> senderParentDeployment.equals(pod.getParentDeployment()))
.map(pod -> pod.getIp())
.map(Pod::getIp)
.collect(Collectors.toList());

//then
Assertions.assertThat(allowedPodsFromKubernetesApi).containsAll(membersUsedForDiscovery);
}

private void sendInitialDiscovery(KUBE_PING kubePingProtocol) throws Exception {
private static void sendInitialDiscovery(KUBE_PING kubePingProtocol) throws Exception {
new JChannel(
new TCP().setValue("bind_addr", InetAddress.getLoopbackAddress()).setValue("bind_port", findFreePort()),
kubePingProtocol,
Expand All @@ -83,7 +83,7 @@ private void sendInitialDiscovery(KUBE_PING kubePingProtocol) throws Exception {
static class KUBE_PING_FOR_TESTING extends KUBE_PING {

private final String resourceFile;
private List<Message> collectedMessages = new ArrayList<>();
private final List<Message> collectedMessages = new ArrayList<>();
private List<Pod> pods;

public KUBE_PING_FOR_TESTING(String resourceFile) {
Expand Down

0 comments on commit 57563a6

Please sign in to comment.