Basic Testing Setup, no getResults method yet
[jabaws.git] / testsrc / compbio / runner / structure / RNAalifoldTester.java
index 6a5056a..123f4b2 100644 (file)
@@ -16,6 +16,7 @@ import java.text.ParseException;
 
 import javax.xml.bind.ValidationException;
 
+import org.apache.log4j.*;
 import org.ggf.drmaa.DrmaaException;
 import org.ggf.drmaa.JobInfo;
 import org.testng.annotations.BeforeMethod;
@@ -46,26 +47,61 @@ import compbio.metadata.LimitsManager;
 import compbio.metadata.PresetManager;
 import compbio.metadata.ResultNotAvailableException;
 import compbio.metadata.RunnerConfig;
+import compbio.runner.msa.ClustalW;
 import compbio.runner.structure.RNAalifold;
 
 public class RNAalifoldTester {
 
+       private static Logger log = Logger
+                       .getLogger(AllTestSuit.RUNNER_TEST_LOGGER);
+       
+       
        private RNAalifold rnaalifold;
        
+       static final String rnaalifoldConfigFile = AllTestSuit.TEST_DATA_PATH
+                       + "RNAalifoldParameters.xml";
        public static String test_outfile = "rnaalifold.out";
        
+       @Test(groups = { AllTestSuit.test_group_runner })
+       public void testRunLocally() {
+               RNAalifold rnaalifold = new RNAalifold();
+               rnaalifold.setInput(AllTestSuit.test_input).setOutput(test_outfile);
+               try{
+                       
+                       ConfiguredExecutable<RNAalifold> confRNAalifold = Configurator
+                                       .configureExecutable(rnaalifold, Executable.ExecProvider.Local);
+                       LocalRunner lr = new LocalRunner(confRNAalifold);
+                       lr.executeJob();
+                       confRNAalifold = (ConfiguredExecutable<RNAalifold>) lr.waitForResult();
+                       // getResults method still to come 
+                       assertNotNull(confRNAalifold.getResults()); 
+               } catch (JobSubmissionException e) {
+                       e.printStackTrace();
+                       fail(e.getLocalizedMessage());
+               } catch (JobExecutionException e) {
+                       e.printStackTrace();
+                       fail(e.getLocalizedMessage());
+               } catch (ResultNotAvailableException e) {
+                       e.printStackTrace();
+                       fail(e.getLocalizedMessage());
+               }
+       }
+       
+       
        public static void main(String[] args) throws JobSubmissionException,
                        JobExecutionException, InterruptedException {
+
                
-               System.out.println("Run RNAalifold.main()");
-               
+               log.warn("Logger test :- Run RNAalifold.main()");
+
                RNAalifold rnaalifold = new RNAalifold();
-               rnaalifold.setInput(AllTestSuit.test_input_rna).setOutput("test_outfile");
+               rnaalifold.setInput(AllTestSuit.test_input_aln).setOutput("test_outfile.txt");
                
                ConfiguredExecutable<RNAalifold> confRNAalifold = Configurator
                                        .configureExecutable(rnaalifold);
                AsyncExecutor lr = new AsyncLocalRunner();
                lr.submitJob(confRNAalifold);
+               
                Thread.sleep(3000);
                LocalExecutorService.shutDown();