Jronn tester
authorpvtroshin <pvtroshin@e3abac25-378b-4346-85de-24260fe3988d>
Thu, 22 Jul 2010 11:13:08 +0000 (11:13 +0000)
committerpvtroshin <pvtroshin@e3abac25-378b-4346-85de-24260fe3988d>
Thu, 22 Jul 2010 11:13:08 +0000 (11:13 +0000)
git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@2648 e3abac25-378b-4346-85de-24260fe3988d

conf/Engine.cluster.properties
conf/Executable.properties
conf/log4j.properties
runner/compbio/runner/disorder/Jronn.java
testsrc/compbio/runner/disorder/JronnTester.java

index f5e83b9..333c77e 100644 (file)
@@ -2,10 +2,10 @@
 \r
 # enable or disable engine true | false\r
 # OPTIONAL defaults to false\r
-engine.cluster.enable=false\r
+engine.cluster.enable=true\r
 \r
 # Directory to use for temporary files storage\r
 # REQUIRED - cluster nodes must have access to this directory!\r
 # An absolute path is required \r
-#cluster.tmp.directory=/homes/pvtroshin/workspace/clustengine/jobsout\r
+cluster.tmp.directory=/homes/pvtroshin/workspace/jaba2/jobsout\r
 \r
index cb3daa1..6f66e35 100644 (file)
@@ -2,7 +2,7 @@
 ### Clustal configuration ###\r
 local.clustalw.bin.windows=binaries/clustalw2.exe\r
 local.clustalw.bin=binaries/src/clustalw/src/clustalw2\r
-cluster.clustalw.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/clustalw/src/clustalw2\r
+cluster.clustalw.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/clustalw/src/clustalw2\r
 # Parameters names which come from RunnerConfig -> Parameters.xml file ultimately are all lowercased in comparison!\r
 # see engine.client.Util.getExecProperty() method for details  \r
 # So they are case insensitive. \r
@@ -17,7 +17,7 @@ local.muscle.bin.windows=binaries/muscle.exe
 local.muscle.bin=binaries/src/muscle/muscle\r
 # Beware version of muscle on the cluster older and does not support some \r
 # of the newer version attributed thus, will not work with Muscle.java wrapper!\r
-cluster.muscle.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/muscle/muscle\r
+cluster.muscle.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/muscle/muscle\r
 #The environment variable MUSCLE_MXPATH can be used to specify a path where the matrices are stored\r
 # e.g. MUSCLE_MXPATH#binaries/matrices - but need to privide absolute path!\r
 muscle.-matrix.path=binaries/matrices\r
@@ -29,7 +29,7 @@ muscle.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M
 ### Mafft configuration ###\r
 #local.mafft.bin.windows=\r
 local.mafft.bin=binaries/src/mafft/binaries/mafft\r
-cluster.mafft.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/mafft/core/mafft\r
+cluster.mafft.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/mafft/core/mafft\r
 mafft.bin.env=MAFFT_BINARIES#binaries/src/mafft/binaries;FASTA_4_MAFFT#binaries/src/fasta34/fasta34;\r
 mafft.--aamatrix.path=binaries/matrices\r
 mafft.presets.file=conf/settings/MafftPresets.xml\r
@@ -39,7 +39,7 @@ mafft.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M
 \r
 ### Tcoffee configuration ###\r
 local.tcoffee.bin=binaries/src/tcoffee/t_coffee_source/t_coffee\r
-cluster.tcoffee.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/tcoffee/t_coffee_source/t_coffee\r
+cluster.tcoffee.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/tcoffee/t_coffee_source/t_coffee\r
 #/sw/bin/t_coffee\r
 # Sub matrix support does not work \r
 #tcoffee.-matrix.path=binaries/matrices\r
@@ -52,7 +52,7 @@ tcoffee.cluster.settings=-q 64bit-pri.q -pe smp 4 -l h_vmem=1700M -l ram=1700M -
 ### Probcons configuration ###\r
 #local.probcons.bin.windows=\r
 local.probcons.bin=binaries/src/probcons/probcons\r
-cluster.probcons.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/probcons/probcons\r
+cluster.probcons.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/probcons/probcons\r
 #Probcons does not support matrix loading - unrecognised option reported! \r
 probcons.parameters.file=conf/settings/ProbconsParameters.xml\r
 probcons.limits.file=conf/settings/ProbconsLimits.xml\r
index 9fe9a23..2ce2bf5 100644 (file)
@@ -20,7 +20,7 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%m%n\r
 \r
 ## Uncomment to enable JWS2 activity logging to the file\r
-log4j.logger.compbio=ERROR, ACTIVITY\r
+log4j.logger.compbio=TRACE, ACTIVITY\r
 log4j.appender.ACTIVITY=org.apache.log4j.RollingFileAppender\r
 log4j.appender.ACTIVITY.File=${logDir}/activity.log\r
 log4j.appender.ACTIVITY.MaxFileSize=10MB\r
index 0c4245a..1b9037e 100644 (file)
@@ -48,117 +48,117 @@ import compbio.runner.Util;
  */\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
index ba0b171..2b79a20 100644 (file)
@@ -19,7 +19,7 @@
 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
@@ -65,268 +65,282 @@ import compbio.util.SysPrefs;
 \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