airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1520626 - in /airavata/sandbox/gsissh/src: main/java/org/apache/airavata/gsi/ssh/api/ main/java/org/apache/airavata/gsi/ssh/config/ main/java/org/apache/airavata/gsi/ssh/impl/ main/java/org/apache/airavata/gsi/ssh/util/ test/java/org/apach...
Date Fri, 06 Sep 2013 16:31:54 GMT
Author: lahiru
Date: Fri Sep  6 16:31:53 2013
New Revision: 1520626

URL: http://svn.apache.org/r1520626
Log:
refactoring the api code.

Added:
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/SCPUtils.java
      - copied, changed from r1518364, airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SCPTo.java
Removed:
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SCPTo.java
Modified:
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/AuthenticationInfo.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Cluster.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandExecutor.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandInfo.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandOutput.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Core.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SSHApiException.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/ServerInfo.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java
    airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/DefaultCluster.java
    airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java
    airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/AuthenticationInfo.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/AuthenticationInfo.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/AuthenticationInfo.java
(original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/AuthenticationInfo.java
Fri Sep  6 16:31:53 2013
@@ -19,13 +19,6 @@ package org.apache.airavata.gsi.ssh.api;
  *
  */
 
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/14/13
- * Time: 3:38 PM
- */
-
-import apple.awt.ClientPropertyApplicator;
 import org.ietf.jgss.GSSCredential;
 
 import java.util.Properties;

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Cluster.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Cluster.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Cluster.java (original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Cluster.java Fri
Sep  6 16:31:53 2013
@@ -24,7 +24,11 @@ import com.jcraft.jsch.Session;
 import org.apache.airavata.gsi.ssh.api.job.Job;
 import org.apache.airavata.gsi.ssh.listener.JobSubmissionListener;
 
-
+/**
+ * This interface represents a Cluster machine
+ * End users of the API can implement this and come up with their own
+ * implementations, but mostly this interface is for internal usage.
+ */
 public interface Cluster {
 
     /**
@@ -63,7 +67,7 @@ public interface Cluster {
      * @return
      * @throws SSHApiException
      */
-    public Session scpTo(String rFile, String lFile) throws SSHApiException;
+    public void scpTo(String rFile, String lFile) throws SSHApiException;
 
     /**
      * submit a job and register the listener so that status changes will be triggers

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandExecutor.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandExecutor.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandExecutor.java
(original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandExecutor.java
Fri Sep  6 16:31:53 2013
@@ -26,6 +26,12 @@ import org.apache.airavata.gsi.ssh.jsch.
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.*;
+
+/**
+ * This is a generic class which take care of command execution
+ * in a shell, this is used through out the other places of the API.
+ */
 public class CommandExecutor {
     static {
         JSch.setConfig("gssapi-with-mic.x509", "org.apache.airavata.gsi.ssh.GSSContextX509");
@@ -165,6 +171,4 @@ public class CommandExecutor {
         channel.disconnect();
         session.disconnect();
     }
-
-
 }

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandInfo.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandInfo.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandInfo.java
(original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandInfo.java
Fri Sep  6 16:31:53 2013
@@ -19,13 +19,6 @@ package org.apache.airavata.gsi.ssh.api;
  *
  */
 
-
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/14/13
- * Time: 3:18 PM
- */
-
 /**
  * Encapsulates information about
  */

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandOutput.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandOutput.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandOutput.java
(original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/CommandOutput.java
Fri Sep  6 16:31:53 2013
@@ -19,11 +19,6 @@ package org.apache.airavata.gsi.ssh.api;
  *
  */
 
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/14/13
- * Time: 3:33 PM
- */
 
 import com.jcraft.jsch.Channel;
 

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Core.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Core.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Core.java (original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/Core.java Fri Sep
 6 16:31:53 2013
@@ -22,6 +22,9 @@ package org.apache.airavata.gsi.ssh.api;
 
 import org.apache.airavata.gsi.ssh.api.job.Job;
 
+/**
+ * This represents a CPU core of a machine in the cluster
+ */
 public class Core {
     private Job job;
     private String id;

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SSHApiException.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SSHApiException.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SSHApiException.java
(original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SSHApiException.java
Fri Sep  6 16:31:53 2013
@@ -22,12 +22,6 @@
 package org.apache.airavata.gsi.ssh.api;
 
 /**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/14/13
- * Time: 3:14 PM
- */
-
-/**
  * An exception class to wrap SSH command execution related errors.
  */
 public class SSHApiException extends Exception {

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/ServerInfo.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/ServerInfo.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/ServerInfo.java
(original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/ServerInfo.java
Fri Sep  6 16:31:53 2013
@@ -20,12 +20,6 @@ package org.apache.airavata.gsi.ssh.api;
  */
 
 /**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/14/13
- * Time: 4:15 PM
- */
-
-/**
  * Encapsulate server information.
  */
 public class ServerInfo {

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java
(original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java
Fri Sep  6 16:31:53 2013
@@ -21,12 +21,6 @@
 
 package org.apache.airavata.gsi.ssh.config;
 
-/**
- * User: AmilaJ (amilaj@apache.org)
- * Date: 8/14/13
- * Time: 2:41 PM
- */
-
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;

Modified: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/DefaultCluster.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/DefaultCluster.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/DefaultCluster.java
(original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/DefaultCluster.java
Fri Sep  6 16:31:53 2013
@@ -26,6 +26,7 @@ import org.apache.airavata.gsi.ssh.api.j
 import org.apache.airavata.gsi.ssh.config.ConfigReader;
 import org.apache.airavata.gsi.ssh.jsch.ExtendedJSch;
 import org.apache.airavata.gsi.ssh.listener.JobSubmissionListener;
+import org.apache.airavata.gsi.ssh.util.SCPUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.slf4j.Logger;
@@ -38,6 +39,11 @@ import java.io.*;
 import java.security.SecureRandom;
 import java.util.ArrayList;
 
+/**
+ * This is the default implementation of a cluster.
+ * this has most of the methods to be used by the end user of the
+ * library.
+ */
 public class DefaultCluster implements Cluster {
     static {
         JSch.setConfig("gssapi-with-mic.x509", "org.apache.airavata.gsi.ssh.GSSContextX509");
@@ -337,84 +343,16 @@ public class DefaultCluster implements C
         return jobDescriptor;
     }
 
-    public Session scpTo(String rFile, String lFile) throws SSHApiException {
-        FileInputStream fis = null;
-        String prefix = null;
-        if (new File(lFile).isDirectory()) {
-            prefix = lFile + File.separator;
-        }
-        boolean ptimestamp = true;
+    public void scpTo(String rFile, String lFile) throws SSHApiException {
         try {
-            // exec 'scp -t rfile' remotely
-            String command = "scp " + (ptimestamp ? "-p" : "") + " -t " + rFile;
-            Channel channel = session.openChannel("exec");
-            ((ChannelExec) channel).setCommand(command);
-
-            // get I/O streams for remote scp
-            OutputStream out = channel.getOutputStream();
-            InputStream in = channel.getInputStream();
-
-            channel.connect();
-
-            if (checkAck(in) != 0) {
-                System.exit(0);
-            }
-
-            File _lfile = new File(lFile);
-
-            if (ptimestamp) {
-                command = "T " + (_lfile.lastModified() / 1000) + " 0";
-                // The access time should be sent here,
-                // but it is not accessible with JavaAPI ;-<
-                command += (" " + (_lfile.lastModified() / 1000) + " 0\n");
-                out.write(command.getBytes());
-                out.flush();
-                if (checkAck(in) != 0) {
-                    System.exit(0);
-                }
-            }
-
-            // send "C0644 filesize filename", where filename should not include '/'
-            long filesize = _lfile.length();
-            command = "C0644 " + filesize + " ";
-            if (lFile.lastIndexOf('/') > 0) {
-                command += lFile.substring(lFile.lastIndexOf('/') + 1);
-            } else {
-                command += lFile;
-            }
-            command += "\n";
-            out.write(command.getBytes());
-            out.flush();
-            if (checkAck(in) != 0) {
-                System.exit(0);
-            }
-
-            // send a content of lFile
-            fis = new FileInputStream(lFile);
-            byte[] buf = new byte[1024];
-            while (true) {
-                int len = fis.read(buf, 0, buf.length);
-                if (len <= 0) break;
-                out.write(buf, 0, len); //out.flush();
-            }
-            fis.close();
-            fis = null;
-            // send '\0'
-            buf[0] = 0;
-            out.write(buf, 0, 1);
-            out.flush();
-            if (checkAck(in) != 0) {
-                System.exit(0);
-            }
-            out.close();
-            // We are not disconnecting the session
-//            session.disconnect();
-            channel.disconnect();
-        } catch (Exception e) {
-            log.error(e.getMessage());
-            throw new SSHApiException("Error occured during file transfer operation: " +
e);
+            SCPUtils.scpTo(rFile, lFile, session);
+        } catch (IOException e) {
+            new SSHApiException("Faile during scping local file:" + lFile + " to remote file
"
+                    + serverInfo.getHost() + ":rFile" , e);
+        } catch (JSchException e) {
+            new SSHApiException("Faile during scping local file:" + lFile + " to remote file
"
+                    + serverInfo.getHost() + ":rFile" , e);
         }
-        return session;
     }
 
 
@@ -466,7 +404,7 @@ public class DefaultCluster implements C
             jobById = this.getJobById(jobID);
         }
         listener.statusChanged(jobById);
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        return listener.getJobStatus().toString();  //To change body of implemented methods
use File | Settings | File Templates.
     }
 
     public void setServerInfo(ServerInfo serverInfo) {

Copied: airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/SCPUtils.java
(from r1518364, airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SCPTo.java)
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/SCPUtils.java?p2=airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/SCPUtils.java&p1=airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SCPTo.java&r1=1518364&r2=1520626&rev=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/SCPTo.java (original)
+++ airavata/sandbox/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/SCPUtils.java Fri
Sep  6 16:31:53 2013
@@ -18,9 +18,12 @@
  * under the License.
  *
 */
-package org.apache.airavata.gsi.ssh.api;
+package org.apache.airavata.gsi.ssh.util;
 
 import com.jcraft.jsch.*;
+import org.apache.airavata.gsi.ssh.api.AuthenticationInfo;
+import org.apache.airavata.gsi.ssh.api.SSHApiException;
+import org.apache.airavata.gsi.ssh.api.ServerInfo;
 import org.apache.airavata.gsi.ssh.config.ConfigReader;
 import org.apache.airavata.gsi.ssh.jsch.ExtendedJSch;
 import org.slf4j.*;
@@ -30,8 +33,8 @@ import java.io.*;
 /**
  * This class is going to be useful to SCP a file to a remote grid machine using my proxy
credentials
  */
-public class SCPTo {
-    private static final org.slf4j.Logger log = LoggerFactory.getLogger(SCPTo.class);
+public class SCPUtils {
+    private static final org.slf4j.Logger log = LoggerFactory.getLogger(SCPUtils.class);
 
     static {
         JSch.setConfig("gssapi-with-mic.x509", "org.apache.airavata.gsi.ssh.GSSContextX509");
@@ -52,7 +55,7 @@ public class SCPTo {
      * @param certificateLocation
      * @param configReader
      */
-    public SCPTo(ServerInfo serverInfo, AuthenticationInfo authenticationInfo, String certificateLocation,
ConfigReader configReader) {
+    public SCPUtils(ServerInfo serverInfo, AuthenticationInfo authenticationInfo, String
certificateLocation, ConfigReader configReader) {
         System.setProperty("X509_CERT_DIR", certificateLocation);
         this.serverInfo = serverInfo;
         this.authenticationInfo = authenticationInfo;
@@ -65,7 +68,7 @@ public class SCPTo {
      * @param authenticationInfo
      * @param configReader
      */
-    public SCPTo(ServerInfo serverInfo, AuthenticationInfo authenticationInfo
+    public SCPUtils(ServerInfo serverInfo, AuthenticationInfo authenticationInfo
             , ConfigReader configReader) {
         this.serverInfo = serverInfo;
         this.authenticationInfo = authenticationInfo;
@@ -78,7 +81,7 @@ public class SCPTo {
      * @param lFile local file path to use in scp
      * @throws IOException
      * @throws JSchException
-     * @throws SSHApiException
+     * @throws org.apache.airavata.gsi.ssh.api.SSHApiException
      */
     public Session scpTo(String rFile, String lFile) throws IOException, JSchException, SSHApiException
{
         FileInputStream fis = null;
@@ -188,8 +191,80 @@ public class SCPTo {
         session.disconnect();
         return session;
     }
+    public static Session scpTo(String rFile, String lFile,Session session) throws IOException,
JSchException, SSHApiException {
+        FileInputStream fis = null;
+        String prefix = null;
+        if (new File(lFile).isDirectory()) {
+            prefix = lFile + File.separator;
+        }
+        boolean ptimestamp = true;
+
+        // exec 'scp -t rfile' remotely
+        String command = "scp " + (ptimestamp ? "-p" : "") + " -t " + rFile;
+        Channel channel = session.openChannel("exec");
+        ((ChannelExec) channel).setCommand(command);
+
+        // get I/O streams for remote scp
+        OutputStream out = channel.getOutputStream();
+        InputStream in = channel.getInputStream();
+
+        channel.connect();
+
+        if (checkAck(in) != 0) {
+            System.exit(0);
+        }
+
+        File _lfile = new File(lFile);
 
+        if (ptimestamp) {
+            command = "T " + (_lfile.lastModified() / 1000) + " 0";
+            // The access time should be sent here,
+            // but it is not accessible with JavaAPI ;-<
+            command += (" " + (_lfile.lastModified() / 1000) + " 0\n");
+            out.write(command.getBytes());
+            out.flush();
+            if (checkAck(in) != 0) {
+                System.exit(0);
+            }
+        }
 
+        // send "C0644 filesize filename", where filename should not include '/'
+        long filesize = _lfile.length();
+        command = "C0644 " + filesize + " ";
+        if (lFile.lastIndexOf('/') > 0) {
+            command += lFile.substring(lFile.lastIndexOf('/') + 1);
+        } else {
+            command += lFile;
+        }
+        command += "\n";
+        out.write(command.getBytes());
+        out.flush();
+        if (checkAck(in) != 0) {
+            System.exit(0);
+        }
+
+        // send a content of lFile
+        fis = new FileInputStream(lFile);
+        byte[] buf = new byte[1024];
+        while (true) {
+            int len = fis.read(buf, 0, buf.length);
+            if (len <= 0) break;
+            out.write(buf, 0, len); //out.flush();
+        }
+        fis.close();
+        fis = null;
+        // send '\0'
+        buf[0] = 0;
+        out.write(buf, 0, 1);
+        out.flush();
+        if (checkAck(in) != 0) {
+            System.exit(0);
+        }
+        out.close();
+
+        channel.disconnect();
+        return session;
+    }
     static int checkAck(InputStream in) throws IOException {
         int b = in.read();
         if (b == 0) return b;

Modified: airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java
(original)
+++ airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/config/SCPToTest.java
Fri Sep  6 16:31:53 2013
@@ -21,7 +21,7 @@
 package org.apache.airavata.gsi.ssh.config;
 
 import org.apache.airavata.gsi.ssh.api.AuthenticationInfo;
-import org.apache.airavata.gsi.ssh.api.SCPTo;
+import org.apache.airavata.gsi.ssh.util.SCPUtils;
 import org.apache.airavata.gsi.ssh.api.ServerInfo;
 import org.apache.airavata.gsi.ssh.impl.MyProxyAuthenticationInfo;
 import org.testng.annotations.BeforeTest;
@@ -66,7 +66,7 @@ public class SCPToTest {
                 = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
                 7512, 17280000,certificateLocation);
         ServerInfo serverInfo = new ServerInfo("ogce" ,"trestles.sdsc.edu");
-        SCPTo scpTo = new SCPTo(serverInfo,authenticationInfo,this.certificateLocation,new
ConfigReader());
+        SCPUtils scpTo = new SCPUtils(serverInfo,authenticationInfo,this.certificateLocation,new
ConfigReader());
         scpTo.scpTo(rFilePath, lFilePath);
     }
 }

Modified: airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java?rev=1520626&r1=1520625&r2=1520626&view=diff
==============================================================================
--- airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java
(original)
+++ airavata/sandbox/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/DefaultSSHApiTest.java
Fri Sep  6 16:31:53 2013
@@ -284,7 +284,8 @@ public class DefaultSSHApiTest {
         inputs.add("Hello World !!");
         jobDescriptor.setInputValues(inputs);
         System.out.println(jobDescriptor.toXML());
-        trestles.submitAsyncJob(jobDescriptor, new DefaultJobSubmissionListener());
+        String status = trestles.submitAsyncJob(jobDescriptor, new DefaultJobSubmissionListener());
+        System.out.println("Job has finished with the status : " + status);
     }
 
 }



Mime
View raw message