From: pvtroshin Date: Thu, 22 Jul 2010 11:13:08 +0000 (+0000) Subject: Jronn tester X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=88d713ca7e5f0612550fafe5a0a2e9dbb35d691b;p=jabaws.git Jronn tester git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@2648 e3abac25-378b-4346-85de-24260fe3988d --- diff --git a/conf/Engine.cluster.properties b/conf/Engine.cluster.properties index f5e83b9..333c77e 100644 --- a/conf/Engine.cluster.properties +++ b/conf/Engine.cluster.properties @@ -2,10 +2,10 @@ # enable or disable engine true | false # OPTIONAL defaults to false -engine.cluster.enable=false +engine.cluster.enable=true # Directory to use for temporary files storage # REQUIRED - cluster nodes must have access to this directory! # An absolute path is required -#cluster.tmp.directory=/homes/pvtroshin/workspace/clustengine/jobsout +cluster.tmp.directory=/homes/pvtroshin/workspace/jaba2/jobsout diff --git a/conf/Executable.properties b/conf/Executable.properties index cb3daa1..6f66e35 100644 --- a/conf/Executable.properties +++ b/conf/Executable.properties @@ -2,7 +2,7 @@ ### Clustal configuration ### local.clustalw.bin.windows=binaries/clustalw2.exe local.clustalw.bin=binaries/src/clustalw/src/clustalw2 -cluster.clustalw.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/clustalw/src/clustalw2 +cluster.clustalw.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/clustalw/src/clustalw2 # Parameters names which come from RunnerConfig -> Parameters.xml file ultimately are all lowercased in comparison! # see engine.client.Util.getExecProperty() method for details # So they are case insensitive. @@ -17,7 +17,7 @@ local.muscle.bin.windows=binaries/muscle.exe local.muscle.bin=binaries/src/muscle/muscle # Beware version of muscle on the cluster older and does not support some # of the newer version attributed thus, will not work with Muscle.java wrapper! -cluster.muscle.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/muscle/muscle +cluster.muscle.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/muscle/muscle #The environment variable MUSCLE_MXPATH can be used to specify a path where the matrices are stored # e.g. MUSCLE_MXPATH#binaries/matrices - but need to privide absolute path! muscle.-matrix.path=binaries/matrices @@ -29,7 +29,7 @@ muscle.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M ### Mafft configuration ### #local.mafft.bin.windows= local.mafft.bin=binaries/src/mafft/binaries/mafft -cluster.mafft.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/mafft/core/mafft +cluster.mafft.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/mafft/core/mafft mafft.bin.env=MAFFT_BINARIES#binaries/src/mafft/binaries;FASTA_4_MAFFT#binaries/src/fasta34/fasta34; mafft.--aamatrix.path=binaries/matrices mafft.presets.file=conf/settings/MafftPresets.xml @@ -39,7 +39,7 @@ mafft.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M ### Tcoffee configuration ### local.tcoffee.bin=binaries/src/tcoffee/t_coffee_source/t_coffee -cluster.tcoffee.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/tcoffee/t_coffee_source/t_coffee +cluster.tcoffee.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/tcoffee/t_coffee_source/t_coffee #/sw/bin/t_coffee # Sub matrix support does not work #tcoffee.-matrix.path=binaries/matrices @@ -52,7 +52,7 @@ tcoffee.cluster.settings=-q 64bit-pri.q -pe smp 4 -l h_vmem=1700M -l ram=1700M - ### Probcons configuration ### #local.probcons.bin.windows= local.probcons.bin=binaries/src/probcons/probcons -cluster.probcons.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/probcons/probcons +cluster.probcons.bin=/homes/pvtroshin/workspace/jaba2/binaries/src/probcons/probcons #Probcons does not support matrix loading - unrecognised option reported! probcons.parameters.file=conf/settings/ProbconsParameters.xml probcons.limits.file=conf/settings/ProbconsLimits.xml diff --git a/conf/log4j.properties b/conf/log4j.properties index 9fe9a23..2ce2bf5 100644 --- a/conf/log4j.properties +++ b/conf/log4j.properties @@ -20,7 +20,7 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%m%n ## Uncomment to enable JWS2 activity logging to the file -log4j.logger.compbio=ERROR, ACTIVITY +log4j.logger.compbio=TRACE, ACTIVITY log4j.appender.ACTIVITY=org.apache.log4j.RollingFileAppender log4j.appender.ACTIVITY.File=${logDir}/activity.log log4j.appender.ACTIVITY.MaxFileSize=10MB diff --git a/runner/compbio/runner/disorder/Jronn.java b/runner/compbio/runner/disorder/Jronn.java index 0c4245a..1b9037e 100644 --- a/runner/compbio/runner/disorder/Jronn.java +++ b/runner/compbio/runner/disorder/Jronn.java @@ -48,117 +48,117 @@ import compbio.runner.Util; */ public class Jronn extends SkeletalExecutable { - private static Logger log = Logger.getLogger(Jronn.class); - - // Cache for Limits information - private static LimitsManager limits; - - public static final String KEY_VALUE_SEPARATOR = Util.SPACE; - public static final String STAT_FILE = "stat.txt"; - - public Jronn() { - addParameters(Arrays.asList("-jar", getLibPath(), "-n=1", "-s=" - + STAT_FILE, "-f=H")); - } - - @SuppressWarnings("unchecked") - @Override - public List getResults(String workDirectory) - throws ResultNotAvailableException { - List sequences = null; - try { - InputStream inStream = new FileInputStream(new File(workDirectory, - getOutput())); - sequences = SequenceUtil.readJRonn(inStream); - inStream.close(); - } catch (FileNotFoundException e) { - log.error(e.getMessage(), e.getCause()); - throw new ResultNotAvailableException(e); - } catch (IOException e) { - log.error(e.getMessage(), e.getCause()); - throw new ResultNotAvailableException(e); - } catch (UnknownFileFormatException e) { - log.error(e.getMessage(), e.getCause()); - throw new ResultNotAvailableException(e); - } catch (NullPointerException e) { - log.error(e.getMessage(), e.getCause()); - throw new ResultNotAvailableException(e); + private static Logger log = Logger.getLogger(Jronn.class); + + // Cache for Limits information + private static LimitsManager limits; + + public static final String KEY_VALUE_SEPARATOR = Util.SPACE; + public static final String STAT_FILE = "stat.txt"; + + public Jronn() { + addParameters(Arrays.asList("-jar", getLibPath(), "-n=1", "-s=" + + STAT_FILE, "-f=H")); } - return sequences; - } - private static String getLibPath() { + @SuppressWarnings("unchecked") + @Override + public List getResults(String workDirectory) + throws ResultNotAvailableException { + List sequences = null; + try { + InputStream inStream = new FileInputStream(new File(workDirectory, + getOutput())); + sequences = SequenceUtil.readJRonn(inStream); + inStream.close(); + } catch (FileNotFoundException e) { + log.error(e.getMessage(), e.getCause()); + throw new ResultNotAvailableException(e); + } catch (IOException e) { + log.error(e.getMessage(), e.getCause()); + throw new ResultNotAvailableException(e); + } catch (UnknownFileFormatException e) { + log.error(e.getMessage(), e.getCause()); + throw new ResultNotAvailableException(e); + } catch (NullPointerException e) { + log.error(e.getMessage(), e.getCause()); + throw new ResultNotAvailableException(e); + } + return sequences; + } - String settings = ph.getProperty("jronn.jar.file"); - if (compbio.util.Util.isEmpty(settings)) { - throw new NullPointerException( - "Please define jronn.jar.file property in Executable.properties file" - + "and initialize it with the location of jronn jar file"); + private static String getLibPath() { + + String settings = ph.getProperty("jronn.jar.file"); + if (compbio.util.Util.isEmpty(settings)) { + throw new NullPointerException( + "Please define jronn.jar.file property in Executable.properties file" + + "and initialize it with the location of jronn jar file"); + } + if (new File(settings).isAbsolute()) { + // Jronn jar can be found so no actions necessary + // no further actions is necessary + return settings; + } + return compbio.engine.client.Util.convertToAbsolute(settings); } - if (new File(settings).isAbsolute()) { - // Jronn jar can be found so no actions necessary - // no further actions is necessary - return settings; + + @Override + public List getCreatedFiles() { + return Arrays.asList(getOutput(), getError()); } - return compbio.engine.client.Util.convertToAbsolute(settings); - } - - @Override - public List getCreatedFiles() { - return Arrays.asList(getOutput(), getError()); - } - - @Override - public Jronn setInput(String inFile) { - super.setInput(inFile); - cbuilder.setParam("-i=" + inFile); - return this; - } - - @Override - public Jronn setOutput(String outFile) { - super.setOutput(outFile); - cbuilder.setParam("-o=" + outFile); - return this; - } - - @Override - public Limit getLimit(String presetName) { - if (limits == null) { - limits = getLimits(); + + @Override + public Jronn setInput(String inFile) { + super.setInput(inFile); + cbuilder.setParam("-i=" + inFile); + return this; } - Limit limit = null; - if (limits != null) { - // this returns default limit if preset is undefined! - limit = limits.getLimitByName(presetName); + + @Override + public Jronn setOutput(String outFile) { + super.setOutput(outFile); + cbuilder.setParam("-o=" + outFile); + return this; } - // If limit is not defined for a particular preset, then return default - // limit - if (limit == null) { - log.debug("Limit for the preset " + presetName - + " is not found. Using default"); - limit = limits.getDefaultLimit(); + + @Override + public Limit getLimit(String presetName) { + if (limits == null) { + limits = getLimits(); + } + Limit limit = null; + if (limits != null) { + // this returns default limit if preset is undefined! + limit = limits.getLimitByName(presetName); + } + // If limit is not defined for a particular preset, then return default + // limit + if (limit == null) { + log.debug("Limit for the preset " + presetName + + " is not found. Using default"); + limit = limits.getDefaultLimit(); + } + return limit; } - return limit; - } - - @Override - public LimitsManager getLimits() { - // synchronise on static field - synchronized (log) { - if (limits == null) { - limits = Util.getLimits(this.getClass()); - } + + @Override + public LimitsManager getLimits() { + // synchronise on static field + synchronized (log) { + if (limits == null) { + limits = Util.getLimits(this.getClass()); + } + } + return limits; } - return limits; - } - @Override - public Class> getType() { - return this.getClass(); - } + @Override + public Class> getType() { + return this.getClass(); + } - public static String getStatFile() { - return STAT_FILE; - } + public static String getStatFile() { + return STAT_FILE; + } } diff --git a/testsrc/compbio/runner/disorder/JronnTester.java b/testsrc/compbio/runner/disorder/JronnTester.java index ba0b171..2b79a20 100644 --- a/testsrc/compbio/runner/disorder/JronnTester.java +++ b/testsrc/compbio/runner/disorder/JronnTester.java @@ -19,7 +19,7 @@ package compbio.runner.disorder; import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; +import static org.testng.Assert.*; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; @@ -65,268 +65,282 @@ import compbio.util.SysPrefs; public class JronnTester { - public static String test_outfile = "TO1381.jronn.out"; // "/homes/pvtroshin/TO1381.clustal.cluster.out + public static String test_outfile = "TO1381.jronn.out"; // "/homes/pvtroshin/TO1381.clustal.cluster.out - private Jronn jronn; + private Jronn jronn; - @BeforeMethod(alwaysRun = true) - void init() { - jronn = new Jronn(); - jronn.setInput(AllTestSuit.test_input).setOutput(test_outfile); - } + @BeforeMethod(alwaysRun = true) + void init() { + jronn = new Jronn(); + jronn.setInput(AllTestSuit.test_input).setOutput(test_outfile); + } - @Test(groups = { AllTestSuit.test_group_cluster, - AllTestSuit.test_group_runner }) - public void testRunOnCluster() { - assertFalse(SysPrefs.isWindows, - "Cluster execution can only be in unix environment"); - try { - ConfiguredExecutable confJronn = Configurator - .configureExecutable(jronn, Executable.ExecProvider.Cluster); - JobRunner runner = JobRunner.getInstance(confJronn); + @Test(groups = { AllTestSuit.test_group_cluster, + AllTestSuit.test_group_runner }) + public void testRunOnCluster() { + assertFalse(SysPrefs.isWindows, + "Cluster execution can only be in unix environment"); + try { + ConfiguredExecutable confJronn = Configurator + .configureExecutable(jronn, Executable.ExecProvider.Cluster); + JobRunner runner = JobRunner.getInstance(confJronn); - assertNotNull(runner, "Runner is NULL"); - runner.executeJob(); - // assertNotNull("JobId is null", jobId1); - JobStatus status = runner.getJobStatus(); - assertTrue(status == JobStatus.PENDING - || status == JobStatus.RUNNING, - "Status of the process is wrong!"); - JobInfo info = runner.getJobInfo(); - assertNotNull(info, "JobInfo is null"); - StatisticManager sm = new StatisticManager(info); - assertNotNull(sm, "Statictic manager is null"); - try { + assertNotNull(runner, "Runner is NULL"); + runner.executeJob(); + // assertNotNull("JobId is null", jobId1); + JobStatus status = runner.getJobStatus(); + assertTrue(status == JobStatus.PENDING + || status == JobStatus.RUNNING, + "Status of the process is wrong!"); + JobInfo info = runner.getJobInfo(); + assertNotNull(info, "JobInfo is null"); + StatisticManager sm = new StatisticManager(info); + assertNotNull(sm, "Statictic manager is null"); + try { - String exits = sm.getExitStatus(); - assertNotNull("Exit status is null", exits); - // cut 4 trailing zeros from the number - int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits) - .intValue(); - assertEquals(0, exitsInt); - System.out.println(sm.getAllStats()); + String exits = sm.getExitStatus(); + assertNotNull("Exit status is null", exits); + // cut 4 trailing zeros from the number + int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits) + .intValue(); + assertEquals(0, exitsInt); + System.out.println(sm.getAllStats()); - } catch (ParseException e) { - e.printStackTrace(); - fail("Parse Exception: " + e.getMessage()); - } - assertFalse(runner.cleanup()); - assertTrue(sm.hasExited()); - assertFalse(sm.wasAborted()); - assertFalse(sm.hasDump()); - assertFalse(sm.hasSignaled()); + } catch (ParseException e) { + e.printStackTrace(); + fail("Parse Exception: " + e.getMessage()); + } + //assertFalse(runner.cleanup()); + assertTrue(sm.hasExited()); + assertFalse(sm.wasAborted()); + assertFalse(sm.hasDump()); + assertFalse(sm.hasSignaled()); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail("DrmaaException caught:" + e.getMessage()); - } catch (JobExecutionException e) { - e.printStackTrace(); - fail("DrmaaException caught:" + e.getMessage()); - } catch (DrmaaException e) { - e.printStackTrace(); - fail("DrmaaException caught:" + e.getMessage()); + } catch (JobSubmissionException e) { + e.printStackTrace(); + fail("DrmaaException caught:" + e.getMessage()); + } catch (JobExecutionException e) { + e.printStackTrace(); + fail("DrmaaException caught:" + e.getMessage()); + } catch (DrmaaException e) { + e.printStackTrace(); + fail("DrmaaException caught:" + e.getMessage()); + } } - } - /** - * This tests fails from time to time depending on the cluster load or some - * other factors. Any client code has to adjust for this issue - */ - @Test(enabled = false, groups = { AllTestSuit.test_group_cluster, - AllTestSuit.test_group_runner }) - public void testRunOnClusterAsync() { - assertFalse(SysPrefs.isWindows, + /** + * This tests fails from time to time depending on the cluster load or some + * other factors. Any client code has to adjust for this issue + */ + @Test(groups = { AllTestSuit.test_group_cluster, + AllTestSuit.test_group_runner }) + public void testRunOnClusterAsync() { + assertFalse(SysPrefs.isWindows, "Cluster execution can only be in unix environment"); - try { - ConfiguredExecutable confJronn = Configurator - .configureExecutable(jronn, Executable.ExecProvider.Cluster); - AsyncExecutor aengine = Configurator.getAsyncEngine(confJronn); - String jobId = aengine.submitJob(confJronn); - assertNotNull(jobId, "Runner is NULL"); - // let drmaa to start - Thread.sleep(500); - JobStatus status = aengine.getJobStatus(jobId); - while (status != JobStatus.FINISHED - || status != JobStatus.UNDEFINED) { - System.out.println("Job Status: " + status); - Thread.sleep(1000); - status = aengine.getJobStatus(jobId); - } - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail("DrmaaException caught:" + e.getMessage()); - } catch (InterruptedException e) { - e.printStackTrace(); - fail(e.getMessage()); + try { + ConfiguredExecutable confJronn = Configurator + .configureExecutable(jronn, Executable.ExecProvider.Cluster); + AsyncExecutor aengine = Configurator.getAsyncEngine(confJronn); + String jobId = aengine.submitJob(confJronn); + assertNotNull(jobId, "Runner is NULL"); + // let drmaa to start + Thread.sleep(500); + JobStatus status = aengine.getJobStatus(jobId); + while (status != JobStatus.FINISHED) { + System.out.println("Job Status: " + status); + Thread.sleep(1000); + status = aengine.getJobStatus(jobId); + ConfiguredExecutable result = (ConfiguredExecutable) aengine.getResults(jobId); + assertNotNull(result); + System.out.println("RES:" + result); + // Some times the job could be removed from the cluster accounting + // before it has been reported to finish. Make sure + // to stop waiting in such case + if(status == JobStatus.UNDEFINED) { + break; + } + } + } catch (JobSubmissionException e) { + e.printStackTrace(); + fail("DrmaaException caught:" + e.getMessage()); + } catch (InterruptedException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (ResultNotAvailableException e) { + e.printStackTrace(); + fail(e.getMessage()); + } } - } - @Test(groups = { AllTestSuit.test_group_runner }) - public void testRunLocally() { - try { - ConfiguredExecutable confJronn = Configurator - .configureExecutable(jronn, Executable.ExecProvider.Local); + @Test(groups = { AllTestSuit.test_group_runner }) + public void testRunLocally() { + try { + ConfiguredExecutable confJronn = Configurator + .configureExecutable(jronn, Executable.ExecProvider.Local); - // For local execution use relative - LocalRunner lr = new LocalRunner(confJronn); - lr.executeJob(); - ConfiguredExecutable al1 = lr.waitForResult(); - assertNotNull(al1.getResults()); - List al2 = confJronn.getResults(); - assertNotNull(al2); - assertEquals(al2.size(), 3); - assertEquals(al1.getResults(), al2); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (ResultNotAvailableException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (JobExecutionException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); + // For local execution use relative + LocalRunner lr = new LocalRunner(confJronn); + lr.executeJob(); + ConfiguredExecutable al1 = lr.waitForResult(); + assertNotNull(al1.getResults()); + List al2 = confJronn.getResults(); + assertNotNull(al2); + assertEquals(al2.size(), 3); + assertEquals(al1.getResults(), al2); + } catch (JobSubmissionException e) { + e.printStackTrace(); + fail(e.getLocalizedMessage()); + } catch (ResultNotAvailableException e) { + e.printStackTrace(); + fail(e.getLocalizedMessage()); + } catch (JobExecutionException e) { + e.printStackTrace(); + fail(e.getLocalizedMessage()); + } } - } - @Test(groups = { AllTestSuit.test_group_runner }) - public void readStatistics() { - try { - ConfiguredExecutable confJronn = Configurator - .configureExecutable(jronn, Executable.ExecProvider.Local); - // For local execution use relavive + @Test( groups = { AllTestSuit.test_group_runner }) + public void readStatistics() { + try { + ConfiguredExecutable confJronn = Configurator + .configureExecutable(jronn, Executable.ExecProvider.Local); + // For local execution use relavive - AsyncExecutor sexec = Configurator.getAsyncEngine(confJronn); - String jobId = sexec.submitJob(confJronn); - FilePuller fw = FilePuller.newFilePuller(confJronn - .getWorkDirectory() - + File.separator + Jronn.getStatFile(), - FileWatcher.MIN_CHUNK_SIZE_BYTES); - int count = 0; - long position = 0; - fw.waitForFile(4); - while (!(sexec.getJobStatus(jobId) == JobStatus.FINISHED - || sexec.getJobStatus(jobId) == JobStatus.FAILED || sexec - .getJobStatus(jobId) == JobStatus.UNDEFINED) - || fw.hasMoreData()) { - ChunkHolder ch = fw.pull(position); - String chunk = ch.getChunk(); - position = ch.getNextPosition(); - System.out.print(chunk); - count++; - } - assertTrue(count > 1); - ConfiguredExecutable al = sexec.getResults(jobId); - assertNotNull(al.getResults()); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (ResultNotAvailableException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (IOException e) { - e.printStackTrace(); - fail(e.getMessage()); + AsyncExecutor sexec = Configurator.getAsyncEngine(confJronn); + String jobId = sexec.submitJob(confJronn); + FilePuller fw = FilePuller.newFilePuller(confJronn + .getWorkDirectory() + + File.separator + Jronn.getStatFile(), + FileWatcher.MIN_CHUNK_SIZE_BYTES); + int count = 0; + long position = 0; + fw.waitForFile(4); + JobStatus status = sexec.getJobStatus(jobId); + while (status != JobStatus.FINISHED + || fw.hasMoreData()) { + ChunkHolder ch = fw.pull(position); + String chunk = ch.getChunk(); + position = ch.getNextPosition(); + System.out.print("C: "+chunk); + count++; + // Make sure the loop is terminated if the job fails + if((status == JobStatus.UNDEFINED || status== JobStatus.FAILED)) { + break; + } + status = sexec.getJobStatus(jobId); + } + System.out.println("\nOut of the LOOP!! "); + assertTrue(count > 1); + ConfiguredExecutable al = sexec.getResults(jobId); + assertNotNull(al.getResults()); + } catch (JobSubmissionException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (ResultNotAvailableException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + fail(e.getMessage()); + } } - } - @Test(groups = { AllTestSuit.test_group_runner }) - public void testPersistance() { - try { - Jronn jronn = new Jronn(); - jronn.setError("errrr.txt").setInput(AllTestSuit.test_input) - .setOutput("outtt.txt"); - assertEquals(jronn.getInput(), AllTestSuit.test_input); - assertEquals(jronn.getError(), "errrr.txt"); - assertEquals(jronn.getOutput(), "outtt.txt"); - ConfiguredExecutable cJronn = Configurator - .configureExecutable(jronn, Executable.ExecProvider.Local); + @Test(groups = { AllTestSuit.test_group_runner }) + public void testPersistance() { + try { + Jronn jronn = new Jronn(); + jronn.setError("errrr.txt").setInput(AllTestSuit.test_input) + .setOutput("outtt.txt"); + assertEquals(jronn.getInput(), AllTestSuit.test_input); + assertEquals(jronn.getError(), "errrr.txt"); + assertEquals(jronn.getOutput(), "outtt.txt"); + ConfiguredExecutable cJronn = Configurator + .configureExecutable(jronn, Executable.ExecProvider.Local); - SyncExecutor sexec = Configurator.getSyncEngine(cJronn); - sexec.executeJob(); - ConfiguredExecutable al = sexec.waitForResult(); - assertNotNull(al.getResults()); - // Save run configuration - assertTrue(cJronn.saveRunConfiguration()); + SyncExecutor sexec = Configurator.getSyncEngine(cJronn); + sexec.executeJob(); + ConfiguredExecutable al = sexec.waitForResult(); + assertNotNull(al.getResults()); + // Save run configuration + assertTrue(cJronn.saveRunConfiguration()); - // See if loaded configuration is the same as saved - RunConfiguration loadedRun = RunConfiguration - .load(new FileInputStream(new File(cJronn - .getWorkDirectory(), RunConfiguration.rconfigFile))); - assertEquals( - ((ConfExecutable) cJronn).getRunConfiguration(), - loadedRun); - // Load run configuration as ConfExecutable - ConfiguredExecutable resurrectedCMuscle = (ConfiguredExecutable) cJronn - .loadRunConfiguration(new FileInputStream(new File(cJronn - .getWorkDirectory(), RunConfiguration.rconfigFile))); - assertNotNull(resurrectedCMuscle); - assertEquals(resurrectedCMuscle.getExecutable().getInput(), - AllTestSuit.test_input); - assertEquals(resurrectedCMuscle.getExecutable().getError(), - "errrr.txt"); - assertEquals(resurrectedCMuscle.getExecutable().getOutput(), - "outtt.txt"); - // See in details whether executables are the same - assertEquals(resurrectedCMuscle.getExecutable(), jronn); + // See if loaded configuration is the same as saved + RunConfiguration loadedRun = RunConfiguration + .load(new FileInputStream(new File(cJronn + .getWorkDirectory(), RunConfiguration.rconfigFile))); + assertEquals( + ((ConfExecutable) cJronn).getRunConfiguration(), + loadedRun); + // Load run configuration as ConfExecutable + ConfiguredExecutable resurrectedCMuscle = (ConfiguredExecutable) cJronn + .loadRunConfiguration(new FileInputStream(new File(cJronn + .getWorkDirectory(), RunConfiguration.rconfigFile))); + assertNotNull(resurrectedCMuscle); + assertEquals(resurrectedCMuscle.getExecutable().getInput(), + AllTestSuit.test_input); + assertEquals(resurrectedCMuscle.getExecutable().getError(), + "errrr.txt"); + assertEquals(resurrectedCMuscle.getExecutable().getOutput(), + "outtt.txt"); + // See in details whether executables are the same + assertEquals(resurrectedCMuscle.getExecutable(), jronn); - ConfiguredExecutable resJronn = Configurator - .configureExecutable(resurrectedCMuscle.getExecutable(), - Executable.ExecProvider.Local); + ConfiguredExecutable resJronn = Configurator + .configureExecutable(resurrectedCMuscle.getExecutable(), + Executable.ExecProvider.Local); - sexec = Configurator.getSyncEngine(resJronn, - Executable.ExecProvider.Local); - sexec.executeJob(); - al = sexec.waitForResult(); - assertNotNull(al); + sexec = Configurator.getSyncEngine(resJronn, + Executable.ExecProvider.Local); + sexec.executeJob(); + al = sexec.waitForResult(); + assertNotNull(al); - } catch (JobSubmissionException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (JobExecutionException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (FileNotFoundException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (IOException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (ResultNotAvailableException e) { - e.printStackTrace(); - fail(e.getMessage()); + } catch (JobSubmissionException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (JobExecutionException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (FileNotFoundException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (ResultNotAvailableException e) { + e.printStackTrace(); + fail(e.getMessage()); + } } - } - @Test(groups = { AllTestSuit.test_group_runner }) - public void testConfigurationLoading() { - try { - RunnerConfig jronnConfig = ConfExecutable - .getRunnerOptions(Jronn.class); - assertNotNull(jronnConfig); - assertTrue(jronnConfig.getArguments().size() > 0); + @Test(groups = { AllTestSuit.test_group_runner }) + public void testConfigurationLoading() { + try { + RunnerConfig jronnConfig = ConfExecutable + .getRunnerOptions(Jronn.class); + assertNotNull(jronnConfig); + assertTrue(jronnConfig.getArguments().size() > 0); - PresetManager jronnPresets = ConfExecutable - .getRunnerPresets(Jronn.class); - assertNotNull(jronnPresets); - assertTrue(jronnPresets.getPresets().size() > 0); - jronnPresets.validate(jronnConfig); + PresetManager jronnPresets = ConfExecutable + .getRunnerPresets(Jronn.class); + assertNull(jronnPresets); // there is no presets - LimitsManager jronnLimits = ConfExecutable - .getRunnerLimits(Jronn.class); - assertNotNull(jronnLimits); - assertTrue(jronnLimits.getLimits().size() > 0); - jronnLimits.validate(jronnPresets); + LimitsManager jronnLimits = ConfExecutable + .getRunnerLimits(Jronn.class); + assertNotNull(jronnLimits); + assertTrue(jronnLimits.getLimits().size() > 0); + jronnLimits.validate(jronnPresets); - } catch (FileNotFoundException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (IOException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); - } catch (ValidationException e) { - e.printStackTrace(); - fail(e.getLocalizedMessage()); + } catch (FileNotFoundException e) { + e.printStackTrace(); + fail(e.getLocalizedMessage()); + } catch (IOException e) { + e.printStackTrace(); + fail(e.getLocalizedMessage()); + } catch (ValidationException e) { + e.printStackTrace(); + fail(e.getLocalizedMessage()); + } } - } }