From 30c90c5fbc1d8ba48c4992c99eabffe9e44d6032 Mon Sep 17 00:00:00 2001 From: Arne Stabenau <stabenau@sanger.ac.uk> Date: Fri, 15 Nov 2002 16:47:54 +0000 Subject: [PATCH] clean up, not enough test yet --- modules/t/repeatFeature.t | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/modules/t/repeatFeature.t b/modules/t/repeatFeature.t index fc22bbb3dd..1fb01c027f 100644 --- a/modules/t/repeatFeature.t +++ b/modules/t/repeatFeature.t @@ -8,30 +8,25 @@ BEGIN { $| = 1; my $loaded = 0; END {print "not ok 1\n" unless $loaded;} -use EnsTestDB; -use Bio::EnsEMBL::DBLoader; +my $verbose = 0; +use MultiTestDB; +my $multi = MultiTestDB->new(); $loaded = 1; ok(1); -# Database will be dropped when this -# object goes out of scope -my $ens_test = EnsTestDB->new; +my $db = $multi->get_DBAdaptor( 'core' ); -$ens_test->do_sql_file("t/minidatabase.dump"); - -ok($ens_test); +$cadp = $db->get_RawContigAdaptor(); +$contig = $cadp->fetch_by_dbID(1); +my $analysis = $db->get_AnalysisAdaptor->fetch_by_logic_name("RepeatMask"); +debug( "ANALYSIS ".$analysis ); -my $db = $ens_test->get_DBSQL_Obj; -$cadp = $db->get_RawContigAdaptor(); -$contig = $cadp->fetch_by_dbID(1); -my $analysis = $db->get_AnalysisAdaptor->fetch_by_logic_name("dummy-repeatmask"); -print STDERR "ANALYSIS ".$analysis."\n"; ok($analysis); ok($contig); @@ -39,7 +34,7 @@ $repeat_f_ad = $db->get_RepeatFeatureAdaptor(); $repeat_c_ad = $db->get_RepeatConsensusAdaptor(); -print STDERR "DBID ".$analysis->dbID."\n"; +debug( "Analysis dbID ".$analysis->dbID ); my $repeat_consensus = Bio::EnsEMBL::RepeatConsensus->new(); @@ -56,7 +51,6 @@ ok(1); my $repeat_feature = Bio::EnsEMBL::RepeatFeature->new(); -$repeat_feature->contig_id($contig->dbID); $repeat_feature->start(26); $repeat_feature->end(65); $repeat_feature->strand(1); @@ -65,20 +59,29 @@ $repeat_feature->hend(45); $repeat_feature->score(100); $repeat_feature->analysis($analysis); $repeat_feature->repeat_consensus($repeat_consensus); +$repeat_feature->contig( $contig ); ok($repeat_feature); +$multi->hide( "core", "repeat_feature" ); + +$repeat_f_ad->store( $repeat_feature ); -$repeat_f_ad->store($contig->dbID, $repeat_feature); ok(1); -my @repeats = $repeat_f_ad->fetch_by_RawContig($contig); +my $repeats = $repeat_f_ad->fetch_all_by_RawContig($contig); -my $repeat = $repeats[0]; +my $repeat = $repeats->[0]; ok($repeat); ok($repeat->start == 26); ok($repeat->hend == 45); +sub debug { + my $txt = shift; + if( $verbose ) { + print STDERR $txt,"\n"; + } +} -- GitLab