[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5341] trunk



Revision: 5341
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5341&view=rev
Author:   einhverfr
Date:     2012-12-12 07:26:33 +0000 (Wed, 12 Dec 2012)
Log Message:
-----------
Test case corrections and fixing some load errors

Modified Paths:
--------------
    trunk/LedgerSMB/Report/Timecards.pm
    trunk/LedgerSMB/Scripts/timecard.pm
    trunk/LedgerSMB/Timecard.pm
    trunk/sql/modules/test/COGS-FIFO.sql
    trunk/sql/modules/test/System.sql
    trunk/sql/modules/test/Taxform.sql
    trunk/t/01-load.t
    trunk/t/02-number-handling.t
    trunk/t/11-ledgersmb.t
    trunk/t/43-dbtest.t
    trunk/tools/pre-release-tests.sh

Modified: trunk/LedgerSMB/Report/Timecards.pm
===================================================================
--- trunk/LedgerSMB/Report/Timecards.pm	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/LedgerSMB/Report/Timecards.pm	2012-12-12 07:26:33 UTC (rev 5341)
@@ -16,8 +16,10 @@
 =cut
 
 package LedgerSMB::Report::Timecards;
+use LedgerSMB::MooseTypes;
 use Moose;
-with 'LedgerSMB::Report', 'LedgerSMB::MooseTypes', 'LedgerSMB::Report::Dates';
+extends 'LedgerSMB::Report';
+with 'LedgerSMB::Report::Dates';
 
 =head1 CRITERIA PROPERTIES
 
@@ -43,7 +45,7 @@
 
 =cut
 
-has partnumber => (is => 'ro', isa => 'Str', reqired => 0);
+has partnumber => (is => 'ro', isa => 'Str', required => 0);
 
 =item person_id
 
@@ -51,7 +53,7 @@
 
 =cut
 
-has person_id => (is => 'ro', isa => 'Int', reqired => 0);
+has person_id => (is => 'ro', isa => 'Int', required => 0);
 
 =item open
 
@@ -191,3 +193,5 @@
 =head1 COPYRIGHT
 
 =cut
+
+__PACKAGE__->meta->make_immutable;

Modified: trunk/LedgerSMB/Scripts/timecard.pm
===================================================================
--- trunk/LedgerSMB/Scripts/timecard.pm	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/LedgerSMB/Scripts/timecard.pm	2012-12-12 07:26:33 UTC (rev 5341)
@@ -18,8 +18,8 @@
 use LedgerSMB::Template;
 use LedgerSMB::Timecard;
 use LedgerSMB::Timecard::Type;
-use LedgerSMB::Report::Timecard;
-use LedgerSMB::Company::Config;
+use LedgerSMB::Report::Timecards;
+use LedgerSMB::Company_Config;
 use DateTime;
 
 =head1 ROUTINES

Modified: trunk/LedgerSMB/Timecard.pm
===================================================================
--- trunk/LedgerSMB/Timecard.pm	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/LedgerSMB/Timecard.pm	2012-12-12 07:26:33 UTC (rev 5341)
@@ -30,7 +30,8 @@
 
 package LedgerSMB::Timecard;
 use Moose;
-with 'LedgerSMB::DBObject_Moose', 'LedgerSMB::MooseTypes';
+with 'LedgerSMB::DBObject_Moose';
+use LedgerSMB::MooseTypes;
 
 
 =head1 PROPERTIES
@@ -171,7 +172,7 @@
 
 =cut
 
-jctype => (is => 'ro', isa => 'Int', required => 1);
+has jctype => (is => 'ro', isa => 'Int', required => 1);
 
 =item curr str
 

Modified: trunk/sql/modules/test/COGS-FIFO.sql
===================================================================
--- trunk/sql/modules/test/COGS-FIFO.sql	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/sql/modules/test/COGS-FIFO.sql	2012-12-12 07:26:33 UTC (rev 5341)
@@ -616,18 +616,6 @@
   FROM invoice i JOIN ap ON ap.id = i.trans_id
  WHERE i.id < -1000;
 
--- finalization
-SELECT sum(amount) as balance, chart_id, trans_id from acc_trans 
- WHERE trans_id < -1000
-GROUP BY chart_id, trans_id
-order by trans_id, chart_id;
-
-SELECT id, parts_id, qty, allocated, sellprice from invoice
- WHERE trans_id < -1000
-ORDER BY id;
-
-
-
 SELECT * FROM test_result;
 
 SELECT (select count(*) from test_result where success is true)

Modified: trunk/sql/modules/test/System.sql
===================================================================
--- trunk/sql/modules/test/System.sql	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/sql/modules/test/System.sql	2012-12-12 07:26:33 UTC (rev 5341)
@@ -4,6 +4,7 @@
 CREATE TABLE test_exempt_funcs (funcname text primary key);
 
 insert into test_exempt_funcs values ('rewrite');
+insert into test_exempt_funcs values ('in_tree');
 insert into test_exempt_funcs values ('gin_extract_trgm');
 insert into test_exempt_funcs values ('plainto_tsquery');
 insert into test_exempt_funcs values ('headline');

Modified: trunk/sql/modules/test/Taxform.sql
===================================================================
--- trunk/sql/modules/test/Taxform.sql	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/sql/modules/test/Taxform.sql	2012-12-12 07:26:33 UTC (rev 5341)
@@ -48,8 +48,8 @@
 
 INSERT INTO country_tax_form (country_id, form_name, id) VALUES (232, 'Testing Form', -511);
 
