Repository: brooklyn-server
Updated Branches:
  refs/heads/master 7f1846c0f -> b034a2727


fix SshjToolIntegrationTest


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/1a279401
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/1a279401
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/1a279401

Branch: refs/heads/master
Commit: 1a279401aaf68a6970f96950fe45e0e72581680b
Parents: 16d4e8b
Author: Andrea Turli <[email protected]>
Authored: Mon Nov 7 11:24:26 2016 +0100
Committer: Andrea Turli <[email protected]>
Committed: Tue Dec 6 15:29:57 2016 +0100

----------------------------------------------------------------------
 .../brooklyn/util/core/internal/ssh/sshj/SshjTool.java      | 9 ++++++---
 .../core/internal/ssh/sshj/SshjToolIntegrationTest.java     | 7 +++----
 .../test/java/org/apache/brooklyn/util/osgi/OsgisTest.java  | 2 --
 3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1a279401/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjTool.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjTool.java
 
b/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjTool.java
index 1ee02da..328f66d 100644
--- 
a/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjTool.java
+++ 
b/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjTool.java
@@ -273,7 +273,7 @@ public class SshjTool extends SshAbstractTool implements 
SshTool {
 
     @Override
     public int copyFromServer(Map<String,?> props, String 
pathAndFileOnRemoteServer, File localFile) {
-        LocalDestFile localDestFile = acquire(new 
GetFileAction(pathAndFileOnRemoteServer));
+        LocalDestFile localDestFile = acquire(new 
GetFileAction(pathAndFileOnRemoteServer, localFile));
         return 0;
     }
 
@@ -697,10 +697,13 @@ public class SshjTool extends SshAbstractTool implements 
SshTool {
 
     private class GetFileAction implements SshAction<LocalDestFile> {
         private final String path;
+        private final File localFile;
         private SFTPClient sftp;
 
-        GetFileAction(String path) {
+
+        public GetFileAction(String path, File localFile) {
             this.path = checkNotNull(path, "path");
+            this.localFile = checkNotNull(localFile, "localFile");
         }
 
         @Override
@@ -712,7 +715,7 @@ public class SshjTool extends SshAbstractTool implements 
SshTool {
         @Override
         public LocalDestFile create() throws Exception {
             sftp = acquire(sftpConnection);
-            LocalDestFile localDestFile = new FileSystemFile(path);
+            LocalDestFile localDestFile = new FileSystemFile(localFile);
             sftp.get(path, localDestFile);
             return localDestFile;
         }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1a279401/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjToolIntegrationTest.java
----------------------------------------------------------------------
diff --git 
a/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjToolIntegrationTest.java
 
b/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjToolIntegrationTest.java
index fd3fa1a..093835e 100644
--- 
a/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjToolIntegrationTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/sshj/SshjToolIntegrationTest.java
@@ -34,14 +34,11 @@ import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
-import net.schmizz.sshj.connection.channel.direct.Session;
-
 import org.apache.brooklyn.core.BrooklynFeatureEnablement;
 import org.apache.brooklyn.test.Asserts;
 import org.apache.brooklyn.util.core.internal.ssh.SshException;
 import org.apache.brooklyn.util.core.internal.ssh.SshTool;
 import 
org.apache.brooklyn.util.core.internal.ssh.SshToolAbstractIntegrationTest;
-import org.apache.brooklyn.util.core.internal.ssh.sshj.SshjTool;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.exceptions.RuntimeTimeoutException;
 import org.apache.brooklyn.util.os.Os;
@@ -52,8 +49,10 @@ import com.google.common.base.Stopwatch;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 
+import net.schmizz.sshj.connection.channel.direct.Session;
+
 /**
- * Test the operation of the {@link SshJschTool} utility class.
+ * Test the operation of the {@link SshjTool} utility class.
  */
 public class SshjToolIntegrationTest extends SshToolAbstractIntegrationTest {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1a279401/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java
----------------------------------------------------------------------
diff --git 
a/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java 
b/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java
index c23c185..c86670a 100644
--- a/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java
+++ b/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgisTest.java
@@ -18,8 +18,6 @@
  */
 package org.apache.brooklyn.util.osgi;
 
-import org.apache.brooklyn.util.osgi.OsgiUtils;
-import org.apache.brooklyn.util.osgi.VersionedName;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 

Reply via email to