Skip to content
Browse files

Vista.t: The 'java Vista 2>&1' command to determine if Vista

is installed gives me a different error message than the one
expected in the match (/NoClassDefFoundError/),
so adding another option (/^Error\:/). Also removed tabs.
  • Loading branch information...
1 parent 61b8f85 commit 17140313b1e2dae1203e58a78ef44a7932b7126d @fjossandon fjossandon committed Dec 11, 2013
Showing with 69 additions and 64 deletions.
  1. +69 −64 t/Vista.t
View
133 t/Vista.t
@@ -6,71 +6,76 @@ BEGIN {
use Bio::Root::Test;
test_begin(-tests => 7);
- use_ok('Bio::Tools::Run::Vista');
- use_ok('Bio::AlignIO');
+ use_ok('Bio::Tools::Run::Vista');
+ use_ok('Bio::AlignIO');
}
SKIP: {
- #Java and java version check
- my $v;
- if (-d "java") {
- skip("Skipping because no java present to run vista",5);
- }
- my $output = `java -version 2>&1`;
- open(PIPE,"java -version 2>&1 |");
-
- while (<PIPE>) {
- if (/Java\sVersion\:\s(\d+\.\d+)/) {
- $v = $1;
- last;
- }
- elsif (/java version\s.(\d+\.\d+)/) {
- $v = $1;
- last;
- }
- elsif (/java version\s\"(\d\.\d)"/) {
- $v = $1;
- last;
- }
- }
- if ($v < 1.2) {
- skip("Skipping due to old java version",5);
- }
- open (PIPE ,'java Vista 2>&1 |');
- while(<PIPE>){
- if(/NoClassDefFoundError/){
- diag('Vista.jar is not in your class path:'.$_);
- skip("Vista.jar is not in your class path",5);
- }
- }
- my $inputfilename= test_input_file("vista.cls");
- my $gff_file = test_input_file("vista.gff");
- my $aio = Bio::AlignIO->new(-file=>$inputfilename,-format=>'clustalw');
- my $aln = $aio->next_aln;
-
- my $out= test_output_file();
- my $vis = Bio::Tools::Run::Vista->new('outfile'=>$out,
- 'title' => "My Vista Plot",
- 'annotation'=>$gff_file,
- 'annotation_format'=>'GFF',
- 'min_perc_id'=>75,
- 'min_length'=>100,
- 'plotmin' => 50,
- 'tickdist' => 2000,
- 'window'=>40,
- 'numwindows'=>4,
- 'start'=>50,
- 'end'=>1500,
- 'tickdist'=>100,
- 'bases'=>1000,
- 'color'=> {'EXON'=>'45 25 54','CNS'=>'0 0 100'},
- 'quiet'=>1);
- isa_ok $vis,'Bio::Tools::Run::Vista';
- is $vis->plotmin, 50;
- is $vis->annotation, $gff_file;
-
- $vis->run($aln,1);
- ok -e $out;
- $vis->run($aln,'mouse');
- ok -e $out;
+ #Java and java version check
+ my $v;
+ if (-d "java") {
+ skip("Skipping because no java present to run vista", 5);
+ }
+
+ open(PIPE,"java -version 2>&1 |");
+ while (<PIPE>) {
+ if (/Java\sVersion\:\s(\d+\.\d+)/) {
+ $v = $1;
+ last;
+ }
+ elsif (/java version\s.(\d+\.\d+)/) {
+ $v = $1;
+ last;
+ }
+ elsif (/java version\s\"(\d\.\d)"/) {
+ $v = $1;
+ last;
+ }
+ }
+ if ($v < 1.2) {
+ skip("Skipping due to old java version", 5);
+ }
+
+ open (PIPE ,'java Vista 2>&1 |');
+ while(<PIPE>){
+ if ( /NoClassDefFoundError/
+ # For JRE 1.7.0_25 - Win7 - Spanish, the message is:
+ # "Error: no se ha encontrado o cargado la clase principal Vista"
+ or /^Error\:/
+ ){
+ diag('Vista.jar is not in your class path: '.$_);
+ skip("Vista.jar is not in your class path",5);
+ }
+ }
+ my $inputfilename= test_input_file("vista.cls");
+ my $gff_file = test_input_file("vista.gff");
+ my $aio = Bio::AlignIO->new(-file => $inputfilename,
+ -format => 'clustalw');
+ my $aln = $aio->next_aln;
+
+ my $out= test_output_file();
+ my $vis = Bio::Tools::Run::Vista->new('outfile' => $out,
+ 'title' => "My Vista Plot",
+ 'annotation' => $gff_file,
+ 'annotation_format' => 'GFF',
+ 'min_perc_id' => 75,
+ 'min_length' => 100,
+ 'plotmin' => 50,
+ 'tickdist' => 2000,
+ 'window' => 40,
+ 'numwindows' => 4,
+ 'start' => 50,
+ 'end' => 1500,
+ 'tickdist' => 100,
+ 'bases' => 1000,
+ 'color' => {'EXON'=>'45 25 54','CNS'=>'0 0 100'},
+ 'quiet' =>1);
+ isa_ok $vis,'Bio::Tools::Run::Vista';
+ is $vis->plotmin, 50;
+ is $vis->annotation, $gff_file;
+
+ $vis->run($aln,1);
+ ok -e $out;
+ $vis->run($aln,'mouse');
+ ok -e $out;
}

0 comments on commit 1714031

Please sign in to comment.
Something went wrong with that request. Please try again.