rhmessaging commits: r3484 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-10 11:18:41 -0400 (Fri, 10 Jul 2009)
New Revision: 3484
Modified:
store/trunk/cpp/tests/Makefile.am
Log:
Enabled directory recursion for long tests; commented-out section accidentally left in from testing
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-07-10 14:33:54 UTC (rev 3483)
+++ store/trunk/cpp/tests/Makefile.am 2009-07-10 15:18:41 UTC (rev 3484)
@@ -90,7 +90,7 @@
# Note: Auto-recursion is not supported for custom targets, so add a ${MAKE} -C for each dir in the SUBDIRS list above.
check-long:
-# $(MAKE) -C jrnl check-long
-# $(MAKE) -C cluster check-long
+ $(MAKE) -C jrnl check-long
+ $(MAKE) -C cluster check-long
$(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
\ No newline at end of file
16 years, 9 months
rhmessaging commits: r3483 - in store/trunk/cpp: tests/jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-10 10:33:54 -0400 (Fri, 10 Jul 2009)
New Revision: 3483
Removed:
store/trunk/cpp/tests/jrnl/_st_long_basic
store/trunk/cpp/tests/jrnl/_st_long_read
Modified:
store/trunk/cpp/rhel4-support/rhel4.patch
store/trunk/cpp/tests/jrnl/
Log:
Removed two built files that were added in error, also fixed incorrect RHEL4 patch
Modified: store/trunk/cpp/rhel4-support/rhel4.patch
===================================================================
--- store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-10 14:14:49 UTC (rev 3482)
+++ store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-10 14:33:54 UTC (rev 3483)
@@ -2,7 +2,7 @@
===================================================================
--- tests/.valgrind.supp (revision 3413)
+++ tests/.valgrind.supp (working copy)
-@@ -1,32 +1,88 @@
+@@ -1,32 +1,74 @@
{
- Benign error in libcpg.
- Memcheck:Param
Property changes on: store/trunk/cpp/tests/jrnl
___________________________________________________________________
Name: svn:ignore
- .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_long_lpmgr
_ut_lpmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
_st_auto_expand
.valgrind.supp
.valgrindrc
+ .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_long_lpmgr
_ut_lpmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_long_basic
_st_long_read
_st_read
_st_read_txn
_st_auto_expand
.valgrind.supp
.valgrindrc
Deleted: store/trunk/cpp/tests/jrnl/_st_long_basic
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_long_basic 2009-07-10 14:14:49 UTC (rev 3482)
+++ store/trunk/cpp/tests/jrnl/_st_long_basic 2009-07-10 14:33:54 UTC (rev 3483)
@@ -1,131 +0,0 @@
-#! /bin/sh
-
-# _st_long_basic - temporary wrapper script for .libs/_st_long_basic
-# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)
-#
-# The _st_long_basic program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='/bin/sed -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command="(cd /home/kpvdr/mrg/store/tests/jrnl; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/kpvdr/bin\"; export PATH; g++ -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -pthread -DBOOST_TEST_DYN_LINK -g -O2 -o \$progdir/\$file _st_long_bas!
ic-_st_basic.o _st_long_basic-unit_test.o -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync -lboost_unit_test_framework ../../lib/.libs/msgstore.so -ldb_cxx-4.7 /home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidbroker.so /home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidcommon.so -lboost_program_options -lboost_filesystem -luuid -ldl -lsasl2 -lrt -laio -Wl,--rpath -Wl,/home/kpvdr/mrg/store/lib/.libs -Wl,--rpath -Wl,/home/kpvdr/mrg/qpid/cpp/src/.libs -Wl,--rpath -Wl,/usr/local/lib/qpid/daemon -Wl,--rpath -Wl,/usr/local/lib ) "
-
-# This environment variable determines our operation mode.
-if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
- # install mode needs the following variable:
- notinst_deplibs=' ../../lib/msgstore.la /home/kpvdr/mrg/qpid/cpp/src/libqpidbroker.la /home/kpvdr/mrg/qpid/cpp/src/libqpidcommon.la'
-else
- # When we are sourced in execute mode, $file and $echo are already set.
- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
- echo="echo"
- file="$0"
- # Make sure echo works.
- if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
- elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
- # Yippee, $echo works!
- :
- else
- # Restart under the correct shell, and then maybe $echo will work.
- exec /bin/sh "$0" --no-reexec ${1+"$@"}
- fi
- fi
-
- # Find the directory that this script lives in.
- thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "x$thisdir" = "x$file" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
- while test -n "$file"; do
- destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-
- # If there was a directory component, then change thisdir.
- if test "x$destdir" != "x$file"; then
- case "$destdir" in
- [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
- *) thisdir="$thisdir/$destdir" ;;
- esac
- fi
-
- file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
- done
-
- # Try to get the absolute directory name.
- absdir=`cd "$thisdir" && pwd`
- test -n "$absdir" && thisdir="$absdir"
-
- program=lt-'_st_long_basic'
- progdir="$thisdir/.libs"
-
- if test ! -f "$progdir/$program" || \
- { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
- test "X$file" != "X$progdir/$program"; }; then
-
- file="$$-$program"
-
- if test ! -d "$progdir"; then
- mkdir "$progdir"
- else
- rm -f "$progdir/$file"
- fi
-
- # relink executable if necessary
- if test -n "$relink_command"; then
- if relink_command_output=`eval $relink_command 2>&1`; then :
- else
- echo "$relink_command_output" >&2
- rm -f "$progdir/$file"
- exit 1
- fi
- fi
-
- mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
- { rm -f "$progdir/$program";
- mv -f "$progdir/$file" "$progdir/$program"; }
- rm -f "$progdir/$file"
- fi
-
- if test -f "$progdir/$program"; then
- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
- # Run the actual program with our arguments.
-
- exec "$progdir/$program" ${1+"$@"}
-
- $echo "$0: cannot exec $program $*"
- exit 1
- fi
- else
- # The program doesn't exist.
- $echo "$0: error: \`$progdir/$program' does not exist" 1>&2
- $echo "This script is just a wrapper for $program." 1>&2
- echo "See the libtool documentation for more information." 1>&2
- exit 1
- fi
-fi
Deleted: store/trunk/cpp/tests/jrnl/_st_long_read
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_long_read 2009-07-10 14:14:49 UTC (rev 3482)
+++ store/trunk/cpp/tests/jrnl/_st_long_read 2009-07-10 14:33:54 UTC (rev 3483)
@@ -1,131 +0,0 @@
-#! /bin/sh
-
-# _st_long_read - temporary wrapper script for .libs/_st_long_read
-# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)
-#
-# The _st_long_read program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='/bin/sed -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command="(cd /home/kpvdr/mrg/store/tests/jrnl; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/kpvdr/bin\"; export PATH; g++ -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -pthread -DBOOST_TEST_DYN_LINK -g -O2 -o \$progdir/\$file _st_long_rea!
d-_st_read.o _st_long_read-unit_test.o -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync -lboost_unit_test_framework ../../lib/.libs/msgstore.so -ldb_cxx-4.7 /home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidbroker.so /home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidcommon.so -lboost_program_options -lboost_filesystem -luuid -ldl -lsasl2 -lrt -laio -Wl,--rpath -Wl,/home/kpvdr/mrg/store/lib/.libs -Wl,--rpath -Wl,/home/kpvdr/mrg/qpid/cpp/src/.libs -Wl,--rpath -Wl,/usr/local/lib/qpid/daemon -Wl,--rpath -Wl,/usr/local/lib ) "
-
-# This environment variable determines our operation mode.
-if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
- # install mode needs the following variable:
- notinst_deplibs=' ../../lib/msgstore.la /home/kpvdr/mrg/qpid/cpp/src/libqpidbroker.la /home/kpvdr/mrg/qpid/cpp/src/libqpidcommon.la'
-else
- # When we are sourced in execute mode, $file and $echo are already set.
- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
- echo="echo"
- file="$0"
- # Make sure echo works.
- if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
- elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
- # Yippee, $echo works!
- :
- else
- # Restart under the correct shell, and then maybe $echo will work.
- exec /bin/sh "$0" --no-reexec ${1+"$@"}
- fi
- fi
-
- # Find the directory that this script lives in.
- thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "x$thisdir" = "x$file" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
- while test -n "$file"; do
- destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-
- # If there was a directory component, then change thisdir.
- if test "x$destdir" != "x$file"; then
- case "$destdir" in
- [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
- *) thisdir="$thisdir/$destdir" ;;
- esac
- fi
-
- file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
- done
-
- # Try to get the absolute directory name.
- absdir=`cd "$thisdir" && pwd`
- test -n "$absdir" && thisdir="$absdir"
-
- program=lt-'_st_long_read'
- progdir="$thisdir/.libs"
-
- if test ! -f "$progdir/$program" || \
- { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
- test "X$file" != "X$progdir/$program"; }; then
-
- file="$$-$program"
-
- if test ! -d "$progdir"; then
- mkdir "$progdir"
- else
- rm -f "$progdir/$file"
- fi
-
- # relink executable if necessary
- if test -n "$relink_command"; then
- if relink_command_output=`eval $relink_command 2>&1`; then :
- else
- echo "$relink_command_output" >&2
- rm -f "$progdir/$file"
- exit 1
- fi
- fi
-
- mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
- { rm -f "$progdir/$program";
- mv -f "$progdir/$file" "$progdir/$program"; }
- rm -f "$progdir/$file"
- fi
-
- if test -f "$progdir/$program"; then
- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
- # Run the actual program with our arguments.
-
- exec "$progdir/$program" ${1+"$@"}
-
- $echo "$0: cannot exec $program $*"
- exit 1
- fi
- else
- # The program doesn't exist.
- $echo "$0: error: \`$progdir/$program' does not exist" 1>&2
- $echo "This script is just a wrapper for $program." 1>&2
- echo "See the libtool documentation for more information." 1>&2
- exit 1
- fi
-fi
16 years, 9 months
rhmessaging commits: r3482 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-10 10:14:49 -0400 (Fri, 10 Jul 2009)
New Revision: 3482
Modified:
store/trunk/cpp/tests/Makefile.am
Log:
Minor correction from last checkin - missing clean script for long tests
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
+++ store/trunk/cpp/tests/Makefile.am 2009-07-10 14:14:49 UTC (rev 3482)
@@ -40,7 +40,8 @@
clean.sh
LONG_TESTS = \
- run_long_python_tests
+ run_long_python_tests \
+ clean.sh
check_PROGRAMS = \
SimpleTest \
16 years, 9 months
rhmessaging commits: r3481 - in store/trunk/cpp: rhel4-support and 5 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-10 10:13:30 -0400 (Fri, 10 Jul 2009)
New Revision: 3481
Added:
store/trunk/cpp/tests/cluster/run_long_cluster_tests
store/trunk/cpp/tests/jrnl/_st_long_basic
store/trunk/cpp/tests/jrnl/_st_long_read
store/trunk/cpp/tests/run_long_python_tests
Modified:
store/trunk/cpp/Makefile.am
store/trunk/cpp/rhel4-support/rhel4.patch
store/trunk/cpp/tests/Makefile.am
store/trunk/cpp/tests/cluster/Makefile.am
store/trunk/cpp/tests/cluster/run_cluster_tests
store/trunk/cpp/tests/jrnl/
store/trunk/cpp/tests/jrnl/Makefile.am
store/trunk/cpp/tests/jrnl/_st_basic.cpp
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/_st_read.cpp
store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
store/trunk/cpp/tests/jrnl/jtt/
store/trunk/cpp/tests/jrnl/jtt/Makefile.am
store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp
store/trunk/cpp/tests/jrnl/run-journal-tests
store/trunk/cpp/tests/python_tests/flow_to_disk.py
store/trunk/cpp/tests/run_python_tests
store/trunk/cpp/tests/system_test.sh
Log:
Split tests into long and short tests. (Python tests till need splitting.) "make check" builds short tests, "make check-long" builds long tests. Both should be run for complete testing, as some crucial tests fall into the long category.
Modified: store/trunk/cpp/Makefile.am
===================================================================
--- store/trunk/cpp/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -55,3 +55,6 @@
else
@echo "WARNING: rpmlint not found, could not validate RPMs."
endif
+
+check-long:
+ $(MAKE) -C tests check-long
\ No newline at end of file
Modified: store/trunk/cpp/rhel4-support/rhel4.patch
===================================================================
--- store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-10 14:13:30 UTC (rev 3481)
@@ -91,24 +91,10 @@
+ fun:calloc
+ fun:_dl_allocate_tls
+ fun:pthread_create@@GLIBC_2.2.5
-+ fun:_ZN3mrg3jtt13jrnl_instance6run_tcEv
-+ fun:_Z13constructor_1v
-+ fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor8functionEv
+}
+{
+ <insert a suppression name here>
+ Memcheck:Leak
-+ fun:calloc
-+ fun:_dl_allocate_tls
-+ fun:pthread_create@@GLIBC_2.2.5
-+ fun:_ZN4qpid3sys13ThreadPrivateC1EPNS0_8RunnableE
-+ fun:_ZN4qpid3sys6ThreadC1EPNS0_8RunnableE
-+ fun:_ZN4qpid6broker5Timer5startEv
-+ fun:_ZN4qpid6broker5TimerC1Ev
-+}
-+{
-+ <insert a suppression name here>
-+ Memcheck:Leak
+ fun:_Znwm
+ fun:_ZN5boost9unit_test9test_caseC2ENS0_13basic_cstringIKcEEbmb
+}
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -39,6 +39,9 @@
system_test.sh \
clean.sh
+LONG_TESTS = \
+ run_long_python_tests
+
check_PROGRAMS = \
SimpleTest \
OrderingTest \
@@ -83,3 +86,10 @@
STORE_LIB=$(abs_builddir)/../lib/.libs/msgstore.so \
TMP_DATA_DIR=$(TMP_DATA_DIR) \
$(srcdir)/run_test
+
+# Note: Auto-recursion is not supported for custom targets, so add a ${MAKE} -C for each dir in the SUBDIRS list above.
+check-long:
+# $(MAKE) -C jrnl check-long
+# $(MAKE) -C cluster check-long
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
+
\ No newline at end of file
Modified: store/trunk/cpp/tests/cluster/Makefile.am
===================================================================
--- store/trunk/cpp/tests/cluster/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/cluster/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -42,6 +42,8 @@
TESTS = run_cluster_tests
+LONG_TESTS = run_long_cluster_tests
+
TESTS_ENVIRONMENT = \
BOOST_TEST_SHOW_PROGRESS=yes \
STORE_ENABLE=1 \
@@ -54,4 +56,7 @@
EXTRA_DIST = \
run_cluster_tests
+check-long:
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
+
endif
\ No newline at end of file
Modified: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -23,6 +23,11 @@
srcdir=`dirname $0`
+if test $1 == "LONG_TEST"; then
+ echo "Running long tests..."
+ LONG_TEST=1
+fi
+
# Check AIS requirements and run tests if found.
id -nG | grep '\<ais\>' >/dev/null || \
NOGROUP="You are not a member of the ais group."
@@ -47,11 +52,10 @@
fi
# QPID_DIR is defined for source tree builds because of the --with-qpid-checkout config parameter
-CPP_CLUSTER_EXEC=cluster_test
-PYTHON_CLUSTER_EXEC=cluster.py
if test "${QPID_DIR}" -a -d ${QPID_DIR} ; then
# Source tree path
CLUSTER_DIR=${QPID_DIR}/cpp/src/tests
+ CPP_CLUSTER_EXEC=cluster_test
export PYTHONPATH=${QPID_DIR}/python:${abs_srcdir}
export QPIDD_EXEC=${QPID_DIR}/cpp/src/qpidd
export CLUSTER_LIB=${QPID_DIR}/cpp/src/.libs/cluster.so
@@ -72,12 +76,12 @@
export STORE_LIB=${abs_srcdir}/../../lib/.libs/msgstore.so
# Run the C++ cluster tests
-pwd=`pwd`
-cd ${CLUSTER_DIR}
-sg ais -c "./${CPP_CLUSTER_EXEC}"
-RETCODE=$?
-if test x${RETCODE} != x0; then
- exit 1;
+if test ! ${LONG_TEST}; then
+ sg ais -c "${CLUSTER_DIR}/${CPP_CLUSTER_EXEC}"
+ RETCODE=$?
+ if test x${RETCODE} != x0; then
+ exit 1;
+ fi
fi
# --- Check for Python, then run python cluster tests ---
@@ -110,7 +114,13 @@
fi
export TMP_DATA_DIR
-sg ais -c "./${PYTHON_CLUSTER_EXEC} -v"
+if test ${LONG_TEST}; then
+ PYTHON_CLUSTER_EXEC=long_cluster_tests.py
+else
+ PYTHON_CLUSTER_EXEC=cluster_tests.py
+fi
+
+sg ais -c "${CLUSTER_DIR}/${PYTHON_CLUSTER_EXEC} -v"
RETCODE=$?
if test x${RETCODE} != x0; then
exit 1;
Added: store/trunk/cpp/tests/cluster/run_long_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_long_cluster_tests (rev 0)
+++ store/trunk/cpp/tests/cluster/run_long_cluster_tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Copyright (c) 2008, 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+./run_cluster_tests LONG_TEST
Property changes on: store/trunk/cpp/tests/cluster/run_long_cluster_tests
___________________________________________________________________
Name: svn:executable
+ *
Property changes on: store/trunk/cpp/tests/jrnl
___________________________________________________________________
Name: svn:ignore
- .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_lpmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
_st_auto_expand
.valgrind.supp
.valgrindrc
+ .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_long_lpmgr
_ut_lpmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
_st_auto_expand
.valgrind.supp
.valgrindrc
Modified: store/trunk/cpp/tests/jrnl/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -56,7 +56,12 @@
_st_basic_txn \
_st_read \
_st_read_txn \
- _st_auto_expand \
+ _st_auto_expand
+
+LONG_TESTS = \
+ _ut_long_lpmgr \
+ _st_long_basic \
+ _st_long_read \
run-journal-tests
check_PROGRAMS = \
@@ -70,14 +75,17 @@
_ut_enq_map \
_ut_txn_map \
_ut_lpmgr \
+ _ut_long_lpmgr \
_st_basic \
_st_basic_txn \
+ _st_long_basic \
+ _st_long_read \
_st_read \
_st_read_txn \
_st_auto_expand
UNIT_TEST_SRCS = ../unit_test.cpp
-UNIT_TEST_LDADD = -lboost_unit_test_framework ${top_builddir}/lib/msgstore.la
+UNIT_TEST_LDADD = -lboost_unit_test_framework $(top_builddir)/lib/msgstore.la
_ut_time_ns_SOURCES = _ut_time_ns.cpp $(UNIT_TEST_SRCS)
_ut_time_ns_LDADD = $(UNIT_TEST_LDADD)
@@ -109,15 +117,27 @@
_ut_lpmgr_SOURCES = _ut_lpmgr.cpp $(UNIT_TEST_SRCS)
_ut_lpmgr_LDADD = $(UNIT_TEST_LDADD) -lrt
+_ut_long_lpmgr_SOURCES = _ut_lpmgr.cpp $(UNIT_TEST_SRCS)
+_ut_long_lpmgr_CPPFLAGS = $(AM_CXXFLAGS) -DLONG_TEST
+_ut_long_lpmgr_LDADD = $(UNIT_TEST_LDADD) -lrt
+
_st_basic_SOURCES = _st_basic.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
_st_basic_LDADD = $(UNIT_TEST_LDADD) -lrt
+_st_long_basic_SOURCES = _st_basic.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
+_st_long_basic_CPPFLAGS = $(AM_CXXFLAGS) -DLONG_TEST
+_st_long_basic_LDADD = $(UNIT_TEST_LDADD) -lrt
+
_st_basic_txn_SOURCES = _st_basic_txn.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
_st_basic_txn_LDADD = $(UNIT_TEST_LDADD) -lrt
_st_read_SOURCES = _st_read.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
_st_read_LDADD = $(UNIT_TEST_LDADD) -lrt
+_st_long_read_SOURCES = _st_read.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
+_st_long_read_CPPFLAGS = $(AM_CXXFLAGS) -DLONG_TEST
+_st_long_read_LDADD = $(UNIT_TEST_LDADD) -lrt
+
_st_read_txn_SOURCES = _st_read_txn.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
_st_read_txn_LDADD = $(UNIT_TEST_LDADD) -lrt
@@ -127,3 +147,8 @@
EXTRA_DIST = \
run-journal-tests \
tests.ods
+
+# Note: Auto-recursion is not supported for custom targets, so add a $(MAKE) -C for each dir in the SUBDIRS list above.
+check-long:
+ $(MAKE) -C jtt check-long
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
Modified: store/trunk/cpp/tests/jrnl/_st_basic.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_basic.cpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/_st_basic.cpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -38,6 +38,16 @@
// === Test suite ===
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
QPID_AUTO_TEST_CASE(instantiation)
{
string test_name = get_test_name(test_filename, "instantiation");
@@ -350,6 +360,37 @@
cout << "ok" << endl;
}
+QPID_AUTO_TEST_CASE(double_dequeue)
+{
+ string test_name = get_test_name(test_filename, "double_dequeue");
+ try
+ {
+ string msg;
+
+ test_jrnl jc(test_name, test_dir, test_name);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ enq_msg(jc, 0, create_msg(msg, 0, MSG_SIZE), false);
+ deq_msg(jc, 0, 1);
+ try{ deq_msg(jc, 0, 2); BOOST_ERROR("Did not throw exception on second dequeue."); }
+ catch (const jexception& e){ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_WMGR_DEQRIDNOTENQ); }
+ enq_msg(jc, 2, create_msg(msg, 1, MSG_SIZE), false);
+ deq_msg(jc, 2, 3);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
QPID_AUTO_TEST_CASE(journal_overflow)
{
string test_name = get_test_name(test_filename, "journal_overflow");
@@ -494,24 +535,6 @@
cout << "ok" << endl;
}
-QPID_AUTO_TEST_CASE(double_dequeue)
-{
- string test_name = get_test_name(test_filename, "double_dequeue");
- try
- {
- string msg;
+#endif
- test_jrnl jc(test_name, test_dir, test_name);
- jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
- enq_msg(jc, 0, create_msg(msg, 0, MSG_SIZE), false);
- deq_msg(jc, 0, 1);
- try{ deq_msg(jc, 0, 2); BOOST_ERROR("Did not throw exception on second dequeue."); }
- catch (const jexception& e){ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_WMGR_DEQRIDNOTENQ); }
- enq_msg(jc, 2, create_msg(msg, 1, MSG_SIZE), false);
- deq_msg(jc, 2, 3);
- }
- catch(const exception& e) { BOOST_FAIL(e.what()); }
- cout << "ok" << endl;
-}
-
QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -534,8 +534,8 @@
}
bool
-handle_jcntl_response(const iores res, jcntl& jc, unsigned& aio_sleep_cnt, const std::string& ctxt,
- const iores exp_ret, test_dtok* dtp)
+handle_jcntl_response(const iores res, jcntl& jc, unsigned& aio_sleep_cnt, const std::string& ctxt, const iores exp_ret,
+ test_dtok* dtp)
{
if (res == RHM_IORES_PAGE_AIOWAIT)
{
@@ -553,8 +553,7 @@
}
u_int64_t
-enq_msg(jcntl& jc, const u_int64_t rid, const string& msg, const bool transient,
- const iores exp_ret = RHM_IORES_SUCCESS)
+enq_msg(jcntl& jc, const u_int64_t rid, const string& msg, const bool transient, const iores exp_ret = RHM_IORES_SUCCESS)
{
ostringstream ctxt;
ctxt << "enq_msg(" << rid << ")";
@@ -595,8 +594,8 @@
}
u_int64_t
-enq_txn_msg(jcntl& jc, const u_int64_t rid, const string& msg, const string& xid,
- const bool transient, const iores exp_ret = RHM_IORES_SUCCESS)
+enq_txn_msg(jcntl& jc, const u_int64_t rid, const string& msg, const string& xid, const bool transient,
+ const iores exp_ret = RHM_IORES_SUCCESS)
{
ostringstream ctxt;
ctxt << "enq_txn_msg(" << rid << ")";
@@ -617,8 +616,8 @@
}
u_int64_t
-enq_extern_txn_msg(jcntl& jc, const u_int64_t rid, const std::size_t msg_size, const string& xid,
- const bool transient, const iores exp_ret = RHM_IORES_SUCCESS)
+enq_extern_txn_msg(jcntl& jc, const u_int64_t rid, const std::size_t msg_size, const string& xid, const bool transient,
+ const iores exp_ret = RHM_IORES_SUCCESS)
{
ostringstream ctxt;
ctxt << "enq_extern_txn_msg(" << rid << ")";
@@ -661,7 +660,7 @@
u_int64_t
deq_txn_msg(jcntl& jc, const u_int64_t drid, const u_int64_t rid, const string& xid,
- const iores exp_ret = RHM_IORES_SUCCESS)
+ const iores exp_ret = RHM_IORES_SUCCESS)
{
ostringstream ctxt;
ctxt << "deq_txn_msg(" << drid << ")";
@@ -719,8 +718,7 @@
}
void
-read_msg(jcntl& jc, string& msg, string& xid, bool& transient, bool& external,
- const iores exp_ret = RHM_IORES_SUCCESS)
+read_msg(jcntl& jc, string& msg, string& xid, bool& transient, bool& external, const iores exp_ret = RHM_IORES_SUCCESS)
{
void* mp = 0;
std::size_t msize = 0;
@@ -755,9 +753,14 @@
delete dtp;
}
+/*
+ * Returns the number of messages of size msg_rec_size_dblks that will fit into an empty journal with or without
+ * corresponding dequeues (controlled by include_deq) without a threshold - ie until the journal is full. Assumes
+ * that dequeue records fit into one dblk.
+ */
u_int32_t
-num_msgs_to_full(const u_int16_t num_files, const u_int32_t file_size_dblks,
- const u_int32_t msg_rec_size_dblks, bool include_deq)
+num_msgs_to_full(const u_int16_t num_files, const u_int32_t file_size_dblks, const u_int32_t msg_rec_size_dblks,
+ bool include_deq)
{
u_int32_t rec_size_dblks = msg_rec_size_dblks;
if (include_deq)
@@ -765,18 +768,30 @@
return u_int32_t(::floor(1.0 * num_files * file_size_dblks / rec_size_dblks));
}
+/*
+ * Returns the number of messages of size msg_rec_size_dblks that will fit into an empty journal before the enqueue
+ * threshold of JRNL_ENQ_THRESHOLD (%).
+ */
u_int32_t
-num_msgs_to_threshold(const u_int16_t num_files, const u_int32_t file_size_dblks,
- const u_int32_t msg_rec_size_dblks)
+num_msgs_to_threshold(const u_int16_t num_files, const u_int32_t file_size_dblks, const u_int32_t msg_rec_size_dblks)
{
- return u_int32_t(::floor(1.0 * num_files * file_size_dblks * JRNL_ENQ_THRESHOLD /
- msg_rec_size_dblks / 100));
+ return u_int32_t(::floor(1.0 * num_files * file_size_dblks * JRNL_ENQ_THRESHOLD / msg_rec_size_dblks / 100));
}
+/*
+ * Returns the amount of space reserved in dblks (== num dequeues assuming dequeue size of 1 dblk) for the enqueue
+ * threshold of JRNL_ENQ_THRESHOLD (%).
+ */
u_int32_t
-num_dequeues_rem(const u_int16_t num_files, const u_int32_t file_size_sblks)
+num_dequeues_rem(const u_int16_t num_files, const u_int32_t file_size_dblks)
{
- return u_int32_t(::ceil(num_files * file_size_sblks * (1 - (1.0 * JRNL_ENQ_THRESHOLD / 100))));
+ /*
+ * Fraction of journal remaining after threshold is used --------------+
+ * Total no. dblks in journal ------+ |
+ * | |
+ * +------------+------------+ +-----------------+---------------------+
+ */
+ return u_int32_t(::ceil(num_files * file_size_dblks * (1.0 - (1.0 * JRNL_ENQ_THRESHOLD / 100))));
}
string&
Added: store/trunk/cpp/tests/jrnl/_st_long_basic
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_long_basic (rev 0)
+++ store/trunk/cpp/tests/jrnl/_st_long_basic 2009-07-10 14:13:30 UTC (rev 3481)
@@ -0,0 +1,131 @@
+#! /bin/sh
+
+# _st_long_basic - temporary wrapper script for .libs/_st_long_basic
+# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)
+#
+# The _st_long_basic program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='/bin/sed -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command="(cd /home/kpvdr/mrg/store/tests/jrnl; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/kpvdr/bin\"; export PATH; g++ -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -pthread -DBOOST_TEST_DYN_LINK -g -O2 -o \$progdir/\$file _st_long_bas!
ic-_st_basic.o _st_long_basic-unit_test.o -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync -lboost_unit_test_framework ../../lib/.libs/msgstore.so -ldb_cxx-4.7 /home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidbroker.so /home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidcommon.so -lboost_program_options -lboost_filesystem -luuid -ldl -lsasl2 -lrt -laio -Wl,--rpath -Wl,/home/kpvdr/mrg/store/lib/.libs -Wl,--rpath -Wl,/home/kpvdr/mrg/qpid/cpp/src/.libs -Wl,--rpath -Wl,/usr/local/lib/qpid/daemon -Wl,--rpath -Wl,/usr/local/lib ) "
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variable:
+ notinst_deplibs=' ../../lib/msgstore.la /home/kpvdr/mrg/qpid/cpp/src/libqpidbroker.la /home/kpvdr/mrg/qpid/cpp/src/libqpidcommon.la'
+else
+ # When we are sourced in execute mode, $file and $echo are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ echo="echo"
+ file="$0"
+ # Make sure echo works.
+ if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec /bin/sh "$0" --no-reexec ${1+"$@"}
+ fi
+ fi
+
+ # Find the directory that this script lives in.
+ thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program=lt-'_st_long_basic'
+ progdir="$thisdir/.libs"
+
+ if test ! -f "$progdir/$program" || \
+ { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
+ test "X$file" != "X$progdir/$program"; }; then
+
+ file="$$-$program"
+
+ if test ! -d "$progdir"; then
+ mkdir "$progdir"
+ else
+ rm -f "$progdir/$file"
+ fi
+
+ # relink executable if necessary
+ if test -n "$relink_command"; then
+ if relink_command_output=`eval $relink_command 2>&1`; then :
+ else
+ echo "$relink_command_output" >&2
+ rm -f "$progdir/$file"
+ exit 1
+ fi
+ fi
+
+ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+ { rm -f "$progdir/$program";
+ mv -f "$progdir/$file" "$progdir/$program"; }
+ rm -f "$progdir/$file"
+ fi
+
+ if test -f "$progdir/$program"; then
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+
+ exec "$progdir/$program" ${1+"$@"}
+
+ $echo "$0: cannot exec $program $*"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ $echo "$0: error: \`$progdir/$program' does not exist" 1>&2
+ $echo "This script is just a wrapper for $program." 1>&2
+ echo "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi
Property changes on: store/trunk/cpp/tests/jrnl/_st_long_basic
___________________________________________________________________
Name: svn:executable
+ *
Added: store/trunk/cpp/tests/jrnl/_st_long_read
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_long_read (rev 0)
+++ store/trunk/cpp/tests/jrnl/_st_long_read 2009-07-10 14:13:30 UTC (rev 3481)
@@ -0,0 +1,131 @@
+#! /bin/sh
+
+# _st_long_read - temporary wrapper script for .libs/_st_long_read
+# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)
+#
+# The _st_long_read program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='/bin/sed -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command="(cd /home/kpvdr/mrg/store/tests/jrnl; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/kpvdr/bin\"; export PATH; g++ -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -pthread -DBOOST_TEST_DYN_LINK -g -O2 -o \$progdir/\$file _st_long_rea!
d-_st_read.o _st_long_read-unit_test.o -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync -lboost_unit_test_framework ../../lib/.libs/msgstore.so -ldb_cxx-4.7 /home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidbroker.so /home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidcommon.so -lboost_program_options -lboost_filesystem -luuid -ldl -lsasl2 -lrt -laio -Wl,--rpath -Wl,/home/kpvdr/mrg/store/lib/.libs -Wl,--rpath -Wl,/home/kpvdr/mrg/qpid/cpp/src/.libs -Wl,--rpath -Wl,/usr/local/lib/qpid/daemon -Wl,--rpath -Wl,/usr/local/lib ) "
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variable:
+ notinst_deplibs=' ../../lib/msgstore.la /home/kpvdr/mrg/qpid/cpp/src/libqpidbroker.la /home/kpvdr/mrg/qpid/cpp/src/libqpidcommon.la'
+else
+ # When we are sourced in execute mode, $file and $echo are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ echo="echo"
+ file="$0"
+ # Make sure echo works.
+ if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec /bin/sh "$0" --no-reexec ${1+"$@"}
+ fi
+ fi
+
+ # Find the directory that this script lives in.
+ thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program=lt-'_st_long_read'
+ progdir="$thisdir/.libs"
+
+ if test ! -f "$progdir/$program" || \
+ { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
+ test "X$file" != "X$progdir/$program"; }; then
+
+ file="$$-$program"
+
+ if test ! -d "$progdir"; then
+ mkdir "$progdir"
+ else
+ rm -f "$progdir/$file"
+ fi
+
+ # relink executable if necessary
+ if test -n "$relink_command"; then
+ if relink_command_output=`eval $relink_command 2>&1`; then :
+ else
+ echo "$relink_command_output" >&2
+ rm -f "$progdir/$file"
+ exit 1
+ fi
+ fi
+
+ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+ { rm -f "$progdir/$program";
+ mv -f "$progdir/$file" "$progdir/$program"; }
+ rm -f "$progdir/$file"
+ fi
+
+ if test -f "$progdir/$program"; then
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+
+ exec "$progdir/$program" ${1+"$@"}
+
+ $echo "$0: cannot exec $program $*"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ $echo "$0: error: \`$progdir/$program' does not exist" 1>&2
+ $echo "This script is just a wrapper for $program." 1>&2
+ echo "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi
Property changes on: store/trunk/cpp/tests/jrnl/_st_long_read
___________________________________________________________________
Name: svn:executable
+ *
Modified: store/trunk/cpp/tests/jrnl/_st_read.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_read.cpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/_st_read.cpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -38,6 +38,16 @@
// === Test suite ===
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
QPID_AUTO_TEST_CASE(empty_read)
{
string test_name = get_test_name(test_filename, "empty_read");
@@ -90,42 +100,6 @@
cout << "ok" << endl;
}
-QPID_AUTO_TEST_CASE(multi_page_enqueue_read_dequeue_block)
-{
- string test_name = get_test_name(test_filename, "multi_page_enqueue_read_dequeue_block");
- try
- {
- string msg;
- string rmsg;
- string xid;
- bool transientFlag;
- bool externalFlag;
-
- test_jrnl jc(test_name, test_dir, test_name);
- jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
- for (int i=0; i<10; i++)
- {
- for (int m=0; m<NUM_MSGS*125; m++)
- enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
- jc.flush();
- for (int m=0; m<NUM_MSGS*125; m++)
- {
- read_msg(jc, rmsg, xid, transientFlag, externalFlag);
- BOOST_CHECK_EQUAL(create_msg(msg, m, 16*MSG_SIZE), rmsg);
- BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
- BOOST_CHECK_EQUAL(transientFlag, false);
- BOOST_CHECK_EQUAL(externalFlag, false);
- }
- read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
- for (int m=0; m<NUM_MSGS*125; m++)
- deq_msg(jc, m, m+NUM_MSGS*125);
- read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
- }
- }
- catch(const exception& e) { BOOST_FAIL(e.what()); }
- cout << "ok" << endl;
-}
-
QPID_AUTO_TEST_CASE(enqueue_read_dequeue_interleaved)
{
string test_name = get_test_name(test_filename, "enqueue_read_dequeue_interleaved");
@@ -374,6 +348,53 @@
cout << "ok" << endl;
}
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+QPID_AUTO_TEST_CASE(multi_page_enqueue_read_dequeue_block)
+{
+ string test_name = get_test_name(test_filename, "multi_page_enqueue_read_dequeue_block");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl jc(test_name, test_dir, test_name);
+ jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
+ for (int i=0; i<10; i++)
+ {
+ for (int m=0; m<NUM_MSGS*125; m++)
+ enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
+ jc.flush();
+ for (int m=0; m<NUM_MSGS*125; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, 16*MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ for (int m=0; m<NUM_MSGS*125; m++)
+ deq_msg(jc, m, m+NUM_MSGS*125);
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
QPID_AUTO_TEST_CASE(increasing_interval_delayed_read)
{
string test_name = get_test_name(test_filename, "increasing_interval_delayed_read");
@@ -422,4 +443,6 @@
cout << "ok" << endl;
}
+#endif
+
QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -395,9 +395,19 @@
// === Tests ===
+#ifndef LONG_TEST
/*
-* Check that after construction, the fcntl array _fcntl_arr is empty and the is_init() function returns false.
-*/
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
+/*
+ * Check that after construction, the fcntl array _fcntl_arr is empty and the is_init() function returns false.
+ */
QPID_AUTO_TEST_CASE(default_constructor)
{
string test_name = get_test_name(test_filename, "default_constructor");
@@ -415,8 +425,8 @@
}
/*
-* Check that initialize() correctly creates an ordered fcntl array _fcntl_arr.
-*/
+ * Check that initialize() correctly creates an ordered fcntl array _fcntl_arr.
+ */
QPID_AUTO_TEST_CASE(initialize)
{
string test_name = get_test_name(test_filename, "initialize");
@@ -443,8 +453,8 @@
}
/*
-* Check that recover() correctly sets up the specified pfid list order.
-*/
+ * Check that recover() correctly sets up the specified pfid list order.
+ */
QPID_AUTO_TEST_CASE(recover)
{
string test_name = get_test_name(test_filename, "recover");
@@ -478,8 +488,8 @@
}
/*
-* Check that finalize() after an initialize() empties _fcntl_arr and that afterwards is_init() returns false.
-*/
+ * Check that finalize() after an initialize() empties _fcntl_arr and that afterwards is_init() returns false.
+ */
QPID_AUTO_TEST_CASE(initialize_finalize)
{
string test_name = get_test_name(test_filename, "initialize_finalize");
@@ -509,8 +519,8 @@
}
/*
-* Check that finalize() after a recover() empties _fcntl_arr and that afterwards is_init() returns false.
-*/
+ * Check that finalize() after a recover() empties _fcntl_arr and that afterwards is_init() returns false.
+ */
QPID_AUTO_TEST_CASE(recover_finalize)
{
string test_name = get_test_name(test_filename, "recover_finalize");
@@ -548,8 +558,8 @@
}
/*
-* Check that 0 and/or null and other extreme/boundary parameters behave as expected.
-*/
+ * Check that 0 and/or null and other extreme/boundary parameters behave as expected.
+ */
QPID_AUTO_TEST_CASE(zero_null_params)
{
string test_name = get_test_name(test_filename, "zero_null_params");
@@ -571,9 +581,9 @@
}
/*
-* Check that initialize()/recover() works correctly after a previous initialize()/recover() with/without an intervening
-* finalize().
-*/
+ * Check that initialize()/recover() works correctly after a previous initialize()/recover() with/without an intervening
+ * finalize().
+ */
QPID_AUTO_TEST_CASE(multiple_initialization_recover)
{
string test_name = get_test_name(test_filename, "multiple_initialization_recover");
@@ -598,15 +608,15 @@
}
/*
-* Check that insert() works correctly after initialize() and shifts the pfid sequence beyond the insert point correctly:
-*
-* The following sequence is tested:
-* initialize 4 pfids=[0,1,2,3] lfids=[0,1,2,3]
-* insert 1 after lfid 0 pfids=[0,4,1,2,3] lfids=[0,2,3,4,1]
-* insert 2 after lfid 2 pfids=[0,4,1,5,6,2,3] lfids=[0,2,5,6,1,3,4]
-* insert 1 after lfid 6 pfids=[0,4,1,5,6,2,3,7] lfids=[0,2,5,6,1,3,4,7]
-* issert 1 after lfid 3 pfids=[0,4,1,5,8,6,2,3,7] lfids=[0,2,6,7,1,3,5,8,4]
-*/
+ * Check that insert() works correctly after initialize() and shifts the pfid sequence beyond the insert point correctly:
+ *
+ * The following sequence is tested:
+ * initialize 4 pfids=[0,1,2,3] lfids=[0,1,2,3]
+ * insert 1 after lfid 0 pfids=[0,4,1,2,3] lfids=[0,2,3,4,1]
+ * insert 2 after lfid 2 pfids=[0,4,1,5,6,2,3] lfids=[0,2,5,6,1,3,4]
+ * insert 1 after lfid 6 pfids=[0,4,1,5,6,2,3,7] lfids=[0,2,5,6,1,3,4,7]
+ * issert 1 after lfid 3 pfids=[0,4,1,5,8,6,2,3,7] lfids=[0,2,6,7,1,3,5,8,4]
+ */
QPID_AUTO_TEST_CASE(initialize_insert)
{
string test_name = get_test_name(test_filename, "initialize_insert");
@@ -629,15 +639,15 @@
}
/*
-* Check that insert() works correctly after recover() and shifts the pfid sequence beyond the insert point correctly:
-*
-* The following sequence is tested:
-* recover 4 pfids=[0,2,3,1] lfids=[0,3,1,2]
-* insert 1 after lfid 0 pfids=[0,4,2,3,1] lfids=[0,4,2,3,1]
-* insert 2 after lfid 2 pfids=[0,4,2,5,6,3,1] lfids=[0,6,2,5,1,3,4]
-* insert 1 after lfid 6 pfids=[0,4,2,5,6,3,1,7] lfids=[0,6,2,5,1,3,4,7]
-* issert 1 after lfid 3 pfids=[0,4,2,5,8,6,3,1,7] lfids=[0,7,2,6,1,3,5,8,4]
-*/
+ * Check that insert() works correctly after recover() and shifts the pfid sequence beyond the insert point correctly:
+ *
+ * The following sequence is tested:
+ * recover 4 pfids=[0,2,3,1] lfids=[0,3,1,2]
+ * insert 1 after lfid 0 pfids=[0,4,2,3,1] lfids=[0,4,2,3,1]
+ * insert 2 after lfid 2 pfids=[0,4,2,5,6,3,1] lfids=[0,6,2,5,1,3,4]
+ * insert 1 after lfid 6 pfids=[0,4,2,5,6,3,1,7] lfids=[0,6,2,5,1,3,4,7]
+ * issert 1 after lfid 3 pfids=[0,4,2,5,8,6,3,1,7] lfids=[0,7,2,6,1,3,5,8,4]
+ */
QPID_AUTO_TEST_CASE(recover_insert)
{
string test_name = get_test_name(test_filename, "recover_insert");
@@ -662,8 +672,8 @@
}
/*
-* Check that illegal ae parameter combinations are caught and result in an exception being thrown.
-*/
+ * Check that illegal ae parameter combinations are caught and result in an exception being thrown.
+ */
QPID_AUTO_TEST_CASE(ae_parameters)
{
string test_name = get_test_name(test_filename, "ae_parameters");
@@ -698,8 +708,8 @@
}
/*
-* Check that initialized or recovered journals with auto-expand disabled will not allow either inserts or appends.
-*/
+ * Check that initialized or recovered journals with auto-expand disabled will not allow either inserts or appends.
+ */
QPID_AUTO_TEST_CASE(ae_disabled)
{
string test_name = get_test_name(test_filename, "ae_disabled");
@@ -716,9 +726,9 @@
}
/*
-* Check that initialized or recovered journals with auto-expand enabled and a file limit set will enforce the correct
-* limits on inserts and appends.
-*/
+ * Check that initialized or recovered journals with auto-expand enabled and a file limit set will enforce the correct
+ * limits on inserts and appends.
+ */
QPID_AUTO_TEST_CASE(ae_enabled_limit)
{
string test_name = get_test_name(test_filename, "ae_enabled_limit");
@@ -735,9 +745,9 @@
}
/*
-* Check that initialized or recovered journals with auto-expand enabled and no file limit set (0) will allow inserts and
-* appends up to the file limit JRNL_MAX_NUM_FILES.
-*/
+ * Check that initialized or recovered journals with auto-expand enabled and no file limit set (0) will allow inserts and
+ * appends up to the file limit JRNL_MAX_NUM_FILES.
+ */
QPID_AUTO_TEST_CASE(ae_enabled_unlimited)
{
string test_name = get_test_name(test_filename, "ae_enabled_unlimited");
@@ -753,12 +763,23 @@
cout << "done" << endl;
}
+#else
/*
-* Tests randomized combinations of initialization/recovery, initial size, number, size and location of inserts.
-*
-* To reproduce a specific test, comment out the get_seed() statement and uncomment the literal below, adjusting the seed
-* value to that required.
-*/
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+/*
+ * Tests randomized combinations of initialization/recovery, initial size, number, size and location of inserts.
+ *
+ * To reproduce a specific test, comment out the get_seed() statement and uncomment the literal below, adjusting the seed
+ * value to that required.
+ */
QPID_AUTO_TEST_CASE(randomized_tests)
{
string test_name = get_test_name(test_filename, "randomized_tests");
@@ -774,7 +795,7 @@
u_int16_t curr_ae_max_jfiles = 0;
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- for (int test_num = 0; test_num < 100; test_num++)
+ for (int test_num = 0; test_num < 250; test_num++)
{
test_jrnl jc(test_name, test_dir, test_name);
lpmgr lm;
@@ -848,4 +869,6 @@
cout << "done" << endl;
}
+#endif
+
QPID_AUTO_TEST_SUITE_END()
Property changes on: store/trunk/cpp/tests/jrnl/jtt
___________________________________________________________________
Name: svn:ignore
- jtt
Makefile
Makefile.in
_ut_data_src
_ut_jrnl_init_params
_ut_jrnl_instance
_ut_read_arg
_ut_test_case
_ut_test_case_set
_ut_test_case_result
_ut_test_case_result_agregation
.deps
.libs
.valgrind.supp
.valgrindrc
+ jtt
Makefile
Makefile.in
_ut_data_src
_ut_jrnl_init_params
_ut_jrnl_instance
_ut_long_data_src
_ut_read_arg
_ut_test_case
_ut_test_case_set
_ut_test_case_result
_ut_test_case_result_agregation
.deps
.libs
.valgrind.supp
.valgrindrc
Modified: store/trunk/cpp/tests/jrnl/jtt/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/jtt/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -22,11 +22,11 @@
abs_builddir=@abs_builddir@
abs_srcdir=@abs_srcdir@
-AM_CXXFLAGS = $(WARNING_CFLAGS) -I${top_srcdir}/lib -pthread -DBOOST_TEST_DYN_LINK
+AM_CXXFLAGS = $(WARNING_CFLAGS) -I$(top_srcdir)/lib -pthread -DBOOST_TEST_DYN_LINK
TMP_DATA_DIR=$(abs_srcdir)/../../tmp_data_dir
-LINK_BDB = ${top_builddir}/lib/msgstore.la
+LINK_BDB = $(top_builddir)/lib/msgstore.la
TESTS_ENVIRONMENT = \
VALGRIND=$(VALGRIND) \
@@ -50,8 +50,12 @@
_ut_test_case_set \
_ut_jrnl_instance
+LONG_TESTS = \
+ _ut_long_data_src
+
check_PROGRAMS = jtt \
_ut_data_src \
+ _ut_long_data_src \
_ut_jrnl_init_params \
_ut_read_arg \
_ut_test_case \
@@ -91,6 +95,13 @@
../../unit_test.cpp
_ut_data_src_LDADD = -lboost_unit_test_framework -lrt $(LINK_BDB)
+_ut_long_data_src_SOURCES = \
+ _ut_data_src.cpp \
+ data_src.cpp \
+ ../../unit_test.cpp
+_ut_long_data_src_CXXFLAGS = $(AM_CXXFLAGS) -DLONG_TEST
+_ut_long_data_src_LDADD = -lboost_unit_test_framework -lrt $(LINK_BDB)
+
_ut_jrnl_init_params_SOURCES = \
_ut_jrnl_init_params.cpp \
jrnl_init_params.cpp \
@@ -157,3 +168,6 @@
jfile_chk.py \
jtt.csv \
_ut_test_case_set.csv
+
+check-long:
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
Modified: store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -35,6 +35,26 @@
const string test_filename("_ut_data_src");
+long
+get_seed()
+{
+ timespec ts;
+ if (::clock_gettime(CLOCK_REALTIME, &ts))
+ BOOST_FAIL("Unable to read clock to generate seed.");
+ long tenths = ts.tv_nsec / 100000000;
+ return long(10 * ts.tv_sec + tenths); // time in tenths of a second
+}
+
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
QPID_AUTO_TEST_CASE(data)
{
cout << test_filename << ".data: " << flush;
@@ -56,9 +76,10 @@
cout << "ok" << endl;
}
+// There is a long version of this test in _ut_long_data_src.cpp
QPID_AUTO_TEST_CASE(xid_data_xid)
{
- const std::size_t num = 256;
+ const std::size_t num = 64;
cout << test_filename << ".xid_data_xid: " << flush;
BOOST_CHECK_EQUAL(data_src::get_xid(1), "0");
BOOST_CHECK_EQUAL(data_src::get_xid(2), "01");
@@ -103,4 +124,86 @@
cout << "ok" << endl;
}
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+/*
+ * To reproduce a specific test, comment out the get_seed() statement and uncomment the literal below, adjusting the seed
+ * value to that required.
+ */
+QPID_AUTO_TEST_CASE(xid_data_xid)
+{
+ const long seed = get_seed();
+ // const long seed = 0x2d9b69d32;
+ ::srand48(seed);
+
+ const std::size_t num = 1024;
+ cout << test_filename << ".xid_data_xid: seed=0x" << std::hex << seed << std::dec << flush;
+ BOOST_CHECK_EQUAL(data_src::get_xid(1), "0");
+ BOOST_CHECK_EQUAL(data_src::get_xid(2), "01");
+ BOOST_CHECK_EQUAL(data_src::get_xid(3), "002");
+ BOOST_CHECK_EQUAL(data_src::get_xid(4), "0003");
+ BOOST_CHECK_EQUAL(data_src::get_xid(5), "00004");
+ BOOST_CHECK_EQUAL(data_src::get_xid(6), "000005");
+ BOOST_CHECK_EQUAL(data_src::get_xid(7), "0000006");
+ BOOST_CHECK_EQUAL(data_src::get_xid(8), "00000007");
+ BOOST_CHECK_EQUAL(data_src::get_xid(9), "xid:00008");
+ BOOST_CHECK_EQUAL(data_src::get_xid(10), "xid:000009");
+ BOOST_CHECK_EQUAL(data_src::get_xid(11), "xid:0000010");
+ BOOST_CHECK_EQUAL(data_src::get_xid(12), "xid:00000011");
+ BOOST_CHECK_EQUAL(data_src::get_xid(13), "xid:00000012:");
+ BOOST_CHECK_EQUAL(data_src::get_xid(14), "xid:00000013:n");
+ BOOST_CHECK_EQUAL(data_src::get_xid(15), "xid:00000014:no");
+ std::size_t i = 15;
+ for (; i<num; i++)
+ {
+ string xid(data_src::get_xid(i));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8) << i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), i);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[i-1], (char)('a' + ((i-1)%26)));
+ }
+ for (std::size_t j=data_src::max_xsize-num; j<data_src::max_xsize; j++,i++)
+ {
+ string xid(data_src::get_xid(j));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8) << i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), j);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[j-1], (char)('a' + ((j-1)%26)));
+ }
+ std::srand(seed);
+ for (int cnt=0; cnt<1000; cnt++,i++)
+ {
+ std::size_t k = 1 + ::lrand48() % (data_src::max_xsize - 1);
+ string xid(data_src::get_xid(k));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8) << i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), k);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[k-1], (char)('a' + ((k-1)%26)));
+ }
+ cout << "ok" << endl;
+}
+
+#endif
+
QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/run-journal-tests
===================================================================
--- store/trunk/cpp/tests/jrnl/run-journal-tests 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/run-journal-tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -22,7 +22,7 @@
# The GNU Lesser General Public License is available in the file COPYING.
fail=0
-num_jrnls=1
+num_jrnls=3
# Run jtt using default test set
echo
Modified: store/trunk/cpp/tests/python_tests/flow_to_disk.py
===================================================================
--- store/trunk/cpp/tests/python_tests/flow_to_disk.py 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/python_tests/flow_to_disk.py 2009-07-10 14:13:30 UTC (rev 3481)
@@ -119,37 +119,42 @@
# --- Simple tests ---
def test_FlowToDisk_00_SimpleMaxCount(self):
+ """Flow-to-disk tests based on setting max_count"""
self.simpleLimit("test_FlowToDisk_00a", max_count = 10)
self.simpleLimit("test_FlowToDisk_00b", max_count = 10, persistent = True)
self.simpleLimit("test_FlowToDisk_00c", max_count = 10, max_size = 10000000, numMsgs = 100, msgSize = 10000)
self.simpleLimit("test_FlowToDisk_00d", max_count = 10, max_size = 10000000, persistent = True, numMsgs = 100, msgSize = 10000)
def test_FlowToDisk_01_SimpleMaxSize(self):
+ """Flow-to-disk tests based on setting max_size"""
self.simpleLimit("test_FlowToDisk_01a", max_size = 100)
self.simpleLimit("test_FlowToDisk_01b", max_size = 100, persistent = True)
self.simpleLimit("test_FlowToDisk_01c", max_size = 100000, numMsgs = 100, msgSize = 10000)
self.simpleLimit("test_FlowToDisk_01d", max_size = 100000, persistent = True, numMsgs = 100, msgSize = 10000)
def test_FlowToDisk_02_SimpleMaxCountNotAcquired(self):
+ """Flow-to-disk tests based on setting max_count, but not using pre-acquired mode (ie browsing)"""
self.simpleLimit("test_FlowToDisk_02a", max_count = 10, pre_acquired = False)
self.simpleLimit("test_FlowToDisk_02b", max_count = 10, persistent = True, pre_acquired = False)
self.simpleLimit("test_FlowToDisk_02c", max_count = 10, max_size = 10000000, pre_acquired = False, numMsgs = 100, msgSize = 10000)
self.simpleLimit("test_FlowToDisk_02d", max_count = 10, max_size = 10000000, persistent = True, pre_acquired = False, numMsgs = 100, msgSize = 10000)
def test_FlowToDisk_03_SimpleMaxSizeNotAcquired(self):
+ """Flow-to-disk tests based on setting max_size, but not using pre-acquired mode (ie browsing)"""
self.simpleLimit("test_FlowToDisk_03a", max_size = 100, pre_acquired = False)
self.simpleLimit("test_FlowToDisk_03b", max_size = 100, persistent = True, pre_acquired = False)
self.simpleLimit("test_FlowToDisk_03c", max_size = 100, pre_acquired = False, numMsgs = 100, msgSize = 10000)
self.simpleLimit("test_FlowToDisk_03d", max_size = 100, persistent = True, pre_acquired = False, numMsgs = 100, msgSize = 10000)
def test_FlowToDisk_04_MaxSizeMaxCount(self):
- """Set both max-count and max-size at the same time"""
+ """Flow-to-disk tests based on setting both max-count and max-size at the same time"""
self.simpleLimit("test_FlowToDisk_04a", max_count = 10, max_size = 1000)
self.simpleLimit("test_FlowToDisk_04b", max_count = 10, max_size = 1000, msgSize = 250)
self.simpleLimit("test_FlowToDisk_04c", max_count = 10, max_size = 1000, persistent = True)
self.simpleLimit("test_FlowToDisk_04d", max_count = 10, max_size = 1000, msgSize = 250, persistent = True)
def test_FlowToDisk_05_Randomized(self):
+ """Randomized flow-to-disk tests"""
seed = long(1000.0 * time.time())
print "seed=0x%x" % seed
random.seed(seed)
Added: store/trunk/cpp/tests/run_long_python_tests
===================================================================
--- store/trunk/cpp/tests/run_long_python_tests (rev 0)
+++ store/trunk/cpp/tests/run_long_python_tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Copyright (c) 2008, 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+./run_python_tests LONG_TEST
Property changes on: store/trunk/cpp/tests/run_long_python_tests
___________________________________________________________________
Name: svn:executable
+ *
Modified: store/trunk/cpp/tests/run_python_tests
===================================================================
--- store/trunk/cpp/tests/run_python_tests 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/run_python_tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -21,6 +21,11 @@
#
# The GNU Lesser General Public License is available in the file COPYING.
+if test x$1 == x"LONG_TEST"; then
+ echo "Running long tests..."
+ LONG_TEST=1
+fi
+
if test -z ${QPID_DIR} ; then
cat <<EOF
@@ -75,7 +80,7 @@
# Run all python tests
pwdir=$(pwd)
cd ${QPID_PYTHON_DIR}
-sg ais -c "./run-tests --skip-self-test -v -s ${AMQP_SPEC} -I ${FAILING_PYTHON_TESTS} -B \"${BROKER_OPTS}\" ${PYTHON_TESTS}" || { echo "FAIL python tests for ${AMQP_SPEC}"; fail=1; }
+./run-tests --skip-self-test -v -s ${AMQP_SPEC} -I ${FAILING_PYTHON_TESTS} -B "${BROKER_OPTS}" ${PYTHON_TESTS} || { echo "FAIL python tests for ${AMQP_SPEC}"; fail=1; }
cd ${pwdir}
exit ${fail}
Modified: store/trunk/cpp/tests/system_test.sh
===================================================================
--- store/trunk/cpp/tests/system_test.sh 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/system_test.sh 2009-07-10 14:13:30 UTC (rev 3481)
@@ -48,7 +48,6 @@
done
}
-echo 'Journal (AIO) persistence...'
run_tests || fail=1
exit $fail
16 years, 9 months
rhmessaging commits: r3480 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-07 17:58:37 -0400 (Tue, 07 Jul 2009)
New Revision: 3480
Modified:
mgmt/trunk/cumin/resources/open-flash-chart.swf
Log:
Remove control chart area at bottom of chart that was inadvertantly checked in.
Modified: mgmt/trunk/cumin/resources/open-flash-chart.swf
===================================================================
(Binary files differ)
16 years, 9 months
rhmessaging commits: r3479 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-07 17:56:00 -0400 (Tue, 07 Jul 2009)
New Revision: 3479
Modified:
mgmt/trunk/cumin/resources/open-flash-chart.swf
Log:
Avoid exception in flash chart
Modified: mgmt/trunk/cumin/resources/open-flash-chart.swf
===================================================================
(Binary files differ)
16 years, 9 months
rhmessaging commits: r3478 - in mgmt/trunk/cumin/python/cumin: grid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-06 12:55:10 -0400 (Mon, 06 Jul 2009)
New Revision: 3478
Modified:
mgmt/trunk/cumin/python/cumin/grid/collector.py
mgmt/trunk/cumin/python/cumin/grid/pool.py
mgmt/trunk/cumin/python/cumin/stat.py
Log:
Implementing stacked area charts (in lieu of stacked bar charts)
Modified: mgmt/trunk/cumin/python/cumin/grid/collector.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/collector.py 2009-07-04 18:17:09 UTC (rev 3477)
+++ mgmt/trunk/cumin/python/cumin/grid/collector.py 2009-07-06 16:55:10 UTC (rev 3478)
@@ -83,20 +83,22 @@
chart = self.JobStackedChart(app, "jobs")
chart.stats = ("RunningJobs", "IdleJobs")
+ chart.chart_type = "stacked"
self.add_child(chart)
chart = self.SlotStackedChart(app, "slots")
chart.stats = ("HostsClaimed", "HostsUnclaimed", "HostsOwner")
+ chart.chart_type = "stacked"
self.add_child(chart)
def render_title(self, session):
return "Statistics"
- class JobStackedChart(StatStackedChart):
+ class JobStackedChart(StatFlashChart):
def render_title(self, session, *args):
return "Job Status"
- class SlotStackedChart(StatStackedChart):
+ class SlotStackedChart(StatFlashChart):
def render_title(self, session, *args):
return "Slot State"
Modified: mgmt/trunk/cumin/python/cumin/grid/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/pool.py 2009-07-04 18:17:09 UTC (rev 3477)
+++ mgmt/trunk/cumin/python/cumin/grid/pool.py 2009-07-06 16:55:10 UTC (rev 3478)
@@ -261,11 +261,12 @@
chart = self.JobStackedChart(app, "jobs")
chart.duration.param.default = "3600"
chart.stats = ("RunningJobs", "IdleJobs")
+ chart.chart_type = "stacked"
self.add_child(chart)
- chart = self.SlotStackedChart(app, "slots")
- chart.duration.param.default = "3600"
+ chart = self.SlotFlashChart(app, "slots")
chart.stats = ("HostsClaimed", "HostsUnclaimed", "HostsOwner")
+ chart.chart_type = "stacked"
self.add_child(chart)
def render_title(self, session):
@@ -283,14 +284,14 @@
def get_args(self, session):
return self.parent.get_collector_args(session)
- class JobStackedChart(StatStackedChart):
+ class JobStackedChart(StatFlashChart):
def render_title(self, session, *args):
return "Job Status"
def get_args(self, session):
return self.parent.get_collector_args(session)
- class SlotStackedChart(StatStackedChart):
+ class SlotFlashChart(StatFlashChart):
def render_title(self, session, *args):
return "Slot State"
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-07-04 18:17:09 UTC (rev 3477)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-07-06 16:55:10 UTC (rev 3478)
@@ -810,96 +810,14 @@
return y_axis, y_axis_right
-class StackedChart(FlashChart):
+class AreaChart(FlashChart):
def __init__(self, app, name, page):
- super(StackedChart, self).__init__(app, name, page)
+ super(AreaChart, self).__init__(app, name, page)
- self.points = self.Points(app, "points")
- self.add_attribute(self.points)
+ self.alpha = 0.3
def fetch_samples(self, object, dur, interval, method, mode, delta, stats):
samples = dict()
-
- # don't average for stacked charts
- interval = 1
- for stat in stats:
- samples[stat] = stat.samples(object, dur, interval, method)
- return samples
-
- def get_max_min(self, session, stats, samples):
- max_value = 0
- min_value = 0
- points = dict()
- values = dict()
- collapsed = dict()
-
- for stat in stats:
- for sample in samples[stat]:
- collapsed[sample[0]] = sample[1]
-
- for t in collapsed:
- if not t in points:
- points[t] = list()
- values[t] = 0
- points[t].append(collapsed[t])
- values[t] = values[t] + collapsed[t]
- max_value = max(values[t], max_value)
- min_value = min(values[t], min_value)
-
- # save the accumulated values for each timestamp
- self.points.set(session, points)
-
- max_value = round(max_value * 1.1 + 1)
- if min_value < 0:
- min_value = round(min_value * 1.1 - 1)
-
- return max_value, min_value
-
- def get_chart(self, session, stats, samples, duration, max_value, min_value, append):
- time_period = self.page.duration.get(session)
- chart = Chart()
- chart.title.text = ""
- chart.bg_colour = "#FFFFFF"
- chart.elements = list()
- element = Element()
- element.type = "bar_stack"
- element.colours = list(self.colors)
-
- points = self.points.get(session)
- values = list()
- for point in points:
- values.append(points[point])
- element.values = values
-
- keys = list()
- for stat, color in zip(stats, self.colors):
- key = dict()
- key['colour'] = color
- key['text'] = stat.title
- keys.append(key)
- element.keys = keys
-
- element.tip = "#key#: #val#<br>Total: #total#"
- chart.elements.append(element)
-
- if append:
- chart.append = self.get_elapsed(session)['value']
- #print "append: time_period=%i duration=%i elapsed=%f" % (time_period, duration, float(self.get_elapsed(session)['value']))
- return chart
- #chart.x_axis = self.get_x_axis(duration)
- y_axis, y_axis_right = self.get_y_axis(max_value, min_value)
- chart.y_axis = y_axis
- chart.y_axis_right = y_axis_right
-
- return chart
-
- class Points(Attribute):
- def get_default(self, session):
- return dict()
-
-class AreaChart(FlashChart):
- def fetch_samples(self, object, dur, interval, method, mode, delta, stats):
- samples = dict()
if mode == "rate":
method = None # don't do averaging
if delta: # need more than 1 point for calculating rate
@@ -943,8 +861,18 @@
return max_value, min_value
- def get_chart(self, session, stats, samples, duration, max_value, min_value, append):
+ def get_vals(self, session, samples, stat, text):
+ tnow = time()
time_period = self.page.duration.get(session)
+ vals = [{"x":int(time_period -(tnow - secs(dt))),
+ "y":value,
+ "uid": dt.strftime("%m%d%Y%H%M%S"),
+ "tip": "<br>%s: #val#<br>Time: %s" % (text, dt.strftime("%m/%d/%Y %H:%M:%S"))}
+ for dt, value, dev in reversed(samples[stat])
+ if value is not None]
+ return vals
+
+ def get_chart(self, session, stats, samples, duration, max_value, min_value, append):
mode = self.page.mode.get(session)
width = self.page.container_width.get(session)
@@ -959,12 +887,11 @@
chart = Chart()
chart.bg_colour = "#FFFFFF"
chart.elements = list()
- tnow = time()
- for stat, color in zip(stats, self.colors):
+ for stat, color in reversed(zip(stats, self.colors)):
line = Element()
line.type = "area"
line.fill = color
- line.fill_alpha = 0.3
+ line.fill_alpha = self.alpha
line.on_show.type = "No"
line.dot_style = {"type": "solid-dot",
@@ -974,18 +901,12 @@
line.width = line_width
line.text = mode == "rate" and "%s / sec" % stat.title or stat.title
- vals = [{"x":int(time_period -(tnow - secs(dt))),
- "y":value,
- "uid": dt.strftime("%m%d%Y%H%M%S"),
- "tip": "<br>%s: #val#<br>Time: %s" % (line.text, dt.strftime("%m/%d/%Y %H:%M:%S"))}
- for dt, value, dev in reversed(samples[stat])
- if value is not None]
- line.values = vals
+ line.values = self.get_vals(session, samples, stat, line.text)
chart.elements.append(line)
if append:
chart.append = self.get_elapsed(session)['value']
- #print "append: time_period=%i duration=%i elapsed=%f" % (time_period, duration, float(self.get_elapsed(session)['value']))
+ #print "append: duration=%i elapsed=%f" % (duration, float(self.get_elapsed(session)['value']))
return chart
chart.title.text = ""
@@ -1005,6 +926,67 @@
#print "sending entire sample set with y_axis.max=%i" % chart.y_axis["max"]
return chart
+class StackedAreaChart(AreaChart):
+ def __init__(self, app, name, page):
+ super(StackedAreaChart, self).__init__(app, name, page)
+
+ self.points = self.Points(app, "points")
+ self.add_attribute(self.points)
+
+ self.alpha = 1
+
+ def get_max_min(self, session, stats, samples):
+ max_value = 0
+ min_value = 0
+ points = dict()
+ totals = dict()
+ collapsed = dict()
+
+ for stat in stats:
+ last_dt = None
+ for dt, value, dev in samples[stat]:
+ if dt == last_dt:
+ continue
+ last_dt = dt
+ if stat not in points:
+ points[stat] = list()
+ if dt not in totals:
+ totals[dt] = 0
+ totals[dt] += value
+ points[stat].append((dt, value, totals[dt]))
+
+ max_value = max(totals[dt], max_value)
+ min_value = min(totals[dt], min_value)
+
+ # save the accumulated values for each timestamp
+ self.points.set(session, points)
+
+ max_value = round(max_value * 1.1 + 1)
+ if min_value < 0:
+ min_value = round(min_value * 1.1 - 1)
+
+ return max_value, min_value
+
+ def get_vals(self, session, samples, stat, text):
+ tnow = time()
+ time_period = self.page.duration.get(session)
+ points = self.points.get(session)
+ vals = list()
+
+ if points:
+ vals = [{"x":int(time_period -(tnow - secs(dt))),
+ "y":stacked_value,
+ "uid": dt.strftime("%m%d%Y%H%M%S"),
+ "tip": "<br>%s: %s<br>Time: %s" % (text, str(value), dt.strftime("%m/%d/%Y %H:%M:%S"))}
+ for dt, value, stacked_value in reversed(points[stat])
+ if value is not None]
+
+ return vals
+
+ class Points(Attribute):
+ def get_default(self, session):
+ return dict()
+
class StatFlashPage(StatChartPage):
def __init__(self, app, name):
super(StatFlashPage, self).__init__(app, name)
@@ -1043,7 +1025,8 @@
if chart_type == "area":
chart_obj = AreaChart(self.app, chart_type, self)
elif chart_type == "stacked":
- chart_obj = StackedChart(self.app, chart_type, self)
+ chart_obj = StackedAreaChart(self.app, chart_type, self)
+ #chart_obj = StackedChart(self.app, chart_type, self)
return chart_obj
16 years, 10 months
rhmessaging commits: r3477 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-04 14:17:09 -0400 (Sat, 04 Jul 2009)
New Revision: 3477
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
Log:
Refactor flash charts to prepare for stacked charts.
Use area charts instead of line charts.
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-07-04 18:15:44 UTC (rev 3476)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-07-04 18:17:09 UTC (rev 3477)
@@ -99,8 +99,8 @@
super(StatValueChart, self).__init__(app, name)
self.mode = None
-
self.stats = ()
+ self.chart_type = None
self.stats_tmpl = Template(self, "stat_html")
@@ -126,6 +126,9 @@
if self.mode:
params.append("mode=%s" % self.mode)
+ if self.chart_type:
+ params.append("type=%s" % self.chart_type)
+
return params
def render_href(self, session, object):
@@ -608,9 +611,13 @@
self.mode = Parameter(app, "mode")
self.add_parameter(self.mode)
+ self.chart_type = Parameter(app, "type")
+ self.add_parameter(self.chart_type)
+
def render_content(self, session):
self.flash_chart.stats = self.stats.get(session)
self.flash_chart.mode = self.mode.get(session)
+ self.flash_chart.chart_type = self.chart_type.get(session)
return self.flash_chart.render(session)
class GenericChart(StatFlashChart):
@@ -631,191 +638,139 @@
params.append("height=%i" % self.render_height(session, object))
return "%s?" % self.get_chart_name(session) + ";".join(params)
-class StatFlashPage(StatChartPage):
- def __init__(self, app, name):
- super(StatFlashPage, self).__init__(app, name)
+ def render_href(self, session, object):
+ params = self.get_href_params(session, object)
+ params.append("width=%i" % self.render_width(session, object))
+ params.append("height=%i" % self.render_height(session, object))
+ return escape_entity("%s?" % self.get_flash_name(session) + ";".join(params))
- self.elapsed = Parameter(app, "elapsed")
- self.elapsed.default = None
- self.add_parameter(self.elapsed)
+class FlashChart(Widget):
+ colors = ('#FF0000', '#0000FF', '#00FF00', '#FF00FF', '#FFFF00', '#00FFFF', '#000000')
+ one_day = 24 * 60 * 60
+ def __init__(self, app, name, page):
+ super(FlashChart, self).__init__(app, name)
+ self.page = page
- self.axis_max = IntegerParameter(app, "amax")
- self.axis_max.default = 0;
- self.add_parameter(self.axis_max)
+ def create(self, session, object, stats):
+ # get the page parameters
+ width = self.page.container_width.get(session)
+ height = self.page.container_height.get(session)
+ mode = self.page.mode.get(session)
+ duration = self.get_duration(session)
+ time_period = self.page.duration.get(session)
+ delta = self.get_delta(session)
+ interval = self.page.get_interval(session, duration, width)
+ method = self.page.method.get(session)
- self.vals_max = IntegerParameter(app, "vmax")
- self.vals_max.default = 0;
- self.add_parameter(self.vals_max)
+ # get the most recent samples
+ samples = self.fetch_samples(object, duration, interval, method, mode, delta, stats)
+ max_value, min_value = self.get_max_min(session, stats, samples)
- def get_content_type(self, session):
- return "text/plain"
+ append = False
+ # if we should append the new samples, see if the y-axis has changed
+ if delta:
+ axis_max = self.page.axis_max.get(session)
+ vals_max = self.page.vals_max.get(session)
+ axis_for_vals = round(float(vals_max) * 1.1 + 1)
+ max_of_axiis = max(max_value, axis_for_vals)
+ # the most recent value(s) changed the y-axis range
+ if axis_max != max_of_axiis:
+ #print "change in axis: axis_max=%s vals_max=%s max_new_values=%s vals_axis=%s desired_axis=%s" % (str(axis_max), str(vals_max), str(max_value), str(axis_for_vals), str(max_of_axiis))
+ duration = time_period
+ samples = self.fetch_samples(object, duration, interval, method, mode, False, stats)
+ max_value, min_value = self.get_max_min(session, stats, samples)
+ else:
+ append = True
+ # create the chart dict
+ chart = self.get_chart(session, stats, samples, duration, max_value, min_value, append)
+ return chart.create()
+
+ def get_chart(self, session, stats, samples, duration, max_value, min_value, append):
+ return Chart()
+
def get_duration(self, session):
- duration = self.duration.get(session)
- elapsed = self.elapsed.get(session)
- if elapsed:
- js_milliseconds = long(elapsed)
- seconds = js_milliseconds / 1000
- elapsed = int(seconds + 1)
- if elapsed <= 24 * 60 * 60:
- duration = elapsed
+ duration = self.page.duration.get(session)
+ elapsed = self.get_elapsed(session)
+ if elapsed['seconds'] <= self.one_day:
+ duration = elapsed['seconds'] + 1
return duration
def get_elapsed(self, session):
- elapsed = self.elapsed.get(session)
- if elapsed:
- js_milliseconds = long(elapsed)
- seconds = js_milliseconds / 1000
+ elapsed = {'seconds': 0, 'milliseconds': 0.0, 'value': 0.0}
+ e = self.page.elapsed.get(session)
+ if e:
+ js_milliseconds = long(e)
+ seconds = int(js_milliseconds / 1000)
milliseconds = (js_milliseconds % 1000.0) / 1000.0
- return seconds + milliseconds
- return 0
+ elapsed['seconds'] = seconds
+ elapsed['milliseconds'] = milliseconds
+ elapsed['value'] = seconds + milliseconds
+ return elapsed
def get_delta(self, session):
""" if we get an elapsed parameter, we want
to send only the new values, that is
unless the elapsed value is too large
in which case we want to get the entire sample """
-
- elapsed = self.elapsed.get(session)
- if elapsed:
- js_milliseconds = long(elapsed)
- seconds = js_milliseconds / 1000
- elapsed = int(seconds)
- if elapsed <= 24 * 60 * 60:
- return True
+ elapsed = self.get_elapsed(session)
+ if elapsed['seconds'] <= self.one_day:
+ return True
return False
- def do_render(self, session):
- object = self.get_object(session)[0]
- colors = ('#FF0000', '#0000FF', '#00FF00')
- samples = dict()
- values = dict()
- cls = self.class_.get(session)
- stats = [getattr(cls, x) for x in self.stats.get(session)]
+ def get_x_labels(self, duration, intervals, step):
+ x_step = duration / intervals
+ labels = list()
+ for i in range(0, intervals + 1):
+ label = dict()
+ if i % step == 0:
+ value = duration - i * x_step
+ text = fmt_duration_brief(value)
- width = self.container_width.get(session)
- height = self.container_height.get(session)
- mode = self.mode.get(session)
- duration = self.get_duration(session)
- time_period = self.duration.get(session)
- delta = self.get_delta(session)
- interval = self.get_interval(session, duration, width)
- #interval = 1
- method = self.method.get(session)
-
- def fetch_samples(object, dur, interval, method, mode, delta):
- if mode == "rate":
- method = None # don't do averaging
- if delta: # need more than 1 point for calculating rate
- dur *= 2;
- for stat in stats:
- os = stat.samples(object, dur, interval, method)
- ns = list()
- prev = None
-
- for sample in reversed(os):
- if prev is not None:
- rate = calc_rate(sample[1], prev[1],
- secs(sample[0]), secs(prev[0]))
-
- ns.insert(0, (sample[0], rate, None))
-
- prev = sample
-
- samples[stat] = ns
+ label["text"] = text
else:
- for stat in stats:
- samples[stat] = stat.samples(object, dur, interval, method)
+ label["text"] = ""
+ label["x"] = i * x_step
- def get_max_min():
- # take stddev into account for max and min y values
- max_value = 0
- min_value = 0
- try:
- deviated_values = [[(nvl(x[1],0) + float(nvl(x[2],0))/2,
- nvl(x[1],0) - float(nvl(x[2],0))/2)
- for x in samples[stat]] for stat in stats]
- for deviated_list in deviated_values:
- if len(deviated_list):
- max_list = max(max(deviated_list)) # list of tuples
- max_value = max(max_list, max_value)
- min_list = min(min(deviated_list))
- min_value = min(min_list, min_value)
+ labels.append(label)
+ return labels
- max_value = round(max_value * 1.1 + 1)
+ def get_y_labels(self, absy, intervals, step):
+ y_step = absy / intervals
+ labels = list()
+ for i in range(0, intervals + 1):
+ label = dict()
- if min_value < 0:
- min_value = round(min_value * 1.1 - 1)
+ if i % step == 0:
+ value = int(round(i * y_step, 0))
- except:
- pass
- return max_value, min_value
+ if value >= 10000000:
+ svalue = "%im" % int(round(value / 1000000.0, -1))
+ elif value >= 10000:
+ svalue = "%ik" % int(round(value / 1000.0, -1))
+ else:
+ svalue = str(value)
- #print "fetching duration=%i time_period=%i" % (duration, time_period)
- fetch_samples(object, duration, interval, method, mode, delta)
- max_value, min_value = get_max_min()
-
- append = False
- if delta:
- axis_max = self.axis_max.get(session)
- vals_max = self.vals_max.get(session)
- axis_for_vals = round(float(vals_max) * 1.1 + 1)
- max_of_axiis = max(max_value, axis_for_vals)
- # the most recent value(s) changed the y-axis range
- if axis_max != max_of_axiis:
- #print "change in axis: axis_max=%s vals_max=%s max_new_values=%s vals_axis=%s desired_axis=%s" % (str(axis_max), str(vals_max), str(max_value), str(axis_for_vals), str(max_of_axiis))
- duration = time_period
- fetch_samples(object, duration, interval, method, mode, False)
- max_value, min_value = get_max_min()
+ label["text"] = svalue
else:
- append = True
+ label["text"] = ""
+ label["y"] = int(i * y_step)
- chart = Chart()
- chart.elements = list()
- tnow = time()
- for stat, color in zip(stats, colors):
- line = Element()
- line.type = "scatter_line"
- #line.dot_size = 3
- #line.dot_style = {"type": "solid-dot",
- # "dot-size": 5,
- # "halo-size": 0}
- line.colour = color
- line.width = 1
- line.text = mode == "rate" and "%s / sec" % stat.title or stat.title
+ labels.append(label)
+ return labels
- vals = [{"x":int(time_period -(tnow - secs(dt))),
- "y":value,
- "uid": dt.strftime("%m%d%Y%H%M%S"),
- "tip": "<br>%s: #val#<br>Time: %s" % (line.text, dt.strftime("%m/%d/%Y %H:%M:%S"))}
- for dt, value, dev in reversed(samples[stat])
- if value is not None]
- line.values = vals
- chart.elements.append(line)
-
- if append:
- chart.append = self.get_elapsed(session)
- #print "append: time_period=%i duration=%i elapsed=%f" % (time_period, duration, float(self.get_elapsed(session)))
- return chart.create()
-
- chart.title.text = ""
- chart.title.style = "{text-align: left; font-weight: bold; font-size: 14px;}"
- chart.tooltip = {"colour": "#000033",
- "background": "#FFFFCC",
- "stroke": 1,
- "title": "{background-color: #000022; color: #FFFFFF; font-size: 1em;}",
- "body": "{font-size: 10px; color: #000000;}"
- }
+ def get_x_axis(self, duration):
x_intervals = 8
x_steps = 2
if duration == 600:
x_intervals = 10
steps = int(duration / x_intervals)
- chart.x_axis.colour = "#CCCCCC"
- chart.x_axis.grid_colour = "#DDDDDD"
- chart.x_axis.stroke = 1
- chart.x_axis.steps = steps
+ x_axis = Element()
+ x_axis.colour = "#CCCCCC"
+ x_axis.grid_colour = "#DDDDDD"
+ x_axis.stroke = 1
+ x_axis.steps = steps
xlbls = Element()
#xlbls.steps = steps
xlbls.size = 12
@@ -824,8 +779,10 @@
xlbls.rotate = 0.0001
lbls = self.get_x_labels(duration, x_intervals, x_steps)
xlbls.labels = lbls
- chart.x_axis.labels = xlbls
+ x_axis.labels = xlbls
+ return x_axis
+ def get_y_axis(self, max_value, min_value):
y_intervals = 6
absy = max_value - min_value
y_steps = int(absy / y_intervals)
@@ -834,7 +791,7 @@
y_steps = 3
# .swf won't show grid lines with a y_axis on the left
- chart.y_axis = {
+ y_axis = {
"min": int(min_value),
"max": int(max_value),
"steps": y_steps,
@@ -843,58 +800,253 @@
"colour": "#CCCCCC",
"grid-colour": "#DDDDDD",
"labels": {"labels": []}}
- chart.y_axis_right = {
+ y_axis_right = {
"min": int(min_value),
"max": int(max_value),
"tick-length": 0,
"stroke": 1,
"colour": "#BBBBBB",
"labels": {"colour": "#AAAAAA", "labels": self.get_y_labels(absy, y_intervals, 2)}}
+
+ return y_axis, y_axis_right
+
+class StackedChart(FlashChart):
+ def __init__(self, app, name, page):
+ super(StackedChart, self).__init__(app, name, page)
+
+ self.points = self.Points(app, "points")
+ self.add_attribute(self.points)
+
+ def fetch_samples(self, object, dur, interval, method, mode, delta, stats):
+ samples = dict()
+
+ # don't average for stacked charts
+ interval = 1
+ for stat in stats:
+ samples[stat] = stat.samples(object, dur, interval, method)
+ return samples
+
+ def get_max_min(self, session, stats, samples):
+ max_value = 0
+ min_value = 0
+ points = dict()
+ values = dict()
+ collapsed = dict()
+
+ for stat in stats:
+ for sample in samples[stat]:
+ collapsed[sample[0]] = sample[1]
+
+ for t in collapsed:
+ if not t in points:
+ points[t] = list()
+ values[t] = 0
+ points[t].append(collapsed[t])
+ values[t] = values[t] + collapsed[t]
+ max_value = max(values[t], max_value)
+ min_value = min(values[t], min_value)
+
+ # save the accumulated values for each timestamp
+ self.points.set(session, points)
+
+ max_value = round(max_value * 1.1 + 1)
+ if min_value < 0:
+ min_value = round(min_value * 1.1 - 1)
+
+ return max_value, min_value
+
+ def get_chart(self, session, stats, samples, duration, max_value, min_value, append):
+ time_period = self.page.duration.get(session)
+ chart = Chart()
+ chart.title.text = ""
chart.bg_colour = "#FFFFFF"
+ chart.elements = list()
+ element = Element()
+ element.type = "bar_stack"
+ element.colours = list(self.colors)
+
+ points = self.points.get(session)
+ values = list()
+ for point in points:
+ values.append(points[point])
+ element.values = values
+
+ keys = list()
+ for stat, color in zip(stats, self.colors):
+ key = dict()
+ key['colour'] = color
+ key['text'] = stat.title
+ keys.append(key)
+ element.keys = keys
+
+ element.tip = "#key#: #val#<br>Total: #total#"
+ chart.elements.append(element)
+
+ if append:
+ chart.append = self.get_elapsed(session)['value']
+ #print "append: time_period=%i duration=%i elapsed=%f" % (time_period, duration, float(self.get_elapsed(session)['value']))
+ return chart
+ #chart.x_axis = self.get_x_axis(duration)
+ y_axis, y_axis_right = self.get_y_axis(max_value, min_value)
+ chart.y_axis = y_axis
+ chart.y_axis_right = y_axis_right
+
+ return chart
+
+ class Points(Attribute):
+ def get_default(self, session):
+ return dict()
+
+class AreaChart(FlashChart):
+ def fetch_samples(self, object, dur, interval, method, mode, delta, stats):
+ samples = dict()
+ if mode == "rate":
+ method = None # don't do averaging
+ if delta: # need more than 1 point for calculating rate
+ dur *= 4;
+ for stat in stats:
+ os = stat.samples(object, dur, interval, method)
+ ns = list()
+ prev = None
+
+ for sample in reversed(os):
+ if prev is not None:
+ rate = calc_rate(sample[1], prev[1],
+ secs(sample[0]), secs(prev[0]))
+
+ ns.insert(0, (sample[0], rate, None))
+
+ prev = sample
+
+ samples[stat] = ns
+ else:
+ for stat in stats:
+ samples[stat] = stat.samples(object, dur, interval, method)
+
+ return samples
+
+ def get_max_min(self, session, stats, samples):
+ # take stddev into account for max and min y values
+ max_value = 0
+ min_value = 0
+
+ for stat in stats:
+ for x in samples[stat]:
+ devmax = nvl(x[1], 0) + float(nvl(x[2], 0))
+ devmin = nvl(x[1], 0) - float(nvl(x[2], 0))
+ max_value = max(max_value, devmax)
+ min_value = min(min_value, devmin)
+
+ max_value = round(max_value * 1.1 + 1)
+ if min_value < 0:
+ min_value = round(min_value * 1.1 - 1)
+
+ return max_value, min_value
+
+ def get_chart(self, session, stats, samples, duration, max_value, min_value, append):
+ time_period = self.page.duration.get(session)
+ mode = self.page.mode.get(session)
+
+ width = self.page.container_width.get(session)
+ dot_size = 1
+ halo_size = 0
+ line_width = 1
+ if width > 400:
+ dot_size = 3
+ halo_size = 1
+ line_width = 2
+
+ chart = Chart()
+ chart.bg_colour = "#FFFFFF"
+ chart.elements = list()
+ tnow = time()
+ for stat, color in zip(stats, self.colors):
+ line = Element()
+ line.type = "area"
+ line.fill = color
+ line.fill_alpha = 0.3
+ line.on_show.type = "No"
+
+ line.dot_style = {"type": "solid-dot",
+ "dot-size": dot_size,
+ "halo-size": halo_size}
+ line.colour = color
+ line.width = line_width
+ line.text = mode == "rate" and "%s / sec" % stat.title or stat.title
+
+ vals = [{"x":int(time_period -(tnow - secs(dt))),
+ "y":value,
+ "uid": dt.strftime("%m%d%Y%H%M%S"),
+ "tip": "<br>%s: #val#<br>Time: %s" % (line.text, dt.strftime("%m/%d/%Y %H:%M:%S"))}
+ for dt, value, dev in reversed(samples[stat])
+ if value is not None]
+ line.values = vals
+ chart.elements.append(line)
+
+ if append:
+ chart.append = self.get_elapsed(session)['value']
+ #print "append: time_period=%i duration=%i elapsed=%f" % (time_period, duration, float(self.get_elapsed(session)['value']))
+ return chart
+
+ chart.title.text = ""
+ chart.title.style = "{text-align: left; font-weight: bold; font-size: 14px;}"
+ chart.tooltip = {"colour": "#000033",
+ "background": "#FFFFCC",
+ "stroke": 1,
+ "title": "{background-color: #000022; color: #FFFFFF; font-size: 1em;}",
+ "body": "{font-size: 10px; color: #000000;}"
+ }
+
+ chart.x_axis = self.get_x_axis(duration)
+ y_axis, y_axis_right = self.get_y_axis(max_value, min_value)
+ chart.y_axis = y_axis
+ chart.y_axis_right = y_axis_right
+
#print "sending entire sample set with y_axis.max=%i" % chart.y_axis["max"]
- return chart.create()
+ return chart
- def get_x_labels(self, duration, intervals, step):
- x_step = duration / intervals
- labels = list()
- for i in range(0, intervals + 1):
- label = dict()
- if i % step == 0:
- value = duration - i * x_step
- text = fmt_duration_brief(value)
+class StatFlashPage(StatChartPage):
+ def __init__(self, app, name):
+ super(StatFlashPage, self).__init__(app, name)
- label["text"] = text
- else:
- label["text"] = ""
- label["x"] = i * x_step
+ # number of milliseconds since the last update
+ self.elapsed = Parameter(app, "elapsed")
+ self.elapsed.default = None
+ self.add_parameter(self.elapsed)
- labels.append(label)
- return labels
+ # the current y-axis max reported by the .swf
+ self.axis_max = IntegerParameter(app, "amax")
+ self.axis_max.default = 0;
+ self.add_parameter(self.axis_max)
- def get_y_labels(self, absy, intervals, step):
- y_step = absy / intervals
- labels = list()
- for i in range(0, intervals + 1):
- label = dict()
+ # the max y value reported by the .swf
+ self.vals_max = IntegerParameter(app, "vmax")
+ self.vals_max.default = 0;
+ self.add_parameter(self.vals_max)
- if i % step == 0:
- value = int(round(i * y_step, 0))
+ self.chart_type = Parameter(app, "type")
+ self.chart_type.default = "area"
+ self.add_parameter(self.chart_type)
- if value >= 10000000:
- svalue = "%im" % int(round(value / 1000000.0, -1))
- elif value >= 10000:
- svalue = "%ik" % int(round(value / 1000.0, -1))
- else:
- svalue = str(value)
+ def get_content_type(self, session):
+ return "text/plain"
- label["text"] = svalue
- else:
- label["text"] = ""
- label["y"] = int(i * y_step)
+ def do_render(self, session):
+ object = self.get_object(session)[0]
+ cls = self.class_.get(session)
+ stats = [getattr(cls, x) for x in self.stats.get(session)]
- labels.append(label)
- return labels
+ chart = self.chart_factory(self.chart_type.get(session))
+ return chart.create(session, object, stats)
+ def chart_factory(self, chart_type):
+ if chart_type == "area":
+ chart_obj = AreaChart(self.app, chart_type, self)
+ elif chart_type == "stacked":
+ chart_obj = StackedChart(self.app, chart_type, self)
+
+ return chart_obj
+
class StatStackedPage(StatChartPage):
def do_render(self, session):
object = self.get_object(session)[0]
16 years, 10 months
rhmessaging commits: r3476 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-04 14:15:44 -0400 (Sat, 04 Jul 2009)
New Revision: 3476
Modified:
mgmt/trunk/cumin/resources/open-flash-chart.swf
Log:
Allow single quotes for json string keys since this is what python outputs natively using str(dict)
Modified: mgmt/trunk/cumin/resources/open-flash-chart.swf
===================================================================
(Binary files differ)
16 years, 10 months
rhmessaging commits: r3475 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-04 14:14:27 -0400 (Sat, 04 Jul 2009)
New Revision: 3475
Modified:
mgmt/trunk/cumin/python/cumin/OpenFlashChart.py
Log:
Use cjson or json if present.
Modified: mgmt/trunk/cumin/python/cumin/OpenFlashChart.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/OpenFlashChart.py 2009-07-04 18:12:38 UTC (rev 3474)
+++ mgmt/trunk/cumin/python/cumin/OpenFlashChart.py 2009-07-04 18:14:27 UTC (rev 3475)
@@ -10,7 +10,18 @@
# Author: Eugene Kin Chee Yip
# Date: 14 June 2009
-# Modified to not use json or cjson by Ernie
+# Modified to not require cjson or json by Ernie
+CJSON = False
+JJSON = False
+try:
+ import cjson
+ CJSON = True
+except ImportError:
+ try:
+ import json
+ JJSON = True
+ except ImportError:
+ pass
import copy
class Chart(dict):
@@ -66,9 +77,13 @@
# Encode the chart attributes as JSON
def create(self):
attributes = copy.copy(self)
- # the json parser in open flash chart .swf requires double quotes
- # this assumes we don't have any single quotes in the line names
- return str(attributes).replace("'", '"')
+ if CJSON:
+ return cjson.encode(attributes)
+ elif JJSON:
+ return json.dumps(attributes)
+ else:
+ return str(attributes)
+
class Element(Chart):
pass
\ No newline at end of file
16 years, 10 months