10 # Look for Cluster/J library, if not found: skip test.
16 my $vardir = $ENV{MYSQLTEST_VARDIR} or die
"Need MYSQLTEST_VARDIR";
17 my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die
"Need MYSQL_TEST_DIR";
18 my $basedir = dirname($mysql_test_dir);
21 # Check if the needed jars and libs are available
24 my $clusterj_jar = my_find_file($basedir,
25 [
"storage/ndb/clusterj",
26 "share/mysql/java", # install unix
27 "lib/java"], # install windows
28 "clusterj-*.jar", NOT_REQUIRED);
30 my $clusterj_test_jar = my_find_file($basedir,
31 [
"storage/ndb/clusterj/clusterj-test",
32 "share/mysql/java", # install unix
33 "lib/java"], # install windows
34 "clusterj-test-*.jar", NOT_REQUIRED);
36 my $ndbclient_lib = my_find_file($basedir,
37 [
"storage/ndb/src/.libs",
41 [
"ndbclient.dll",
"libndbclient.so",
"libndbclient.dylib"],
44 my $F = IO::File->new(
"$vardir/tmp/have_clusterj_result.inc",
'w') or die;
46 print $F
"--let \$CLUSTERJ_JAR= $clusterj_jar\n";
47 print $F
"--echo Found clusterj.jar: '\$CLUSTERJ_JAR'\n"
49 print $F
"skip Could not find clusterj jar file\n";
52 if ($clusterj_test_jar) {
53 print $F
"--let \$CLUSTERJ_TEST_JAR= $clusterj_test_jar\n";
54 print $F
"--echo Found clusterj_test jar: '\$CLUSTERJ_TEST_JAR'\n"
56 print $F
"skip Could not find clusterj test jar file\n";
60 my $ndbclient_lib_dir = dirname($ndbclient_lib);
61 print $F
"--let \$NDBCLIENT_LIB_DIR= $ndbclient_lib_dir\n";
63 print $F
"skip Did not find libndbclient\n";
74 print $F
"com.mysql.clusterj.$prop=$val\n";
77 sub write_properties {
80 my $F = IO::File->new(
"$vardir/tmp/clusterj.properties",
'w') or die;
81 add($F,
'connectstring', $ENV{
'NDB_CONNECTSTRING'});
82 add($F,
'connect.retries',
'4');
83 add($F,
'connect.delay',
'5');
84 add($F,
'connect.verbose',
'1');
85 add($F,
'connect.timeout.before',
'30');
86 add($F,
'connect.timeout.after',
'20');
87 add($F,
'jdbc.url',
"jdbc:mysql://localhost:$ENV{MASTER_MYPORT}/$db");
88 add($F,
'jdbc.driver',
'com.mysql.jdbc.Driver');
89 add($F,
'jdbc.username', $user);
90 add($F,
'jdbc.password',
'');
91 add($F,
'username',
'');
92 add($F,
'password',
'');
93 add($F,
'database', $db);
94 add($F,
'max.transactions',
'1024');
100 --source $MYSQLTEST_VARDIR/tmp/have_clusterj_result.inc