--- a
+++ b/src/test/java/net/timbusproject/extractors/util/SSHManagerTest.java
@@ -0,0 +1,38 @@
+package net.timbusproject.extractors.util;
+
+import com.jcraft.jsch.Session;
+import net.timbusproject.extractors.modules.tavernaextractor.utils.SSHManager;
+import org.junit.Test;
+
+import java.io.File;
+
+public class SSHManagerTest{
+
+
+ @Test
+ public void test_communication()throws Exception{
+
+ SSHManager ssh = new SSHManager("172.16.1.42",22, "timbus", "timbus");
+ Session session = ssh.createSession(60000);
+
+ // downloading file
+ File file = ssh.readFile(session, "/home/timbus/Documents/opencv.sh");
+ if(file!=null){
+ System.out.println("File successfully saved at "+file.getAbsolutePath() + " [size="+file.length()+"]");
+ }
+
+ while(session.isConnected()){
+ ;
+ }
+
+ // receiving file
+
+ /*
+ IMPORTANT: session.disconnect sends session object into the void.
+ Therefore it is necessary to create a new session after a sessions.disconnect() call.
+ */
+ session = ssh.createSession(60000);
+ ssh.sendFile(session, file.getAbsolutePath(), "/home/timbus/Documents/opencv.sh.new");
+ System.out.println("Send file to /home/timbus/Documents/opencv.sh.new has been executed without errors.");
+ }
+}