airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject git commit: Adding new tests to monitor-tool
Date Mon, 14 Apr 2014 19:28:19 GMT
Repository: airavata
Updated Branches:
  refs/heads/master b7122a9d2 -> b1bdbd918


Adding new tests to monitor-tool


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b1bdbd91
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b1bdbd91
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b1bdbd91

Branch: refs/heads/master
Commit: b1bdbd91829e28ccac9f5d22eb9e28e992aab755
Parents: b7122a9
Author: lahiru <lahiru@apache.org>
Authored: Mon Apr 14 15:27:56 2014 -0400
Committer: lahiru <lahiru@apache.org>
Committed: Mon Apr 14 15:27:56 2014 -0400

----------------------------------------------------------------------
 .../main/resources/airavata-server.properties   |   2 +-
 .../airavata/job/monitor/AMQPMonitorTest.java   |  31 ++--
 .../QstatMonitorTestWithMyProxyAuth.java        |  11 +-
 .../apache/airavata/job/AMQPMonitorTest.java    | 158 +++++++++++++++++++
 .../job/QstatMonitorTestWithMyProxyAuth.java    | 156 ++++++++++++++++++
 5 files changed, 344 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b1bdbd91/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/airavata-server.properties b/modules/configuration/server/src/main/resources/airavata-server.properties
index 22849b1..2768f62 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -261,7 +261,7 @@ monitors=org.apache.airavata.job.monitor.impl.pull.qstat.QstatMonitor,org.apache
 #This is the amqp related configuration and this lists down the Rabbitmq host, this is an
xsede specific configuration
 amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
 proxy.file.path=/Users/lahirugunathilake/Downloads/x509up_u503876
