public class ClustalOTester {\r
\r
static final String clustalConfigFile = AllTestSuit.TEST_DATA_PATH\r
- + "ClustalParameters.xml";\r
- public static String test_outfile = "TO1381.clustal.out";\r
- public static String cluster_test_outfile = "TO1381.clustal.cluster.out";\r
+ + "ClustaloParameters.xml";\r
+ public static String test_outfile = "TO1381.clustalo.out";\r
+ public static String cluster_test_outfile = "TO1381.clustalo.cluster.out";\r
\r
@Test(groups = {AllTestSuit.test_group_cluster,\r
AllTestSuit.test_group_runner})\r
public void testRunOnCluster() {\r
- ClustalW clustal = new ClustalW();\r
+ ClustalO clustal = new ClustalO();\r
assertFalse(SysPrefs.isWindows,\r
"Cluster execution can only be in unix environment");\r
clustal.setInput(AllTestSuit.test_input)\r
\r
try {\r
\r
- ConfiguredExecutable<ClustalW> confClustal = Configurator\r
+ ConfiguredExecutable<ClustalO> confClustal = Configurator\r
.configureExecutable(clustal);\r
JobRunner runner = JobRunner.getInstance(confClustal);\r
// ClusterSession csession = JobRunner.getSession();\r
@Test(groups = {AllTestSuit.test_group_runner})\r
public void testConfigurationLoading() {\r
try {\r
- RunnerConfig<ClustalW> clustalConfig = ConfExecutable\r
- .getRunnerOptions(ClustalW.class);\r
+ RunnerConfig<ClustalO> clustalConfig = ConfExecutable\r
+ .getRunnerOptions(ClustalO.class);\r
assertNotNull(clustalConfig);\r
assertTrue(clustalConfig.getArguments().size() > 0);\r
\r
- PresetManager<ClustalW> clustalPresets = ConfExecutable\r
- .getRunnerPresets(ClustalW.class);\r
+ /* Unsupported\r
+ PresetManager<ClustalO> clustalPresets = ConfExecutable\r
+ .getRunnerPresets(ClustalO.class);\r
assertNotNull(clustalPresets);\r
assertTrue(clustalPresets.getPresets().size() > 0);\r
clustalPresets.validate(clustalConfig);\r
-\r
- LimitsManager<ClustalW> clustalLimits = ConfExecutable\r
- .getRunnerLimits(ClustalW.class);\r
+ */\r
+ LimitsManager<ClustalO> clustalLimits = ConfExecutable\r
+ .getRunnerLimits(ClustalO.class);\r
assertNotNull(clustalLimits);\r
assertTrue(clustalLimits.getLimits().size() > 0);\r
- clustalLimits.validate(clustalPresets);\r
+ //clustalLimits.validate(clustalPresets);\r
\r
} catch (FileNotFoundException e) {\r
e.printStackTrace();\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
public void testOptionsLocally() {\r
try {\r
\r
- RunnerConfigMarshaller<ClustalW> clustalmarsh = new RunnerConfigMarshaller<ClustalW>(\r
+ RunnerConfigMarshaller<ClustalO> clustalmarsh = new RunnerConfigMarshaller<ClustalO>(\r
RunnerConfig.class);\r
\r
- RunnerConfig<ClustalW> clustalConfig = clustalmarsh.read(\r
+ RunnerConfig<ClustalO> clustalConfig = clustalmarsh.read(\r
new FileInputStream(new File(clustalConfigFile)),\r
RunnerConfig.class);\r
\r
List<String> options = clustalOpc.getOptionsAtRandom();\r
for (int i = 0; i < options.size(); i++) {\r
System.out.println("Using options: " + options);\r
- ClustalW clustal = new ClustalW();\r
+ ClustalO clustal = new ClustalO();\r
clustal.setInput(AllTestSuit.test_input)\r
.setOutput(test_outfile);\r
\r
// For local execution use relavive\r
- ConfiguredExecutable<ClustalW> confClustal = Configurator\r
+ ConfiguredExecutable<ClustalO> confClustal = Configurator\r
.configureExecutable(clustal, ExecProvider.Local);\r
\r
// Add options to the executable\r
\r
LocalRunner lr = new LocalRunner(confClustal);\r
lr.executeJob();\r
- confClustal = (ConfiguredExecutable<ClustalW>) lr\r
+ confClustal = (ConfiguredExecutable<ClustalO>) lr\r
.waitForResult();\r
assertNotNull(confClustal.getResults());\r
Collections.shuffle(options);\r
\r
public static final void main(String[] args) throws JobSubmissionException,\r
JobExecutionException, InterruptedException {\r
- ClustalW clustal = new ClustalW();\r
+ ClustalO clustal = new ClustalO();\r
clustal.setInput(AllTestSuit.test_input).setOutput(test_outfile);\r
// For local execution use relavive\r
- ConfiguredExecutable<ClustalW> confClustal = Configurator\r
+ ConfiguredExecutable<ClustalO> confClustal = Configurator\r
.configureExecutable(clustal);\r
AsyncExecutor lr = new AsyncLocalRunner();\r
lr.submitJob(confClustal);\r
LocalExecutorService.shutDown();\r
}\r
\r
- @Test(enabled = false)\r
- public void testAddParameters() {\r
- ArrayList<FastaSequence> seqs = new ArrayList<FastaSequence>();\r
- FastaSequence fs = new FastaSequence("tests1",\r
- "aqtctcatcatctcatctgcccccgggttatgagtagtacgcatctacg");\r
- FastaSequence fs2 = new FastaSequence("tests2",\r
- "aqtctcatcatctcatctgcccccgggttatgagtagtacgcatctacg");\r
- FastaSequence fs3 = new FastaSequence("tests3",\r
- "aqtctcatcatctcatctgcccccgggttatgagtagtacgcatctacg");\r
- seqs.add(fs);\r
- seqs.add(fs2);\r
- seqs.add(fs3);\r
- ClustalW cl = new ClustalW();\r
- cl.setInput("input.txt").setOutput("output.txt");\r
- ConfiguredExecutable<ClustalW> confClustal;\r
- try {\r
- confClustal = Configurator.configureExecutable(cl);\r
- Util.writeInput(seqs, confClustal);\r
-\r
- LocalRunner lr = new LocalRunner(confClustal);\r
- lr.executeJob();\r
- confClustal = (ConfiguredExecutable<ClustalW>) lr.waitForResult();\r
- assertNotNull(confClustal.getResults());\r
-\r
- assertTrue(confClustal.saveRunConfiguration());\r
- ConfiguredExecutable<ClustalW> cexec = (ConfiguredExecutable<ClustalW>) confClustal\r
- .loadRunConfiguration(new FileInputStream(new File(\r
- confClustal.getWorkDirectory(),\r
- RunConfiguration.rconfigFile)));\r
- assertNotNull(cexec);\r
-\r
- lr = new LocalRunner(cexec);\r
- lr.executeJob();\r
- confClustal = (ConfiguredExecutable<ClustalW>) lr.waitForResult();\r
- assertNotNull(confClustal.getResults());\r
-\r
- System.out.println("CE:" + cexec);\r
- } catch (JobSubmissionException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- } catch (FileNotFoundException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- } catch (JobExecutionException 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
@Test(groups = {AllTestSuit.test_group_runner})\r
public void testPersistance() {\r
try {\r
- ClustalW clustal = new ClustalW();\r
+ ClustalO clustal = new ClustalO();\r
clustal.setError("errrr.txt").setInput(AllTestSuit.test_input)\r
.setOutput("outtt.txt");\r
assertEquals(clustal.getInput(), AllTestSuit.test_input);\r
assertEquals(clustal.getError(), "errrr.txt");\r
assertEquals(clustal.getOutput(), "outtt.txt");\r
- ConfiguredExecutable<ClustalW> cClustal = Configurator\r
+ ConfiguredExecutable<ClustalO> cClustal = Configurator\r
.configureExecutable(clustal, Executable.ExecProvider.Local);\r
\r
SyncExecutor sexec = Configurator.getSyncEngine(cClustal);\r
sexec.executeJob();\r
- cClustal = (ConfiguredExecutable<ClustalW>) sexec.waitForResult();\r
+ cClustal = (ConfiguredExecutable<ClustalO>) sexec.waitForResult();\r
assertNotNull(cClustal.getResults());\r
// Save run configuration\r
assertTrue(cClustal.saveRunConfiguration());\r
RunConfiguration loadedRun = RunConfiguration\r
.load(new FileInputStream(new File(cClustal\r
.getWorkDirectory(), RunConfiguration.rconfigFile)));\r
- assertTrue(((ConfExecutable<ClustalW>) cClustal)\r
+ assertTrue(((ConfExecutable<ClustalO>) cClustal)\r
.getRunConfiguration().equals(loadedRun));\r
// Load run configuration as ConfExecutable\r
- ConfiguredExecutable<ClustalW> resurrectedCclustal = (ConfiguredExecutable<ClustalW>) cClustal\r
+ ConfiguredExecutable<ClustalO> resurrectedCclustal = (ConfiguredExecutable<ClustalO>) cClustal\r
.loadRunConfiguration(new FileInputStream(new File(cClustal\r
.getWorkDirectory(), RunConfiguration.rconfigFile)));\r
assertNotNull(resurrectedCclustal);\r
assertEquals(resurrectedCclustal.getExecutable(), clustal);\r
\r
// Finally rerun the job in the new task directory\r
- ConfiguredExecutable<ClustalW> resclustal = Configurator\r
+ ConfiguredExecutable<ClustalO> resclustal = Configurator\r
.configureExecutable(resurrectedCclustal.getExecutable(),\r
Executable.ExecProvider.Local);\r
\r
sexec = Configurator.getSyncEngine(resclustal,\r
Executable.ExecProvider.Local);\r
sexec.executeJob();\r
- cClustal = (ConfiguredExecutable<ClustalW>) sexec.waitForResult();\r
+ cClustal = (ConfiguredExecutable<ClustalO>) sexec.waitForResult();\r
assertNotNull(cClustal.getResults());\r
\r
} catch (JobSubmissionException e) {\r
@Test(groups = {AllTestSuit.test_group_runner})\r
public void readStatistics() {\r
try {\r
- ClustalW clustal = new ClustalW().setInput(AllTestSuit.test_input)\r
+ ClustalO clustal = new ClustalO().setInput(AllTestSuit.test_input)\r
.setOutput(test_outfile);\r
- ConfiguredExecutable<ClustalW> confClustal = Configurator\r
+ ConfiguredExecutable<ClustalO> confClustal = Configurator\r
.configureExecutable(clustal, Executable.ExecProvider.Local);\r
\r
AsyncExecutor sexec = Configurator.getAsyncEngine(confClustal);\r
AllTestSuit.test_group_runner})\r
public void readStatisticsClusterExecution() {\r
try {\r
- ClustalW clustal = new ClustalW().setInput(AllTestSuit.test_input)\r
+ ClustalO clustal = new ClustalO().setInput(AllTestSuit.test_input)\r
.setOutput(test_outfile);\r
- ConfiguredExecutable<ClustalW> confClustal = Configurator\r
+ ConfiguredExecutable<ClustalO> confClustal = Configurator\r
.configureExecutable(clustal,\r
Executable.ExecProvider.Cluster);\r
\r
position = ch.getNextPosition();\r
System.out.print(chunk);\r
count++;\r
+ Thread.sleep(200);\r
if (sexec.getJobStatus(jobId) == JobStatus.UNDEFINED) {\r
System.out.println("DRMAA reported wrong status for job + "\r
+ jobId + " continue anyway!");\r
} catch (IOException e) {\r
e.printStackTrace();\r
fail(e.getMessage());\r
+ } catch (InterruptedException e) {\r
+ e.printStackTrace();\r
+ fail(e.getMessage());\r
}\r
}\r
}\r