qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r1530301 [6/8] - in /qpid/trunk/qpid: cpp/src/tests/legacystore/ cpp/src/tests/legacystore/federation/ cpp/src/tests/legacystore/jrnl/ cpp/src/tests/legacystore/jrnl/jtt/ cpp/src/tests/legacystore/python_tests/ tools/src/py/ tools/src/py/qp...
Date Tue, 08 Oct 2013 15:09:01 GMT
Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/jtt.csv
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/jtt.csv?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/jtt.csv (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/jtt.csv Tue Oct  8 15:09:00 2013
@@ -0,0 +1,234 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+,,,,,,,"Msg size",,"Xid size",,,,,"enq-size",,"deq-size",,"txn-size",,
+"Test #","tf","pf","amn","mn incr","#msgs","ms incr","Min","Max","Min","Max","auto-deq","transient","extern","bytes","dblks","bytes","dblks","bytes","dblks","comment"
+,,,,,,,,,,,,,,,,,,,,
+"Initialize only",,,,,,,,,,,,,,,,,,,,
+0,"L",0,0,0,0,0,0,0,0,0,FALSE,FALSE,FALSE,44,1,0,0,0,0,"No messages -  journal creation/initialization only"
+,,,,,,,,,,,,,,,,,,,,
+"Simple message  combinations of persistent/deq transientueued/non-dequeued, transactional/non-transactional",,,,,,,,,,,,,,,,,,,,
+1,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,FALSE,54,1,0,0,0,0,"1 * 10-byte message"
+2,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,FALSE,54,1,0,0,0,0,"10 * 10-byte message"
+3,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,FALSE,54,1,0,0,0,0,"1 * 10-byte message [transient]"
+4,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,FALSE,54,1,0,0,0,0,"10 * 10-byte message [transient]"
+5,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,FALSE,64,1,0,0,0,0,"1 * 10-byte message [txn]"
+6,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,FALSE,64,1,0,0,0,0,"10 * 10-byte message [txn]"
+7,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,FALSE,64,1,0,0,0,0,"1 * 10-byte message [txn transient]"
+8,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,FALSE,64,1,0,0,0,0,"10 * 10-byte message [txn transient]"
+9,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,FALSE,54,1,32,1,0,0,"1 * 10-byte message [deq]"
+10,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,FALSE,54,1,32,1,0,0,"10 * 10-byte message [deq]"
+11,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,FALSE,54,1,32,1,0,0,"1 * 10-byte message [deq transient]"
+12,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,FALSE,54,1,32,1,0,0,"10 * 10-byte message [deq transient]"
+13,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [deq txn]"
+14,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [deq txn]"
+15,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient]"
+16,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient]"
+17,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [extern]"
+18,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [extern]"
+19,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [transient extern]"
+20,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [transient extern]"
+21,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn extern]"
+22,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn extern]"
+23,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn transient extern]"
+24,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn transient extern]"
+25,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq extern]"
+26,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq extern]"
+27,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq transient extern]"
+28,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq transient extern]"
+29,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [deq txn extern]"
+30,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [deq txn extern]"
+31,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient extern]"
+32,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient extern]"
+,,,,,,,,,,,,,,,,,,,,
+"Transition from one d-block to two per message",,,,,,,,,,,,,,,,,,,,
+33,"L",1,10,0,10,0,84,84,0,0,FALSE,FALSE,FALSE,128,1,0,0,0,0,"1 dblk exact fit"
+34,"L",1,10,0,10,1,85,85,0,0,FALSE,FALSE,FALSE,129,2,0,0,0,0,"1 dblk + 1 byte"
+35,"L",1,10,0,10,0,58,58,26,26,FALSE,FALSE,FALSE,128,1,0,0,0,0,"1 dblk exact fit [txn]"
+36,"L",1,10,0,10,1,59,59,26,26,FALSE,FALSE,FALSE,129,2,0,0,0,0,"1 dblk + 1 byte [txn]"
+,,,,,,,,,,,,,,,,,,,,
+"Transition from one s-block to two per message",,,,,,,,,,,,,,,,,,,,
+37,"L",1,10,0,10,0,468,468,0,0,FALSE,FALSE,FALSE,512,4,0,0,0,0,"1 sblk exact fit"
+38,"L",1,10,0,10,1,469,469,0,0,FALSE,FALSE,FALSE,513,5,0,0,0,0,"1 sblk + 1 byte"
+39,"L",1,10,0,10,0,442,442,26,26,FALSE,FALSE,FALSE,512,4,0,0,0,0,"1 sblk exact fit [txn]"
+40,"L",1,10,0,10,1,443,443,26,26,FALSE,FALSE,FALSE,513,5,0,0,0,0,"1 sblk + 1 byte [txn]"
+,,,,,,,,,,,,,,,,,,,,
+"Transition from first page to second",,,,,,,,,,,,,,,,,,,,
+41,"L",1,8,0,8,0,4052,4052,0,0,FALSE,FALSE,FALSE,4096,32,0,0,0,0,"1/8 page"
+42,"L",1,8,1,9,0,4052,4052,0,0,FALSE,FALSE,FALSE,4096,32,0,0,0,0,"1/8 page"
+43,"L",1,8,0,8,1,4053,4053,0,0,FALSE,FALSE,FALSE,4097,33,0,0,0,0,"1/8 page + 1 byte"
+44,"L",1,8,0,8,0,3796,3796,256,256,FALSE,FALSE,FALSE,4096,32,0,0,0,0,"1/8 page [txn]"
+45,"L",1,8,1,9,0,3796,3796,256,256,FALSE,FALSE,FALSE,4096,32,0,0,0,0,"1/8 page [txn]"
+46,"L",1,8,0,8,1,3797,3797,256,256,FALSE,FALSE,FALSE,4097,33,0,0,0,0,"1/8 page + 1 byte [txn]"
+47,"L",1,8,0,8,0,3924,3924,0,0,TRUE,FALSE,FALSE,3968,31,32,1,0,0,"1/8 page incl deq [deq]"
+48,"L",1,8,1,9,0,3924,3924,0,0,TRUE,FALSE,FALSE,3968,31,32,1,0,0,"1/8 page incl deq [deq]"
+49,"L",1,8,0,8,1,3925,3925,0,0,TRUE,FALSE,FALSE,3969,32,32,1,0,0,"1/8 page incl deq + 1 byte [deq]"
+50,"L",1,8,0,8,0,3028,3028,256,256,TRUE,FALSE,FALSE,3328,26,300,3,292,3,"1/8 page incl deq & txn [deq txn]"
+51,"L",1,8,1,9,0,3028,3028,256,256,TRUE,FALSE,FALSE,3328,26,300,3,292,3,"1/8 page incl deq & txn [deq txn]"
+52,"L",1,8,0,8,1,3029,3029,256,256,TRUE,FALSE,FALSE,3329,27,300,3,292,3,"1/8 page incl deq & txn + 1 byte [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"Page cache rollover (from page 32 back to page 0)",,,,,,,,,,,,,,,,,,,,
+53,"L",1,32,0,32,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page"
+54,"L",1,32,1,33,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page"
+55,"L",1,32,0,32,1,32725,32725,0,0,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"1 page + 1 byte"
+56,"L",1.5,22,0,22,0,49108,49108,0,0,FALSE,FALSE,FALSE,49152,384,0,0,0,0,"1.5 pages"
+57,"L",1,32,0,32,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page [txn]"
+58,"L",1,32,1,33,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page [txn]"
+59,"L",1,32,0,32,1,32469,32469,256,256,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"1 page + 1 byte [txn]"
+60,"L",1.5,22,0,22,0,48852,48852,256,256,FALSE,FALSE,FALSE,49152,384,0,0,0,0,"1.5 pages [txn]"
+61,"L",1,32,0,32,0,32596,32596,0,0,TRUE,FALSE,FALSE,32640,255,32,1,0,0,"1 page incl deq [deq]"
+62,"L",1,32,1,33,0,32596,32596,0,0,TRUE,FALSE,FALSE,32640,255,32,1,0,0,"1 page incl deq [deq]"
+63,"L",1,32,0,32,1,32597,32597,0,0,TRUE,FALSE,FALSE,32641,256,32,1,0,0,"1 page incl deq + 1 byte [deq]"
+64,"L",1.5,22,0,22,0,48980,48980,0,0,TRUE,FALSE,FALSE,49024,383,32,1,0,0,"1.5 pages incl deq [deq]"
+65,"L",1,32,0,32,0,31700,31700,256,256,TRUE,FALSE,FALSE,32000,250,300,3,292,3,"1 page incl deq & txn [deq txn]"
+66,"L",1,32,1,33,0,31700,31700,256,256,TRUE,FALSE,FALSE,32000,250,300,3,292,3,"1 page incl deq & txn [deq txn]"
+67,"L",1,32,0,32,1,31701,31701,256,256,TRUE,FALSE,FALSE,32001,251,300,3,292,3,"1 page incl deq & txn + 1 byte [deq txn]"
+68,"L",1.5,22,0,22,0,48084,48084,256,256,TRUE,FALSE,FALSE,48384,378,300,3,292,3,"1.5 pages incl deq & txn [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"File transition (from file 0000 to 0001)",,,,,,,,,,,,,,,,,,,,
+69,"L",1,48,0,48,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page"
+70,"L",1,48,1,49,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page"
+71,"L",1,48,0,48,1,32725,32725,0,0,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"1 page + 1 byte"
+72,"L",2.5,20,0,20,0,81876,81876,0,0,FALSE,FALSE,FALSE,81920,640,0,0,0,0,"2.5 pages"
+73,"L",1,48,0,48,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page [txn]"
+74,"L",1,48,1,49,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"1 page [txn]"
+75,"L",1,48,0,48,1,32469,32469,256,256,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"1 page + 1 byte [txn]"
+76,"L",2.5,20,0,20,0,81620,81620,256,256,FALSE,FALSE,FALSE,81920,640,0,0,0,0,"2.5 pages [txn]"
+77,"L",1,48,0,48,0,32596,32596,0,0,TRUE,FALSE,FALSE,32640,255,32,1,0,0,"1 page incl deq [deq]"
+78,"L",1,48,1,49,0,32596,32596,0,0,TRUE,FALSE,FALSE,32640,255,32,1,0,0,"1 page incl deq [deq]"
+79,"L",1,48,0,48,1,32597,32597,0,0,TRUE,FALSE,FALSE,32641,256,32,1,0,0,"1 page incl deq + 1 byte [deq]"
+80,"L",2.5,20,0,20,0,81748,81748,0,0,TRUE,FALSE,FALSE,81792,639,32,1,0,0,"2.5 pages incl deq [deq]"
+81,"L",1,48,0,48,0,31700,31700,256,256,TRUE,FALSE,FALSE,32000,250,300,3,292,3,"1 page incl deq & txn [deq txn]"
+82,"L",1,48,1,49,0,31700,31700,256,256,TRUE,FALSE,FALSE,32000,250,300,3,292,3,"1 page incl deq & txn [deq txn]"
+83,"L",1,48,0,48,1,31701,31701,256,256,TRUE,FALSE,FALSE,32001,251,300,3,292,3,"1 page incl deq & txn + 1 byte [deq txn]"
+84,"L",2.5,20,0,20,0,80852,80852,256,256,TRUE,FALSE,FALSE,81152,634,300,3,292,3,"2.5 pages incl deq & txn [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"File rollover (from file 0007 to 0000) - RHM_WRONLY req'd for auto-dequeue == FALSE",,,,,,,,,,,,,,,,,,,,
+85,"L",0.5,16,0,16,0,786260,786260,0,0,TRUE,FALSE,FALSE,786304,6143,32,1,0,0,"24 pages incl deq = ½ file [deq]"
+86,"L",0.5,16,1,17,0,786260,786260,0,0,TRUE,FALSE,FALSE,786304,6143,32,1,0,0,"24 pages incl deq = ½ file [deq]"
+87,"L",0.5,16,0,16,1,786261,786261,0,0,TRUE,FALSE,FALSE,786305,6144,32,1,0,0,"24 pages incl deq + 1 byte [deq]"
+88,"L",0.5,16,0,16,0,785364,785364,256,256,TRUE,FALSE,FALSE,785664,6138,300,3,292,3,"24 pages incl deq & txn = ½ file [deq txn]"
+89,"L",0.5,16,1,17,0,785364,785364,256,256,TRUE,FALSE,FALSE,785664,6138,300,3,292,3,"24 pages incl deq & txn = ½ file [deq txn]"
+90,"L",0.5,16,0,16,1,785365,785365,256,256,TRUE,FALSE,FALSE,785665,6139,300,3,292,3,"24 pages incl deq & txn + 1 byte [deq txn]"
+91,"L",0.25,32,0,32,0,786260,786260,0,0,TRUE,FALSE,FALSE,786304,6143,32,1,0,0,"24 pages incl deq = ½ file [deq]"
+92,"L",0.25,32,1,33,0,786260,786260,0,0,TRUE,FALSE,FALSE,786304,6143,32,1,0,0,"24 pages incl deq = ½ file [deq]"
+93,"L",0.25,32,0,32,1,786261,786261,0,0,TRUE,FALSE,FALSE,786305,6144,32,1,0,0,"24 pages incl deq + 1 byte [deq]"
+94,"L",0.25,32,0,32,0,785364,785364,256,256,TRUE,FALSE,FALSE,785664,6138,300,3,292,3,"24 pages incl deq & txn = ½ file [deq txn]"
+95,"L",0.25,32,1,33,0,785364,785364,256,256,TRUE,FALSE,FALSE,785664,6138,300,3,292,3,"24 pages incl deq & txn = ½ file [deq txn]"
+96,"L",0.25,32,0,32,1,785365,785365,256,256,TRUE,FALSE,FALSE,785665,6139,300,3,292,3,"24 pages incl deq & txn + 1 byte [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"Multi-page messages (large messages) - tests various paths in encoder.",,,,,,,,,,,,,,,,,,,,
+97,"L",1,16,0,16,0,32724,32724,0,0,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"data 1 page"
+98,"L",1,16,0,16,1,32725,32725,0,0,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"data 1 page + 1 byte (tail split; 1 byte over page boundary)"
+99,"L",1,16,0,16,11,32735,32735,0,0,FALSE,FALSE,FALSE,32779,257,0,0,0,0,"data 1 page + 11 bytes (tail split; 11 bytes over page boundary)"
+100,"L",1,16,0,16,12,32736,32736,0,0,FALSE,FALSE,FALSE,32780,257,0,0,0,0,"data 1 page + 12 bytes (tail separated exactly onto next page)"
+101,"L",1,16,0,16,13,32737,32737,0,0,FALSE,FALSE,FALSE,32781,257,0,0,0,0,"data 1 page + 13 bytes (data split; 1 byte over page boundary)"
+102,"L",1,16,0,16,0,32468,32468,256,256,FALSE,FALSE,FALSE,32768,256,0,0,0,0,"data 1 page [txn]"
+103,"L",1,16,0,16,1,32469,32469,256,256,FALSE,FALSE,FALSE,32769,257,0,0,0,0,"data 1 page + 1 byte (tail split; 1 byte over page boundary) [txn]"
+104,"L",1,16,0,16,11,32479,32479,256,256,FALSE,FALSE,FALSE,32779,257,0,0,0,0,"data 1 page + 11 bytes (tail split; 11 bytes over page boundary) [txn]"
+105,"L",1,16,0,16,12,32480,32480,256,256,FALSE,FALSE,FALSE,32780,257,0,0,0,0,"data 1 page + 12 bytes (tail separated exactly onto next page) [txn]"
+106,"L",1,16,0,16,13,32481,32481,256,256,FALSE,FALSE,FALSE,32781,257,0,0,0,0,"data 1 page + 13 bytes (data split; 1 byte over page boundary) [txn]"
+107,"L",2,16,0,16,0,65492,65492,0,0,FALSE,FALSE,FALSE,65536,512,0,0,0,0,"data 2 pages"
+108,"L",2,16,0,16,1,65493,65493,0,0,FALSE,FALSE,FALSE,65537,513,0,0,0,0,"data 2 pages + 1 byte (tail split; 1 byte over page boundary)"
+109,"L",2,16,0,16,11,65503,65503,0,0,FALSE,FALSE,FALSE,65547,513,0,0,0,0,"data 2 pages + 11 bytes (tail split; 11 bytes over page boundary)"
+110,"L",2,16,0,16,12,65504,65504,0,0,FALSE,FALSE,FALSE,65548,513,0,0,0,0,"data 2 pages + 12 bytes (tail separated exactly onto next page)"
+111,"L",2,16,0,16,13,65505,65505,0,0,FALSE,FALSE,FALSE,65549,513,0,0,0,0,"data 2 pages + 13 bytes (data split; 1 byte over page boundary)"
+112,"L",2,16,0,16,0,65236,65236,256,256,FALSE,FALSE,FALSE,65536,512,0,0,0,0,"data 2 pages [txn]"
+113,"L",2,16,0,16,1,65237,65237,256,256,FALSE,FALSE,FALSE,65537,513,0,0,0,0,"data 2 pages + 1 byte (tail split; 1 byte over page boundary) [txn]"
+114,"L",2,16,0,16,11,65247,65247,256,256,FALSE,FALSE,FALSE,65547,513,0,0,0,0,"data 2 pages + 11 bytes (tail split; 11 bytes over page boundary) [txn]"
+115,"L",2,16,0,16,12,65248,65248,256,256,FALSE,FALSE,FALSE,65548,513,0,0,0,0,"data 2 pages + 12 bytes (tail separated exactly onto next page) [txn]"
+116,"L",2,16,0,16,13,65249,65249,256,256,FALSE,FALSE,FALSE,65549,513,0,0,0,0,"data 2 pages + 13 bytes (data split; 1 byte over page boundary) [txn]"
+117,"L",4,16,0,16,0,131028,131028,0,0,FALSE,FALSE,FALSE,131072,1024,0,0,0,0,"data 4 pages"
+118,"L",4,16,0,16,1,131029,131029,0,0,FALSE,FALSE,FALSE,131073,1025,0,0,0,0,"data 4 pages + 1 byte (tail split; 1 byte over page boundary)"
+119,"L",4,16,0,16,11,131039,131039,0,0,FALSE,FALSE,FALSE,131083,1025,0,0,0,0,"data 4 pages + 11 bytes (tail split; 11 bytes over page boundary)"
+120,"L",4,16,0,16,12,131040,131040,0,0,FALSE,FALSE,FALSE,131084,1025,0,0,0,0,"data 4 pages + 12 bytes (tail separated exactly onto next page)"
+121,"L",4,16,0,16,13,131041,131041,0,0,FALSE,FALSE,FALSE,131085,1025,0,0,0,0,"data 4 pages + 13 bytes (data split; 1 byte over page boundary)"
+122,"L",4,16,0,16,0,130772,130772,256,256,FALSE,FALSE,FALSE,131072,1024,0,0,0,0,"data 4 pages [txn]"
+123,"L",4,16,0,16,1,130773,130773,256,256,FALSE,FALSE,FALSE,131073,1025,0,0,0,0,"data 4 pages + 1 byte (tail split; 1 byte over page boundary) [txn]"
+124,"L",4,16,0,16,11,130783,130783,256,256,FALSE,FALSE,FALSE,131083,1025,0,0,0,0,"data 4 pages + 11 bytes (tail split; 11 bytes over page boundary) [txn]"
+125,"L",4,16,0,16,12,130784,130784,256,256,FALSE,FALSE,FALSE,131084,1025,0,0,0,0,"data 4 pages + 12 bytes (tail separated exactly onto next page) [txn]"
+126,"L",4,16,0,16,13,130785,130785,256,256,FALSE,FALSE,FALSE,131085,1025,0,0,0,0,"data 4 pages + 13 bytes (data split; 1 byte over page boundary) [txn]"
+127,"L",3.5,16,0,16,0,114644,114644,0,0,FALSE,FALSE,FALSE,114688,896,0,0,0,0,"data 3.5 pages"
+128,"L",3.5,16,0,16,1,114645,114645,0,0,FALSE,FALSE,FALSE,114689,897,0,0,0,0,"data 3.5 pages + 1 byte"
+129,"L",3.5,16,0,16,0,114388,114388,256,256,FALSE,FALSE,FALSE,114688,896,0,0,0,0,"data 3.5 pages [txn]"
+130,"L",3.5,16,0,16,1,114389,114389,256,256,FALSE,FALSE,FALSE,114689,897,0,0,0,0,"data 3.5 pages + 1 byte [txn]"
+131,"L",1,16,0,16,-1,10,10,32735,32735,FALSE,FALSE,FALSE,32789,257,0,0,0,0,"xid 1 page – 1 byte; data 10 bytes (exact fit) [txn]"
+132,"L",1,16,0,16,0,10,10,32736,32736,FALSE,FALSE,FALSE,32790,257,0,0,0,0,"xid 1 page; data 10 bytes (exact fit) [txn]"
+133,"L",1,16,0,16,1,10,10,32737,32737,FALSE,FALSE,FALSE,32791,257,0,0,0,0,"xid 1 page + 1 byte; data 10 bytes (exact fit) [txn]"
+134,"L",2,16,0,16,-1,10,10,65503,65503,FALSE,FALSE,FALSE,65557,513,0,0,0,0,"xid 2 pages – 1 byte; data 10 bytes (exact fit) [txn]"
+135,"L",2,16,0,16,0,10,10,65504,65504,FALSE,FALSE,FALSE,65558,513,0,0,0,0,"xid 2 pages; data 10 bytes (exact fit) [txn]"
+136,"L",2,16,0,16,1,10,10,65505,65505,FALSE,FALSE,FALSE,65559,513,0,0,0,0,"xid 2 pages + 1 byte; data 10 bytes (exact fit) [txn]"
+137,"L",4,16,0,16,-1,10,10,131039,131039,FALSE,FALSE,FALSE,131093,1025,0,0,0,0,"xid 4 pages – 1 byte; data 10 bytes (exact fit) [txn]"
+138,"L",4,16,0,16,0,10,10,131040,131040,FALSE,FALSE,FALSE,131094,1025,0,0,0,0,"xid 4 pages; data 10 bytes (exact fit) [txn]"
+139,"L",4,16,0,16,1,10,10,131041,131041,FALSE,FALSE,FALSE,131095,1025,0,0,0,0,"xid 4 pages + 1 byte; data 10 bytes (exact fit) [txn]"
+140,"L",3.5,16,0,16,0,10,10,114656,114656,FALSE,FALSE,FALSE,114710,897,0,0,0,0,"xid 3.5 pages; data 10 bytes (exact fit) [txn]"
+141,"L",3.5,16,0,16,1,10,10,114657,114657,FALSE,FALSE,FALSE,114711,897,0,0,0,0,"xid 3.5 pages + 1 byte; data 10 bytes (exact fit) [txn]"
+142,"L",1,16,0,16,-1,10,10,32735,32735,TRUE,FALSE,FALSE,32789,257,32779,257,32771,257,"xid 1 page – 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+143,"L",1,16,0,16,0,10,10,32736,32736,TRUE,FALSE,FALSE,32790,257,32780,257,32772,257,"xid 1 page for enq rec; data 10 bytes (exact fit) [deq, txn]"
+144,"L",1,16,0,16,1,10,10,32737,32737,TRUE,FALSE,FALSE,32791,257,32781,257,32773,257,"xid 1 page + 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+145,"L",2,16,0,16,-1,10,10,65503,65503,TRUE,FALSE,FALSE,65557,513,65547,513,65539,513,"xid 2 pages – 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+146,"L",2,16,0,16,0,10,10,65504,65504,TRUE,FALSE,FALSE,65558,513,65548,513,65540,513,"xid 2 pages for enq rec; data 10 bytes (exact fit) [deq, txn]"
+147,"L",2,16,0,16,1,10,10,65505,65505,TRUE,FALSE,FALSE,65559,513,65549,513,65541,513,"xid 2 pages + 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+148,"L",4,16,0,16,-1,10,10,131039,131039,TRUE,FALSE,FALSE,131093,1025,131083,1025,131075,1025,"xid 4 pages – 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+149,"L",4,16,0,16,0,10,10,131040,131040,TRUE,FALSE,FALSE,131094,1025,131084,1025,131076,1025,"xid 4 pages for enq rec; data 10 bytes (exact fit) [deq, txn]"
+150,"L",4,16,0,16,1,10,10,131041,131041,TRUE,FALSE,FALSE,131095,1025,131085,1025,131077,1025,"xid 4 pages + 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+151,"L",3.5,16,0,16,0,10,10,114656,114656,TRUE,FALSE,FALSE,114710,897,114700,897,114692,897,"xid 3.5 pages for enq rec; data 10 bytes (exact fit) [deq, txn]"
+152,"L",3.5,16,0,16,1,10,10,114657,114657,TRUE,FALSE,FALSE,114711,897,114701,897,114693,897,"xid 3.5 pages + 1 byte for enq rec; data 10 bytes (exact fit) [deq, txn]"
+153,"L",1,16,0,16,-1,10,10,32735,32735,TRUE,FALSE,FALSE,32789,257,32779,257,32771,257,"xid 1 page – 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+154,"L",1,16,0,16,0,10,10,32736,32736,TRUE,FALSE,FALSE,32790,257,32780,257,32772,257,"xid 1 page for deq rec; data 10 bytes (exact fit) [deq, txn]"
+155,"L",1,16,0,16,1,10,10,32737,32737,TRUE,FALSE,FALSE,32791,257,32781,257,32773,257,"xid 1 page + 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+156,"L",2,16,0,16,-1,10,10,65503,65503,TRUE,FALSE,FALSE,65557,513,65547,513,65539,513,"xid 2 pages – 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+157,"L",2,16,0,16,0,10,10,65504,65504,TRUE,FALSE,FALSE,65558,513,65548,513,65540,513,"xid 2 pages for deq rec; data 10 bytes (exact fit) [deq, txn]"
+158,"L",2,16,0,16,1,10,10,65505,65505,TRUE,FALSE,FALSE,65559,513,65549,513,65541,513,"xid 2 pages + 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+159,"L",4,16,0,16,-1,10,10,131039,131039,TRUE,FALSE,FALSE,131093,1025,131083,1025,131075,1025,"xid 4 pages – 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+160,"L",4,16,0,16,0,10,10,131040,131040,TRUE,FALSE,FALSE,131094,1025,131084,1025,131076,1025,"xid 4 pages for deq rec; data 10 bytes (exact fit) [deq, txn]"
+161,"L",4,16,0,16,1,10,10,131041,131041,TRUE,FALSE,FALSE,131095,1025,131085,1025,131077,1025,"xid 4 pages + 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+162,"L",3.5,16,0,16,0,10,10,114656,114656,TRUE,FALSE,FALSE,114710,897,114700,897,114692,897,"xid 3.5 pages for deq rec; data 10 bytes (exact fit) [deq, txn]"
+163,"L",3.5,16,0,16,1,10,10,114657,114657,TRUE,FALSE,FALSE,114711,897,114701,897,114693,897,"xid 3.5 pages + 1 byte for deq rec; data 10 bytes (exact fit) [deq, txn]"
+164,"L",1,16,0,16,-1,10,10,32743,32743,TRUE,FALSE,FALSE,32797,257,32787,257,32779,257,"xid 1 page – 1 byte for txn rec; data 10 bytes (exact fit) [deq, txn]"
+165,"L",1,16,0,16,0,10,10,32744,32744,TRUE,FALSE,FALSE,32798,257,32788,257,32780,257,"xid 1 page for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+166,"L",1,16,0,16,1,10,10,32745,32745,TRUE,FALSE,FALSE,32799,257,32789,257,32781,257,"xid 1 page + 1 byte for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+167,"L",2,16,0,16,-1,10,10,65511,65511,TRUE,FALSE,FALSE,65565,513,65555,513,65547,513,"xid 2 pages – 1 byte for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+168,"L",2,16,0,16,0,10,10,65512,65512,TRUE,FALSE,FALSE,65566,513,65556,513,65548,513,"xid 2 pages for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+169,"L",2,16,0,16,1,10,10,65513,65513,TRUE,FALSE,FALSE,65567,513,65557,513,65549,513,"xid 2 pages + 1 byte for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+170,"L",4,16,0,16,-1,10,10,131047,131047,TRUE,FALSE,FALSE,131101,1025,131091,1025,131083,1025,"xid 4 pages – 1 byte for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+171,"L",4,16,0,16,0,10,10,131048,131048,TRUE,FALSE,FALSE,131102,1025,131092,1025,131084,1025,"xid 4 pages for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+172,"L",4,16,0,16,1,10,10,131049,131049,TRUE,FALSE,FALSE,131103,1025,131093,1025,131085,1025,"xid 4 pages + 1 byte for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+173,"L",3.5,16,0,16,0,10,10,114664,114664,TRUE,FALSE,FALSE,114718,897,114708,897,114700,897,"xid 3.5 pages for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+174,"L",3.5,16,0,16,1,10,10,114665,114665,TRUE,FALSE,FALSE,114719,897,114709,897,114701,897,"xid 3.5 pages + 1 byte for  txn rec; data 10 bytes (exact fit) [deq, txn]"
+,,,,,,,,,,,,,,,,,,,,
+"High volume tests of random message lengths - RHM_WRONLY req'd for auto-dequeue == FALSE",,,,,,,,,,,,,,,,,,,,
+#175,"M",1,5000000,0,5000000,0,0,84,0,0,TRUE,FALSE,FALSE,128,1,32,1,0,0,"1 dblk max [deq]"
+#176,"M",3,3000000,0,3000000,0,0,340,0,0,TRUE,FALSE,FALSE,384,3,32,1,0,0,"3 dblks max [deq]"
+#177,"M",10,1600000,0,1600000,0,0,1236,0,0,TRUE,FALSE,FALSE,1280,10,32,1,0,0,"10 dblks max [deq]"
+#178,"M",30,600000,0,600000,0,0,3796,0,0,TRUE,FALSE,FALSE,3840,30,32,1,0,0,"30 dblks max [deq]"
+#179,"M",100,200000,0,200000,0,0,12756,0,0,TRUE,FALSE,FALSE,12800,100,32,1,0,0,"100 dblks max [deq]"
+#180,"M",300,60000,0,60000,0,0,38356,0,0,TRUE,FALSE,FALSE,38400,300,32,1,0,0,"300 dblks max [deq]"
+#181,"M",1000,20000,0,20000,0,0,127956,0,0,TRUE,FALSE,FALSE,128000,1000,32,1,0,0,"1000 dblks max [deq]"
+#182,"M",1,5000000,0,5000000,0,0,100,1,100,TRUE,FALSE,FALSE,244,2,144,2,136,2,"100 bytes xid max + 100 bytes data max [deq txn]"
+#183,"M",3,3000000,0,3000000,0,0,300,1,300,TRUE,FALSE,FALSE,644,6,344,3,336,3,"300 bytes xid max + 300 bytes data max [deq txn]"
+#184,"M",10,1600000,0,1600000,0,0,1000,1,1000,TRUE,FALSE,FALSE,2044,16,1044,9,1036,9,"1000 bytes xid max + 1000 bytes data max [deq txn]"
+#185,"M",30,600000,0,600000,0,0,3000,1,3000,TRUE,FALSE,FALSE,6044,48,3044,24,3036,24,"3000 bytes xid max + 3000 bytes data max [deq txn]"
+#186,"M",100,200000,0,200000,0,0,10000,1,10000,TRUE,FALSE,FALSE,20044,157,10044,79,10036,79,"10000 bytes xid max + 10000 bytes data max [deq txn]"
+#187,"M",300,60000,0,60000,0,0,30000,1,30000,TRUE,FALSE,FALSE,60044,470,30044,235,30036,235,"30000 bytes xid max + 30000 bytes data max [deq txn]"
+#188,"M",1000,20000,0,20000,0,0,100000,1,100000,TRUE,FALSE,FALSE,200044,1563,100044,782,100036,782,"100000 bytes xid max + 100000 bytes data max [deq txn]"
+,,,,,,,,,,,,,,,,,,,,
+"STANDARD PERFORMANCE BENCHMARK: 10,000,000 writes, data=212b (2 dblks)",,,,,,,,,,,,,,,,,,,,
+#189,"M",1,10000000,0,10000000,0,212,212,0,0,TRUE,FALSE,FALSE,256,2,32,1,0,0,"212 bytes data (2 dblks enq + 1 dblk deq)"
+#190,"M",1,10000000,0,10000000,0,148,148,64,64,TRUE,FALSE,FALSE,256,2,108,1,100,1,"148 bytes data + 64 bytes xid (2 dblks enq + 1 dblks deq + 1 dblks txn)"

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/main.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/main.cpp?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/main.cpp (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/main.cpp Tue Oct  8 15:09:00 2013
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "test_mgr.h"
+
+#include "args.h"
+#include <csignal>
+#include <iostream>
+
+#define PACKAGE_NAME "Journal Test Tool"
+#define VERSION "0.1"
+
+namespace po = boost::program_options;
+
+int main(int argc, char** argv)
+{
+    std::signal(SIGINT, mrg::jtt::test_mgr::signal_handler);
+    std::signal(SIGTERM, mrg::jtt::test_mgr::signal_handler);
+
+    std::cout << PACKAGE_NAME << " v." << VERSION << std::endl;
+
+    std::ostringstream oss;
+    oss << PACKAGE_NAME << " options";
+    mrg::jtt::args args(oss.str());
+    if (args.parse(argc, argv)) return 1;
+
+    try
+    {
+        mrg::jtt::test_mgr tm(args);
+        tm.run();
+        if (tm.error()) return 2; // One or more tests threw exceptions
+    }
+    catch (const std::exception& e)
+    {
+        std::cerr << e.what() << std::endl;
+        return 3;
+    }
+    return 0;
+}

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.cpp?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.cpp (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.cpp Tue Oct  8 15:09:00 2013
@@ -0,0 +1,93 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "read_arg.h"
+
+#include <cassert>
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+namespace mrg
+{
+namespace jtt
+{
+std::map<std::string, read_arg::read_mode_t> read_arg::_map;
+std::string read_arg::_description;
+const bool read_arg::init = __init();
+
+// static init fn
+bool
+read_arg::__init()
+{
+    // Set string versions of each enum option here
+    _map["NONE"] = NONE;
+    _map["ALL"] = ALL;
+    _map["RANDOM"] = RANDOM;
+    _map["LAZYLOAD"] = LAZYLOAD;
+    _description = "Determines if and when messages will be read prior to dequeueing. "
+            "Values: (NONE | ALL | RANDOM | LAZYLOAD)";
+    return true;
+}
+
+void
+read_arg::parse(const std::string& str)
+{
+    std::map<std::string, read_arg::read_mode_t>::const_iterator i = _map.find(str);
+    if (i == _map.end())
+        throw po::invalid_option_value(str);
+    _rm = i->second;
+}
+
+// static fn
+const std::string&
+read_arg::str(const read_mode_t rm)
+{
+    std::map<std::string, read_mode_t>::const_iterator i = _map.begin();
+    while (i->second != rm && i != _map.end()) i++;
+    assert(i != _map.end());
+    return i->first;
+}
+
+// static fn
+const std::string&
+read_arg::descr()
+{
+    return _description;
+}
+
+std::ostream&
+operator<<(std::ostream& os, const read_arg& ra)
+{
+    os << ra.str();
+    return os;
+}
+
+std::istream&
+operator>>(std::istream& is, read_arg& ra)
+{
+    std::string s;
+    is >> s;
+    ra.parse(s);
+    return is;
+}
+
+} // namespace jtt
+} // namespace mrg

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.h?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.h (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/read_arg.h Tue Oct  8 15:09:00 2013
@@ -0,0 +1,62 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#ifndef mrg_jtt_read_arg_hpp
+#define mrg_jtt_read_arg_hpp
+
+#include <string>
+#include <map>
+
+namespace mrg
+{
+namespace jtt
+{
+
+class read_arg
+{
+    public:
+        enum read_mode_t { NONE, ALL, RANDOM, LAZYLOAD};
+    private:
+        static std::map<std::string, read_mode_t> _map;
+        static std::string _description;
+        static const bool init;
+        static bool __init();
+        read_mode_t _rm;
+    public:
+        inline read_arg() : _rm(NONE) {}
+        inline read_arg(read_mode_t rm) : _rm(rm) {}
+
+        inline read_mode_t val() const { return _rm; }
+        inline void set_val(const read_mode_t rm) { _rm = rm; }
+        void parse(const std::string& str);
+
+        inline const std::string& str() const { return str(_rm); }
+        static const std::string& str(const read_mode_t rm);
+        static const std::string& descr();
+
+        friend std::ostream& operator<<(std::ostream& os, const read_arg& ra);
+        friend std::istream& operator>>(std::istream& is, read_arg& ra);
+};
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_read_arg_hpp

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.cpp?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.cpp (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.cpp Tue Oct  8 15:09:00 2013
@@ -0,0 +1,179 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "test_case.h"
+
+#include <cstdlib>
+#include <iomanip>
+#include <sstream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_case::test_case(const unsigned test_case_num, const u_int32_t num_msgs,
+        const std::size_t min_data_size, const std::size_t max_data_size, const bool auto_deq,
+        const std::size_t min_xid_size, const std::size_t max_xid_size, const transient_t transient,
+        const external_t external, const std::string& comment):
+        _test_case_num(test_case_num),
+        _num_msgs(num_msgs),
+        _min_data_size(min_data_size),
+        _max_data_size(max_data_size),
+        _auto_dequeue(auto_deq),
+        _min_xid_size(min_xid_size),
+        _max_xid_size(max_xid_size),
+        _transient(transient),
+        _external(external),
+        _comment(comment),
+        _result_average(),
+        _result_jmap()
+{}
+
+test_case::~test_case()
+{}
+
+std::size_t
+test_case::this_data_size() const
+{
+    if (_min_data_size == _max_data_size)
+        return _max_data_size;
+    std::size_t size_diff = _max_data_size - _min_data_size;
+    return _min_data_size + std::size_t(1.0 * std::rand() * size_diff/(RAND_MAX + 1.0));
+}
+
+std::size_t
+test_case::this_xid_size() const
+{
+    // TODO: rework when probabilities are introduced. Assume 50% if _min_xid_size = 0
+    if (_max_xid_size == 0)
+        return std::size_t(0);
+    if (_min_xid_size == 0)
+    {
+        if (1.0 * std::rand() / RAND_MAX < 0.5)
+            return std::size_t(0);
+    }
+    std::size_t size_diff = _max_xid_size - _min_xid_size;
+    return _min_xid_size + std::size_t(1.0 * std::rand() * size_diff/(RAND_MAX + 1.0));
+}
+
+bool
+test_case::this_transience() const
+{
+    // TODO: rework when probabilities are introduced. Assume 50% if JTT_RANDOM
+    if (_transient == JTT_TRANSIENT)
+        return false;
+    if (_transient == JTT_PERSISTNET)
+        return true;
+    return 1.0 * std::rand() / RAND_MAX < 0.5;
+}
+
+bool
+test_case::this_external() const
+{
+    // TODO: rework when probabilities are introduced. Assume 50% if JDL_RANDOM
+    if (_external == JDL_INTERNAL)
+        return false;
+    if (_external == JDL_EXTERNAL)
+        return true;
+    return 1.0 * std::rand() / RAND_MAX < 0.5;
+}
+
+void
+test_case::add_result(test_case_result::shared_ptr& tcrp)
+{
+    _result_average.add_test_result(tcrp);
+    res_map_citr ari = _result_jmap.find(tcrp->jid());
+    if (ari == _result_jmap.end())
+    {
+        test_case_result_agregation::shared_ptr p(new test_case_result_agregation(tcrp->jid()));
+        p->add_test_result(tcrp);
+        _result_jmap.insert(res_map_pair(tcrp->jid(), p));
+    }
+    else
+        ari->second->add_test_result(tcrp);
+}
+
+void
+test_case::set_fmt_chk_res(const bool res, const std::string& jid)
+{
+    _result_average.set_fmt_chk_res(res);
+    res_map_citr ari = _result_jmap.find(jid);
+    if (ari != _result_jmap.end())
+        ari->second->set_fmt_chk_res(res);
+}
+
+const test_case_result::shared_ptr
+test_case::jmap_last(std::string& jid) const
+{
+    res_map_citr i = _result_jmap.find(jid);
+    if (i == _result_jmap.end())
+        return test_case_result::shared_ptr();
+    u_int32_t num_res = (*i).second->num_results();
+    if (num_res)
+        return (*(*i).second)[num_res - 1];
+    return test_case_result::shared_ptr();
+}
+
+void
+test_case::clear()
+{
+    _result_average.clear();
+    _result_jmap.clear();
+}
+
+const std::string
+test_case::str() const
+{
+    std::ostringstream oss;
+    oss << "Test Parameters: Test case no. " << _test_case_num << ":" << std::endl;
+    oss << "  Comment: " << _comment << std::endl;
+    oss << "  Number of messages: " << _num_msgs << std::endl;
+    oss << "  Data size: " << _min_data_size;
+    if (_min_data_size == _max_data_size)
+        oss << " bytes (fixed)" << std::endl;
+    else
+        oss << " - " << _max_data_size << " bytes" << std::endl;
+    oss << "  XID size: " << _min_xid_size;
+    if (_min_xid_size == _max_xid_size)
+        oss << " bytes (fixed)" << std::endl;
+    else
+        oss << " - " <<  _max_xid_size << " bytes" << std::endl;
+    oss << "  Auto-dequeue: " << (_auto_dequeue ? "true" : "false") << std::endl;
+    oss << "  Persistence: ";
+    switch (_transient)
+    {
+        case JTT_TRANSIENT: oss << "TRANSIENT" << std::endl; break;
+        case JTT_PERSISTNET: oss << "PERSISTNET" << std::endl; break;
+        case JTT_RANDOM: oss << "RANDOM" << std::endl; break;
+    }
+    oss << "  Message Data: ";
+    switch (_external)
+    {
+        case JDL_INTERNAL: oss << "INTERNAL"; break;
+        case JDL_EXTERNAL: oss << "EXTERNAL"; break;
+        case JDL_RANDOM: oss << "RANDOM"; break;
+    }
+    return oss.str();
+}
+
+} // namespace jtt
+} // namespace mrg

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.h?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.h (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case.h Tue Oct  8 15:09:00 2013
@@ -0,0 +1,110 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#ifndef mrg_jtt_test_case_hpp
+#define mrg_jtt_test_case_hpp
+
+#include <boost/shared_ptr.hpp>
+#include <cstddef>
+#include <map>
+#include "test_case_result.h"
+#include "test_case_result_agregation.h"
+#include <vector>
+
+namespace mrg
+{
+namespace jtt
+{
+
+    class test_case
+    {
+    public:
+        enum transient_type { JTT_TRANSIENT = 0, JTT_PERSISTNET, JTT_RANDOM };
+        typedef transient_type transient_t;
+
+        enum data_location { JDL_INTERNAL = 0, JDL_EXTERNAL, JDL_RANDOM };
+        typedef data_location external_t;
+
+        typedef boost::shared_ptr<test_case> shared_ptr;
+
+        typedef std::map<std::string, test_case_result_agregation::shared_ptr> res_map;
+        typedef std::pair<std::string, test_case_result_agregation::shared_ptr> res_map_pair;
+        typedef res_map::const_iterator res_map_citr;
+
+    private:
+        unsigned _test_case_num;
+        u_int32_t _num_msgs;
+        std::size_t _min_data_size;
+        std::size_t _max_data_size;
+        bool _auto_dequeue;
+        // TODO: add probability of transaction to these params
+        std::size_t _min_xid_size;
+        std::size_t _max_xid_size;
+        // TODO: change these enums (transient_t & external_t) to probabilities
+        transient_t _transient;
+        external_t _external;
+        std::string _comment;
+
+        test_case_result_agregation _result_average; // overall average result
+        res_map _result_jmap; // map of per-journal averages
+
+    public:
+        test_case(const unsigned test_case_num, const u_int32_t num_msgs,
+                const std::size_t min_data_size, const std::size_t max_data_size,
+                const bool auto_deq,  const std::size_t min_xid_size,
+                const std::size_t max_xid_size, const transient_t transient,
+                const external_t external, const std::string& comment);
+        virtual ~test_case();
+
+        inline unsigned test_case_num() const { return _test_case_num; }
+        inline u_int32_t num_msgs() const { return _num_msgs; }
+        inline std::size_t min_data_size() const { return _min_data_size; }
+        inline std::size_t max_data_size() const { return _max_data_size; }
+        std::size_t this_data_size() const;
+        inline bool auto_deq() const { return _auto_dequeue; }
+        inline std::size_t min_xid_size() const { return _min_xid_size; }
+        inline std::size_t max_xid_size() const { return _max_xid_size; }
+        std::size_t this_xid_size() const;
+        inline transient_t transient() const { return _transient; }
+        bool this_transience() const;
+        inline external_t external() const { return _external; }
+        bool this_external() const;
+        inline const std::string& comment() const { return _comment; }
+
+        void add_result(test_case_result::shared_ptr& p);
+        void set_fmt_chk_res(const bool res, const std::string& jid);
+
+        inline const test_case_result_agregation& average() const { return _result_average; }
+        inline u_int32_t num_results() const { return _result_average.num_results(); }
+        inline unsigned num_jrnls() const { return _result_jmap.size(); }
+        inline res_map_citr jrnl_average(std::string& jid) const { return _result_jmap.find(jid); }
+        inline res_map_citr jmap_begin() const { return _result_jmap.begin(); }
+        inline res_map_citr jmap_end() const { return _result_jmap.end(); }
+        const test_case_result::shared_ptr jmap_last(std::string& jid) const;
+
+        void clear();
+        const std::string str() const;
+    };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_case_hpp

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.cpp?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.cpp (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.cpp Tue Oct  8 15:09:00 2013
@@ -0,0 +1,201 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "test_case_result.h"
+
+#include <iomanip>
+#include <sstream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_case_result::test_case_result(const std::string& jid):
+        _jid(jid),
+        _num_enq(0),
+        _num_deq(0),
+        _num_read(0),
+        _num_rproc(0),
+        _start_time(),
+        _stop_time(),
+        _stopped(false),
+        _test_time(),
+        _exception_list()
+{}
+
+test_case_result::~test_case_result()
+{}
+
+const std::string
+test_case_result::test_time_str() const
+{
+    return _test_time.str(9);
+}
+
+void
+test_case_result::add_exception(const journal::jexception& e, const bool set_stop_time_flag)
+{
+    if (!_stopped && set_stop_time_flag)
+    {
+        set_stop_time();
+        _stopped = true;
+    }
+    _exception_list.push_back(e.what());
+}
+
+void
+test_case_result::add_exception(const std::string& err_str, const bool set_stop_time_flag)
+{
+    if (!_stopped && set_stop_time_flag)
+    {
+        set_stop_time();
+        _stopped = true;
+    }
+    _exception_list.push_back(err_str);
+}
+
+void
+test_case_result::add_exception(const char* err_str, const bool set_stop_time_flag)
+{
+    if (!_stopped && set_stop_time_flag)
+    {
+        set_stop_time();
+        _stopped = true;
+    }
+    _exception_list.push_back(err_str);
+}
+
+void
+test_case_result::clear()
+{
+    _num_enq = 0;
+    _num_deq = 0;
+    _num_read = 0;
+    _start_time.set_zero();
+    _stop_time.set_zero();
+    _test_time.set_zero();
+    _exception_list.clear();
+}
+
+const std::string
+test_case_result::str(const bool summary) const
+{
+    std::ostringstream oss;
+    if (summary)
+    {
+        oss << _jid << ":";
+        oss << str_summary();
+        if (_exception_list.size())
+            oss << "; fail: " << _exception_list[0] << std::endl;
+        else
+            oss << "; ok" << std::endl;
+    }
+    else
+    {
+        oss << "--- Journal instance: jid=\"" << _jid << "\" ---" << std::endl;
+        oss << str_full();
+        if (_exception_list.size())
+            oss << "       exception/error:" << _exception_list[0] << std::endl;
+    }
+    return oss.str();
+}
+
+const std::string
+test_case_result::str_full() const
+{
+    const double t = _test_time.tv_sec + (_test_time.tv_nsec/1e9);
+    const bool no_exception = _exception_list.empty();
+    std::ostringstream oss;
+    oss.setf(std::ios::fixed, std::ios::floatfield);
+    oss.precision(2);
+    if (no_exception)
+    {
+        oss.precision(6);
+        oss << "       total test time: " << t << "s" << std::endl;
+    }
+    oss.precision(3);
+    oss << " total number enqueues: " << _num_enq;
+    if (no_exception)
+        oss << " (" << (_num_enq / t) << " enq/sec)";
+    oss << std::endl;
+    oss << " total number dequeues: " << _num_deq;
+    if (no_exception)
+        oss << " (" << (_num_deq / t) << " deq/sec)";
+    oss << std::endl;
+    oss << "total write operations: " << (_num_enq + _num_deq);
+    if (no_exception)
+        oss << " (" << ((_num_enq + _num_deq) / t) << " wrops/sec)";
+    oss << std::endl;
+    oss << "    total number reads: " << _num_read;
+    if (no_exception)
+        oss << " (" << (_num_read / t) << " rd/sec)";
+    oss << std::endl;
+    oss << "      total operations: " << (_num_enq + _num_deq + _num_read);
+    if (no_exception)
+        oss << " (" << ((_num_enq + _num_deq + _num_read) / t) << " ops/sec)";
+    oss << std::endl;
+    oss << "        overall result: " << (no_exception ? "PASS" : "*** FAIL ***") << std::endl;
+    return oss.str();
+}
+
+const std::string
+test_case_result::str_summary() const
+{
+    const double t = _test_time.tv_sec + (_test_time.tv_nsec/1e9);
+    const bool no_exception = _exception_list.empty();
+    std::ostringstream oss;
+    oss.setf(std::ios::fixed, std::ios::floatfield);
+    if (no_exception)
+    {
+        oss.precision(6);
+        oss << " t=" << t << "s;";
+    }
+    else
+        oss << " exception";
+    oss.precision(3);
+    oss << " enq=" << _num_enq;
+    if (no_exception)
+        oss << " (" << (_num_enq / t) << ")";
+    oss << "; deq=" << _num_deq;
+    if (no_exception)
+        oss << " (" << (_num_deq / t) << ")";
+    oss << "; wr=" << (_num_enq + _num_deq);
+    if (no_exception)
+        oss << " (" << ((_num_enq + _num_deq) / t) << ")";
+    oss << "; rd=" << _num_read;
+    if (no_exception)
+        oss << " (" << (_num_read / t) << ")";
+    oss << "; tot=" << (_num_enq + _num_deq + _num_read);
+    if (no_exception)
+        oss << " (" << ((_num_enq + _num_deq + _num_read) / t) << ")";
+    return oss.str();
+}
+
+void
+test_case_result::calc_test_time()
+{
+    if (!_start_time.is_zero() && _stop_time >= _start_time)
+        _test_time = _stop_time - _start_time;
+}
+
+} // namespace jtt
+} // namespace mrg

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.h?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.h (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result.h Tue Oct  8 15:09:00 2013
@@ -0,0 +1,100 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#ifndef mrg_jtt_test_case_result_hpp
+#define mrg_jtt_test_case_result_hpp
+
+#include <boost/shared_ptr.hpp>
+#include <deque>
+#include "qpid/legacystore/jrnl/jexception.h"
+#include "qpid/legacystore/jrnl/time_ns.h"
+#include <string>
+
+namespace mrg
+{
+namespace jtt
+{
+
+    class test_case_result
+    {
+    public:
+        typedef boost::shared_ptr<test_case_result> shared_ptr;
+
+        typedef std::deque<std::string> elist;
+        typedef elist::const_iterator elist_citr;
+
+    protected:
+        std::string _jid;
+        u_int32_t _num_enq;
+        u_int32_t _num_deq;
+        u_int32_t _num_read;  // Messages actually read
+        u_int32_t _num_rproc; // Messages handled by read thread (not all are read)
+        journal::time_ns _start_time;
+        journal::time_ns _stop_time;
+        bool _stopped;
+        journal::time_ns _test_time;
+        elist _exception_list;
+
+    public:
+        test_case_result(const std::string& jid);
+        virtual ~test_case_result();
+
+        inline const std::string& jid() const { return _jid; }
+        inline u_int32_t num_enq() const { return _num_enq; }
+        inline u_int32_t incr_num_enq() { return ++_num_enq; }
+        inline u_int32_t num_deq() const { return _num_deq; }
+        inline u_int32_t incr_num_deq() { return ++_num_deq; }
+        inline u_int32_t num_read() const { return _num_read; }
+        inline u_int32_t incr_num_read() { return ++_num_read; }
+        inline u_int32_t num_rproc() const { return _num_rproc; }
+        inline u_int32_t incr_num_rproc() { return ++_num_rproc; }
+
+        inline const journal::time_ns& start_time() const { return _start_time; }
+        inline void set_start_time() { ::clock_gettime(CLOCK_REALTIME, &_start_time); }
+        inline const journal::time_ns& stop_time() const { return _stop_time; }
+        inline void set_stop_time()
+                { ::clock_gettime(CLOCK_REALTIME, &_stop_time); calc_test_time(); }
+        inline void set_test_time(const journal::time_ns& ts) { _test_time = ts; }
+        inline const journal::time_ns& test_time() const { return _test_time; }
+        const std::string test_time_str() const;
+
+        void add_exception(const journal::jexception& e, const bool set_stop_time_flag = true);
+        void add_exception(const std::string& err_str, const bool set_stop_time_flag = true);
+        void add_exception(const char* err_str, const bool set_stop_time_flag = true);
+        inline bool exception() const { return _exception_list.size() > 0; }
+        inline unsigned exception_count() const { return _exception_list.size(); }
+        inline elist_citr begin() { return _exception_list.begin(); }
+        inline elist_citr end() { return _exception_list.end(); }
+        inline const std::string& operator[](unsigned i) { return _exception_list[i]; }
+
+        void clear();
+        const std::string str(const bool summary) const;
+
+    protected:
+        const std::string str_full() const;
+        const std::string str_summary() const;
+        void calc_test_time();
+    };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_case_result_hpp

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.cpp?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.cpp (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.cpp Tue Oct  8 15:09:00 2013
@@ -0,0 +1,185 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "test_case_result_agregation.h"
+
+#include <iomanip>
+#include <sstream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_case_result_agregation::test_case_result_agregation():
+        test_case_result("Average"),
+        _tc_average(true),
+        _fmt_chk_done(false),
+        _fmt_chk_err(false),
+        _res_list()
+{
+}
+
+test_case_result_agregation::test_case_result_agregation(const std::string& jid):
+        test_case_result(jid),
+        _tc_average(false),
+        _fmt_chk_done(false),
+        _fmt_chk_err(false),
+        _res_list()
+{}
+
+test_case_result_agregation::~test_case_result_agregation()
+{}
+
+void
+test_case_result_agregation::add_test_result(const test_case_result::shared_ptr& tcrp)
+{
+    if (_tc_average || _jid.compare(tcrp->jid()) == 0)
+    {
+        _num_enq += tcrp->num_enq();
+        _num_deq += tcrp->num_deq();
+        _num_read += tcrp->num_read();
+        add_test_time(tcrp->test_time());
+        _exception_list.insert(_exception_list.end(), tcrp->begin(), tcrp->end());
+        _res_list.push_back(tcrp);
+    }
+}
+
+bool
+test_case_result_agregation::exception() const
+{
+    for (tcrp_list_citr i = _res_list.begin(); i < _res_list.end(); i++)
+        if ((*i)->exception())
+            return true;
+    return false;
+}
+
+unsigned
+test_case_result_agregation::exception_count() const
+{
+    unsigned cnt = 0;
+    for (tcrp_list_citr i = _res_list.begin(); i < _res_list.end(); i++)
+        cnt += (*i)->exception_count();
+    return cnt;
+}
+
+void
+test_case_result_agregation::clear()
+{
+    test_case_result::clear();
+    _res_list.clear();
+}
+
+const std::string
+test_case_result_agregation::str(const bool last_only, const bool summary) const
+{
+    std::ostringstream oss;
+    if (last_only)
+        oss << "  " << _res_list.at(_res_list.size()-1)->str(summary);
+    else
+    {
+        for (tcrp_list_citr i=_res_list.begin(); i!=_res_list.end(); i++)
+            oss << "  " << (*i)->str(summary);
+    }
+    if (_res_list.size() > 1)
+         oss << "  " << (summary ? str_summary(last_only) : str_full(last_only));
+    return oss.str();
+}
+
+const std::string
+test_case_result_agregation::str_full(const bool /*last_only*/) const
+{
+    std::ostringstream oss;
+    oss.precision(2);
+    if (_tc_average)
+        oss << "Average across all journal instances:" << std::endl;
+    else
+        oss << "Average for jid=\"" << _jid << "\":" << std::endl;
+    oss << "  total number results: " << _res_list.size() << std::endl;
+    oss << "     number exceptions: " << _exception_list.size() << " (" <<
+            (100.0 * _res_list.size() / _exception_list.size()) << "%)" << std::endl;
+
+    oss << test_case_result::str_full();
+
+    if (_exception_list.size())
+    {
+        unsigned n = 0;
+        oss << "List of exceptions/errors:" << std::endl;
+        for (elist_citr i = _exception_list.begin(); i != _exception_list.end(); i++, n++)
+            oss << "  " << n << ". " << (*i) << std::endl;
+    }
+
+    if (!_tc_average && _res_list.size() > 1)
+    {
+        oss << "Individual results:" << std::endl;
+        for (tcrp_list_citr i=_res_list.begin(); i!=_res_list.end(); i++)
+            oss << "  " << (*i)->str(false) << std::endl;
+        oss << std::endl;
+    }
+
+    return oss.str();
+}
+
+const std::string
+test_case_result_agregation::str_summary(const bool /*last_only*/) const
+{
+    std::ostringstream oss;
+    if (_tc_average)
+        oss << "overall average [" << _res_list.size() << "]:";
+    else
+        oss << "average (" << _res_list.size() << "):";
+
+    oss << test_case_result::str_summary();
+    if (_fmt_chk_done)
+        oss << " fmt-chk=" << (_fmt_chk_err ? "fail" : "ok");
+
+    if (_exception_list.size())
+    {
+        if (_tc_average)
+            oss << " fail: " << _exception_list.size() << " exception"
+                << (_exception_list.size()>1?"s":"") << std::endl;
+        else
+        {
+            if (_exception_list.size() == 1)
+                oss << " fail: " << *_exception_list.begin() << std::endl;
+            else
+            {
+                oss << std::endl;
+                unsigned n = 0;
+                for (elist_citr i = _exception_list.begin(); i != _exception_list.end(); i++, n++)
+                    oss << "    " << n << ". " << (*i) << std::endl;
+            }
+        }
+    }
+    else
+        oss << " ok" << std::endl;
+    return oss.str();
+}
+
+const journal::time_ns&
+test_case_result_agregation::add_test_time(const journal::time_ns& t)
+{
+    _test_time += t;
+    return _test_time;
+}
+
+} // namespace jtt
+} // namespace mrg

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.h?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.h (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_result_agregation.h Tue Oct  8 15:09:00 2013
@@ -0,0 +1,81 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#ifndef mrg_jtt_test_case_result_agregation_hpp
+#define mrg_jtt_test_case_result_agregation_hpp
+
+#include "test_case_result.h"
+
+#include <iostream>
+#include <vector>
+
+namespace mrg
+{
+namespace jtt
+{
+
+    class test_case_result_agregation : public test_case_result
+    {
+    public:
+        typedef boost::shared_ptr<test_case_result_agregation> shared_ptr;
+
+        typedef std::vector<test_case_result::shared_ptr> tcrp_list;
+        typedef tcrp_list::const_iterator tcrp_list_citr;
+
+    private:
+        bool _tc_average;
+        bool _fmt_chk_done;
+        bool _fmt_chk_err;
+        tcrp_list _res_list;
+
+    public:
+        test_case_result_agregation(); // used for average across jrnl instances
+        test_case_result_agregation(const std::string& jid);
+        virtual ~test_case_result_agregation();
+
+        void add_test_result(const test_case_result::shared_ptr& tcrp);
+
+        inline bool tc_average_mode() const { return _tc_average; }
+        inline bool fmt_chk_done() const { return _fmt_chk_done; }
+        inline bool fmt_chk_res() const { return _fmt_chk_err; }
+        inline void set_fmt_chk_res(const bool err)
+                { _fmt_chk_done = true; _fmt_chk_err |= err; if (err) add_exception("Journal format error"); }
+        inline u_int32_t num_results() const { return _res_list.size(); }
+        inline tcrp_list_citr rlist_begin() const { return _res_list.begin(); }
+        inline tcrp_list_citr rlist_end() const { return _res_list.end(); }
+        inline const test_case_result::shared_ptr& operator[](unsigned i) const
+                { return _res_list[i]; }
+        bool exception() const;
+        unsigned exception_count() const;
+
+        void clear();
+        const std::string str(const bool last_only, const bool summary) const;
+
+    private:
+        const std::string str_full(const bool last_only) const;
+        const std::string str_summary(const bool last_only) const;
+        const journal::time_ns& add_test_time(const journal::time_ns& t);
+    };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_case_result_agregation_hpp

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.cpp?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.cpp (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.cpp Tue Oct  8 15:09:00 2013
@@ -0,0 +1,169 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "test_case_set.h"
+
+#include <cstdlib>
+#include <fstream>
+#include <iostream>
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_case_set::test_case_set():
+        _tc_list(),
+        _csv_ignored(0)
+{}
+
+test_case_set::test_case_set(const std::string& csv_filename, const bool recover_mode,
+        const csv_map& cols):
+        _tc_list(),
+        _csv_ignored(0)
+{
+    append_from_csv(csv_filename, recover_mode, cols);
+}
+
+test_case_set::~test_case_set()
+{}
+
+void
+test_case_set::append(const unsigned test_case_num, const u_int32_t num_msgs,
+        const std::size_t min_data_size, const std::size_t max_data_size, const bool auto_deq,
+        const std::size_t min_xid_size, const std::size_t max_xid_size,
+        const test_case::transient_t transient, const test_case::external_t external,
+        const std::string& comment)
+{
+    test_case::shared_ptr tcp(new test_case(test_case_num, num_msgs, min_data_size,
+            max_data_size, auto_deq, min_xid_size, max_xid_size, transient, external, comment));
+    append(tcp);
+}
+
+
+#define CSV_BUFF_SIZE 2048
+void
+test_case_set::append_from_csv(const std::string& csv_filename, const bool recover_mode,
+        const csv_map& cols)
+{
+    char buff[CSV_BUFF_SIZE];
+    std::ifstream ifs(csv_filename.c_str());
+    while (ifs.good())
+    {
+        ifs.getline(buff, (std::streamsize)CSV_BUFF_SIZE);
+        if (ifs.gcount())
+        {
+            test_case::shared_ptr tcp = get_tc_from_csv(buff, cols);
+            if (tcp.get())
+            {
+                if (!recover_mode || tcp->auto_deq())
+                    append(tcp);
+                else
+                    _csv_ignored++;
+            }
+        }
+    }
+}
+
+test_case::shared_ptr
+test_case_set::get_tc_from_csv(const std::string& csv_line, const csv_map& cols)
+{
+    unsigned test_case_num = 0;
+    u_int32_t num_msgs = 0;
+    std::size_t min_data_size = 0;
+    std::size_t max_data_size = 0;
+    bool auto_deq = false;
+    std::size_t min_xid_size = 0;
+    std::size_t max_xid_size = 0;
+    test_case::transient_t transient = test_case::JTT_TRANSIENT;
+    test_case::external_t external = test_case::JDL_INTERNAL;
+    std::string comment;
+
+    csv_tok t(csv_line);
+    unsigned col_num = 0;
+    for (csv_tok_citr t_itr = t.begin(); t_itr != t.end(); ++t_itr, ++col_num)
+    {
+        const std::string& tok = *t_itr;
+        csv_map_citr m_citr = cols.find(col_num);
+        if (m_citr != cols.end())
+        {
+            switch (m_citr->second)
+            {
+                case CSV_TC_NUM:
+                    if (!tok.size() || tok[0] < '0' || tok[0] > '9')
+                        return test_case::shared_ptr();
+                    test_case_num = unsigned(std::atol(tok.c_str()));
+                    break;
+                case CSV_TC_NUM_MSGS: num_msgs = u_int32_t(std::atol(tok.c_str())); break;
+                case CSV_TC_MIN_DATA_SIZE: min_data_size = std::size_t(std::atol(tok.c_str())); break;
+                case CSV_TC_MAX_DATA_SIZE: max_data_size = std::size_t(std::atol(tok.c_str())); break;
+                case CSV_TC_AUTO_DEQ:
+                    if (tok == "TRUE" || tok == "1")
+                        auto_deq = true;
+                    break;
+                case CSV_TC_MIN_XID_SIZE: min_xid_size = std::size_t(std::atol(tok.c_str())); break;
+                case CSV_TC_MAX_XID_SIZE: max_xid_size = std::size_t(std::atol(tok.c_str())); break;
+                case CSV_TC_TRANSIENT:
+                    if (tok == "TRUE" || tok == "1")
+                        transient = test_case::JTT_PERSISTNET;
+                    else if (tok == "RANDOM" || tok == "-1")
+                        transient = test_case::JTT_RANDOM;
+                    break;
+                case CSV_TC_EXTERNAL:
+                    if (tok == "TRUE" || tok == "1")
+                        external = test_case::JDL_EXTERNAL;
+                    else if (tok == "RANDOM" || tok == "-1")
+                       external  = test_case::JDL_RANDOM;
+                    break;
+                case CSV_TC_COMMENT: comment = *t_itr; break;
+            }
+        }
+    }
+    if (col_num)
+        return test_case::shared_ptr(new test_case(test_case_num, num_msgs, min_data_size,
+                max_data_size, auto_deq, min_xid_size, max_xid_size, transient, external, comment));
+    else
+        return test_case::shared_ptr();
+}
+
+// Static member initializations
+// This csv_map is for use on the standard spreadsheet-derived test case csv files.
+test_case_set::csv_map test_case_set::std_csv_map;
+const bool test_case_set::_map_init = __init();
+
+bool
+test_case_set::__init()
+{
+    std_csv_map.insert(test_case_set::csv_pair(0, test_case_set::CSV_TC_NUM));
+    std_csv_map.insert(test_case_set::csv_pair(5, test_case_set::CSV_TC_NUM_MSGS));
+    std_csv_map.insert(test_case_set::csv_pair(7, test_case_set::CSV_TC_MIN_DATA_SIZE));
+    std_csv_map.insert(test_case_set::csv_pair(8, test_case_set::CSV_TC_MAX_DATA_SIZE));
+    std_csv_map.insert(test_case_set::csv_pair(11, test_case_set::CSV_TC_AUTO_DEQ));
+    std_csv_map.insert(test_case_set::csv_pair(9, test_case_set::CSV_TC_MIN_XID_SIZE));
+    std_csv_map.insert(test_case_set::csv_pair(10, test_case_set::CSV_TC_MAX_XID_SIZE));
+    std_csv_map.insert(test_case_set::csv_pair(12, test_case_set::CSV_TC_TRANSIENT));
+    std_csv_map.insert(test_case_set::csv_pair(13, test_case_set::CSV_TC_EXTERNAL));
+    std_csv_map.insert(test_case_set::csv_pair(20, test_case_set::CSV_TC_COMMENT));
+    return true;
+}
+
+} // namespace jtt
+} // namespace mrg

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.h?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.h (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_case_set.h Tue Oct  8 15:09:00 2013
@@ -0,0 +1,99 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#ifndef mrg_jtt_test_case_set_hpp
+#define mrg_jtt_test_case_set_hpp
+
+#include "test_case.h"
+
+#include <cstddef>
+#include <boost/tokenizer.hpp>
+#include <map>
+#include <vector>
+
+namespace mrg
+{
+namespace jtt
+{
+
+    class test_case_set
+    {
+    public:
+        enum csv_col_enum {
+                CSV_TC_NUM = 0,
+                CSV_TC_NUM_MSGS,
+                CSV_TC_MIN_DATA_SIZE,
+                CSV_TC_MAX_DATA_SIZE,
+                CSV_TC_AUTO_DEQ,
+                CSV_TC_MIN_XID_SIZE,
+                CSV_TC_MAX_XID_SIZE,
+                CSV_TC_TRANSIENT,
+                CSV_TC_EXTERNAL,
+                CSV_TC_COMMENT };
+        typedef std::pair<unsigned, csv_col_enum> csv_pair;
+        typedef std::map<unsigned, csv_col_enum> csv_map;
+        typedef csv_map::const_iterator csv_map_citr;
+        static csv_map std_csv_map;
+
+        typedef std::vector<test_case::shared_ptr> tcl;
+        typedef tcl::iterator tcl_itr;
+        typedef tcl::const_iterator tcl_citr;
+
+        typedef boost::tokenizer<boost::escaped_list_separator<char> > csv_tok;
+        typedef csv_tok::const_iterator csv_tok_citr;
+
+    private:
+        tcl _tc_list;
+        static const bool _map_init;
+        unsigned _csv_ignored;
+
+    public:
+        test_case_set();
+        test_case_set(const std::string& csv_filename, const bool recover_mode,
+                const csv_map& cols = std_csv_map);
+        virtual ~test_case_set();
+
+         inline unsigned size() const { return _tc_list.size(); }
+         inline unsigned ignored() const { return _csv_ignored; }
+         inline bool empty() const { return _tc_list.empty(); }
+
+        inline void append(const test_case::shared_ptr& tc) { _tc_list.push_back(tc); }
+        void append(const unsigned test_case_num, const u_int32_t num_msgs,
+                const std::size_t min_data_size, const std::size_t max_data_size,
+                const bool auto_deq, const std::size_t min_xid_size,
+                const std::size_t max_xid_size, const test_case::transient_t transient,
+                const test_case::external_t external, const std::string& comment);
+        void append_from_csv(const std::string& csv_filename, const bool recover_mode,
+                const csv_map& cols = std_csv_map);
+        inline tcl_itr begin() { return _tc_list.begin(); }
+        inline tcl_itr end() { return _tc_list.end(); }
+        inline const test_case::shared_ptr& operator[](unsigned i) { return _tc_list[i]; }
+        inline void clear() { _tc_list.clear(); }
+
+    private:
+        test_case::shared_ptr get_tc_from_csv(const std::string& csv_line, const csv_map& cols);
+        static bool __init();
+    };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_case_set_hpp

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.cpp?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.cpp (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.cpp Tue Oct  8 15:09:00 2013
@@ -0,0 +1,218 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "test_mgr.h"
+
+#include <cstdlib>
+#include <iostream>
+#include <sys/stat.h>
+#include "test_case_set.h"
+
+namespace mrg
+{
+namespace jtt
+{
+
+test_mgr::test_mgr(args& args):
+        _ji_list(),
+        _args(args),
+        _err_flag(false),
+        _random_fn_ptr(random_fn)
+{
+    if (_args.seed)
+        std::srand(_args.seed);
+}
+
+test_mgr::~test_mgr()
+{}
+
+void
+test_mgr::run()
+{
+    // TODO: complete tidy-up of non-summary (verbose) results, then pull through
+    // a command-line summary to control this.
+    // Idea: --summary: prints short results afterwards
+    //       --verbose: prints long version as test progresses
+    //       defualt: none of these, similar to current summary = true version.
+    const bool summary = true;
+
+    std::cout << "CSV file: \"" << _args.test_case_csv_file_name << "\"";
+    test_case_set tcs(_args.test_case_csv_file_name, _args.recover_mode);
+
+    if (tcs.size())
+    {
+        std::cout << " (found " << tcs.size() << " test case" << (tcs.size() != 1 ? "s" : "") <<
+                ")" << std::endl;
+        if (tcs.ignored())
+            std::cout << "WARNING: " << tcs.ignored() << " test cases were ignored. (All test "
+                    "cases without auto-dequeue are ignored when recover-mode is selected.)" <<
+                    std::endl;
+        _args.print_args();
+    }
+    else if(tcs.ignored())
+    {
+        std::cout << " WARNING: All " << tcs.ignored() << " test case(s) were ignored. (All test "
+                "cases without auto-dequeue are ignored when recover-mode is selected.)" <<
+                std::endl;
+    }
+    else
+        std::cout << " (WARNING: This CSV file is empty or does not exist.)" << std::endl;
+
+    do
+    {
+        unsigned u = 0;
+        if (_args.randomize)
+            random_shuffle(tcs.begin(), tcs.end(), _random_fn_ptr);
+        for (test_case_set::tcl_itr tci = tcs.begin(); tci != tcs.end(); tci++, u++)
+        {
+            if (summary)
+                std::cout << "Test case " << (*tci)->test_case_num() << ": \"" <<
+                        (*tci)->comment() << "\"" << std::endl;
+            else
+                std::cout << (*tci)->str() << std::endl;
+            if (!_args.reuse_instance || _ji_list.empty())
+                initialize_jrnls();
+            for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+                (*jii)->init_tc(*tci, &_args);
+            for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+                (*jii)->run_tc();
+            for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+                (*jii)->tc_wait_compl();
+
+            if (_args.format_chk)
+            {
+                for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+                {
+                    jrnl_init_params::shared_ptr jpp = (*jii)->params();
+                    std::string ja = _args.jfile_analyzer;
+                    if (ja.empty()) ja = "./jfile_chk.py";
+                    if (!exists(ja))
+                    {
+                        std::ostringstream oss;
+                        oss << "ERROR: Validation program \"" << ja << "\" does not exist" << std::endl;
+                        throw std::runtime_error(oss.str());
+                    }
+                    std::ostringstream oss;
+                    oss << ja << " -b " << jpp->base_filename();
+                    // TODO: When jfile_check.py can handle previously recovered journals for
+                    // specific tests, then remove this exclusion.
+                    if (!_args.recover_mode)
+                    {
+                        oss << " -c " << _args.test_case_csv_file_name;
+                        oss << " -t " << (*tci)->test_case_num();
+                    }
+                    oss << " -q " << jpp->jdir();
+                    bool res = system(oss.str().c_str()) != 0;
+                    (*tci)->set_fmt_chk_res(res, jpp->jid());
+                    if (res) _err_flag = true;
+                }
+            }
+
+            if (!_args.recover_mode && !_args.keep_jrnls)
+                for (ji_list_citr jii=_ji_list.begin(); jii!=_ji_list.end(); jii++)
+                    try { mrg::journal::jdir::delete_dir((*jii)->jrnl_dir()); }
+                    catch (...) {} // TODO - work out exception strategy for failure here...
+
+            print_results(*tci, summary);
+            if ((*tci)->average().exception())
+                _err_flag = true;
+            if (_abort || (!_args.repeat_flag && _signal))
+                break;
+            if (_args.pause_secs && tci != tcs.end())
+                ::usleep(_args.pause_secs * 1000000);
+        }
+    }
+    while (_args.repeat_flag && !_signal);
+}
+
+// static fn:
+void
+test_mgr::signal_handler(int sig)
+{
+    if (_signal)
+        _abort = true;
+    _signal = sig;
+    std::cout << std::endl;
+    std::cout << "********************************" << std::endl;
+    std::cout << "Caught signal " << sig << std::endl;
+    if (_abort)
+        std::cout << "Aborting..." << std::endl;
+    else
+        std::cout << "Completing current test cycle..." << std::endl;
+    std::cout << "********************************" << std::endl << std::endl;
+}
+
+bool
+test_mgr::exists(std::string fname)
+{
+    struct stat s;
+    if (::stat(fname.c_str(), &s))
+    {
+        if (errno == ENOENT) // No such dir or file
+            return false;
+        // Throw for any other condition
+        std::ostringstream oss;
+        oss << "ERROR: test_mgr::exists(): file=\"" << fname << "\": " << FORMAT_SYSERR(errno);
+        throw std::runtime_error(oss.str());
+    }
+    return true;
+}
+
+void
+test_mgr::initialize_jrnls()
+{
+    _ji_list.clear();
+    for (unsigned i=0; i<_args.num_jrnls; i++)
+    {
+        std::ostringstream jid;
+        jid << std::hex << std::setfill('0');
+        jid << "test_" << std::setw(4) << std::hex << i;
+        std::ostringstream jdir;
+        jdir << _args.journal_dir << "/" << jid.str();
+        jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid.str(), jdir.str(), jid.str()));
+        jrnl_instance::shared_ptr jip(new jrnl_instance(jpp));
+        _ji_list.push_back(jip);
+    }
+}
+
+void
+test_mgr::print_results(test_case::shared_ptr tcp, const bool summary)
+{
+    if (!summary)
+        std::cout << "  === Results ===" << std::endl;
+
+// TODO - the reporting is broken when --repeat is used. The following commented-out
+// section was an attempt to fix it, but there are too many side-effects.
+//     for (test_case::res_map_citr i=tcp->jmap_begin(); i!=tcp->jmap_end(); i++)
+//         std::cout << (*i).second->str(summary, summary);
+//     if (tcp->num_jrnls() > 1)
+    std::cout << tcp->average().str(false, summary);
+
+    if (!summary)
+        std::cout << std::endl;
+}
+
+// static instances
+volatile sig_atomic_t test_mgr::_signal = 0;
+volatile bool test_mgr::_abort = false;
+
+} // namespace jtt
+} // namespace mrg

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.h?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.h (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/jtt/test_mgr.h Tue Oct  8 15:09:00 2013
@@ -0,0 +1,68 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#ifndef mrg_jtt_test_mgr_hpp
+#define mrg_jtt_test_mgr_hpp
+
+#include "args.h"
+#include <csignal>
+#include <cstdlib>
+#include "jrnl_instance.h"
+
+namespace mrg
+{
+namespace jtt
+{
+    class test_mgr
+    {
+    public:
+        typedef std::vector<jrnl_instance::shared_ptr> ji_list;
+        typedef ji_list::iterator ji_list_itr;
+        typedef ji_list::const_iterator ji_list_citr;
+
+    private:
+        ji_list _ji_list;
+        args& _args;
+        bool _err_flag;
+        ptrdiff_t (*_random_fn_ptr)(const ptrdiff_t i);
+        static volatile std::sig_atomic_t _signal;
+        static volatile bool _abort;
+
+    public:
+        test_mgr(args& args);
+        virtual ~test_mgr();
+        void run();
+        inline bool error() const { return _err_flag; }
+
+        static void signal_handler(int signal);
+
+    private:
+        static bool exists(std::string file_name);
+        void initialize_jrnls();
+        void print_results(test_case::shared_ptr tcp, const bool summary);
+        inline static ptrdiff_t random_fn(const ptrdiff_t i)
+                { return static_cast<ptrdiff_t>(1.0 * i * std::rand() / RAND_MAX); }
+    };
+
+} // namespace jtt
+} // namespace mrg
+
+#endif // ifndef mrg_jtt_test_mgr_hpp

Added: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/prof
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/prof?rev=1530301&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/prof (added)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/prof Tue Oct  8 15:09:00 2013
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+mkdir -p profile
+opcontrol --setup --no-vmlinux --separate=library 
+opcontrol --start
+# -- Do stuff here --
+./jtest wtests.csv 264
+# -- End of stuff --
+opcontrol --stop
+opcontrol --dump
+opcontrol --shutdown
+opreport -l ./jtest
+opannotate --source --output-dir=profile ./jtest

Propchange: qpid/trunk/qpid/cpp/src/tests/legacystore/jrnl/prof
------------------------------------------------------------------------------
    svn:executable = *



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message