-connection.name=xsede_private
+connection.name=xsede
 
 
 ###---------------------------Orchestrator module Configurations---------------------------###

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1bdbd91/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/AMQPMonitorTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/AMQPMonitorTest.java
b/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/AMQPMonitorTest.java
index 107f0dc..43ec28b 100644
--- a/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/AMQPMonitorTest.java
+++ b/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/AMQPMonitorTest.java
@@ -37,6 +37,7 @@ import org.junit.Test;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Iterator;
 import java.util.List;
 
 public class AMQPMonitorTest {
@@ -51,15 +52,16 @@ public class AMQPMonitorTest {
 
     @Before
     public void setUp() throws Exception {
-        System.setProperty("myproxy.user", "ogce");
-        System.setProperty("myproxy.password", "");
-        System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh");
-        System.setProperty("gsi.working.directory", "/home/ogce");
-        myProxyUserName = System.getProperty("myproxy.user");
+//        System.setProperty("myproxy.username", "ogce");
+//        System.setProperty("myproxy.password", "");
+//        System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh");
+//        System.setProperty("gsi.working.directory", "/home/ogce");
+//        System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates");
+        myProxyUserName = System.getProperty("myproxy.username");
         myProxyPassword = System.getProperty("myproxy.password");
         workingDirectory = System.getProperty("gsi.working.directory");
-        String pomDirectory = System.getProperty("basedir");
-        certificateLocation = "/Users/lahirugunathilake/Downloads/certificates";
+        certificateLocation = System.getProperty("trusted.cert.location");
+        System.setProperty("connection.name", "xsede");
         if (myProxyUserName == null || myProxyPassword == null || workingDirectory == null)
{
             System.out.println(">>>>>> Please run tests with my proxy user
name and password. " +
                     "E.g :- mvn clean install -Dmyproxy.user=xxx -Dmyproxy.password=xxx -Dgsi.working.directory=/path<<<<<<<");
@@ -69,7 +71,7 @@ public class AMQPMonitorTest {
         monitorManager = new MonitorManager();
         AMQPMonitor amqpMonitor = new
                 AMQPMonitor(monitorManager.getMonitorPublisher(),
-                monitorManager.getPushQueue(), monitorManager.getFinishQueue(),"/Users/lahirugunathilake/Downloads/x509up_u503876","xsede_private",
+                monitorManager.getPushQueue(), monitorManager.getFinishQueue(),"/Users/lahirugunathilake/Downloads/x509up_u503876","xsede",
                 Arrays.asList("info1.dyn.teragrid.org,info2.dyn.teragrid.org".split(",")));
         try {
             monitorManager.addPushMonitor(amqpMonitor);
@@ -79,8 +81,12 @@ public class AMQPMonitorTest {
         }
 
         hostDescription = new HostDescription(GsisshHostType.type);
-        hostDescription.getType().setHostAddress("gordon.sdsc.xsede.org");
-        hostDescription.getType().setHostName("gsissh-gordon");
+        hostDescription.getType().setHostAddress("stampede.tacc.xsede.org");
+        hostDescription.getType().setHostName("stampede-host");
+        ((GsisshHostType) hostDescription.getType()).setJobManager("slurm");
+        ((GsisshHostType) hostDescription.getType()).setInstalledPath("/usr/bin/");
+        ((GsisshHostType) hostDescription.getType()).setPort(2222);
+        ((GsisshHostType) hostDescription.getType()).setMonitorMode("push");
     }
 
     @Test
@@ -132,7 +138,10 @@ public class AMQPMonitorTest {
             e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
         }
         try {
-            Thread.sleep(10000);
+            Thread.sleep(5000);
+            Iterator<MonitorID> iterator = monitorManager.getPushQueue().iterator();
+            MonitorID next = iterator.next();
+            org.junit.Assert.assertNotNull(next.getStatus());
         } catch (InterruptedException e) {
             e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1bdbd91/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/QstatMonitorTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/QstatMonitorTestWithMyProxyAuth.java
b/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/QstatMonitorTestWithMyProxyAuth.java
index 33ed964..b48d809 100644
--- a/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/QstatMonitorTestWithMyProxyAuth.java
+++ b/modules/gfac/gfac-monitor/src/test/java/org/apache/airavata/job/monitor/QstatMonitorTestWithMyProxyAuth.java
@@ -38,7 +38,9 @@ import org.junit.Test;
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.concurrent.BlockingQueue;
 
 public class QstatMonitorTestWithMyProxyAuth {
     private MonitorManager monitorManager;
@@ -135,8 +137,13 @@ public class QstatMonitorTestWithMyProxyAuth {
             }
         }
         try {
-            Thread.sleep(10000000);
-        } catch (InterruptedException e) {
+            Thread.sleep(5000);
+            BlockingQueue<UserMonitorData> pullQueue = monitorManager.getPullQueue();
+            Iterator<UserMonitorData> iterator = pullQueue.iterator();
+            UserMonitorData next = iterator.next();
+            MonitorID monitorID = next.getHostMonitorData().get(0).getMonitorIDs().get(0);
+            org.junit.Assert.assertNotNull(monitorID.getStatus());
+        } catch (Exception e) {
             e.printStackTrace();
         }
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1bdbd91/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java
b/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java
new file mode 100644
index 0000000..0452c35
--- /dev/null
+++ b/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java
@@ -0,0 +1,158 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.job;
+
+import com.google.common.eventbus.EventBus;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.gsi.ssh.api.Cluster;
+import org.apache.airavata.gsi.ssh.api.SSHApiException;
+import org.apache.airavata.gsi.ssh.api.ServerInfo;
+import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
+import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
+import org.apache.airavata.gsi.ssh.impl.PBSCluster;
+import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
+import org.apache.airavata.job.monitor.MonitorID;
+import org.apache.airavata.job.monitor.UserMonitorData;
+import org.apache.airavata.job.monitor.event.MonitorPublisher;
+import org.apache.airavata.job.monitor.exception.AiravataMonitorException;
+import org.apache.airavata.job.monitor.impl.push.amqp.AMQPMonitor;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+public class AMQPMonitorTest {
+
+    private String myProxyUserName;
+    private String myProxyPassword;
+    private String certificateLocation;
+    private String pbsFilePath;
+    private String workingDirectory;
+    private HostDescription hostDescription;
+    private MonitorPublisher monitorPublisher;
+    private BlockingQueue<MonitorID> finishQueue;
+    private BlockingQueue<MonitorID> pushQueue;
+    private Thread pushThread;
+    @Before
+    public void setUp() throws Exception {
+//        System.setProperty("myproxy.username", "ogce");
+//        System.setProperty("myproxy.password", "");
+//        System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh");
+//        System.setProperty("gsi.working.directory", "/home/ogce");
+//        System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates");
+        myProxyUserName = System.getProperty("myproxy.username");
+        myProxyPassword = System.getProperty("myproxy.password");
+        workingDirectory = System.getProperty("gsi.working.directory");
+        certificateLocation = System.getProperty("trusted.cert.location");
+        System.setProperty("connection.name", "xsede");
+        if (myProxyUserName == null || myProxyPassword == null || workingDirectory == null)
{
+            System.out.println(">>>>>> Please run tests with my proxy user
name and password. " +
+                    "E.g :- mvn clean install -Dmyproxy.user=xxx -Dmyproxy.password=xxx -Dgsi.working.directory=/path<<<<<<<");
+            throw new Exception("Need my proxy user name password to run tests.");
+        }
+
+        monitorPublisher =  new MonitorPublisher(new EventBus());
+        pushQueue = new LinkedBlockingQueue<MonitorID>();
+        finishQueue = new LinkedBlockingQueue<MonitorID>();
+
+        AMQPMonitor amqpMonitor = new
+                AMQPMonitor(monitorPublisher,
+                pushQueue, finishQueue,"/Users/lahirugunathilake/Downloads/x509up_u503876","xsede",
+                Arrays.asList("info1.dyn.teragrid.org,info2.dyn.teragrid.org".split(",")));
+        try {
+            pushThread = (new Thread(amqpMonitor));
+            pushThread.start();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        hostDescription = new HostDescription(GsisshHostType.type);
+        hostDescription.getType().setHostAddress("stampede.tacc.xsede.org");
+        hostDescription.getType().setHostName("stampede-host");
+        ((GsisshHostType) hostDescription.getType()).setJobManager("slurm");
+        ((GsisshHostType) hostDescription.getType()).setInstalledPath("/usr/bin/");
+        ((GsisshHostType) hostDescription.getType()).setPort(2222);
+        ((GsisshHostType) hostDescription.getType()).setMonitorMode("push");
+    }
+
+    @Test
+    public void testAMQPMonitor() throws SSHApiException {
+        /* now have to submit a job to some machine and add that job to the queue */
+        //Create authentication
+        GSIAuthenticationInfo authenticationInfo
+                = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
+                7512, 17280000, certificateLocation);
+
+        // Server info
+        ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
+
+
+        Cluster pbsCluster = new
+                PBSCluster(serverInfo, authenticationInfo, org.apache.airavata.gsi.ssh.util.CommonUtils.getPBSJobManager("/opt/torque/bin/"));
+
+
+        // Execute command
+        System.out.println("Target PBS file path: " + workingDirectory);
+        // constructing the job object
+        JobDescriptor jobDescriptor = new JobDescriptor();
+        jobDescriptor.setWorkingDirectory(workingDirectory);
+        jobDescriptor.setShellName("/bin/bash");
+        jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB");
+        jobDescriptor.setExecutablePath("/bin/echo");
+        jobDescriptor.setAllEnvExport(true);
+        jobDescriptor.setMailOptions("n");
+        jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out");
+        jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err");
+        jobDescriptor.setNodes(1);
+        jobDescriptor.setProcessesPerNode(1);
+        jobDescriptor.setQueueName("normal");
+        jobDescriptor.setMaxWallTime("60");
+        jobDescriptor.setAcountString("sds128");
+        List<String> inputs = new ArrayList<String>();
+        jobDescriptor.setOwner("ogce");
+        inputs.add("Hello World");
+        jobDescriptor.setInputValues(inputs);
+        //finished construction of job object
+        System.out.println(jobDescriptor.toXML());
+        String jobID = pbsCluster.submitBatchJob(jobDescriptor);
+        System.out.println(jobID);
+        try {
+            pushQueue.add(new MonitorID(hostDescription, jobID,null,null, "ogce"));
+        } catch (Exception e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        }
+        try {
+            pushThread.join(5000);
+            Iterator<MonitorID> iterator = pushQueue.iterator();
+            MonitorID next = iterator.next();
+            org.junit.Assert.assertNotNull(next.getStatus());
+        } catch (InterruptedException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b1bdbd91/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java
b/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java
new file mode 100644
index 0000000..0bd95b3
--- /dev/null
+++ b/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java
@@ -0,0 +1,156 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.job;
+
+import com.google.common.eventbus.EventBus;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.gsi.ssh.api.Cluster;
+import org.apache.airavata.gsi.ssh.api.SSHApiException;
+import org.apache.airavata.gsi.ssh.api.ServerInfo;
+import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
+import org.apache.airavata.gsi.ssh.api.job.JobDescriptor;
+import org.apache.airavata.gsi.ssh.impl.PBSCluster;
+import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
+import org.apache.airavata.gsi.ssh.util.CommonUtils;
+import org.apache.airavata.job.monitor.MonitorID;
+import org.apache.airavata.job.monitor.UserMonitorData;
+import org.apache.airavata.job.monitor.event.MonitorPublisher;
+import org.apache.airavata.job.monitor.exception.AiravataMonitorException;
+import org.apache.airavata.job.monitor.impl.pull.qstat.QstatMonitor;
+import org.apache.airavata.job.monitor.state.JobStatus;
+import org.apache.airavata.model.workspace.experiment.JobState;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
+import org.junit.Before;
+import org.junit.Test;
+import sun.jvm.hotspot.utilities.Assert;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+public class QstatMonitorTestWithMyProxyAuth {
+    private String myProxyUserName;
+    private String myProxyPassword;
+    private String certificateLocation;
+    private String pbsFilePath;
+    private String workingDirectory;
+    private HostDescription hostDescription;
+    private MonitorPublisher monitorPublisher;
+    private BlockingQueue<UserMonitorData> pullQueue;
+    private Thread monitorThread;
+    @Before
+    public void setUp() throws Exception {
+//        System.setProperty("myproxy.username", "ogce");
+//        System.setProperty("myproxy.password", "");
+//        System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh");
+//        System.setProperty("gsi.working.directory", "/home/ogce");
+//        System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates");
+        myProxyUserName = System.getProperty("myproxy.username");
+        myProxyPassword = System.getProperty("myproxy.password");
+        workingDirectory = System.getProperty("gsi.working.directory");
+        certificateLocation = System.getProperty("trusted.cert.location");
+        if (myProxyUserName == null || myProxyPassword == null || workingDirectory == null)
{
+            System.out.println(">>>>>> Please run tests with my proxy user
name and password. " +
+                    "E.g :- mvn clean install -Dmyproxy.username=xxx -Dmyproxy.password=xxx
-Dgsi.working.directory=/path<<<<<<<");
+            throw new Exception("Need my proxy user name password to run tests.");
+        }
+
+        monitorPublisher =  new MonitorPublisher(new EventBus());
+        pullQueue = new LinkedBlockingQueue<UserMonitorData>();
+        QstatMonitor qstatMonitor = new
+                QstatMonitor(pullQueue, monitorPublisher);
+        try {
+            monitorThread = (new Thread(qstatMonitor));
+            monitorThread.start();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        hostDescription = new HostDescription(GsisshHostType.type);
+        hostDescription.getType().setHostAddress("trestles.sdsc.edu");
+        hostDescription.getType().setHostName("gsissh-gordon");
+        ((GsisshHostType) hostDescription.getType()).setPort(22);
+        ((GsisshHostType)hostDescription.getType()).setInstalledPath("/opt/torque/bin/");
+    }
+
+    @Test
+    public void testQstatMonitor() throws SSHApiException {
+        /* now have to submit a job to some machine and add that job to the queue */
+        //Create authentication
+        GSIAuthenticationInfo authenticationInfo
+                = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
+                7512, 17280000, certificateLocation);
+
+        // Server info
+        ServerInfo serverInfo = new ServerInfo("ogce", hostDescription.getType().getHostAddress());
+
+
+        Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager("/opt/torque/bin/"));
+
+
+        // Execute command
+        System.out.println("Target PBS file path: " + workingDirectory);
+        // constructing the job object
+        JobDescriptor jobDescriptor = new JobDescriptor();
+        jobDescriptor.setWorkingDirectory(workingDirectory);
+        jobDescriptor.setShellName("/bin/bash");
+        jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB");
+        jobDescriptor.setExecutablePath("/bin/echo");
+        jobDescriptor.setAllEnvExport(true);
+        jobDescriptor.setMailOptions("n");
+        jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out");
+        jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err");
+        jobDescriptor.setNodes(1);
+        jobDescriptor.setProcessesPerNode(1);
+        jobDescriptor.setQueueName("normal");
+        jobDescriptor.setMaxWallTime("60");
+        jobDescriptor.setAcountString("sds128");
+        List<String> inputs = new ArrayList<String>();
+        jobDescriptor.setOwner("ogce");
+        inputs.add("Hello World");
+        jobDescriptor.setInputValues(inputs);
+        //finished construction of job object
+        System.out.println(jobDescriptor.toXML());
+        for (int i = 0; i < 1; i++) {
+            String jobID = pbsCluster.submitBatchJob(jobDescriptor);
+            System.out.println("Job submitted successfully, Job ID: " +  jobID);
+            MonitorID monitorID = new MonitorID(hostDescription, jobID,null,null, "ogce");
+            monitorID.setAuthenticationInfo(authenticationInfo);
+            try {
+                org.apache.airavata.job.monitor.util.CommonUtils.addMonitortoQueue(pullQueue,
monitorID);
+            } catch (Exception e) {
+                e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+            }
+        }
+        try {
+            monitorThread.join(5000);
+            Iterator<UserMonitorData> iterator = pullQueue.iterator();
+            UserMonitorData next = iterator.next();
+            MonitorID monitorID = next.getHostMonitorData().get(0).getMonitorIDs().get(0);
+            org.junit.Assert.assertNotNull(monitorID.getStatus());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}


Mime
View raw message