From a1f8aa90c01f5e3eb4a807a883f62c28f57b3e43 Mon Sep 17 00:00:00 2001 From: kshakir Date: Tue, 21 Jun 2011 22:54:55 +0000 Subject: [PATCH] Added an integration test showing how to use LSF C API to get LSF parameters. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@6025 348d0f76-0448-11de-a6fe-93d51630548a --- .../jna/lsf/v7_0_6/LibBatIntegrationTest.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/java/test/org/broadinstitute/sting/jna/lsf/v7_0_6/LibBatIntegrationTest.java b/java/test/org/broadinstitute/sting/jna/lsf/v7_0_6/LibBatIntegrationTest.java index 7b15d1a7e..aa6303a6f 100644 --- a/java/test/org/broadinstitute/sting/jna/lsf/v7_0_6/LibBatIntegrationTest.java +++ b/java/test/org/broadinstitute/sting/jna/lsf/v7_0_6/LibBatIntegrationTest.java @@ -24,7 +24,7 @@ package org.broadinstitute.sting.jna.lsf.v7_0_6; -import com.sun.jna.StringArray; +import com.sun.jna.*; import com.sun.jna.ptr.IntByReference; import org.apache.commons.io.FileUtils; import org.broadinstitute.sting.utils.Utils; @@ -34,6 +34,7 @@ import org.testng.annotations.Test; import org.broadinstitute.sting.BaseTest; import org.broadinstitute.sting.jna.lsf.v7_0_6.LibBat.*; +import javax.jws.soap.SOAPBinding; import java.io.File; /** @@ -52,6 +53,29 @@ public class LibBatIntegrationTest extends BaseTest { Assert.assertNotNull(clusterName); } + @Test + public void testReadConfEnv() { + LibLsf.config_param[] unitsParam = (LibLsf.config_param[]) new LibLsf.config_param().toArray(4); + + unitsParam[0].paramName = "LSF_UNIT_FOR_LIMITS"; + unitsParam[1].paramName = "LSF_CONFDIR"; + unitsParam[2].paramName = "MADE_UP_PARAMETER"; + + Structure.autoWrite(unitsParam); + + if (LibLsf.ls_readconfenv(unitsParam[0], null) != 0) { + Assert.fail(LibLsf.ls_sysmsg()); + } + + Structure.autoRead(unitsParam); + + System.out.println("LSF_UNIT_FOR_LIMITS: " + unitsParam[0].paramValue); + Assert.assertNotNull(unitsParam[1].paramValue); + Assert.assertNull(unitsParam[2].paramValue); + Assert.assertNull(unitsParam[3].paramName); + Assert.assertNull(unitsParam[3].paramValue); + } + @Test public void testReadQueueLimits() { String queue = "hour";