Changeset 22815
- Timestamp:
- 09/09/10 10:23:54 (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mnw21/pathquery_refactor/intermine/perl/t/10_acceptance/01_live_test.t
r22676 r22815 7 7 8 8 my $url = 'localhost:8080/intermine-test/service'; 9 #my $url = 'web2:8080/new-pathquery/service'; 9 10 my @view = ('Employee.name', 'Employee.age', 'Employee.fullTime', 10 11 'Employee.address.address', 'Employee.department.name', … … 93 94 my $res; 94 95 96 $q = $module->new_query; 97 $q->add_view(@view); 98 99 #diag($q2->url, "=>\n" , $q2->results(as => 'string')); 100 95 101 lives_ok( 96 102 sub {$res = $q->results}, 97 103 "Queries for results", 98 ) or diag($q->url); ;104 ) or diag($q->url); 99 105 100 106 is(ref $res, 'ARRAY', "And it is an arrayref"); … … 102 108 is(ref $res->[0], 'ARRAY', "An array of arrays in fact"); 103 109 104 is($res->[1][3], "Chédin S", "With the right fields"); 110 is($res->[1][1], "20", "With the right fields - Int") or diag(explain $res);; 111 is($res->[1][3], "Employee Street, AVille", "With the right fields - Str") or diag(explain $res);; 112 113 $q->add_constraint( 114 path => 'Employee.age', 115 op => '<', 116 value => 35, 117 ); 105 118 106 119 lives_ok( … … 109 122 ); 110 123 111 is($res->[1]->{'Employee.address.address'}, "Chédin S", "with the right fields"); 124 is(@$res, 3, "Gets the right number of records"); 125 is($res->[1]->{'Employee.age'}, "20", "with the right fields - Int"); 126 is($res->[1]->{'Employee.address.address'}, "Employee Street, AVille", "with the right fields - Str"); 112 127 113 128 my $t; … … 122 137 123 138 lives_ok( 124 sub {$res = $t->results_with(valueA => 'foo');},139 sub {$res = $t->results_with(valueA => 10);}, 125 140 "Runs results with ok", 126 ) ;141 ) or diag($t->url); 127 142 128 is($res->[1][3], "Chédin S", "With the right fields"); 143 is($res->[1][3], "Chédin S", "With the right fields") 144 or diag($t->url, explain $res), diag $t->show_constraints; 129 145 130 is($t->results->[1][3], "Chédin S", "And ditto for results");146 #is($t->results->[1][3], "Chédin S", "And ditto for results") or diag($t->url, explain $res);
Note: See TracChangeset
for help on using the changeset viewer.
