You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by lg...@apache.org on 2017/12/20 13:19:58 UTC
[1/3] mina-sshd git commit: Upgraded Spring version(s) to 5+
Repository: mina-sshd
Updated Branches:
refs/heads/master 65d7f65d1 -> b1464ecc1
Upgraded Spring version(s) to 5+
Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/b1464ecc
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/b1464ecc
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/b1464ecc
Branch: refs/heads/master
Commit: b1464ecc148947c369ffab8491d7f71985ae933b
Parents: 73b20e2
Author: Goldstein Lyor <ly...@c-b4.com>
Authored: Wed Dec 20 13:50:36 2017 +0200
Committer: Goldstein Lyor <ly...@c-b4.com>
Committed: Wed Dec 20 15:19:50 2017 +0200
----------------------------------------------------------------------
pom.xml | 2 +-
.../apache/sshd/common/auth/AuthenticationTest.java | 15 ++++++++++++++-
sshd-spring-sftp/pom.xml | 2 +-
3 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b1464ecc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f30ad1c..80f1b83 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,7 +110,7 @@
<bouncycastle.version>1.58</bouncycastle.version>
<slf4j.version>1.7.25</slf4j.version>
- <spring.version>4.3.8.RELEASE</spring.version>
+ <spring.version>5.0.2.RELEASE</spring.version>
<jgit.version>4.9.2.201712150930-r</jgit.version>
<junit.version>4.12</junit.version>
<surefire.plugin.version>2.20.1</surefire.plugin.version>
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b1464ecc/sshd-core/src/test/java/org/apache/sshd/common/auth/AuthenticationTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/common/auth/AuthenticationTest.java b/sshd-core/src/test/java/org/apache/sshd/common/auth/AuthenticationTest.java
index 0f99de0..322f55c 100644
--- a/sshd-core/src/test/java/org/apache/sshd/common/auth/AuthenticationTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/common/auth/AuthenticationTest.java
@@ -32,6 +32,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
import org.apache.sshd.client.SshClient;
import org.apache.sshd.client.auth.hostbased.HostKeyIdentityProvider;
@@ -517,12 +518,20 @@ public class AuthenticationTest extends BaseTestSupport {
try (SshClient client = setupTestClient()) {
RuntimeException expected = new RuntimeException("Synthetic exception");
AtomicInteger invocations = new AtomicInteger(0);
+ AtomicReference<Throwable> caughtException = new AtomicReference<>();
client.addSessionListener(new SessionListener() {
@Override
public void sessionEvent(Session session, Event event) {
assertEquals("Mismatched invocations count", 1, invocations.incrementAndGet());
throw expected;
}
+
+ @Override
+ public void sessionException(Session session, Throwable t) {
+ if (t == expected) {
+ caughtException.set(t);
+ }
+ }
});
client.start();
@@ -540,7 +549,11 @@ public class AuthenticationTest extends BaseTestSupport {
}
if (expected != actual) {
- fail("Mismatched authentication failure reason: signalled=" + signalled + ", actual=" + actual);
+ // Possible race condition between session close and session exception signalled
+ Throwable caught = caughtException.get();
+ if (caught == null) {
+ fail("Mismatched authentication failure reason: signalled=" + signalled + ", actual=" + actual);
+ }
}
} finally {
client.stop();
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b1464ecc/sshd-spring-sftp/pom.xml
----------------------------------------------------------------------
diff --git a/sshd-spring-sftp/pom.xml b/sshd-spring-sftp/pom.xml
index 455878e..368307c 100644
--- a/sshd-spring-sftp/pom.xml
+++ b/sshd-spring-sftp/pom.xml
@@ -34,7 +34,7 @@
<properties>
<projectRoot>${basedir}/..</projectRoot>
- <spring.integration.version>4.3.9.RELEASE</spring.integration.version>
+ <spring.integration.version>5.0.0.RELEASE</spring.integration.version>
</properties>
<dependencyManagement>
[2/3] mina-sshd git commit: Upgraded used JGit version to
4.9.2.201712150930-r
Posted by lg...@apache.org.
Upgraded used JGit version to 4.9.2.201712150930-r
Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/73b20e2c
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/73b20e2c
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/73b20e2c
Branch: refs/heads/master
Commit: 73b20e2cbb39377344994ff824b5bc07336e4a44
Parents: 2846710
Author: Goldstein Lyor <ly...@c-b4.com>
Authored: Wed Dec 20 12:44:41 2017 +0200
Committer: Goldstein Lyor <ly...@c-b4.com>
Committed: Wed Dec 20 15:19:50 2017 +0200
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/73b20e2c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2a942c4..f30ad1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,7 +111,7 @@
<bouncycastle.version>1.58</bouncycastle.version>
<slf4j.version>1.7.25</slf4j.version>
<spring.version>4.3.8.RELEASE</spring.version>
- <jgit.version>4.7.0.201704051617-r</jgit.version>
+ <jgit.version>4.9.2.201712150930-r</jgit.version>
<junit.version>4.12</junit.version>
<surefire.plugin.version>2.20.1</surefire.plugin.version>
<!-- See https://pmd.github.io/ for available latest version -->
[3/3] mina-sshd git commit: Using Mockito 2.13.0 framework
Posted by lg...@apache.org.
Using Mockito 2.13.0 framework
Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/28467105
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/28467105
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/28467105
Branch: refs/heads/master
Commit: 2846710598dd98edef7de49c7327f63e30e309a4
Parents: 65d7f65
Author: Goldstein Lyor <ly...@c-b4.com>
Authored: Wed Dec 20 12:41:47 2017 +0200
Committer: Goldstein Lyor <ly...@c-b4.com>
Committed: Wed Dec 20 15:19:50 2017 +0200
----------------------------------------------------------------------
pom.xml | 4 ++--
sshd-contrib/pom.xml | 2 +-
.../password/InteractivePasswordIdentityProviderTest.java | 10 +++++-----
sshd-core/pom.xml | 4 ++--
.../client/subsystem/sftp/DefaultCloseableHandleTest.java | 6 +++---
.../java/org/apache/sshd/common/AttributeStoreTest.java | 4 ++--
.../sshd/common/channel/ChannelPipedOutputStreamTest.java | 6 +++---
sshd-ldap/pom.xml | 10 +++++-----
sshd-spring-sftp/pom.xml | 2 +-
9 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index aa9ed29..2a942c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -335,8 +335,8 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.10.19</version>
+ <artifactId>mockito-core</artifactId>
+ <version>2.13.0</version>
</dependency>
<dependency>
<groupId>net.sf.jpam</groupId>
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/sshd-contrib/pom.xml
----------------------------------------------------------------------
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index 04be272..718dd7e 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -76,7 +76,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/sshd-contrib/src/test/java/org/apache/sshd/client/auth/password/InteractivePasswordIdentityProviderTest.java
----------------------------------------------------------------------
diff --git a/sshd-contrib/src/test/java/org/apache/sshd/client/auth/password/InteractivePasswordIdentityProviderTest.java b/sshd-contrib/src/test/java/org/apache/sshd/client/auth/password/InteractivePasswordIdentityProviderTest.java
index af52e7a..a141960 100644
--- a/sshd-contrib/src/test/java/org/apache/sshd/client/auth/password/InteractivePasswordIdentityProviderTest.java
+++ b/sshd-contrib/src/test/java/org/apache/sshd/client/auth/password/InteractivePasswordIdentityProviderTest.java
@@ -28,7 +28,7 @@ import org.apache.sshd.util.test.BaseTestSupport;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -51,8 +51,8 @@ public class InteractivePasswordIdentityProviderTest extends BaseTestSupport {
AtomicInteger passwordIndex = new AtomicInteger(0);
String prompt = getCurrentTestName();
UserInteraction userInteraction = Mockito.mock(UserInteraction.class);
- Mockito.when(userInteraction.isInteractionAllowed(Matchers.any(ClientSession.class))).thenReturn(Boolean.TRUE);
- Mockito.when(userInteraction.getUpdatedPassword(Matchers.any(ClientSession.class), Matchers.anyString(), Matchers.anyString()))
+ Mockito.when(userInteraction.isInteractionAllowed(ArgumentMatchers.any(ClientSession.class))).thenReturn(Boolean.TRUE);
+ Mockito.when(userInteraction.getUpdatedPassword(ArgumentMatchers.any(ClientSession.class), ArgumentMatchers.anyString(), ArgumentMatchers.anyString()))
.thenAnswer(new Answer<String>() {
@Override
public String answer(InvocationOnMock invocation) throws Throwable {
@@ -87,8 +87,8 @@ public class InteractivePasswordIdentityProviderTest extends BaseTestSupport {
public void testInteractionAllowedConsultation() {
ClientSession session = Mockito.mock(ClientSession.class);
UserInteraction userInteraction = Mockito.mock(UserInteraction.class);
- Mockito.when(userInteraction.isInteractionAllowed(Matchers.any(ClientSession.class))).thenReturn(Boolean.FALSE);
- Mockito.when(userInteraction.getUpdatedPassword(Matchers.any(ClientSession.class), Matchers.anyString(), Matchers.anyString()))
+ Mockito.when(userInteraction.isInteractionAllowed(ArgumentMatchers.any(ClientSession.class))).thenReturn(Boolean.FALSE);
+ Mockito.when(userInteraction.getUpdatedPassword(ArgumentMatchers.any(ClientSession.class), ArgumentMatchers.anyString(), ArgumentMatchers.anyString()))
.thenThrow(new UnsupportedOperationException("Unexpected call"));
PasswordIdentityProvider provider = InteractivePasswordIdentityProvider.providerOf(session, userInteraction, getCurrentTestName());
Iterable<String> passwords = provider.loadPasswords();
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/sshd-core/pom.xml
----------------------------------------------------------------------
diff --git a/sshd-core/pom.xml b/sshd-core/pom.xml
index a27b588..89a6f2a 100644
--- a/sshd-core/pom.xml
+++ b/sshd-core/pom.xml
@@ -52,7 +52,7 @@
<artifactId>tomcat-apr</artifactId>
<optional>true</optional>
</dependency>
-
+
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpg-jdk15on</artifactId>
@@ -104,7 +104,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/DefaultCloseableHandleTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/DefaultCloseableHandleTest.java b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/DefaultCloseableHandleTest.java
index 7d14e6c..eee30c5 100644
--- a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/DefaultCloseableHandleTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/DefaultCloseableHandleTest.java
@@ -29,7 +29,7 @@ import org.apache.sshd.util.test.BaseTestSupport;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
/**
@@ -50,7 +50,7 @@ public class DefaultCloseableHandleTest extends BaseTestSupport {
Handle handle = (Handle) args[0];
assertArrayEquals("Mismatched closing handle", id, handle.getIdentifier());
return null;
- }).when(client).close(Matchers.any(Handle.class));
+ }).when(client).close(ArgumentMatchers.any(Handle.class));
CloseableHandle handle = new DefaultCloseableHandle(client, getCurrentTestName(), id);
try {
@@ -71,7 +71,7 @@ public class DefaultCloseableHandleTest extends BaseTestSupport {
Object[] args = invocation.getArguments();
assertFalse("Close already called on handle=" + args[0], closeCalled.getAndSet(true));
return null;
- }).when(client).close(Matchers.any(Handle.class));
+ }).when(client).close(ArgumentMatchers.any(Handle.class));
CloseableHandle handle = new DefaultCloseableHandle(client, getCurrentTestName(), getCurrentTestName().getBytes(StandardCharsets.UTF_8));
for (int index = 0; index < Byte.SIZE; index++) {
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/sshd-core/src/test/java/org/apache/sshd/common/AttributeStoreTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/common/AttributeStoreTest.java b/sshd-core/src/test/java/org/apache/sshd/common/AttributeStoreTest.java
index 6f73123..c0f1a73 100644
--- a/sshd-core/src/test/java/org/apache/sshd/common/AttributeStoreTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/common/AttributeStoreTest.java
@@ -28,7 +28,7 @@ import org.apache.sshd.util.test.BaseTestSupport;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
/**
@@ -101,7 +101,7 @@ public class AttributeStoreTest extends BaseTestSupport {
}
private static String setAttributeValue(AttributeStore store, String value) {
- Mockito.when(store.getAttribute(Matchers.eq(KEY))).thenReturn(value);
+ Mockito.when(store.getAttribute(ArgumentMatchers.eq(KEY))).thenReturn(value);
return value;
}
}
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/sshd-core/src/test/java/org/apache/sshd/common/channel/ChannelPipedOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/common/channel/ChannelPipedOutputStreamTest.java b/sshd-core/src/test/java/org/apache/sshd/common/channel/ChannelPipedOutputStreamTest.java
index eb2d61f..5cbcefd 100644
--- a/sshd-core/src/test/java/org/apache/sshd/common/channel/ChannelPipedOutputStreamTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/common/channel/ChannelPipedOutputStreamTest.java
@@ -28,7 +28,7 @@ import org.apache.sshd.util.test.BaseTestSupport;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
/**
@@ -51,10 +51,10 @@ public class ChannelPipedOutputStreamTest extends BaseTestSupport {
AtomicInteger receiveCount = new AtomicInteger(0);
Mockito.doAnswer(invocation -> {
- Number len = invocation.getArgumentAt(2, Number.class);
+ Number len = invocation.getArgument(2);
receiveCount.addAndGet(len.intValue());
return null;
- }).when(sink).receive(Matchers.any(byte[].class), Matchers.anyInt(), Matchers.anyInt());
+ }).when(sink).receive(ArgumentMatchers.any(byte[].class), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
try (ChannelPipedOutputStream stream = new ChannelPipedOutputStream(sink)) {
assertTrue("Stream not marked as initially open", stream.isOpen());
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/sshd-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/sshd-ldap/pom.xml b/sshd-ldap/pom.xml
index 7fa0920..495b893 100644
--- a/sshd-ldap/pom.xml
+++ b/sshd-ldap/pom.xml
@@ -58,7 +58,7 @@
<artifactId>xpp3</artifactId>
</exclusion>
</exclusions>
- </dependency>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -75,19 +75,19 @@
<artifactId>apacheds-test-framework</artifactId>
<version>${apacheds.version}</version>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-server-integ</artifactId>
<version>${apacheds.version}</version>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-core-integ</artifactId>
<version>${apacheds.version}</version>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.sshd</groupId>
@@ -103,7 +103,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/28467105/sshd-spring-sftp/pom.xml
----------------------------------------------------------------------
diff --git a/sshd-spring-sftp/pom.xml b/sshd-spring-sftp/pom.xml
index aa76da7..455878e 100644
--- a/sshd-spring-sftp/pom.xml
+++ b/sshd-spring-sftp/pom.xml
@@ -107,7 +107,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>