+++ /dev/null
-/* Copyright (c) 2009 Peter Troshin\r
- * \r
- * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 \r
- * \r
- * This library is free software; you can redistribute it and/or modify it under the terms of the\r
- * Apache License version 2 as published by the Apache Software Foundation\r
- * \r
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
- * License for more details.\r
- * \r
- * A copy of the license is in apache_license.txt. It is also available here:\r
- * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
- * \r
- * Any republication or derived work distributed in source code form\r
- * must include this copyright and license notice.\r
- */\r
-package compbio.runner._impl;\r
-\r
-import static org.testng.AssertJUnit.assertFalse;\r
-import static org.testng.AssertJUnit.assertNotNull;\r
-import static org.testng.AssertJUnit.assertTrue;\r
-import static org.testng.AssertJUnit.fail;\r
-\r
-import java.text.ParseException;\r
-\r
-import org.ggf.drmaa.DrmaaException;\r
-import org.ggf.drmaa.JobInfo;\r
-import org.testng.annotations.Test;\r
-\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
-import compbio.engine.cluster.drmaa.JobRunner;\r
-import compbio.engine.cluster.drmaa.StatisticManager;\r
-import compbio.metadata.AllTestSuit;\r
-import compbio.metadata.JobExecutionException;\r
-import compbio.metadata.JobStatus;\r
-import compbio.metadata.JobSubmissionException;\r
-\r
-public class NetNglycTester {\r
-\r
- public static String test_input = "/homes/pvtroshin/TO1381.fasta";\r
- public static String test_outfile = "/homes/pvtroshin/TO1381.netNGlycout";\r
-\r
- @Test()\r
- public void testGetTestCommand() {\r
- assertNotNull(Tmhmm2.getTestCommand());\r
- }\r
-\r
- @Test(enabled = false, groups = { AllTestSuit.test_group_cluster,\r
- AllTestSuit.test_group_runner })\r
- public void testBuildCommand() {\r
- NetNglyc netnGlyc = new NetNglyc();\r
- // TODO netnGlyc.setInput(test_input).setOutput(test_outfile);\r
-\r
- try {\r
- JobRunner runner = JobRunner.getInstance(null);\r
- assertNotNull("Runner is NULL", runner);\r
- runner.executeJob();\r
- assertNotNull("JobId is NULL");\r
- JobStatus status = runner.getJobStatus();\r
- assertTrue("Status of the job is wrong!",\r
- status == JobStatus.PENDING || status == JobStatus.RUNNING);\r
- JobInfo info = runner.getJobInfo();\r
- assertNotNull("Cannot Obtain Job Info", info);\r
- StatisticManager sm = new StatisticManager(info);\r
- assertNotNull("StatisticManager is NULL", sm);\r
-\r
- String exits = sm.getExitStatus();\r
- assertNotNull("Status is NULL", exits);\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
- .intValue();\r
- assertTrue("Time elapsed is greater than 0", exitsInt >= 0);\r
- System.out.println(sm.getAllStats());\r
-\r
- assertTrue("Process exited:", sm.hasExited());\r
- assertFalse("Process aborted:", sm.wasAborted());\r
- assertFalse("Process hasdump:", sm.hasDump());\r
- assertFalse("Process signaled:", sm.hasSignaled());\r
-\r
- } catch (DrmaaException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- } catch (ParseException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- } catch (JobSubmissionException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- } catch (JobExecutionException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- }\r
- }\r
-}\r