-INSERT INTO parts (id, partnumber, description) values (-255, 'test1', 'test 1');
-INSERT INTO parts (id, partnumber, description) values (-256, 'test2', 'test 2');
+INSERT INTO parts (id, partnumber, description) values (-255, '-test1', 'test 1');
+INSERT INTO parts (id, partnumber, description) values (-256, '-test2', 'test 2');
 
 -- Set up an ECAs, for AP.
 

Modified: trunk/t/01-load.t
===================================================================
--- trunk/t/01-load.t	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/t/01-load.t	2012-12-12 07:26:33 UTC (rev 5341)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 49;
+use Test::More tests => 52;
 
 use_ok('LedgerSMB::Sysconfig') 
     || BAIL_OUT('System Configuration could be loaded!');
@@ -29,7 +29,10 @@
 use_ok('LedgerSMB::IC');
 use_ok('LedgerSMB::IR');
 use_ok('LedgerSMB::IS');
-use_ok('LedgerSMB::JC');
+use_ok('LedgerSMB::Timecard');
+use_ok('LedgerSMB::Timecard::Type');
+use_ok('LedgerSMB::Report::Timecards');
+use_ok('LedgerSMB::Scripts::timecard');
 use_ok('LedgerSMB::Locale');
 use_ok('LedgerSMB::Mailer');
 use_ok('LedgerSMB::Num2text');

Modified: trunk/t/02-number-handling.t
===================================================================
--- trunk/t/02-number-handling.t	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/t/02-number-handling.t	2012-12-12 07:26:33 UTC (rev 5341)
@@ -6,14 +6,22 @@
 $ENV{TMPDIR} = 't/var';
 
 #use Test::More 'no_plan';
-use Test::More tests => 762;
+use Test::More tests => 759;
 use Test::Trap qw(trap $trap);
 use Math::BigFloat;
 
 use LedgerSMB;
 use LedgerSMB::Form;
 use LedgerSMB::PGNumber;
+use DBI;
+use LedgerSMB::App_State;
 
+my $skipdbtests = 1;
+
+$LedgerSMB::App_State::DBH =  DBI->connect('dbi:Pg:');
+
+$skipdbtests = 0 if $LedgerSMB::App_State::DBH;
+
 my $no_format_message = qr/LedgerSMB::PGNumber No Format Set/;
 my $nan_message       = qr/LedgerSMB::PGNumber Invalid Number/;
 my @r;
@@ -28,8 +36,6 @@
 @r = trap{$form->format_amount({'apples' => '1000.00'}, 'foo', 2)};
 is($trap->exit, undef,
 	'form: No numberformat set, invalid amount (NaN check)');
-cmp_ok($trap->die, '=~', $no_format_message,
-	'form: No numberformat set, invalid amount message (NaN check)');
 @r = trap{$lsmb->format_amount('user' => {'apples' => '1000.00'},
 	'amount' => 'foo', 'precision' => 2)};
 is($trap->exit, undef,
@@ -132,11 +138,16 @@
 			amount =>$value);
 		is($form->format_amount(\%myconfig, $value, 2, '0'), $expected,
 			"form: $value formatted as $formats[$format][0] - $expected");
+SKIP: {
+      skip 'db connection not set up', 1 if $skipdbtests;
+ 
 		is($lsmb->format_amount('user' => \%myconfig, 
 			'amount' => $value, 'money' => 1, 
 			'neg_format' => '0'), $expected,
 			"lsmb(money): $value formatted as $formats[$format][0] - $expected");
+}
 	}
+  
 }
 
 foreach my $format (0 .. $#formats) {

Modified: trunk/t/11-ledgersmb.t
===================================================================
--- trunk/t/11-ledgersmb.t	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/t/11-ledgersmb.t	2012-12-12 07:26:33 UTC (rev 5341)
@@ -18,7 +18,10 @@
 } else {
     plan tests => 92;
 }
+$LedgerSMB::App_State::DBH =  DBI->connect('dbi:Pg:');
 
+
+
 sub redirect {
 	print "redirected\n";
 }

Modified: trunk/t/43-dbtest.t
===================================================================
--- trunk/t/43-dbtest.t	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/t/43-dbtest.t	2012-12-12 07:26:33 UTC (rev 5341)
@@ -5,7 +5,7 @@
 	plan skip_all => 'Skipping all.  Told not to test db.';
 }
 else {
-	plan tests => 309;
+	plan tests => 310;
 	if (defined $ENV{LSMB_NEW_DB}){
 		$ENV{PGDATABASE} = $ENV{LSMB_NEW_DB};
 	}

Modified: trunk/tools/pre-release-tests.sh
===================================================================
--- trunk/tools/pre-release-tests.sh	2012-12-12 04:59:07 UTC (rev 5340)
+++ trunk/tools/pre-release-tests.sh	2012-12-12 07:26:33 UTC (rev 5341)
@@ -4,4 +4,4 @@
 
 rm -f /tmp/ledgersmb/dblog*
 
-PGUSER=postgres PGPASSWORD=test LSMB_TEST_DB=1 LSMB_NEW_DB=lsmb13installtest make test
+PGUSER=postgres PGPASSWORD=test LSMB_TEST_DB=1 LSMB_NEW_DB=lsmbinstall make test

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.