[svn:dbd-oracle] r14815 - in dbd-oracle/branches/TAF: . t

[email protected] Mon, 4 Apr 2011 10:35:41 -0700 (PDT)
Newsgroups perl.dbd.oracle.changes
Message-ID <[email protected]>
Author: byterock
Date: Mon Apr  4 10:35:40 2011
New Revision: 14815

Added:
   dbd-oracle/branches/TAF/t/38taf.t
Modified:
   dbd-oracle/branches/TAF/MANIFEST

Log:
new test for taf

Modified: dbd-oracle/branches/TAF/MANIFEST
==============================================================================
--- dbd-oracle/branches/TAF/MANIFEST	(original)
+++ dbd-oracle/branches/TAF/MANIFEST	Mon Apr  4 10:35:40 2011
@@ -87,6 +87,8 @@
 t/31lob_extended.t
 t/32xmltype.t
 t/34pres_lobs.t
+t/36lob_leak.t
+t/38taf.t
 t/40ph_type.t
 t/50cursor.t
 t/51scroll.t

Added: dbd-oracle/branches/TAF/t/38taf.t
==============================================================================
--- (empty file)
+++ dbd-oracle/branches/TAF/t/38taf.t	Mon Apr  4 10:35:40 2011
@@ -0,0 +1,48 @@
+#!perl -w
+
+use DBI;
+use DBD::Oracle(qw(:ora_fail_over));
+use strict;
+use Data::Dumper;
+
+use Test::More;
+unshift @INC ,'t';
+require 'nchar_test_lib.pl';
+
+$| = 1;
+
+
+# create a database handle
+my $dsn = oracle_test_dsn();
+my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '',)};
+if ($dbh) {
+    if ($dbh->ora_can_taf()){
+      plan tests => 1;  
+    }
+    else {
+       plan tests =>1;      
+    }
+} else {
+    plan skip_all => "Unable to connect to Oracle";
+}
+
+$dbh->disconnect;
+
+if (!$dbh->ora_can_taf()){
+    
+  eval {$dbh = DBI->connect($dsn, $dbuser, '',{ora_taf=>1,taf_sleep=>15,ora_taf_function=>'taf'})};   
+  ok($@    =~ /You are attempting to enable TAF/, "'$@' expected! ");      
+  
+    
+}
+else {
+   ok($dbh = DBI->connect($dsn, $dbuser, '',{ora_taf=>1,taf_sleep=>15,ora_taf_function=>'taf'}),"Well this is all I can test!");         
+    
+}
+
+$dbh->disconnect;
+#not much I can do with taf as I cannot really shut down somones server pephaps later
+
+1;