--perl use strict; use lib "lib/"; use My::Exec; use My::Platform; ## ## run_java.inc - include script to run Java ## ## Parameters ## $MTR_JAVA: Java which should be used ## $JAVA_CLASS: Class file to run ## $JAVA_CLASSPATH: Class path to use when running test ## $JAVA_JVM_OPTS: Optional parameters to the JVM ## ## ## Usage: ## ## --source suite/ndb/include/have_java.inc ## ## let JAVA_CLASSPATH=-classpath .:/some/path; ## let JAVA_JVM_OPTS=-Dsome.setting=123 -ea -Xcheck:jni; ## ## let JAVA_CLASS=test/SomeTest.class; ## --source suite/ndb/include/run_java.inc ## ## let JAVA_CLASS=test/SomeOtherTest.class; ## --source suite/ndb/include/run_java.inc ## # Check parameters my $java = $ENV{MTR_JAVA} || die "ERROR: Java not found, set MTR_JAVA"; my $java_classpath = $ENV{JAVA_CLASSPATH} || die "ERROR: Java classpath not set, please set JAVA_CLASSPATH"; my $java_class = $ENV{JAVA_CLASS} || die "ERROR: Java class to run not set, please set JAVA_CLASS"; my $java_args = $ENV{MTR_JAVA_ARGS} || ''; my $jvm_opts = $ENV{JAVA_JVM_OPTS} || ''; my $class_args = $ENV{JAVA_ARGUMENTS} || ''; my $sep = ":"; if(IS_WINDOWS) { $sep = ";"; } # The length of the variables that can be passed in environment variables are limited # (around 1024 characters) - this trick lets you plit the classpath in several variables to # be avle to pass longer classpaths for my $i (1..9) { my $env = $ENV{"JAVA_CLASSPATH_$i"} || ''; if ($env) { $java_classpath .= "$sep$env"; } my $jvm = $ENV{"JAVA_JVM_OPTS_$i"} || ''; if ($jvm) { $jvm_opts .= " $jvm"; } } if ($ENV{MTR_CLASSPATH}) { $java_classpath .= "$sep$ENV{MTR_CLASSPATH}" } my $cmd = "$java $java_args $jvm_opts -classpath \"$java_classpath\" $java_class $class_args"; my $res = exec_print_on_error($cmd); my $vardir = $ENV{MYSQLTEST_VARDIR} || die "Need MYSQLTEST_VARDIR"; my $F = IO::File->new("$vardir/tmp/run_java.result", "w") || die "Couldn't open varfile for writing"; if ($res) { print $F "# Success\n"; } else { print $F "die \'$cmd\' run failed;\n"; } $F->close(); EOF --source $MYSQLTEST_VARDIR/tmp/run_java.result
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
have_clusterj.inc | File | 3.03 KB | 0644 |
|
have_clusterj_jpa.inc | File | 1.72 KB | 0644 |
|
have_connectorj.inc | File | 1002 B | 0644 |
|
have_java.inc | File | 3.42 KB | 0644 |
|
have_junit.inc | File | 892 B | 0644 |
|
have_ndbjtie_junit.inc | File | 1.3 KB | 0644 |
|
have_openjpa.inc | File | 971 B | 0644 |
|
memory_usage.inc | File | 3.08 KB | 0644 |
|
ndb_add_node.cnf | File | 1000 B | 0644 |
|
ndb_add_node_mysqld.cnf | File | 550 B | 0644 |
|
ndb_desc_print.inc | File | 408 B | 0644 |
|
ndb_execute_count.inc | File | 190 B | 0644 |
|
ndb_info.inc | File | 3.55 KB | 0644 |
|
ndb_init_execute_count.inc | File | 212 B | 0644 |
|
ndb_init_scan_counts.inc | File | 346 B | 0644 |
|
ndb_scan_counts.inc | File | 387 B | 0644 |
|
ndb_share_check_shares.inc | File | 264 B | 0644 |
|
restart_cluster.inc | File | 1.17 KB | 0644 |
|
restart_cluster_rolling.inc | File | 1.33 KB | 0644 |
|
restart_node.inc | File | 1.46 KB | 0644 |
|
restart_random_node.inc | File | 1.04 KB | 0644 |
|
run_java.inc | File | 2.06 KB | 0644 |
|
run_ndbapitest.inc | File | 1.06 KB | 0644 |
|