*/\r
public class Jronn extends SkeletalExecutable<Jronn> {\r
\r
- private static Logger log = Logger.getLogger(Jronn.class);\r
-\r
- // Cache for Limits information\r
- private static LimitsManager<Jronn> limits;\r
-\r
- public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
- public static final String STAT_FILE = "stat.txt";\r
-\r
- public Jronn() {\r
- addParameters(Arrays.asList("-jar", getLibPath(), "-n=1", "-s="\r
- + STAT_FILE, "-f=H"));\r
- }\r
-\r
- @SuppressWarnings("unchecked")\r
- @Override\r
- public List<AnnotatedSequence> getResults(String workDirectory)\r
- throws ResultNotAvailableException {\r
- List<AnnotatedSequence> sequences = null;\r
- try {\r
- InputStream inStream = new FileInputStream(new File(workDirectory,\r
- getOutput()));\r
- sequences = SequenceUtil.readJRonn(inStream);\r
- inStream.close();\r
- } catch (FileNotFoundException e) {\r
- log.error(e.getMessage(), e.getCause());\r
- throw new ResultNotAvailableException(e);\r
- } catch (IOException e) {\r
- log.error(e.getMessage(), e.getCause());\r
- throw new ResultNotAvailableException(e);\r
- } catch (UnknownFileFormatException e) {\r
- log.error(e.getMessage(), e.getCause());\r
- throw new ResultNotAvailableException(e);\r
- } catch (NullPointerException e) {\r
- log.error(e.getMessage(), e.getCause());\r
- throw new ResultNotAvailableException(e);\r
+ private static Logger log = Logger.getLogger(Jronn.class);\r
+\r
+ // Cache for Limits information\r
+ private static LimitsManager<Jronn> limits;\r
+\r
+ public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
+ public static final String STAT_FILE = "stat.txt";\r
+\r
+ public Jronn() {\r
+ addParameters(Arrays.asList("-jar", getLibPath(), "-n=1", "-s="\r
+ + STAT_FILE, "-f=H"));\r
}\r
- return sequences;\r
- }\r
\r
- private static String getLibPath() {\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public List<AnnotatedSequence> getResults(String workDirectory)\r
+ throws ResultNotAvailableException {\r
+ List<AnnotatedSequence> sequences = null;\r
+ try {\r
+ InputStream inStream = new FileInputStream(new File(workDirectory,\r
+ getOutput()));\r
+ sequences = SequenceUtil.readJRonn(inStream);\r
+ inStream.close();\r
+ } catch (FileNotFoundException e) {\r
+ log.error(e.getMessage(), e.getCause());\r
+ throw new ResultNotAvailableException(e);\r
+ } catch (IOException e) {\r
+ log.error(e.getMessage(), e.getCause());\r
+ throw new ResultNotAvailableException(e);\r
+ } catch (UnknownFileFormatException e) {\r
+ log.error(e.getMessage(), e.getCause());\r
+ throw new ResultNotAvailableException(e);\r
+ } catch (NullPointerException e) {\r
+ log.error(e.getMessage(), e.getCause());\r
+ throw new ResultNotAvailableException(e);\r
+ }\r
+ return sequences;\r
+ }\r
\r
- String settings = ph.getProperty("jronn.jar.file");\r
- if (compbio.util.Util.isEmpty(settings)) {\r
- throw new NullPointerException(\r
- "Please define jronn.jar.file property in Executable.properties file"\r
- + "and initialize it with the location of jronn jar file");\r
+ private static String getLibPath() {\r
+\r
+ String settings = ph.getProperty("jronn.jar.file");\r
+ if (compbio.util.Util.isEmpty(settings)) {\r
+ throw new NullPointerException(\r
+ "Please define jronn.jar.file property in Executable.properties file"\r
+ + "and initialize it with the location of jronn jar file");\r
+ }\r
+ if (new File(settings).isAbsolute()) {\r
+ // Jronn jar can be found so no actions necessary\r
+ // no further actions is necessary\r
+ return settings;\r
+ }\r
+ return compbio.engine.client.Util.convertToAbsolute(settings);\r
}\r
- if (new File(settings).isAbsolute()) {\r
- // Jronn jar can be found so no actions necessary\r
- // no further actions is necessary\r
- return settings;\r
+\r
+ @Override\r
+ public List<String> getCreatedFiles() {\r
+ return Arrays.asList(getOutput(), getError());\r
}\r
- return compbio.engine.client.Util.convertToAbsolute(settings);\r
- }\r
-\r
- @Override\r
- public List<String> getCreatedFiles() {\r
- return Arrays.asList(getOutput(), getError());\r
- }\r
-\r
- @Override\r
- public Jronn setInput(String inFile) {\r
- super.setInput(inFile);\r
- cbuilder.setParam("-i=" + inFile);\r
- return this;\r
- }\r
-\r
- @Override\r
- public Jronn setOutput(String outFile) {\r
- super.setOutput(outFile);\r
- cbuilder.setParam("-o=" + outFile);\r
- return this;\r
- }\r
-\r
- @Override\r
- public Limit<Jronn> getLimit(String presetName) {\r
- if (limits == null) {\r
- limits = getLimits();\r
+\r
+ @Override\r
+ public Jronn setInput(String inFile) {\r
+ super.setInput(inFile);\r
+ cbuilder.setParam("-i=" + inFile);\r
+ return this;\r
}\r
- Limit<Jronn> limit = null;\r
- if (limits != null) {\r
- // this returns default limit if preset is undefined!\r
- limit = limits.getLimitByName(presetName);\r
+\r
+ @Override\r
+ public Jronn setOutput(String outFile) {\r
+ super.setOutput(outFile);\r
+ cbuilder.setParam("-o=" + outFile);\r
+ return this;\r
}\r
- // If limit is not defined for a particular preset, then return default\r
- // limit\r
- if (limit == null) {\r
- log.debug("Limit for the preset " + presetName\r
- + " is not found. Using default");\r
- limit = limits.getDefaultLimit();\r
+\r
+ @Override\r
+ public Limit<Jronn> getLimit(String presetName) {\r
+ if (limits == null) {\r
+ limits = getLimits();\r
+ }\r
+ Limit<Jronn> limit = null;\r
+ if (limits != null) {\r
+ // this returns default limit if preset is undefined!\r
+ limit = limits.getLimitByName(presetName);\r
+ }\r
+ // If limit is not defined for a particular preset, then return default\r
+ // limit\r
+ if (limit == null) {\r
+ log.debug("Limit for the preset " + presetName\r
+ + " is not found. Using default");\r
+ limit = limits.getDefaultLimit();\r
+ }\r
+ return limit;\r
}\r
- return limit;\r
- }\r
-\r
- @Override\r
- public LimitsManager<Jronn> getLimits() {\r
- // synchronise on static field\r
- synchronized (log) {\r
- if (limits == null) {\r
- limits = Util.getLimits(this.getClass());\r
- }\r
+\r
+ @Override\r
+ public LimitsManager<Jronn> getLimits() {\r
+ // synchronise on static field\r
+ synchronized (log) {\r
+ if (limits == null) {\r
+ limits = Util.getLimits(this.getClass());\r
+ }\r
+ }\r
+ return limits;\r
}\r
- return limits;\r
- }\r
\r
- @Override\r
- public Class<? extends Executable<?>> getType() {\r
- return this.getClass();\r
- }\r
+ @Override\r
+ public Class<? extends Executable<?>> getType() {\r
+ return this.getClass();\r
+ }\r
\r
- public static String getStatFile() {\r
- return STAT_FILE;\r
- }\r
+ public static String getStatFile() {\r
+ return STAT_FILE;\r
+ }\r
}\r
package compbio.runner.disorder;\r
\r
import static org.testng.Assert.assertEquals;\r
-import static org.testng.Assert.assertFalse;\r
+import static org.testng.Assert.*;\r
import static org.testng.Assert.assertNotNull;\r
import static org.testng.Assert.assertTrue;\r
import static org.testng.Assert.fail;\r
\r
public class JronnTester {\r
\r
- public static String test_outfile = "TO1381.jronn.out"; // "/homes/pvtroshin/TO1381.clustal.cluster.out\r
+ public static String test_outfile = "TO1381.jronn.out"; // "/homes/pvtroshin/TO1381.clustal.cluster.out\r
\r
- private Jronn jronn;\r
+ private Jronn jronn;\r
\r
- @BeforeMethod(alwaysRun = true)\r
- void init() {\r
- jronn = new Jronn();\r
- jronn.setInput(AllTestSuit.test_input).setOutput(test_outfile);\r
- }\r
+ @BeforeMethod(alwaysRun = true)\r
+ void init() {\r
+ jronn = new Jronn();\r
+ jronn.setInput(AllTestSuit.test_input).setOutput(test_outfile);\r
+ }\r
\r
- @Test(groups = { AllTestSuit.test_group_cluster,\r
- AllTestSuit.test_group_runner })\r
- public void testRunOnCluster() {\r
- assertFalse(SysPrefs.isWindows,\r
- "Cluster execution can only be in unix environment");\r
- try {\r
- ConfiguredExecutable<Jronn> confJronn = Configurator\r
- .configureExecutable(jronn, Executable.ExecProvider.Cluster);\r
- JobRunner runner = JobRunner.getInstance(confJronn);\r
+ @Test(groups = { AllTestSuit.test_group_cluster,\r
+ AllTestSuit.test_group_runner })\r
+ public void testRunOnCluster() {\r
+ assertFalse(SysPrefs.isWindows,\r
+ "Cluster execution can only be in unix environment");\r
+ try {\r
+ ConfiguredExecutable<Jronn> confJronn = Configurator\r
+ .configureExecutable(jronn, Executable.ExecProvider.Cluster);\r
+ JobRunner runner = JobRunner.getInstance(confJronn);\r
\r
- assertNotNull(runner, "Runner is NULL");\r
- runner.executeJob();\r
- // assertNotNull("JobId is null", jobId1);\r
- JobStatus status = runner.getJobStatus();\r
- assertTrue(status == JobStatus.PENDING\r
- || status == JobStatus.RUNNING,\r
- "Status of the process is wrong!");\r
- JobInfo info = runner.getJobInfo();\r
- assertNotNull(info, "JobInfo is null");\r
- StatisticManager sm = new StatisticManager(info);\r
- assertNotNull(sm, "Statictic manager is null");\r
- try {\r
+ assertNotNull(runner, "Runner is NULL");\r
+ runner.executeJob();\r
+ // assertNotNull("JobId is null", jobId1);\r
+ JobStatus status = runner.getJobStatus();\r
+ assertTrue(status == JobStatus.PENDING\r
+ || status == JobStatus.RUNNING,\r
+ "Status of the process is wrong!");\r
+ JobInfo info = runner.getJobInfo();\r
+ assertNotNull(info, "JobInfo is null");\r
+ StatisticManager sm = new StatisticManager(info);\r
+ assertNotNull(sm, "Statictic manager is null");\r
+ try {\r
\r
- String exits = sm.getExitStatus();\r
- assertNotNull("Exit status is null", exits);\r
- // cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
- .intValue();\r
- assertEquals(0, exitsInt);\r
- System.out.println(sm.getAllStats());\r
+ String exits = sm.getExitStatus();\r
+ assertNotNull("Exit status is null", exits);\r
+ // cut 4 trailing zeros from the number\r
+ int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+ .intValue();\r
+ assertEquals(0, exitsInt);\r
+ System.out.println(sm.getAllStats());\r
\r
- } catch (ParseException e) {\r
- e.printStackTrace();\r
- fail("Parse Exception: " + e.getMessage());\r
- }\r
- assertFalse(runner.cleanup());\r
- assertTrue(sm.hasExited());\r
- assertFalse(sm.wasAborted());\r
- assertFalse(sm.hasDump());\r
- assertFalse(sm.hasSignaled());\r
+ } catch (ParseException e) {\r
+ e.printStackTrace();\r
+ fail("Parse Exception: " + e.getMessage());\r
+ }\r
+ //assertFalse(runner.cleanup());\r
+ assertTrue(sm.hasExited());\r
+ assertFalse(sm.wasAborted());\r
+ assertFalse(sm.hasDump());\r
+ assertFalse(sm.hasSignaled());\r
\r
- } catch (JobSubmissionException e) {\r
- e.printStackTrace();\r
- fail("DrmaaException caught:" + e.getMessage());\r
- } catch (JobExecutionException e) {\r
- e.printStackTrace();\r
- fail("DrmaaException caught:" + e.getMessage());\r
- } catch (DrmaaException e) {\r
- e.printStackTrace();\r
- fail("DrmaaException caught:" + e.getMessage());\r
+ } catch (JobSubmissionException e) {\r
+ e.printStackTrace();\r
+ fail("DrmaaException caught:" + e.getMessage());\r
+ } catch (JobExecutionException e) {\r
+ e.printStackTrace();\r
+ fail("DrmaaException caught:" + e.getMessage());\r
+ } catch (DrmaaException e) {\r
+ e.printStackTrace();\r
+ fail("DrmaaException caught:" + e.getMessage());\r
+ }\r
}\r
- }\r
\r
- /**\r
- * This tests fails from time to time depending on the cluster load or some\r
- * other factors. Any client code has to adjust for this issue\r
- */\r
- @Test(enabled = false, groups = { AllTestSuit.test_group_cluster,\r
- AllTestSuit.test_group_runner })\r
- public void testRunOnClusterAsync() {\r
- assertFalse(SysPrefs.isWindows,\r
+ /**\r
+ * This tests fails from time to time depending on the cluster load or some\r
+ * other factors. Any client code has to adjust for this issue\r
+ */\r
+ @Test(groups = { AllTestSuit.test_group_cluster,\r
+ AllTestSuit.test_group_runner })\r
+ public void testRunOnClusterAsync() {\r
+ assertFalse(SysPrefs.isWindows,\r
"Cluster execution can only be in unix environment");\r
- try {\r
- ConfiguredExecutable<Jronn> confJronn = Configurator\r
- .configureExecutable(jronn, Executable.ExecProvider.Cluster);\r
- AsyncExecutor aengine = Configurator.getAsyncEngine(confJronn);\r
- String jobId = aengine.submitJob(confJronn);\r
- assertNotNull(jobId, "Runner is NULL");\r
- // let drmaa to start\r
- Thread.sleep(500);\r
- JobStatus status = aengine.getJobStatus(jobId);\r
- while (status != JobStatus.FINISHED\r
- || status != JobStatus.UNDEFINED) {\r
- System.out.println("Job Status: " + status);\r
- Thread.sleep(1000);\r
- status = aengine.getJobStatus(jobId);\r
- }\r
- } catch (JobSubmissionException e) {\r
- e.printStackTrace();\r
- fail("DrmaaException caught:" + e.getMessage());\r
- } catch (InterruptedException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
+ try {\r
+ ConfiguredExecutable<Jronn> confJronn = Configurator\r
+ .configureExecutable(jronn, Executable.ExecProvider.Cluster);\r
+ AsyncExecutor aengine = Configurator.getAsyncEngine(confJronn);\r
+ String jobId = aengine.submitJob(confJronn);\r
+ assertNotNull(jobId, "Runner is NULL");\r
+ // let drmaa to start\r
+ Thread.sleep(500);\r
+ JobStatus status = aengine.getJobStatus(jobId);\r
+ while (status != JobStatus.FINISHED) {\r
+ System.out.println("Job Status: " + status);\r
+ Thread.sleep(1000);\r
+ status = aengine.getJobStatus(jobId);\r
+ ConfiguredExecutable<Jronn> result = (ConfiguredExecutable<Jronn>) aengine.getResults(jobId);\r
+ assertNotNull(result);\r
+ System.out.println("RES:" + result);\r
+ // Some times the job could be removed from the cluster accounting \r
+ // before it has been reported to finish. Make sure \r
+ // to stop waiting in such case\r
+ if(status == JobStatus.UNDEFINED) {\r
+ break;\r
+ }\r
+ }\r
+ } catch (JobSubmissionException e) {\r
+ e.printStackTrace();\r
+ fail("DrmaaException caught:" + e.getMessage());\r
+ } catch (InterruptedException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ } catch (ResultNotAvailableException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ }\r
}\r
- }\r
\r
- @Test(groups = { AllTestSuit.test_group_runner })\r
- public void testRunLocally() {\r
- try {\r
- ConfiguredExecutable<Jronn> confJronn = Configurator\r
- .configureExecutable(jronn, Executable.ExecProvider.Local);\r
+ @Test(groups = { AllTestSuit.test_group_runner })\r
+ public void testRunLocally() {\r
+ try {\r
+ ConfiguredExecutable<Jronn> confJronn = Configurator\r
+ .configureExecutable(jronn, Executable.ExecProvider.Local);\r
\r
- // For local execution use relative\r
- LocalRunner lr = new LocalRunner(confJronn);\r
- lr.executeJob();\r
- ConfiguredExecutable<?> al1 = lr.waitForResult();\r
- assertNotNull(al1.getResults());\r
- List<AnnotatedSequence> al2 = confJronn.getResults();\r
- assertNotNull(al2);\r
- assertEquals(al2.size(), 3);\r
- assertEquals(al1.getResults(), al2);\r
- } catch (JobSubmissionException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- } catch (ResultNotAvailableException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- } catch (JobExecutionException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
+ // For local execution use relative\r
+ LocalRunner lr = new LocalRunner(confJronn);\r
+ lr.executeJob();\r
+ ConfiguredExecutable<?> al1 = lr.waitForResult();\r
+ assertNotNull(al1.getResults());\r
+ List<AnnotatedSequence> al2 = confJronn.getResults();\r
+ assertNotNull(al2);\r
+ assertEquals(al2.size(), 3);\r
+ assertEquals(al1.getResults(), al2);\r
+ } catch (JobSubmissionException e) {\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
+ } catch (ResultNotAvailableException e) {\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
+ } catch (JobExecutionException e) {\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
+ }\r
}\r
- }\r
\r
- @Test(groups = { AllTestSuit.test_group_runner })\r
- public void readStatistics() {\r
- try {\r
- ConfiguredExecutable<Jronn> confJronn = Configurator\r
- .configureExecutable(jronn, Executable.ExecProvider.Local);\r
- // For local execution use relavive\r
+ @Test( groups = { AllTestSuit.test_group_runner })\r
+ public void readStatistics() {\r
+ try {\r
+ ConfiguredExecutable<Jronn> confJronn = Configurator\r
+ .configureExecutable(jronn, Executable.ExecProvider.Local);\r
+ // For local execution use relavive\r
\r
- AsyncExecutor sexec = Configurator.getAsyncEngine(confJronn);\r
- String jobId = sexec.submitJob(confJronn);\r
- FilePuller fw = FilePuller.newFilePuller(confJronn\r
- .getWorkDirectory()\r
- + File.separator + Jronn.getStatFile(),\r
- FileWatcher.MIN_CHUNK_SIZE_BYTES);\r
- int count = 0;\r
- long position = 0;\r
- fw.waitForFile(4);\r
- while (!(sexec.getJobStatus(jobId) == JobStatus.FINISHED\r
- || sexec.getJobStatus(jobId) == JobStatus.FAILED || sexec\r
- .getJobStatus(jobId) == JobStatus.UNDEFINED)\r
- || fw.hasMoreData()) {\r
- ChunkHolder ch = fw.pull(position);\r
- String chunk = ch.getChunk();\r
- position = ch.getNextPosition();\r
- System.out.print(chunk);\r
- count++;\r
- }\r
- assertTrue(count > 1);\r
- ConfiguredExecutable<?> al = sexec.getResults(jobId);\r
- assertNotNull(al.getResults());\r
- } catch (JobSubmissionException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- } catch (ResultNotAvailableException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- } catch (IOException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
+ AsyncExecutor sexec = Configurator.getAsyncEngine(confJronn);\r
+ String jobId = sexec.submitJob(confJronn);\r
+ FilePuller fw = FilePuller.newFilePuller(confJronn\r
+ .getWorkDirectory()\r
+ + File.separator + Jronn.getStatFile(),\r
+ FileWatcher.MIN_CHUNK_SIZE_BYTES);\r
+ int count = 0;\r
+ long position = 0;\r
+ fw.waitForFile(4);\r
+ JobStatus status = sexec.getJobStatus(jobId);\r
+ while (status != JobStatus.FINISHED\r
+ || fw.hasMoreData()) {\r
+ ChunkHolder ch = fw.pull(position);\r
+ String chunk = ch.getChunk();\r
+ position = ch.getNextPosition();\r
+ System.out.print("C: "+chunk);\r
+ count++;\r
+ // Make sure the loop is terminated if the job fails\r
+ if((status == JobStatus.UNDEFINED || status== JobStatus.FAILED)) {\r
+ break;\r
+ }\r
+ status = sexec.getJobStatus(jobId);\r
+ }\r
+ System.out.println("\nOut of the LOOP!! ");\r
+ assertTrue(count > 1);\r
+ ConfiguredExecutable<?> al = sexec.getResults(jobId);\r
+ assertNotNull(al.getResults());\r
+ } catch (JobSubmissionException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ } catch (ResultNotAvailableException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ }\r
}\r
- }\r
\r
- @Test(groups = { AllTestSuit.test_group_runner })\r
- public void testPersistance() {\r
- try {\r
- Jronn jronn = new Jronn();\r
- jronn.setError("errrr.txt").setInput(AllTestSuit.test_input)\r
- .setOutput("outtt.txt");\r
- assertEquals(jronn.getInput(), AllTestSuit.test_input);\r
- assertEquals(jronn.getError(), "errrr.txt");\r
- assertEquals(jronn.getOutput(), "outtt.txt");\r
- ConfiguredExecutable<Jronn> cJronn = Configurator\r
- .configureExecutable(jronn, Executable.ExecProvider.Local);\r
+ @Test(groups = { AllTestSuit.test_group_runner })\r
+ public void testPersistance() {\r
+ try {\r
+ Jronn jronn = new Jronn();\r
+ jronn.setError("errrr.txt").setInput(AllTestSuit.test_input)\r
+ .setOutput("outtt.txt");\r
+ assertEquals(jronn.getInput(), AllTestSuit.test_input);\r
+ assertEquals(jronn.getError(), "errrr.txt");\r
+ assertEquals(jronn.getOutput(), "outtt.txt");\r
+ ConfiguredExecutable<Jronn> cJronn = Configurator\r
+ .configureExecutable(jronn, Executable.ExecProvider.Local);\r
\r
- SyncExecutor sexec = Configurator.getSyncEngine(cJronn);\r
- sexec.executeJob();\r
- ConfiguredExecutable<?> al = sexec.waitForResult();\r
- assertNotNull(al.getResults());\r
- // Save run configuration\r
- assertTrue(cJronn.saveRunConfiguration());\r
+ SyncExecutor sexec = Configurator.getSyncEngine(cJronn);\r
+ sexec.executeJob();\r
+ ConfiguredExecutable<?> al = sexec.waitForResult();\r
+ assertNotNull(al.getResults());\r
+ // Save run configuration\r
+ assertTrue(cJronn.saveRunConfiguration());\r
\r
- // See if loaded configuration is the same as saved\r
- RunConfiguration loadedRun = RunConfiguration\r
- .load(new FileInputStream(new File(cJronn\r
- .getWorkDirectory(), RunConfiguration.rconfigFile)));\r
- assertEquals(\r
- ((ConfExecutable<Jronn>) cJronn).getRunConfiguration(),\r
- loadedRun);\r
- // Load run configuration as ConfExecutable\r
- ConfiguredExecutable<Jronn> resurrectedCMuscle = (ConfiguredExecutable<Jronn>) cJronn\r
- .loadRunConfiguration(new FileInputStream(new File(cJronn\r
- .getWorkDirectory(), RunConfiguration.rconfigFile)));\r
- assertNotNull(resurrectedCMuscle);\r
- assertEquals(resurrectedCMuscle.getExecutable().getInput(),\r
- AllTestSuit.test_input);\r
- assertEquals(resurrectedCMuscle.getExecutable().getError(),\r
- "errrr.txt");\r
- assertEquals(resurrectedCMuscle.getExecutable().getOutput(),\r
- "outtt.txt");\r
- // See in details whether executables are the same\r
- assertEquals(resurrectedCMuscle.getExecutable(), jronn);\r
+ // See if loaded configuration is the same as saved\r
+ RunConfiguration loadedRun = RunConfiguration\r
+ .load(new FileInputStream(new File(cJronn\r
+ .getWorkDirectory(), RunConfiguration.rconfigFile)));\r
+ assertEquals(\r
+ ((ConfExecutable<Jronn>) cJronn).getRunConfiguration(),\r
+ loadedRun);\r
+ // Load run configuration as ConfExecutable\r
+ ConfiguredExecutable<Jronn> resurrectedCMuscle = (ConfiguredExecutable<Jronn>) cJronn\r
+ .loadRunConfiguration(new FileInputStream(new File(cJronn\r
+ .getWorkDirectory(), RunConfiguration.rconfigFile)));\r
+ assertNotNull(resurrectedCMuscle);\r
+ assertEquals(resurrectedCMuscle.getExecutable().getInput(),\r
+ AllTestSuit.test_input);\r
+ assertEquals(resurrectedCMuscle.getExecutable().getError(),\r
+ "errrr.txt");\r
+ assertEquals(resurrectedCMuscle.getExecutable().getOutput(),\r
+ "outtt.txt");\r
+ // See in details whether executables are the same\r
+ assertEquals(resurrectedCMuscle.getExecutable(), jronn);\r
\r
- ConfiguredExecutable<Jronn> resJronn = Configurator\r
- .configureExecutable(resurrectedCMuscle.getExecutable(),\r
- Executable.ExecProvider.Local);\r
+ ConfiguredExecutable<Jronn> resJronn = Configurator\r
+ .configureExecutable(resurrectedCMuscle.getExecutable(),\r
+ Executable.ExecProvider.Local);\r
\r
- sexec = Configurator.getSyncEngine(resJronn,\r
- Executable.ExecProvider.Local);\r
- sexec.executeJob();\r
- al = sexec.waitForResult();\r
- assertNotNull(al);\r
+ sexec = Configurator.getSyncEngine(resJronn,\r
+ Executable.ExecProvider.Local);\r
+ sexec.executeJob();\r
+ al = sexec.waitForResult();\r
+ assertNotNull(al);\r
\r
- } catch (JobSubmissionException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- } catch (JobExecutionException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- } catch (FileNotFoundException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- } catch (IOException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- } catch (ResultNotAvailableException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
+ } catch (JobSubmissionException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ } catch (JobExecutionException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ } catch (ResultNotAvailableException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
+ }\r
}\r
- }\r
\r
- @Test(groups = { AllTestSuit.test_group_runner })\r
- public void testConfigurationLoading() {\r
- try {\r
- RunnerConfig<Jronn> jronnConfig = ConfExecutable\r
- .getRunnerOptions(Jronn.class);\r
- assertNotNull(jronnConfig);\r
- assertTrue(jronnConfig.getArguments().size() > 0);\r
+ @Test(groups = { AllTestSuit.test_group_runner })\r
+ public void testConfigurationLoading() {\r
+ try {\r
+ RunnerConfig<Jronn> jronnConfig = ConfExecutable\r
+ .getRunnerOptions(Jronn.class);\r
+ assertNotNull(jronnConfig);\r
+ assertTrue(jronnConfig.getArguments().size() > 0);\r
\r
- PresetManager<Jronn> jronnPresets = ConfExecutable\r
- .getRunnerPresets(Jronn.class);\r
- assertNotNull(jronnPresets);\r
- assertTrue(jronnPresets.getPresets().size() > 0);\r
- jronnPresets.validate(jronnConfig);\r
+ PresetManager<Jronn> jronnPresets = ConfExecutable\r
+ .getRunnerPresets(Jronn.class);\r
+ assertNull(jronnPresets); // there is no presets\r
\r
- LimitsManager<Jronn> jronnLimits = ConfExecutable\r
- .getRunnerLimits(Jronn.class);\r
- assertNotNull(jronnLimits);\r
- assertTrue(jronnLimits.getLimits().size() > 0);\r
- jronnLimits.validate(jronnPresets);\r
+ LimitsManager<Jronn> jronnLimits = ConfExecutable\r
+ .getRunnerLimits(Jronn.class);\r
+ assertNotNull(jronnLimits);\r
+ assertTrue(jronnLimits.getLimits().size() > 0);\r
+ jronnLimits.validate(jronnPresets);\r
\r
- } catch (FileNotFoundException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- } catch (IOException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- } catch (ValidationException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
+ } catch (ValidationException e) {\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
+ }\r
}\r
- }\r
\r
}\r