7 test_begin(-tests => 14);
9 use_ok('DBTestHarness');
11 use_ok('Bio::Annotation::Comment');
14 $biosql = DBTestHarness->new("biosql");
15 $db = $biosql->get_DBAdaptor();
18 my $seqio = Bio::SeqIO->new('-format' => 'genbank',
19 '-file' => test_input_file('parkin.gb'));
20 my $seq = $seqio->next_seq();
22 my $pseq = $db->create_persistent($seq);
23 $pseq->namespace("mytestnamespace");
26 ok $pseq->primary_key();
28 $adp = $db->get_object_adaptor("Bio::Annotation::Comment");
33 my $comment = Bio::Annotation::Comment->new();
34 $comment->text("Some text");
36 my $pcomment = $adp->create_persistent($comment);
38 $pcomment->create(-fkobjs => [$pseq]);
39 ok $pcomment->primary_key();
41 my $dbcomment = $adp->find_by_primary_key($pcomment->primary_key());
45 is ($dbcomment->text, $comment->text);
48 print STDERR $@ if $@;
51 is ($pseq->remove(), 1);
52 my $ns = Bio::DB::Persistent::BioNamespace->new(-identifiable => $pseq);
53 ok $ns = $db->get_object_adaptor($ns)->find_by_unique_key($ns);
54 ok $ns->primary_key();
55 is ($ns->remove(), 1);