return suite;
}
public void testSimple() throws Exception {
JGDI jgdi = createJGDI();
try {
jgdi.disableQueues(new String[]{"*"}, false);
try {
String[] args = new String[]{"-e", "/dev/null", "-o", "/dev/null", "-l", "arch=*", "-soft", "-l", "arch=*", "$SGE_ROOT/examples/jobs/sleeper.sh"};
int jobId = JobSubmitter.submitJob(getCurrentCluster(), args);
QueueInstanceSummaryOptions options = new QueueInstanceSummaryOptions();
options.setShowRequestedResourcesForJobs(true);
options.setShowFullOutput(true);
options.setShowArrayJobs(true);
options.setShowExtendedSubTaskInfo(true);
QueueInstanceSummaryResult result = jgdi.getQueueInstanceSummary(options);
PrintWriter pw = new PrintWriter(System.out);
QueueInstanceSummaryPrinter.print(pw, result, options);
pw.flush();
List<JobSummary> pendingJobs = result.getPendingJobs();
JobSummary jobFound = null;
for (JobSummary js : pendingJobs) {
if (js.getId() == jobId) {
jobFound = js;
break;
}
}
assertNotNull("job with id " + jobId + " not found in pending job list", jobFound);
Set hardRequestNames = jobFound.getHardRequestNames();
assertFalse("Job has not hard requested value", hardRequestNames.isEmpty());
assertTrue(hardRequestNames.contains("arch"));
assertEquals(jobFound.getHardRequestValue("arch").getValue(), "*");
} finally {
jgdi.enableQueues(new String[]{"*"}, false);
}
} finally {
jgdi.close();
}
}