3 # Copyright (C) - 2013 David Goulet <dgoulet@efficios.com>
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License, version 2 only, as published by
7 # the Free Software Foundation.
9 # This program is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14 # You should have received a copy of the GNU General Public License along with
15 # this program; if not, write to the Free Software Foundation, Inc., 51
16 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 TEST_DESC
="Java JUL support"
21 TESTDIR
=$CURDIR/..
/..
/..
24 TESTAPP_NAME
="JTestLTTng"
25 TESTAPP_BIN
="$TESTAPP_NAME.java"
26 TESTAPP_PATH
="$CURDIR/$TESTAPP_NAME"
28 EVENT_NAME
="JTestLTTng"
29 JAVA_CP
="$CURDIR:/usr/local/lib/lttng/java/liblttng-ust-jul.jar:/usr/lib/lttng/java/liblttng-ust-jul.jar"
31 TRACE_PATH
=$
(mktemp
-d)
35 source $TESTDIR/utils
/utils.sh
39 java
-cp $JAVA_CP -Djava.library.path
="/usr/local/lib:/usr/lib" $TESTAPP_NAME $NR_ITER $NR_MSEC_WAIT >/dev
/null
2>&1 &
44 while [ -n "$(pidof java)" ]; do
47 pass
"Wait for applications to end"
50 # MUST set TESTDIR before calling those functions
52 function test_jul_before_start
()
54 diag
"Test JUL application BEFORE tracing starts"
55 create_lttng_session
$SESSION_NAME $TRACE_PATH
56 enable_jul_lttng_event
$SESSION_NAME $EVENT_NAME
58 # Run 5 times with a 1 second delay
61 start_lttng_tracing
$SESSION_NAME
65 stop_lttng_tracing
$SESSION_NAME
66 destroy_lttng_session
$SESSION_NAME
69 function test_jul_after_start
()
71 diag
"Test JUL application AFTER tracing starts"
73 create_lttng_session
$SESSION_NAME $TRACE_PATH
74 enable_jul_lttng_event
$SESSION_NAME $EVENT_NAME
75 start_lttng_tracing
$SESSION_NAME
77 # Run 5 times with a 1 second delay
82 stop_lttng_tracing
$SESSION_NAME
83 destroy_lttng_session
$SESSION_NAME
88 print_test_banner
"$TEST_DESC"
90 if [ ! -f "$TESTAPP_PATH.class" ]; then
96 skip
$withapp "JUL support is needed. Skipping all tests." $NUM_TESTS ||
101 test_jul_before_start
105 for fct_test
in ${tests[@]};
110 validate_trace
$EVENT_NAME $TRACE_PATH
111 if [ $?
-eq 0 ]; then
112 # Only delete if successful
This page took 0.033015 seconds and 5 git commands to generate.