X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F21xml-xmi-parser.t;h=558252edc14f49f87b995abd8a0ef1a6d3fc3038;hb=11bebd6e1142d51aab716e38d66c9c122247c4bb;hp=773d8b998fba737303026506474b6e22aaec6679;hpb=215c6c52ec63d0ada504254c49fef379f18e60a7;p=dbsrgits%2FSQL-Translator.git diff --git a/t/21xml-xmi-parser.t b/t/21xml-xmi-parser.t index 773d8b9..558252e 100644 --- a/t/21xml-xmi-parser.t +++ b/t/21xml-xmi-parser.t @@ -5,22 +5,23 @@ # `make test'. After `make install' it should work as `perl test.pl' # -# basic.t -# ------- -# Tests that; +# Tests basic functionality and the default xmi2schema # use strict; -use Test::More; -use Test::Exception; - -use strict; +use FindBin qw/$Bin/; use Data::Dumper; + +# run test with -d for debug my %opt; BEGIN { map { $opt{$_}=1 if s/^-// } @ARGV; } use constant DEBUG => (exists $opt{d} ? 1 : 0); -use FindBin qw/$Bin/; +use Test::More; +use Test::Exception; +use Test::SQL::Translator qw(maybe_plan); +use SQL::Translator; +use SQL::Translator::Schema::Constants; # Usefull test subs for the schema objs #============================================================================= @@ -78,25 +79,13 @@ sub test_table { # Testing 1,2,3,.. #============================================================================= -plan tests => 103; - -use SQL::Translator; -use SQL::Translator::Schema::Constants; +maybe_plan(103, + 'SQL::Translator::Parser::XML::XMI', + 'SQL::Translator::Producer::MySQL'); my $testschema = "$Bin/data/xmi/Foo.poseidon2.xmi"; die "Can't find test schema $testschema" unless -e $testschema; -my %base_translator_args = ( - filename => $testschema, - from => 'XML-XMI', - to => 'MySQL', - debug => DEBUG, - show_warnings => 1, - add_drop_table => 1, -); -# -# Basic tests -# my $obj; $obj = SQL::Translator->new( filename => $testschema, @@ -104,12 +93,9 @@ $obj = SQL::Translator->new( to => 'MySQL', debug => DEBUG, show_warnings => 1, - add_drop_table => 1, ); my $sql = $obj->translate; print $sql if DEBUG; -#print "Debug: translator", Dumper($obj) if DEBUG; -#print "Debug: schema", Dumper($obj->schema) if DEBUG; # # Test the schema @@ -119,8 +105,6 @@ my @tblnames = map {$_->name} $scma->get_tables; is_deeply( \@tblnames, [qw/Foo PrivateFoo Recording CD Track ProtectedFoo/] ,"tables"); -# - # # Tables #