Supply TEMPLATE and SUFFIX for temporary query sequence files.
[bioperl-run.git] / t / Eponine.t
blob66d3d26519087b15b3e1dee5bd404ba07beb8c7b
1 # -*-Perl-*-
2 # $Id$
3 ## Bioperl Test Harness Script for Modules
5 use strict;
6 BEGIN {
7     use Bio::Root::Test;
8     test_begin(-tests => 7);
9         use_ok('Bio::Tools::Run::Eponine');
10         use_ok('Bio::SeqIO');
13 SKIP: {
14         #Java and java version check
15         my $v;
16         if (-d "java") {
17                 diag("You must have java to run eponine");
18                 skip("Skipping because no java present to run eponine",5);
19         }
20         open(my $PIPE,"java -version 2>&1 |") || exit;
22         while (<$PIPE>) { 
23                 if (/Java\sversion\:?\s+\"?(\d+\.\d+)\"?/i) {
24                 $v = $1;
25                         last;
26                 }
27         }
28         if ($v < 1.2) {
29                 diag("You need at least version 1.2 of JDK to run eponine");
30                 skip("Skipping due to old java version",5);
31         }
32         
33         test_skip( -requires_env => 'EPONINEDIR', -tests => 5);
34         my $inputfilename= test_input_file("eponine.fa");
35         my $fact = Bio::Tools::Run::Eponine->new("threshold" => 0.999);
37         is ($fact->threshold, 0.999);
38         my @feats = $fact->run($inputfilename);
39         is ($feats[0]->start, 69);
40         is ($feats[0]->end, 69);
41         is ($feats[0]->strand, 1);
42         is ($feats[1]->start,178 );