airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1436465 - in /airavata/sandbox/grid-tools/bes-client/src: main/java/org/apache/airavata/sample/bes/HPCPUtils.java main/java/org/apache/airavata/sample/bes/RunBESJob.java test/java/org/apache/airavata/sample/bes/TestInterop.java
Date Mon, 21 Jan 2013 16:36:08 GMT
Author: lahiru
Date: Mon Jan 21 16:36:08 2013
New Revision: 1436465

URL: http://svn.apache.org/viewvc?rev=1436465&view=rev
Log:
committing https://issues.apache.org/jira/browse/AIRAVATA-657.

Modified:
    airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/HPCPUtils.java
    airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/RunBESJob.java
    airavata/sandbox/grid-tools/bes-client/src/test/java/org/apache/airavata/sample/bes/TestInterop.java

Modified: airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/HPCPUtils.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/HPCPUtils.java?rev=1436465&r1=1436464&r2=1436465&view=diff
==============================================================================
--- airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/HPCPUtils.java
(original)
+++ airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/HPCPUtils.java
Mon Jan 21 16:36:08 2013
@@ -6,6 +6,11 @@ import javax.xml.namespace.QName;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlCursor.TokenType;
 import org.apache.xmlbeans.XmlObject;
+import org.ggf.schemas.jsdl.x2005.x11.jsdl.DataStagingType;
+import org.ggf.schemas.jsdl.x2005.x11.jsdl.SourceTargetType;
+
+import de.fzj.unicore.wsrflite.xmlbeans.WSUtilities;
+
 import eu.unicore.security.util.Log;
 
 /**
@@ -112,5 +117,24 @@ public class HPCPUtils {
 		}
 		return null;
 	}
-
+	
+	
+	public static XmlObject createCredentialsElement(String userName, String password){
+		XmlObject newXml = XmlObject.Factory.newInstance();
+		
+		XmlCursor cursor = newXml.newCursor();
+		cursor.toNextToken();
+		cursor.beginElement(AC_QNAME);
+		cursor.insertElementWithText(AC_USERNAME, userName);
+		cursor.insertElementWithText(AC_PASSWD, password);
+		cursor.dispose();
+		
+		return newXml;
+	}
+	
+	
+	public static void appendDataStagingWithCredentials(DataStagingType dsType, String userName,
String password){
+		WSUtilities.append(createCredentialsElement(userName, password), dsType);
+	}
+	
 }

Modified: airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/RunBESJob.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/RunBESJob.java?rev=1436465&r1=1436464&r2=1436465&view=diff
==============================================================================
--- airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/RunBESJob.java
(original)
+++ airavata/sandbox/grid-tools/bes-client/src/main/java/org/apache/airavata/sample/bes/RunBESJob.java
Mon Jan 21 16:36:08 2013
@@ -2,26 +2,19 @@ package org.apache.airavata.sample.bes;
 
 import java.io.File;
 import org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDefinitionDocument;
-import de.fzj.unicore.uas.security.ClientProperties;
-import eu.unicore.security.util.client.IClientProperties;
 
-public class RunBESJob {
+public class RunBESJob extends AbstractJobCommand{
 
-	protected IClientProperties securityProperties;
-
-	static final String factoryUrl = "https://zam1161v01.zam.kfa-juelich.de:8002/INTEROP1/services/BESFactory?res=default_bes_factory";
-
-	static final String jsdlPath = "src/test/resources/date.xml";
 
 	public RunBESJob() {
-		securityProperties = initSecurityProperties();
+		super();
 	}
 
 	public void runJob() {
 
 		JobDefinitionDocument jobDoc = null;
 		try {
-			jobDoc = JobDefinitionDocument.Factory.parse(new File(jsdlPath));
+			jobDoc = JobDefinitionDocument.Factory.parse(new File(dateJsdlPath));
 		} catch (Exception e) {
 			System.err.println("Error parsing JSDL instance. " + e);
 		}
@@ -39,26 +32,5 @@ public class RunBESJob {
 		}
 
 	}
-
-	protected ClientProperties initSecurityProperties() {
-
-		ClientProperties sp = new ClientProperties();
-
-		sp.setSslEnabled(true);
-		sp.setSignMessage(true);
-
-		sp.setKeystore("src/test/resources/demo-keystore.jks");
-		sp.setKeystorePassword("654321");
-		sp.setKeystoreAlias("demouser-new");
-		sp.setKeystoreType("JKS");
-
-//		sp.setTruststore("src/test/resources/demo-keystore.jks");
-//		sp.setTruststorePassword("654321");
-//		sp.setKeystoreType("JKS");
-
-		return sp;
-
-	}
-
 	
 }

Modified: airavata/sandbox/grid-tools/bes-client/src/test/java/org/apache/airavata/sample/bes/TestInterop.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/grid-tools/bes-client/src/test/java/org/apache/airavata/sample/bes/TestInterop.java?rev=1436465&r1=1436464&r2=1436465&view=diff
==============================================================================
--- airavata/sandbox/grid-tools/bes-client/src/test/java/org/apache/airavata/sample/bes/TestInterop.java
(original)
+++ airavata/sandbox/grid-tools/bes-client/src/test/java/org/apache/airavata/sample/bes/TestInterop.java
Mon Jan 21 16:36:08 2013
@@ -13,5 +13,10 @@ public class TestInterop {
 		besJob.runJob();
 	}
 	
+	@Test
+	public void testRunAndTerminateJob(){
+		RunAndTerminateJob besJob = new RunAndTerminateJob();
+		besJob.runAndTerminate();
+	}
 	
 }



Mime
View raw message