Skip to content

Commit

Permalink
Vista.t: The 'java Vista 2>&1' command to determine if Vista
Browse files Browse the repository at this point in the history
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
fjossandon committed Dec 11, 2013
1 parent 61b8f85 commit 1714031
Showing 1 changed file with 69 additions and 64 deletions.
133 changes: 69 additions & 64 deletions t/Vista.t
Expand Up @@ -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.