You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
(57) |
Apr
(103) |
May
(164) |
Jun
(139) |
Jul
(173) |
Aug
(196) |
Sep
(221) |
Oct
(333) |
Nov
(214) |
Dec
(88) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(163) |
Feb
(165) |
Mar
(98) |
Apr
(93) |
May
(199) |
Jun
(118) |
Jul
(200) |
Aug
(212) |
Sep
(185) |
Oct
(297) |
Nov
(437) |
Dec
(272) |
| 2006 |
Jan
(542) |
Feb
(329) |
Mar
(267) |
Apr
(332) |
May
(267) |
Jun
(130) |
Jul
(161) |
Aug
(348) |
Sep
(166) |
Oct
(305) |
Nov
(173) |
Dec
(173) |
| 2007 |
Jan
(199) |
Feb
(118) |
Mar
(133) |
Apr
(200) |
May
(208) |
Jun
(146) |
Jul
(198) |
Aug
(146) |
Sep
(187) |
Oct
(182) |
Nov
(181) |
Dec
(83) |
| 2008 |
Jan
(252) |
Feb
(124) |
Mar
(124) |
Apr
(101) |
May
(143) |
Jun
(122) |
Jul
(129) |
Aug
(60) |
Sep
(80) |
Oct
(89) |
Nov
(54) |
Dec
(112) |
| 2009 |
Jan
(88) |
Feb
(145) |
Mar
(105) |
Apr
(164) |
May
(123) |
Jun
(154) |
Jul
(374) |
Aug
(341) |
Sep
(219) |
Oct
(137) |
Nov
(373) |
Dec
(240) |
| 2010 |
Jan
(197) |
Feb
(270) |
Mar
(253) |
Apr
(150) |
May
(102) |
Jun
(51) |
Jul
(300) |
Aug
(512) |
Sep
(254) |
Oct
(258) |
Nov
(288) |
Dec
(143) |
| 2011 |
Jan
(238) |
Feb
(179) |
Mar
(253) |
Apr
(332) |
May
(248) |
Jun
(255) |
Jul
(216) |
Aug
(282) |
Sep
(146) |
Oct
(77) |
Nov
(86) |
Dec
(69) |
| 2012 |
Jan
(172) |
Feb
(234) |
Mar
(229) |
Apr
(101) |
May
(212) |
Jun
(267) |
Jul
(129) |
Aug
(210) |
Sep
(239) |
Oct
(271) |
Nov
(368) |
Dec
(220) |
| 2013 |
Jan
(179) |
Feb
(155) |
Mar
(59) |
Apr
(47) |
May
(99) |
Jun
(158) |
Jul
(185) |
Aug
(16) |
Sep
(16) |
Oct
(7) |
Nov
(20) |
Dec
(12) |
| 2014 |
Jan
(21) |
Feb
(17) |
Mar
(18) |
Apr
(13) |
May
(27) |
Jun
(15) |
Jul
(19) |
Aug
(22) |
Sep
(30) |
Oct
(16) |
Nov
(19) |
Dec
(16) |
| 2015 |
Jan
(14) |
Feb
(24) |
Mar
(33) |
Apr
(41) |
May
(14) |
Jun
(80) |
Jul
(53) |
Aug
(8) |
Sep
(7) |
Oct
(15) |
Nov
(13) |
Dec
(2) |
| 2016 |
Jan
(22) |
Feb
(12) |
Mar
(30) |
Apr
(6) |
May
(33) |
Jun
(16) |
Jul
(8) |
Aug
(20) |
Sep
(12) |
Oct
(18) |
Nov
(12) |
Dec
(11) |
| 2017 |
Jan
(24) |
Feb
(26) |
Mar
(47) |
Apr
(23) |
May
(19) |
Jun
(14) |
Jul
(28) |
Aug
(30) |
Sep
(17) |
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
(73) |
Mar
(90) |
Apr
(42) |
May
(116) |
Jun
(90) |
Jul
(127) |
Aug
(103) |
Sep
(56) |
Oct
(42) |
Nov
(95) |
Dec
(58) |
| 2020 |
Jan
(102) |
Feb
(31) |
Mar
(93) |
Apr
(60) |
May
(57) |
Jun
(45) |
Jul
(29) |
Aug
(32) |
Sep
(44) |
Oct
(86) |
Nov
(51) |
Dec
(71) |
| 2021 |
Jan
(44) |
Feb
(25) |
Mar
(78) |
Apr
(130) |
May
(64) |
Jun
(74) |
Jul
(21) |
Aug
(64) |
Sep
(40) |
Oct
(43) |
Nov
(21) |
Dec
(99) |
| 2022 |
Jan
(154) |
Feb
(64) |
Mar
(45) |
Apr
(95) |
May
(62) |
Jun
(48) |
Jul
(73) |
Aug
(37) |
Sep
(71) |
Oct
(27) |
Nov
(40) |
Dec
(65) |
| 2023 |
Jan
(89) |
Feb
(130) |
Mar
(124) |
Apr
(50) |
May
(93) |
Jun
(46) |
Jul
(45) |
Aug
(68) |
Sep
(62) |
Oct
(71) |
Nov
(108) |
Dec
(82) |
| 2024 |
Jan
(53) |
Feb
(76) |
Mar
(64) |
Apr
(75) |
May
(36) |
Jun
(54) |
Jul
(98) |
Aug
(137) |
Sep
(58) |
Oct
(177) |
Nov
(84) |
Dec
(52) |
| 2025 |
Jan
(70) |
Feb
(53) |
Mar
(72) |
Apr
(47) |
May
(88) |
Jun
(49) |
Jul
(86) |
Aug
(51) |
Sep
(65) |
Oct
(91) |
Nov
(18) |
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(3) |
2
(6) |
|
3
(14) |
4
(5) |
5
(5) |
6
(8) |
7
(3) |
8
(4) |
9
(1) |
|
10
(8) |
11
(9) |
12
(11) |
13
(4) |
14
(14) |
15
(14) |
16
(1) |
|
17
(2) |
18
(5) |
19
(5) |
20
(3) |
21
(4) |
22
(9) |
23
(7) |
|
24
|
25
(3) |
26
(3) |
27
(4) |
28
(4) |
29
(9) |
30
(2) |
|
31
(3) |
|
|
|
|
|
|
|
From: <wol...@us...> - 2006-12-31 18:33:07
|
Revision: 5103
http://svn.sourceforge.net/exist/?rev=5103&view=rev
Author: wolfgang_m
Date: 2006-12-31 10:33:03 -0800 (Sun, 31 Dec 2006)
Log Message:
-----------
Fixed: support for multiple unary operators, e.g. --7, +-9
Modified Paths:
--------------
trunk/eXist/build/scripts/build-impl.xml
trunk/eXist/build.properties
Modified: trunk/eXist/build/scripts/build-impl.xml
===================================================================
--- trunk/eXist/build/scripts/build-impl.xml 2006-12-31 18:29:59 UTC (rev 5102)
+++ trunk/eXist/build/scripts/build-impl.xml 2006-12-31 18:33:03 UTC (rev 5103)
@@ -235,7 +235,8 @@
</classpath>
</antlr>
<antlr target="${src}/org/exist/xquery/parser/XQueryTree.g"
- outputdirectory="${src}/org/exist/xquery/parser">
+ outputdirectory="${src}/org/exist/xquery/parser"
+ tracetreewalker="no">
<classpath>
<path refid="classpath.core"/>
</classpath>
Modified: trunk/eXist/build.properties
===================================================================
--- trunk/eXist/build.properties 2006-12-31 18:29:59 UTC (rev 5102)
+++ trunk/eXist/build.properties 2006-12-31 18:33:03 UTC (rev 5103)
@@ -19,6 +19,7 @@
# set these properties to true to get a lot of debugging output
antlr.traceParser = false
antlr.traceLexer = false
+antlr.traceTreeWalker = false
# Tomcat home directory. Required for building the XmldbRealm
# Replace, if you compile against your own Tomcat version
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-31 18:30:01
|
Revision: 5102
http://svn.sourceforge.net/exist/?rev=5102&view=rev
Author: wolfgang_m
Date: 2006-12-31 10:29:59 -0800 (Sun, 31 Dec 2006)
Log Message:
-----------
Fixed: support for multiple unary operators, e.g. --7, +-9
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/parser/XQuery.g
trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java
trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java
Modified: trunk/eXist/src/org/exist/xquery/parser/XQuery.g
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/XQuery.g 2006-12-31 13:17:13 UTC (rev 5101)
+++ trunk/eXist/src/org/exist/xquery/parser/XQuery.g 2006-12-31 18:29:59 UTC (rev 5102)
@@ -710,19 +710,9 @@
unaryExpr throws XPathException
:
- // TODO: XPath 2.0 allows an arbitrary number of +/-,
- // we restrict it to one
- m:MINUS expr:valueExpr
- {
- #unaryExpr= #(#[UNARY_MINUS, "-"], #expr);
- #unaryExpr.copyLexInfo(#m);
- }
+ MINUS! ( unaryExpr ) { #unaryExpr = #(#[UNARY_MINUS, "-"], #unaryExpr); }
|
- p:PLUS expr2:valueExpr
- {
- #unaryExpr= #(#[UNARY_PLUS, "+"], #expr2);
- #unaryExpr.copyLexInfo(#p);
- }
+ PLUS! ( unaryExpr ) { #unaryExpr = #(#[UNARY_PLUS, "+"], #unaryExpr); }
|
valueExpr
;
Modified: trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java 2006-12-31 13:17:13 UTC (rev 5101)
+++ trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java 2006-12-31 18:29:59 UTC (rev 5102)
@@ -2253,17 +2253,17 @@
int _saveIndex;
{
- int _cnt428=0;
- _loop428:
+ int _cnt430=0;
+ _loop430:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- if ( _cnt428>=1 ) { break _loop428; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt430>=1 ) { break _loop430; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt428++;
+ _cnt430++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -2404,8 +2404,8 @@
int _saveIndex;
{
- int _cnt431=0;
- _loop431:
+ int _cnt433=0;
+ _loop433:
do {
switch ( LA(1)) {
case '0': case '1': case '2': case '3':
@@ -2429,10 +2429,10 @@
}
default:
{
- if ( _cnt431>=1 ) { break _loop431; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt433>=1 ) { break _loop433; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
}
- _cnt431++;
+ _cnt433++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3156,13 +3156,13 @@
mNMSTART(false);
{
- _loop438:
+ _loop440:
do {
if ((_tokenSet_5.member(LA(1)))) {
mNMCHAR(false);
}
else {
- break _loop438;
+ break _loop440;
}
} while (true);
@@ -3181,8 +3181,8 @@
int _saveIndex;
{
- int _cnt441=0;
- _loop441:
+ int _cnt443=0;
+ _loop443:
do {
if ((LA(1)==' ') && (true) && (true) && (true)) {
match(' ');
@@ -3200,10 +3200,10 @@
match('\r');
}
else {
- if ( _cnt441>=1 ) { break _loop441; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt443>=1 ) { break _loop443; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt441++;
+ _cnt443++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3220,10 +3220,10 @@
match("(:");
{
- _loop445:
+ _loop447:
do {
// nongreedy exit test
- if ((LA(1)==':') && (LA(2)==')') && (true) && (true)) break _loop445;
+ if ((LA(1)==':') && (LA(2)==')') && (true) && (true)) break _loop447;
if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && (true)) {
{
if ((LA(1)=='(') && (LA(2)==':') && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe'))) {
@@ -3239,7 +3239,7 @@
}
}
else {
- break _loop445;
+ break _loop447;
}
} while (true);
@@ -3290,13 +3290,13 @@
{
match('.');
{
- _loop453:
+ _loop455:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- break _loop453;
+ break _loop455;
}
} while (true);
@@ -3384,13 +3384,13 @@
if ((LA(1)=='.')) {
match('.');
{
- _loop461:
+ _loop463:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- break _loop461;
+ break _loop463;
}
} while (true);
@@ -3498,7 +3498,7 @@
match('"');
text.setLength(_saveIndex);
{
- _loop471:
+ _loop473:
do {
if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) {
mPREDEFINED_ENTITY_REF(false);
@@ -3520,7 +3520,7 @@
}
}
else {
- break _loop471;
+ break _loop473;
}
} while (true);
@@ -3536,7 +3536,7 @@
match('\'');
text.setLength(_saveIndex);
{
- _loop475:
+ _loop477:
do {
if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) {
mPREDEFINED_ENTITY_REF(false);
@@ -3558,7 +3558,7 @@
}
}
else {
- break _loop475;
+ break _loop477;
}
} while (true);
@@ -3586,8 +3586,8 @@
int _saveIndex;
{
- int _cnt479=0;
- _loop479:
+ int _cnt481=0;
+ _loop481:
do {
if ((_tokenSet_8.member(LA(1)))) {
{
@@ -3595,10 +3595,10 @@
}
}
else {
- if ( _cnt479>=1 ) { break _loop479; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt481>=1 ) { break _loop481; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt479++;
+ _cnt481++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3620,8 +3620,8 @@
int _saveIndex;
{
- int _cnt483=0;
- _loop483:
+ int _cnt485=0;
+ _loop485:
do {
if ((_tokenSet_9.member(LA(1)))) {
{
@@ -3629,10 +3629,10 @@
}
}
else {
- if ( _cnt483>=1 ) { break _loop483; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt485>=1 ) { break _loop485; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt483++;
+ _cnt485++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3682,8 +3682,8 @@
int _saveIndex;
{
- int _cnt488=0;
- _loop488:
+ int _cnt490=0;
+ _loop490:
do {
switch ( LA(1)) {
case '\t':
@@ -3745,10 +3745,10 @@
matchRange('\u007e','\uFFFD');
}
else {
- if ( _cnt488>=1 ) { break _loop488; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt490>=1 ) { break _loop490; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
}
- _cnt488++;
+ _cnt490++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3767,7 +3767,7 @@
match("<!--");
text.setLength(_saveIndex);
{
- _loop495:
+ _loop497:
do {
if ((_tokenSet_10.member(LA(1)))) {
{
@@ -3775,10 +3775,10 @@
}
}
else {
- boolean synPredMatched494 = false;
+ boolean synPredMatched496 = false;
if (((LA(1)=='-'))) {
- int _m494 = mark();
- synPredMatched494 = true;
+ int _m496 = mark();
+ synPredMatched496 = true;
inputState.guessing++;
try {
{
@@ -3789,16 +3789,16 @@
}
}
catch (RecognitionException pe) {
- synPredMatched494 = false;
+ synPredMatched496 = false;
}
- rewind(_m494);
+ rewind(_m496);
inputState.guessing--;
}
- if ( synPredMatched494 ) {
+ if ( synPredMatched496 ) {
match('-');
}
else {
- break _loop495;
+ break _loop497;
}
}
} while (true);
@@ -3823,7 +3823,7 @@
if ((LA(1)==' ')) {
match(' ');
{
- _loop503:
+ _loop505:
do {
if ((_tokenSet_11.member(LA(1)))) {
{
@@ -3831,10 +3831,10 @@
}
}
else {
- boolean synPredMatched502 = false;
+ boolean synPredMatched504 = false;
if (((LA(1)=='?'))) {
- int _m502 = mark();
- synPredMatched502 = true;
+ int _m504 = mark();
+ synPredMatched504 = true;
inputState.guessing++;
try {
{
@@ -3845,16 +3845,16 @@
}
}
catch (RecognitionException pe) {
- synPredMatched502 = false;
+ synPredMatched504 = false;
}
- rewind(_m502);
+ rewind(_m504);
inputState.guessing--;
}
- if ( synPredMatched502 ) {
+ if ( synPredMatched504 ) {
match('?');
}
else {
- break _loop503;
+ break _loop505;
}
}
} while (true);
@@ -3880,12 +3880,12 @@
mXML_CDATA_START(false);
text.setLength(_saveIndex);
{
- _loop514:
+ _loop516:
do {
- boolean synPredMatched509 = false;
+ boolean synPredMatched511 = false;
if (((LA(1)==']') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe')))) {
- int _m509 = mark();
- synPredMatched509 = true;
+ int _m511 = mark();
+ synPredMatched511 = true;
inputState.guessing++;
try {
{
@@ -3896,19 +3896,19 @@
}
}
catch (RecognitionException pe) {
- synPredMatched509 = false;
+ synPredMatched511 = false;
}
- rewind(_m509);
+ rewind(_m511);
inputState.guessing--;
}
- if ( synPredMatched509 ) {
+ if ( synPredMatched511 ) {
match(']');
}
else {
- boolean synPredMatched512 = false;
+ boolean synPredMatched514 = false;
if (((LA(1)==']') && (LA(2)==']') && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe')))) {
- int _m512 = mark();
- synPredMatched512 = true;
+ int _m514 = mark();
+ synPredMatched514 = true;
inputState.guessing++;
try {
{
@@ -3920,12 +3920,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched512 = false;
+ synPredMatched514 = false;
}
- rewind(_m512);
+ rewind(_m514);
inputState.guessing--;
}
- if ( synPredMatched512 ) {
+ if ( synPredMatched514 ) {
{
match(']');
match(']');
@@ -3937,7 +3937,7 @@
}
}
else {
- break _loop514;
+ break _loop516;
}
}
} while (true);
@@ -3958,8 +3958,8 @@
int _saveIndex;
{
- int _cnt518=0;
- _loop518:
+ int _cnt520=0;
+ _loop520:
do {
if ((LA(1)=='\t'||LA(1)=='\n'||LA(1)=='\r'||LA(1)==' ')) {
{
@@ -3992,10 +3992,10 @@
}
}
else {
- if ( _cnt518>=1 ) { break _loop518; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt520>=1 ) { break _loop520; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt518++;
+ _cnt520++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -4042,15 +4042,15 @@
mWS(false);
text.setLength(_saveIndex);
{
- _loop524:
+ _loop526:
do {
// nongreedy exit test
- if ((LA(1)=='#') && (LA(2)==')') && (true)) break _loop524;
+ if ((LA(1)=='#') && (LA(2)==')') && (true)) break _loop526;
if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe'))) {
matchNot(EOF_CHAR);
}
else {
- break _loop524;
+ break _loop526;
}
} while (true);
@@ -4140,10 +4140,10 @@
}
}
else {
- boolean synPredMatched532 = false;
+ boolean synPredMatched534 = false;
if (((_tokenSet_14.member(LA(1))) && (_tokenSet_15.member(LA(2))) && (_tokenSet_16.member(LA(3))) && (true))) {
- int _m532 = mark();
- synPredMatched532 = true;
+ int _m534 = mark();
+ synPredMatched534 = true;
inputState.guessing++;
try {
{
@@ -4170,22 +4170,22 @@
}
}
catch (RecognitionException pe) {
- synPredMatched532 = false;
+ synPredMatched534 = false;
}
- rewind(_m532);
+ rewind(_m534);
inputState.guessing--;
}
- if ( synPredMatched532 ) {
+ if ( synPredMatched534 ) {
mDOUBLE_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DOUBLE_LITERAL;
}
}
else {
- boolean synPredMatched541 = false;
+ boolean synPredMatched543 = false;
if (((_tokenSet_14.member(LA(1))) && (_tokenSet_15.member(LA(2))) && (_tokenSet_16.member(LA(3))) && (true))) {
- int _m541 = mark();
- synPredMatched541 = true;
+ int _m543 = mark();
+ synPredMatched543 = true;
inputState.guessing++;
try {
{
@@ -4239,12 +4239,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched541 = false;
+ synPredMatched543 = false;
}
- rewind(_m541);
+ rewind(_m543);
inputState.guessing--;
}
- if ( synPredMatched541 ) {
+ if ( synPredMatched543 ) {
mDOUBLE_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DOUBLE_LITERAL;
@@ -4263,10 +4263,10 @@
}
}
else {
- boolean synPredMatched527 = false;
+ boolean synPredMatched529 = false;
if (((LA(1)=='<') && (LA(2)=='?'))) {
- int _m527 = mark();
- synPredMatched527 = true;
+ int _m529 = mark();
+ synPredMatched529 = true;
inputState.guessing++;
try {
{
@@ -4274,12 +4274,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched527 = false;
+ synPredMatched529 = false;
}
- rewind(_m527);
+ rewind(_m529);
inputState.guessing--;
}
- if ( synPredMatched527 ) {
+ if ( synPredMatched529 ) {
mXML_PI(false);
if ( inputState.guessing==0 ) {
_ttype = XML_PI;
@@ -4320,10 +4320,10 @@
}
}
else {
- boolean synPredMatched529 = false;
+ boolean synPredMatched531 = false;
if ((((LA(1)=='.') && (LA(2)=='.') && (true) && (true))&&( !(inAttributeContent || inElementContent) ))) {
- int _m529 = mark();
- synPredMatched529 = true;
+ int _m531 = mark();
+ synPredMatched531 = true;
inputState.guessing++;
try {
{
@@ -4332,12 +4332,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched529 = false;
+ synPredMatched531 = false;
}
- rewind(_m529);
+ rewind(_m531);
inputState.guessing--;
}
- if ( synPredMatched529 ) {
+ if ( synPredMatched531 ) {
mPARENT(false);
if ( inputState.guessing==0 ) {
_ttype = PARENT;
@@ -4455,10 +4455,10 @@
}
}
else {
- boolean synPredMatched534 = false;
+ boolean synPredMatched536 = false;
if (((_tokenSet_14.member(LA(1))) && (true) && (true) && (true))) {
- int _m534 = mark();
- synPredMatched534 = true;
+ int _m536 = mark();
+ synPredMatched536 = true;
inputState.guessing++;
try {
{
@@ -4467,22 +4467,22 @@
}
}
catch (RecognitionException pe) {
- synPredMatched534 = false;
+ synPredMatched536 = false;
}
- rewind(_m534);
+ rewind(_m536);
inputState.guessing--;
}
- if ( synPredMatched534 ) {
+ if ( synPredMatched536 ) {
mDECIMAL_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DECIMAL_LITERAL;
}
}
else {
- boolean synPredMatched536 = false;
+ boolean synPredMatched538 = false;
if (((LA(1)=='.') && (true) && (true) && (true))) {
- int _m536 = mark();
- synPredMatched536 = true;
+ int _m538 = mark();
+ synPredMatched538 = true;
inputState.guessing++;
try {
{
@@ -4490,22 +4490,22 @@
}
}
catch (RecognitionException pe) {
- synPredMatched536 = false;
+ synPredMatched538 = false;
}
- rewind(_m536);
+ rewind(_m538);
inputState.guessing--;
}
- if ( synPredMatched536 ) {
+ if ( synPredMatched538 ) {
mSELF(false);
if ( inputState.guessing==0 ) {
_ttype = SELF;
}
}
else {
- boolean synPredMatched543 = false;
+ boolean synPredMatched545 = false;
if (((_tokenSet_14.member(LA(1))) && (true) && (true) && (true))) {
- int _m543 = mark();
- synPredMatched543 = true;
+ int _m545 = mark();
+ synPredMatched545 = true;
inputState.guessing++;
try {
{
@@ -4514,12 +4514,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched543 = false;
+ synPredMatched545 = false;
}
- rewind(_m543);
+ rewind(_m545);
inputState.guessing--;
}
- if ( synPredMatched543 ) {
+ if ( synPredMatched545 ) {
mDECIMAL_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DECIMAL_LITERAL;
Modified: trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java 2006-12-31 13:17:13 UTC (rev 5101)
+++ trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java 2006-12-31 18:29:59 UTC (rev 5102)
@@ -1956,10 +1956,10 @@
String name2;
- boolean synPredMatched320 = false;
+ boolean synPredMatched322 = false;
if (((_tokenSet_1.member(LA(1))))) {
- int _m320 = mark();
- synPredMatched320 = true;
+ int _m322 = mark();
+ synPredMatched322 = true;
inputState.guessing++;
try {
{
@@ -1969,12 +1969,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched320 = false;
+ synPredMatched322 = false;
}
- rewind(_m320);
+ rewind(_m322);
inputState.guessing--;
}
- if ( synPredMatched320 ) {
+ if ( synPredMatched322 ) {
name=ncnameOrKeyword();
nc1_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
astFactory.addASTChild(currentAST, returnAST);
@@ -4633,29 +4633,18 @@
returnAST = null;
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST unaryExpr_AST = null;
- Token m = null;
- org.exist.xquery.parser.XQueryAST m_AST = null;
- org.exist.xquery.parser.XQueryAST expr_AST = null;
- Token p = null;
- org.exist.xquery.parser.XQueryAST p_AST = null;
- org.exist.xquery.parser.XQueryAST expr2_AST = null;
switch ( LA(1)) {
case MINUS:
{
- m = LT(1);
- m_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(m);
- astFactory.addASTChild(currentAST, m_AST);
match(MINUS);
- valueExpr();
- expr_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
+ {
+ unaryExpr();
astFactory.addASTChild(currentAST, returnAST);
+ }
if ( inputState.guessing==0 ) {
unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
-
- unaryExpr_AST= (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(UNARY_MINUS,"-")).add(expr_AST));
- unaryExpr_AST.copyLexInfo(m_AST);
-
+ unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(UNARY_MINUS,"-")).add(unaryExpr_AST));
currentAST.root = unaryExpr_AST;
currentAST.child = unaryExpr_AST!=null &&unaryExpr_AST.getFirstChild()!=null ?
unaryExpr_AST.getFirstChild() : unaryExpr_AST;
@@ -4666,19 +4655,14 @@
}
case PLUS:
{
- p = LT(1);
- p_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(p);
- astFactory.addASTChild(currentAST, p_AST);
match(PLUS);
- valueExpr();
- expr2_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
+ {
+ unaryExpr();
astFactory.addASTChild(currentAST, returnAST);
+ }
if ( inputState.guessing==0 ) {
unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
-
- unaryExpr_AST= (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(UNARY_PLUS,"+")).add(expr2_AST));
- unaryExpr_AST.copyLexInfo(p_AST);
-
+ unaryExpr_AST = (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(UNARY_PLUS,"+")).add(unaryExpr_AST));
currentAST.root = unaryExpr_AST;
currentAST.child = unaryExpr_AST!=null &&unaryExpr_AST.getFirstChild()!=null ?
unaryExpr_AST.getFirstChild() : unaryExpr_AST;
@@ -4821,9 +4805,9 @@
switch ( LA(1)) {
case LITERAL_to:
{
- org.exist.xquery.parser.XQueryAST tmp238_AST = null;
- tmp238_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp238_AST);
+ org.exist.xquery.parser.XQueryAST tmp240_AST = null;
+ tmp240_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp240_AST);
match(LITERAL_to);
additiveExpr();
astFactory.addASTChild(currentAST, returnAST);
@@ -4901,17 +4885,17 @@
switch ( LA(1)) {
case PLUS:
{
- org.exist.xquery.parser.XQueryAST tmp239_AST = null;
- tmp239_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp239_AST);
+ org.exist.xquery.parser.XQueryAST tmp241_AST = null;
+ tmp241_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp241_AST);
match(PLUS);
break;
}
case MINUS:
{
- org.exist.xquery.parser.XQueryAST tmp240_AST = null;
- tmp240_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp240_AST);
+ org.exist.xquery.parser.XQueryAST tmp242_AST = null;
+ tmp242_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp242_AST);
match(MINUS);
break;
}
@@ -4950,33 +4934,33 @@
switch ( LA(1)) {
case STAR:
{
- org.exist.xquery.parser.XQueryAST tmp241_AST = null;
- tmp241_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp241_AST);
+ org.exist.xquery.parser.XQueryAST tmp243_AST = null;
+ tmp243_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp243_AST);
match(STAR);
break;
}
case LITERAL_div:
{
- org.exist.xquery.parser.XQueryAST tmp242_AST = null;
- tmp242_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp242_AST);
+ org.exist.xquery.parser.XQueryAST tmp244_AST = null;
+ tmp244_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp244_AST);
match(LITERAL_div);
break;
}
case LITERAL_idiv:
{
- org.exist.xquery.parser.XQueryAST tmp243_AST = null;
- tmp243_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp243_AST);
+ org.exist.xquery.parser.XQueryAST tmp245_AST = null;
+ tmp245_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp245_AST);
match(LITERAL_idiv);
break;
}
case LITERAL_mod:
{
- org.exist.xquery.parser.XQueryAST tmp244_AST = null;
- tmp244_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp244_AST);
+ org.exist.xquery.parser.XQueryAST tmp246_AST = null;
+ tmp246_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp246_AST);
match(LITERAL_mod);
break;
}
@@ -5364,9 +5348,9 @@
}
case DSLASH:
{
- org.exist.xquery.parser.XQueryAST tmp247_AST = null;
- tmp247_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp247_AST);
+ org.exist.xquery.parser.XQueryAST tmp249_AST = null;
+ tmp249_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp249_AST);
match(DSLASH);
relativePathExpr();
relPath2_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
@@ -5383,10 +5367,10 @@
break;
}
default:
- boolean synPredMatched231 = false;
+ boolean synPredMatched233 = false;
if (((LA(1)==SLASH))) {
- int _m231 = mark();
- synPredMatched231 = true;
+ int _m233 = mark();
+ synPredMatched233 = true;
inputState.guessing++;
try {
{
@@ -5395,15 +5379,15 @@
}
}
catch (RecognitionException pe) {
- synPredMatched231 = false;
+ synPredMatched233 = false;
}
- rewind(_m231);
+ rewind(_m233);
inputState.guessing--;
}
- if ( synPredMatched231 ) {
- org.exist.xquery.parser.XQueryAST tmp248_AST = null;
- tmp248_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp248_AST);
+ if ( synPredMatched233 ) {
+ org.exist.xquery.parser.XQueryAST tmp250_AST = null;
+ tmp250_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp250_AST);
match(SLASH);
relativePathExpr();
relPath_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
@@ -5419,9 +5403,9 @@
pathExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else if ((LA(1)==SLASH)) {
- org.exist.xquery.parser.XQueryAST tmp249_AST = null;
- tmp249_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp249_AST);
+ org.exist.xquery.parser.XQueryAST tmp251_AST = null;
+ tmp251_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp251_AST);
match(SLASH);
if ( inputState.guessing==0 ) {
pathExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -5447,18 +5431,18 @@
org.exist.xquery.parser.XQueryAST extensionExpr_AST = null;
{
- int _cnt220=0;
- _loop220:
+ int _cnt222=0;
+ _loop222:
do {
if ((LA(1)==PRAGMA_START)) {
pragma();
astFactory.addASTChild(currentAST, returnAST);
}
else {
- if ( _cnt220>=1 ) { break _loop220; } else {throw new NoViableAltException(LT(1), getFilename());}
+ if ( _cnt222>=1 ) { break _loop222; } else {throw new NoViableAltException(LT(1), getFilename());}
}
- _cnt220++;
+ _cnt222++;
} while (true);
}
match(LCURLY);
@@ -5478,9 +5462,9 @@
match(PRAGMA_START);
name=qName();
- org.exist.xquery.parser.XQueryAST tmp253_AST = null;
- tmp253_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp253_AST);
+ org.exist.xquery.parser.XQueryAST tmp255_AST = null;
+ tmp255_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp255_AST);
match(PRAGMA_END);
if ( inputState.guessing==0 ) {
pragma_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -5505,24 +5489,24 @@
instanceofExpr();
astFactory.addASTChild(currentAST, returnAST);
{
- _loop228:
+ _loop230:
do {
if ((LA(1)==LITERAL_intersect||LA(1)==LITERAL_except)) {
{
switch ( LA(1)) {
case LITERAL_intersect:
{
- org.exist.xquery.parser.XQueryAST tmp254_AST = null;
- tmp254_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp254_AST);
+ org.exist.xquery.parser.XQueryAST tmp256_AST = null;
+ tmp256_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp256_AST);
match(LITERAL_intersect);
break;
}
case LITERAL_except:
{
- org.exist.xquery.parser.XQueryAST tmp255_AST = null;
- tmp255_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp255_AST);
+ org.exist.xquery.parser.XQueryAST tmp257_AST = null;
+ tmp257_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp257_AST);
match(LITERAL_except);
break;
}
@@ -5536,7 +5520,7 @@
astFactory.addASTChild(currentAST, returnAST);
}
else {
- break _loop228;
+ break _loop230;
}
} while (true);
@@ -5554,24 +5538,24 @@
stepExpr();
astFactory.addASTChild(currentAST, returnAST);
{
- _loop235:
+ _loop237:
do {
if ((LA(1)==SLASH||LA(1)==DSLASH)) {
{
switch ( LA(1)) {
case SLASH:
{
- org.exist.xquery.parser.XQueryAST tmp256_AST = null;
- tmp256_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp256_AST);
+ org.exist.xquery.parser.XQueryAST tmp258_AST = null;
+ tmp258_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp258_AST);
match(SLASH);
break;
}
case DSLASH:
{
- org.exist.xquery.parser.XQueryAST tmp257_AST = null;
- tmp257_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp257_AST);
+ org.exist.xquery.parser.XQueryAST tmp259_AST = null;
+ tmp259_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp259_AST);
match(DSLASH);
break;
}
@@ -5585,7 +5569,7 @@
astFactory.addASTChild(currentAST, returnAST);
}
else {
- break _loop235;
+ break _loop237;
}
} while (true);
@@ -5600,10 +5584,10 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST stepExpr_AST = null;
- boolean synPredMatched239 = false;
+ boolean synPredMatched241 = false;
if (((_tokenSet_7.member(LA(1))))) {
- int _m239 = mark();
- synPredMatched239 = true;
+ int _m241 = mark();
+ synPredMatched241 = true;
inputState.guessing++;
try {
{
@@ -5654,21 +5638,21 @@
}
}
catch (RecognitionException pe) {
- synPredMatched239 = false;
+ synPredMatched241 = false;
}
- rewind(_m239);
+ rewind(_m241);
inputState.guessing--;
}
- if ( synPredMatched239 ) {
+ if ( synPredMatched241 ) {
axisStep();
astFactory.addASTChild(currentAST, returnAST);
stepExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else {
- boolean synPredMatched242 = false;
+ boolean synPredMatched244 = false;
if (((_tokenSet_8.member(LA(1))))) {
- int _m242 = mark();
- synPredMatched242 = true;
+ int _m244 = mark();
+ synPredMatched244 = true;
inputState.guessing++;
try {
{
@@ -5724,21 +5708,21 @@
}
}
catch (RecognitionException pe) {
- synPredMatched242 = false;
+ synPredMatched244 = false;
}
- rewind(_m242);
+ rewind(_m244);
inputState.guessing--;
}
- if ( synPredMatched242 ) {
+ if ( synPredMatched244 ) {
filterStep();
astFactory.addASTChild(currentAST, returnAST);
stepExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else {
- boolean synPredMatched245 = false;
+ boolean synPredMatched247 = false;
if (((_tokenSet_8.member(LA(1))))) {
- int _m245 = mark();
- synPredMatched245 = true;
+ int _m247 = mark();
+ synPredMatched247 = true;
inputState.guessing++;
try {
{
@@ -5775,21 +5759,21 @@
}
}
catch (RecognitionException pe) {
- synPredMatched245 = false;
+ synPredMatched247 = false;
}
- rewind(_m245);
+ rewind(_m247);
inputState.guessing--;
}
- if ( synPredMatched245 ) {
+ if ( synPredMatched247 ) {
filterStep();
astFactory.addASTChild(currentAST, returnAST);
stepExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else {
- boolean synPredMatched248 = false;
+ boolean synPredMatched250 = false;
if (((_tokenSet_8.member(LA(1))))) {
- int _m248 = mark();
- synPredMatched248 = true;
+ int _m250 = mark();
+ synPredMatched250 = true;
inputState.guessing++;
try {
{
@@ -5938,12 +5922,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched248 = false;
+ synPredMatched250 = false;
}
- rewind(_m248);
+ rewind(_m250);
inputState.guessing--;
}
- if ( synPredMatched248 ) {
+ if ( synPredMatched250 ) {
filterStep();
astFactory.addASTChild(currentAST, returnAST);
stepExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -5999,9 +5983,9 @@
switch ( LA(1)) {
case STRING_LITERAL:
{
- org.exist.xquery.parser.XQueryAST tmp258_AST = null;
- tmp258_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp258_AST);
+ org.exist.xquery.parser.XQueryAST tmp260_AST = null;
+ tmp260_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp260_AST);
match(STRING_LITERAL);
literal_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
@@ -6029,10 +6013,10 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST forwardOrReverseStep_AST = null;
- boolean synPredMatched257 = false;
+ boolean synPredMatched259 = false;
if (((_tokenSet_9.member(LA(1))))) {
- int _m257 = mark();
- synPredMatched257 = true;
+ int _m259 = mark();
+ synPredMatched259 = true;
inputState.guessing++;
try {
{
@@ -6041,12 +6025,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched257 = false;
+ synPredMatched259 = false;
}
- rewind(_m257);
+ rewind(_m259);
inputState.guessing--;
}
- if ( synPredMatched257 ) {
+ if ( synPredMatched259 ) {
forwardAxis();
astFactory.addASTChild(currentAST, returnAST);
nodeTest();
@@ -6054,10 +6038,10 @@
forwardOrReverseStep_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else {
- boolean synPredMatched259 = false;
+ boolean synPredMatched261 = false;
if (((_tokenSet_10.member(LA(1))))) {
- int _m259 = mark();
- synPredMatched259 = true;
+ int _m261 = mark();
+ synPredMatched261 = true;
inputState.guessing++;
try {
{
@@ -6066,12 +6050,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched259 = false;
+ synPredMatched261 = false;
}
- rewind(_m259);
+ rewind(_m261);
inputState.guessing--;
}
- if ( synPredMatched259 ) {
+ if ( synPredMatched261 ) {
reverseAxis();
astFactory.addASTChild(currentAST, returnAST);
nodeTest();
@@ -6097,14 +6081,14 @@
org.exist.xquery.parser.XQueryAST predicates_AST = null;
{
- _loop253:
+ _loop255:
do {
if ((LA(1)==LPPAREN)) {
predicate();
astFactory.addASTChild(currentAST, returnAST);
}
else {
- break _loop253;
+ break _loop255;
}
} while (true);
@@ -6146,63 +6130,63 @@
switch ( LA(1)) {
case LITERAL_child:
{
- org.exist.xquery.parser.XQueryAST tmp261_AST = null;
- tmp261_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp261_AST);
+ org.exist.xquery.parser.XQueryAST tmp263_AST = null;
+ tmp263_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp263_AST);
match(LITERAL_child);
forwardAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case LITERAL_self:
{
- org.exist.xquery.parser.XQueryAST tmp262_AST = null;
- tmp262_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp262_AST);
+ org.exist.xquery.parser.XQueryAST tmp264_AST = null;
+ tmp264_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp264_AST);
match(LITERAL_self);
forwardAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case LITERAL_attribute:
{
- org.exist.xquery.parser.XQueryAST tmp263_AST = null;
- tmp263_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp263_AST);
+ org.exist.xquery.parser.XQueryAST tmp265_AST = null;
+ tmp265_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp265_AST);
match(LITERAL_attribute);
forwardAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case LITERAL_descendant:
{
- org.exist.xquery.parser.XQueryAST tmp264_AST = null;
- tmp264_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp264_AST);
+ org.exist.xquery.parser.XQueryAST tmp266_AST = null;
+ tmp266_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp266_AST);
match(LITERAL_descendant);
forwardAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case 180:
{
- org.exist.xquery.parser.XQueryAST tmp265_AST = null;
- tmp265_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp265_AST);
+ org.exist.xquery.parser.XQueryAST tmp267_AST = null;
+ tmp267_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp267_AST);
match(180);
forwardAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case 181:
{
- org.exist.xquery.parser.XQueryAST tmp266_AST = null;
- tmp266_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp266_AST);
+ org.exist.xquery.parser.XQueryAST tmp268_AST = null;
+ tmp268_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp268_AST);
match(181);
forwardAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case LITERAL_following:
{
- org.exist.xquery.parser.XQueryAST tmp267_AST = null;
- tmp267_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp267_AST);
+ org.exist.xquery.parser.XQueryAST tmp269_AST = null;
+ tmp269_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp269_AST);
match(LITERAL_following);
forwardAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
@@ -6235,10 +6219,10 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST nodeTest_AST = null;
- boolean synPredMatched268 = false;
+ boolean synPredMatched270 = false;
if (((_tokenSet_4.member(LA(1))))) {
- int _m268 = mark();
- synPredMatched268 = true;
+ int _m270 = mark();
+ synPredMatched270 = true;
inputState.guessing++;
try {
{
@@ -6247,12 +6231,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched268 = false;
+ synPredMatched270 = false;
}
- rewind(_m268);
+ rewind(_m270);
inputState.guessing--;
}
- if ( synPredMatched268 ) {
+ if ( synPredMatched270 ) {
kindTest();
astFactory.addASTChild(currentAST, returnAST);
nodeTest_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -6278,45 +6262,45 @@
switch ( LA(1)) {
case LITERAL_parent:
{
- org.exist.xquery.parser.XQueryAST tmp270_AST = null;
- tmp270_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp270_AST);
+ org.exist.xquery.parser.XQueryAST tmp272_AST = null;
+ tmp272_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp272_AST);
match(LITERAL_parent);
reverseAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case LITERAL_ancestor:
{
- org.exist.xquery.parser.XQueryAST tmp271_AST = null;
- tmp271_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp271_AST);
+ org.exist.xquery.parser.XQueryAST tmp273_AST = null;
+ tmp273_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp273_AST);
match(LITERAL_ancestor);
reverseAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case 184:
{
- org.exist.xquery.parser.XQueryAST tmp272_AST = null;
- tmp272_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp272_AST);
+ org.exist.xquery.parser.XQueryAST tmp274_AST = null;
+ tmp274_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp274_AST);
match(184);
reverseAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case 185:
{
- org.exist.xquery.parser.XQueryAST tmp273_AST = null;
- tmp273_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp273_AST);
+ org.exist.xquery.parser.XQueryAST tmp275_AST = null;
+ tmp275_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp275_AST);
match(185);
reverseAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case LITERAL_preceding:
{
- org.exist.xquery.parser.XQueryAST tmp274_AST = null;
- tmp274_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp274_AST);
+ org.exist.xquery.parser.XQueryAST tmp276_AST = null;
+ tmp276_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp276_AST);
match(LITERAL_preceding);
reverseAxisSpecifier_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
@@ -6449,9 +6433,9 @@
switch ( LA(1)) {
case AT:
{
- org.exist.xquery.parser.XQueryAST tmp277_AST = null;
- tmp277_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp277_AST);
+ org.exist.xquery.parser.XQueryAST tmp279_AST = null;
+ tmp279_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp279_AST);
match(AT);
break;
}
@@ -6564,9 +6548,9 @@
}
case PARENT:
{
- org.exist.xquery.parser.XQueryAST tmp278_AST = null;
- tmp278_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp278_AST);
+ org.exist.xquery.parser.XQueryAST tmp280_AST = null;
+ tmp280_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp280_AST);
match(PARENT);
abbrevStep_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
@@ -6586,10 +6570,10 @@
org.exist.xquery.parser.XQueryAST nameTest_AST = null;
String name= null;
- boolean synPredMatched272 = false;
+ boolean synPredMatched274 = false;
if (((_tokenSet_11.member(LA(1))))) {
- int _m272 = mark();
- synPredMatched272 = true;
+ int _m274 = mark();
+ synPredMatched274 = true;
inputState.guessing++;
try {
{
@@ -6706,12 +6690,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched272 = false;
+ synPredMatched274 = false;
}
- rewind(_m272);
+ rewind(_m274);
inputState.guessing--;
}
- if ( synPredMatched272 ) {
+ if ( synPredMatched274 ) {
wildcard();
astFactory.addASTChild(currentAST, returnAST);
nameTest_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -6743,10 +6727,10 @@
org.exist.xquery.parser.XQueryAST wildcard_AST = null;
String name= null;
- boolean synPredMatched275 = false;
+ boolean synPredMatched277 = false;
if (((LA(1)==STAR))) {
- int _m275 = mark();
- synPredMatched275 = true;
+ int _m277 = mark();
+ synPredMatched277 = true;
inputState.guessing++;
try {
{
@@ -6755,12 +6739,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched275 = false;
+ synPredMatched277 = false;
}
- rewind(_m275);
+ rewind(_m277);
inputState.guessing--;
}
- if ( synPredMatched275 ) {
+ if ( synPredMatched277 ) {
match(STAR);
match(COLON);
name=ncnameOrKeyword();
@@ -6791,9 +6775,9 @@
wildcard_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else if ((LA(1)==STAR)) {
- org.exist.xquery.parser.XQueryAST tmp283_AST = null;
- tmp283_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp283_AST);
+ org.exist.xquery.parser.XQueryAST tmp285_AST = null;
+ tmp285_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp285_AST);
match(STAR);
if ( inputState.guessing==0 ) {
wildcard_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -6864,10 +6848,10 @@
break;
}
default:
- boolean synPredMatched280 = false;
+ boolean synPredMatched282 = false;
if (((_tokenSet_12.member(LA(1))))) {
- int _m280 = mark();
- synPredMatched280 = true;
+ int _m282 = mark();
+ synPredMatched282 = true;
inputState.guessing++;
try {
{
@@ -6913,21 +6897,21 @@
}
}
catch (RecognitionException pe) {
- synPredMatched280 = false;
+ synPredMatched282 = false;
}
- rewind(_m280);
+ rewind(_m282);
inputState.guessing--;
}
- if ( synPredMatched280 ) {
+ if ( synPredMatched282 ) {
computedConstructor();
astFactory.addASTChild(currentAST, returnAST);
primaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else {
- boolean synPredMatched283 = false;
+ boolean synPredMatched285 = false;
if (((_tokenSet_12.member(LA(1))))) {
- int _m283 = mark();
- synPredMatched283 = true;
+ int _m285 = mark();
+ synPredMatched285 = true;
inputState.guessing++;
try {
{
@@ -6964,21 +6948,21 @@
}
}
catch (RecognitionException pe) {
- synPredMatched283 = false;
+ synPredMatched285 = false;
}
- rewind(_m283);
+ rewind(_m285);
inputState.guessing--;
}
- if ( synPredMatched283 ) {
+ if ( synPredMatched285 ) {
computedConstructor();
astFactory.addASTChild(currentAST, returnAST);
primaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else {
- boolean synPredMatched285 = false;
+ boolean synPredMatched287 = false;
if (((LA(1)==LITERAL_ordered))) {
- int _m285 = mark();
- synPredMatched285 = true;
+ int _m287 = mark();
+ synPredMatched287 = true;
inputState.guessing++;
try {
{
@@ -6987,21 +6971,21 @@
}
}
catch (RecognitionException pe) {
- synPredMatched285 = false;
+ synPredMatched287 = false;
}
- rewind(_m285);
+ rewind(_m287);
inputState.guessing--;
}
- if ( synPredMatched285 ) {
+ if ( synPredMatched287 ) {
orderedExpr();
astFactory.addASTChild(currentAST, returnAST);
primaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
else {
- boolean synPredMatched287 = false;
+ boolean synPredMatched289 = false;
if (((LA(1)==LITERAL_unordered))) {
- int _m287 = mark();
- synPredMatched287 = true;
+ int _m289 = mark();
+ synPredMatched289 = true;
inputState.guessing++;
try {
{
@@ -7010,12 +6994,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched287 = false;
+ synPredMatched289 = false;
}
- rewind(_m287);
+ rewind(_m289);
inputState.guessing--;
}
- if ( synPredMatched287 ) {
+ if ( synPredMatched289 ) {
unorderedExpr();
astFactory.addASTChild(currentAST, returnAST);
primaryExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -7333,9 +7317,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST contextItemExpr_AST = null;
- org.exist.xquery.parser.XQueryAST tmp291_AST = null;
- tmp291_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp291_AST);
+ org.exist.xquery.parser.XQueryAST tmp293_AST = null;
+ tmp293_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp293_AST);
match(SELF);
contextItemExpr_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
returnAST = contextItemExpr_AST;
@@ -7526,27 +7510,27 @@
switch ( LA(1)) {
case DOUBLE_LITERAL:
{
- org.exist.xquery.parser.XQueryAST tmp295_AST = null;
- tmp295_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp295_AST);
+ org.exist.xquery.parser.XQueryAST tmp297_AST = null;
+ tmp297_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp297_AST);
match(DOUBLE_LITERAL);
numericLiteral_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case DECIMAL_LITERAL:
{
- org.exist.xquery.parser.XQueryAST tmp296_AST = null;
- tmp296_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp296_AST);
+ org.exist.xquery.parser.XQueryAST tmp298_AST = null;
+ tmp298_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp298_AST);
match(DECIMAL_LITERAL);
numericLiteral_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
case INTEGER_LITERAL:
{
- org.exist.xquery.parser.XQueryAST tmp297_AST = null;
- tmp297_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp297_AST);
+ org.exist.xquery.parser.XQueryAST tmp299_AST = null;
+ tmp299_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp299_AST);
match(INTEGER_LITERAL);
numericLiteral_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
@@ -7568,7 +7552,7 @@
exprSingle();
astFactory.addASTChild(currentAST, returnAST);
{
- _loop299:
+ _loop301:
do {
if ((LA(1)==COMMA)) {
match(COMMA);
@@ -7576,7 +7560,7 @@
astFactory.addASTChild(currentAST, returnAST);
}
else {
- break _loop299;
+ break _loop301;
}
} while (true);
@@ -7591,9 +7575,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST textTest_AST = null;
- org.exist.xquery.parser.XQueryAST tmp299_AST = null;
- tmp299_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp299_AST);
+ org.exist.xquery.parser.XQueryAST tmp301_AST = null;
+ tmp301_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp301_AST);
match(LITERAL_text);
match(LPAREN);
match(RPAREN);
@@ -7607,9 +7591,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST anyKindTest_AST = null;
- org.exist.xquery.parser.XQueryAST tmp302_AST = null;
- tmp302_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp302_AST);
+ org.exist.xquery.parser.XQueryAST tmp304_AST = null;
+ tmp304_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp304_AST);
match(LITERAL_node);
match(LPAREN);
match(RPAREN);
@@ -7623,9 +7607,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST elementTest_AST = null;
- org.exist.xquery.parser.XQueryAST tmp305_AST = null;
- tmp305_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp305_AST);
+ org.exist.xquery.parser.XQueryAST tmp307_AST = null;
+ tmp307_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp307_AST);
match(LITERAL_element);
match(LPAREN);
{
@@ -7736,9 +7720,9 @@
switch ( LA(1)) {
case QUESTION:
{
- org.exist.xquery.parser.XQueryAST tmp308_AST = null;
- tmp308_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp308_AST);
+ org.exist.xquery.parser.XQueryAST tmp310_AST = null;
+ tmp310_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp310_AST);
match(QUESTION);
break;
}
@@ -7897,9 +7881,9 @@
switch ( LA(1)) {
case QUESTION:
{
- org.exist.xquery.parser.XQueryAST tmp313_AST = null;
- tmp313_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp313_AST);
+ org.exist.xquery.parser.XQueryAST tmp315_AST = null;
+ tmp315_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp315_AST);
match(QUESTION);
break;
}
@@ -7956,9 +7940,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST commentTest_AST = null;
- org.exist.xquery.parser.XQueryAST tmp315_AST = null;
- tmp315_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp315_AST);
+ org.exist.xquery.parser.XQueryAST tmp317_AST = null;
+ tmp317_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp317_AST);
match(LITERAL_comment);
match(LPAREN);
match(RPAREN);
@@ -7972,9 +7956,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST piTest_AST = null;
- org.exist.xquery.parser.XQueryAST tmp318_AST = null;
- tmp318_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp318_AST);
+ org.exist.xquery.parser.XQueryAST tmp320_AST = null;
+ tmp320_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp320_AST);
match(167);
match(LPAREN);
match(RPAREN);
@@ -7988,9 +7972,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST documentTest_AST = null;
- org.exist.xquery.parser.XQueryAST tmp321_AST = null;
- tmp321_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp321_AST);
+ org.exist.xquery.parser.XQueryAST tmp323_AST = null;
+ tmp323_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp323_AST);
match(168);
match(LPAREN);
match(RPAREN);
@@ -8008,9 +7992,9 @@
switch ( LA(1)) {
case STAR:
{
- org.exist.xquery.parser.XQueryAST tmp324_AST = null;
- tmp324_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp324_AST);
+ org.exist.xquery.parser.XQueryAST tmp326_AST = null;
+ tmp326_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp326_AST);
match(STAR);
if ( inputState.guessing==0 ) {
elementNameOrWildcard_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -8167,9 +8151,9 @@
switch ( LA(1)) {
case STAR:
{
- org.exist.xquery.parser.XQueryAST tmp325_AST = null;
- tmp325_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp325_AST);
+ org.exist.xquery.parser.XQueryAST tmp327_AST = null;
+ tmp327_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp327_AST);
match(STAR);
if ( inputState.guessing==0 ) {
attributeNameOrWildcard_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -8304,10 +8288,10 @@
String name= null;
- boolean synPredMatched352 = false;
+ boolean synPredMatched354 = false;
if (((LA(1)==LT))) {
- int _m352 = mark();
- synPredMatched352 = true;
+ int _m354 = mark();
+ synPredMatched354 = true;
inputState.guessing++;
try {
{
@@ -8319,12 +8303,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched352 = false;
+ synPredMatched354 = false;
}
- rewind(_m352);
+ rewind(_m354);
inputState.guessing--;
}
- if ( synPredMatched352 ) {
+ if ( synPredMatched354 ) {
elementWithAttributes();
astFactory.addASTChild(currentAST, returnAST);
elementConstructor_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -8347,9 +8331,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST xmlComment_AST = null;
- org.exist.xquery.parser.XQueryAST tmp326_AST = null;
- tmp326_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp326_AST);
+ org.exist.xquery.parser.XQueryAST tmp328_AST = null;
+ tmp328_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp328_AST);
match(XML_COMMENT);
match(XML_COMMENT_END);
xmlComment_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -8362,9 +8346,9 @@
ASTPair currentAST = new ASTPair();
org.exist.xquery.parser.XQueryAST xmlPI_AST = null;
- org.exist.xquery.parser.XQueryAST tmp328_AST = null;
- tmp328_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp328_AST);
+ org.exist.xquery.parser.XQueryAST tmp330_AST = null;
+ tmp330_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp330_AST);
match(XML_PI);
match(XML_PI_END);
xmlPI_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -8381,10 +8365,10 @@
String qn;
- boolean synPredMatched325 = false;
+ boolean synPredMatched327 = false;
if (((LA(1)==LITERAL_element))) {
- int _m325 = mark();
- synPredMatched325 = true;
+ int _m327 = mark();
+ synPredMatched327 = true;
inputState.guessing++;
try {
{
@@ -8393,12 +8377,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched325 = false;
+ synPredMatched327 = false;
}
- rewind(_m325);
+ rewind(_m327);
inputState.guessing--;
}
- if ( synPredMatched325 ) {
+ if ( synPredMatched327 ) {
match(LITERAL_element);
match(LCURLY);
expr();
@@ -8706,10 +8690,10 @@
String qn;
- boolean synPredMatched339 =...
[truncated message content] |
|
From: <wol...@us...> - 2006-12-31 13:17:14
|
Revision: 5101
http://svn.sourceforge.net/exist/?rev=5101&view=rev
Author: wolfgang_m
Date: 2006-12-31 05:17:13 -0800 (Sun, 31 Dec 2006)
Log Message:
-----------
Fixed nested document construction bug:
<test>{
document {
comment{"I love this book!"},
<?xml-stylesheet type="text/xsl" href="c:\temp\double-slash.xslt"?>,
<book year="1977"/>
}
}</test>
Modified Paths:
--------------
trunk/eXist/src/org/exist/memtree/DocumentImpl.java
Modified: trunk/eXist/src/org/exist/memtree/DocumentImpl.java
===================================================================
--- trunk/eXist/src/org/exist/memtree/DocumentImpl.java 2006-12-30 21:04:04 UTC (rev 5100)
+++ trunk/eXist/src/org/exist/memtree/DocumentImpl.java 2006-12-31 13:17:13 UTC (rev 5101)
@@ -688,18 +688,18 @@
while (node != null) {
copyStartNode(node, receiver, expandRefs);
NodeImpl nextNode;
- if (node instanceof ReferenceNode)
- //Nothing more to stream ?
- nextNode = null;
- else
- nextNode = (NodeImpl) node.getFirstChild();
+ if (node instanceof ReferenceNode)
+ //Nothing more to stream ?
+ nextNode = null;
+ else
+ nextNode = (NodeImpl) node.getFirstChild();
while (nextNode == null) {
copyEndNode(node, receiver);
- if (top != null && top.nodeNumber == node.nodeNumber)
+ if (top != null && top.nodeNumber == node.nodeNumber)
break;
//No nextNode if the top node is a Document node
- if (top != null && top.nodeNumber == 0)
- break;
+// if (top != null && top.nodeNumber == 0)
+// break;
nextNode = (NodeImpl) node.getNextSibling();
if (nextNode == null) {
node = (NodeImpl) node.getParentNode();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2006-12-30 21:04:06
|
Revision: 5100
http://svn.sourceforge.net/exist/?rev=5100&view=rev
Author: brihaye
Date: 2006-12-30 13:04:04 -0800 (Sat, 30 Dec 2006)
Log Message:
-----------
Imporved toString() method for in-memory document nodes.
Modified Paths:
--------------
trunk/eXist/src/org/exist/memtree/DocumentImpl.java
Modified: trunk/eXist/src/org/exist/memtree/DocumentImpl.java
===================================================================
--- trunk/eXist/src/org/exist/memtree/DocumentImpl.java 2006-12-30 20:03:17 UTC (rev 5099)
+++ trunk/eXist/src/org/exist/memtree/DocumentImpl.java 2006-12-30 21:04:04 UTC (rev 5100)
@@ -1119,8 +1119,17 @@
StringBuffer result = new StringBuffer();
result.append("in-memory#");
result.append("document {");
- result.append(getDocumentElement().toString());
- result.append("} ");
+ if (size != 1) {
+ int nodeNr = 1;
+ while (true) {
+ result.append(getNode(nodeNr).toString());
+ if (next[nodeNr] < nodeNr) {
+ break;
+ } else
+ nodeNr = next[nodeNr];
+ }
+ }
+ result.append("} ");
return result.toString();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-30 20:03:21
|
Revision: 5099
http://svn.sourceforge.net/exist/?rev=5099&view=rev
Author: wolfgang_m
Date: 2006-12-30 12:03:17 -0800 (Sat, 30 Dec 2006)
Log Message:
-----------
Added some tests on Goethe's works to the performance test suite (to be continued).
Modified Paths:
--------------
trunk/eXist/build/scripts/performance.xml
trunk/eXist/test/src/org/exist/performance/test.xml
Modified: trunk/eXist/build/scripts/performance.xml
===================================================================
--- trunk/eXist/build/scripts/performance.xml 2006-12-29 18:45:43 UTC (rev 5098)
+++ trunk/eXist/build/scripts/performance.xml 2006-12-30 20:03:17 UTC (rev 5099)
@@ -16,7 +16,8 @@
<target name="benchmark" depends="run-benchmark, post-process-benchmark"/>
- <target name="run-benchmark" xmlns:test="http://exist-db.org/test">
+ <target name="run-benchmark" depends="test-compile, install-data-goethe"
+ xmlns:test="http://exist-db.org/test">
<typedef resource="org/exist/performance/ant/antlib.xml" uri="http://exist-db.org/test">
<classpath>
<path refid="classpath.core"/>
@@ -52,10 +53,11 @@
<echo>Downloading XML data: this may take a few minutes ...</echo>
<mkdir dir="${benchmark.data}"/>
<mkdir dir="${benchmark.data}/jgoethe"/>
- <get src="http://exist-db.org/jgoethe-tei.zip"
+ <get src="http://data.exist-db.org/jgoethe-tei.zip"
dest="${benchmark.data}/jgoethe-tei.zip" verbose="on"/>
<unzip src="${benchmark.data}/jgoethe-tei.zip"
dest="${benchmark.data}/jgoethe"/>
+ <delete file="${benchmark.data}/jgoethe-tei.zip}" failonerror="false"/>
<available property="benchmark.data.available"
file="jgoethe.xml" filepath="${benchmark.data}/jgoethe"/>
</target>
Modified: trunk/eXist/test/src/org/exist/performance/test.xml
===================================================================
--- trunk/eXist/test/src/org/exist/performance/test.xml 2006-12-29 18:45:43 UTC (rev 5098)
+++ trunk/eXist/test/src/org/exist/performance/test.xml 2006-12-30 20:03:17 UTC (rev 5099)
@@ -29,7 +29,7 @@
</index>
</collection>
</store>
- <generate count="10000" todir="test/benchmark/temp" prefix="book">
+ <generate count="1000" todir="test/benchmark/temp" prefix="book">
<book xmlns="" id="{$filename}" n="{$count}">
<chapter>
<title>{pt:random-text(7)}</title>
@@ -39,7 +39,7 @@
<section id="sect{$section}">
<title>{pt:random-text(7)}</title>
{
- for $para in 1 to 20 return
+ for $para in 1 to 10 return
<para>{pt:random-text(40)}</para>
}
</section>
@@ -61,4 +61,49 @@
<remove-collection parent="/db" collection="test" description="remove /db/test"/>
</tear-down>
</group>
+ <group name="ft-tests">
+ <setup connection="con">
+ <create-collection parent="/db/system/config" name="db"/>
+ <store collection="/db/system/config/db" name="collection.xconf">
+ <collection xmlns="http://exist-db.org/collection-config/1.0">
+ <index>
+ <fulltext default="all" attributes="false">
+ <create qname="p"/>
+ <create qname="head"/>
+ </fulltext>
+ </index>
+ </collection>
+ </store>
+ </setup>
+ <thread name="thread2" connection="con">
+ <create-collection parent="/db" name="jgoethe"/>
+ <store-files dir="test/benchmark/data/jgoethe" includes="*.xml" collection="/db/jgoethe"
+ description="storing Goethe data"/>
+ <sequence repeat="10">
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[. &= 'liebe']"/>
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[. &= 'liebe sinnlichkeit']"/>
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[. &= 'sinnlich*']"/>
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[. &= 'liebe sinnlich*']"/>
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[. &= 'schmerz* herz']"/>
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[. &= 'himmel hölle']"/>
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[. |= 'liebe sinnlich*']"/>
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[. |= 'himmel hölle']"/>
+ <xquery collection="/db/jgoethe" query="//(p|l|head|cell)[match-all(., 'himme?l.*')]"/>
+
+ <xquery collection="/db/jgoethe" query="//div3[head &= 'götz von berlichingen']"/>
+ <xquery collection="/db/jgoethe" query="//*[head &= 'götz von berlichingen']"/>
+ <xquery collection="/db/jgoethe" query="/TEI.2//div3[head &= 'götz von berlichingen']"/>
+ <xquery collection="/db/jgoethe" query="/TEI.2//*[head &= 'götz von berlichingen']"/>
+ <xquery collection="/db/jgoethe" query="//div3[head &= 'götz von berlichingen']//p[. &= 'arsch']"/>
+ <xquery collection="/db/jgoethe" query="//*[head &= 'götz von berlichingen']//p[. &= 'arsch']"/>
+ <xquery collection="/db/jgoethe" query="//div3[head &= 'götz von berlichingen']//p[. &= 'arsch']"/>
+ <xquery collection="/db/jgoethe" query="/TEI.2//div3[head &= 'götz von berlichingen']//p[. &= 'arsch']"/>
+ <xquery collection="/db/jgoethe" query="/TEI.2//*[head &= 'götz von berlichingen']//p[. &= 'arsch']"/>
+ <xquery collection="/db/jgoethe" query="//(div1|div2|div3|div4|div5)[head &= 'berlichingen eisernen hand']//p[. &= 'arsch']"/>
+ </sequence>
+ </thread>
+ <tear-down connection="con">
+ <!--remove-collection parent="/db" collection="jgoethe" description="remove /db/jgoethe"/-->
+ </tear-down>
+ </group>
</test>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-29 18:45:44
|
Revision: 5098
http://svn.sourceforge.net/exist/?rev=5098&view=rev
Author: wolfgang_m
Date: 2006-12-29 10:45:43 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
Performance test suite:
* added "generate" action to generate XML files using XQuery.
* new function random-text()
* added "store" action to store inline XML
* added "setup" and "tear-down" sections
* support for test "groups"
Modified Paths:
--------------
trunk/eXist/build/scripts/junit.xml
Modified: trunk/eXist/build/scripts/junit.xml
===================================================================
--- trunk/eXist/build/scripts/junit.xml 2006-12-29 18:39:15 UTC (rev 5097)
+++ trunk/eXist/build/scripts/junit.xml 2006-12-29 18:45:43 UTC (rev 5098)
@@ -38,8 +38,6 @@
file="${junit.reports}/src/org/exist/performance/ant/antlib.xml"/>
<copy todir="${junit.reports}/classes/org/exist/performance"
file="${junit.reports}/src/org/exist/performance/log2html.xql"/>
- <copy todir="${junit.reports}/classes/org/exist/performance"
- file="${junit.reports}/src/org/exist/performance/wordlist.xq"/>
</target>
<!-- Seperate target for creating folders -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-29 18:39:18
|
Revision: 5097
http://svn.sourceforge.net/exist/?rev=5097&view=rev
Author: wolfgang_m
Date: 2006-12-29 10:39:15 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
Performance test suite:
* added "generate" action to generate XML files using XQuery.
* new function random-text()
* added "store" action to store inline XML
* added "setup" and "tear-down" sections
* support for test "groups"
Modified Paths:
--------------
trunk/eXist/build/scripts/junit.xml
trunk/eXist/build/scripts/performance.xml
Modified: trunk/eXist/build/scripts/junit.xml
===================================================================
--- trunk/eXist/build/scripts/junit.xml 2006-12-29 18:37:45 UTC (rev 5096)
+++ trunk/eXist/build/scripts/junit.xml 2006-12-29 18:39:15 UTC (rev 5097)
@@ -34,9 +34,14 @@
<path refid="classpath.jetty"/>
</classpath>
</javac>
-
+ <copy todir="${junit.reports}/classes/org/exist/performance/ant"
+ file="${junit.reports}/src/org/exist/performance/ant/antlib.xml"/>
+ <copy todir="${junit.reports}/classes/org/exist/performance"
+ file="${junit.reports}/src/org/exist/performance/log2html.xql"/>
+ <copy todir="${junit.reports}/classes/org/exist/performance"
+ file="${junit.reports}/src/org/exist/performance/wordlist.xq"/>
</target>
-
+
<!-- Seperate target for creating folders -->
<target name="test-prepare" depends="jar,test-compile">
<delete failonerror="false">
Modified: trunk/eXist/build/scripts/performance.xml
===================================================================
--- trunk/eXist/build/scripts/performance.xml 2006-12-29 18:37:45 UTC (rev 5096)
+++ trunk/eXist/build/scripts/performance.xml 2006-12-29 18:39:15 UTC (rev 5097)
@@ -4,46 +4,59 @@
<!-- eXist build file : Run jUnit tests -->
<!-- ======================================================================= -->
<project basedir="../.." default="benchmark" name="performance tests">
-
+
<description>Performance tests for eXist</description>
-
+
<property name="benchmark.output" value="${junit.reports}/benchmark"/>
<property name="benchmark.src" value="${junit.reports}/src"/>
-
- <!-- Don't forget build clean all before calling this target -->
- <target name="benchmark" depends="prepare-benchmark,run-benchmark, post-process-benchmark"/>
-
- <target name="prepare-benchmark" >
- <copy todir="${junit.reports}/classes">
- <fileset dir="${junit.reports}/src">
- <include name="**/antlib.xml"/>
- </fileset>
- </copy>
- </target>
-
+ <property name="benchmark.data" value="${benchmark.output}/data"/>
+
+ <available property="benchmark.data.available"
+ file="jgoethe.xml" filepath="${benchmark.data}/jgoethe"/>
+
+ <target name="benchmark" depends="run-benchmark, post-process-benchmark"/>
+
<target name="run-benchmark" xmlns:test="http://exist-db.org/test">
<typedef resource="org/exist/performance/ant/antlib.xml" uri="http://exist-db.org/test">
- <classpath refid="classpath.core"/>
- <classpath refid="classpath.junit"/>
+ <classpath>
+ <path refid="classpath.core"/>
+ <path refid="classpath.junit"/>
+ </classpath>
</typedef>
-
+
+ <delete dir="${benchmark.output}/temp" failonerror="false"/>
<mkdir dir="${benchmark.output}"/>
+ <mkdir dir="${benchmark.output}/temp"/>
<test:benchmark outputFile="${benchmark.output}/results.xml"
source="${benchmark.src}/org/exist/performance/test.xml"/>
</target>
-
+
<target name="post-process-benchmark" xmlns:xdb="http://exist-db.org/ant">
<typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
<classpath refid="classpath.core"/>
</typedef>
-
+
<xdb:store uri="xmldb:exist:///db/bench" createcollection="true" initdb="true">
- <fileset dir="${benchmark.output}" includes="results.xml"/>
- </xdb:store>
+ <fileset dir="${benchmark.output}" includes="results.xml"/>
+ </xdb:store>
<xdb:xquery uri="xmldb:exist:///db/bench"
- queryFile="${benchmark.src}/org/exist/performance/log2html.xql"
- outputProperty="benchmark.result"/>
+ queryFile="${benchmark.src}/org/exist/performance/log2html.xql"
+ outputProperty="benchmark.result"/>
<echo file="${benchmark.output}/results.html" message="${benchmark.result}"/>
<copy todir="${benchmark.output}" file="${benchmark.src}/org/exist/performance/style.css"/>
</target>
+
+ <target name="install-data-goethe" unless="benchmark.data.available">
+ <echo>Installing Test Data: "Der Junge Goethe in seiner Zeit"</echo>
+ <echo>-------------------------</echo>
+ <echo>Downloading XML data: this may take a few minutes ...</echo>
+ <mkdir dir="${benchmark.data}"/>
+ <mkdir dir="${benchmark.data}/jgoethe"/>
+ <get src="http://exist-db.org/jgoethe-tei.zip"
+ dest="${benchmark.data}/jgoethe-tei.zip" verbose="on"/>
+ <unzip src="${benchmark.data}/jgoethe-tei.zip"
+ dest="${benchmark.data}/jgoethe"/>
+ <available property="benchmark.data.available"
+ file="jgoethe.xml" filepath="${benchmark.data}/jgoethe"/>
+ </target>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-29 18:37:47
|
Revision: 5096
http://svn.sourceforge.net/exist/?rev=5096&view=rev
Author: wolfgang_m
Date: 2006-12-29 10:37:45 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
Performance test suite:
* added "generate" action to generate XML files using XQuery.
* new function random-text()
* added "store" action to store inline XML
* added "setup" and "tear-down" sections
* support for test "groups"
Modified Paths:
--------------
trunk/eXist/test/src/org/exist/performance/actions/Action.java
trunk/eXist/test/src/org/exist/performance/actions/DataGenerator.java
trunk/eXist/test/src/org/exist/performance/actions/StoreInline.java
Modified: trunk/eXist/test/src/org/exist/performance/actions/Action.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/Action.java 2006-12-29 18:23:09 UTC (rev 5095)
+++ trunk/eXist/test/src/org/exist/performance/actions/Action.java 2006-12-29 18:37:45 UTC (rev 5096)
@@ -34,7 +34,7 @@
void configure(Runner runner, Action parent, Element config) throws EXistException;
- void execute(Connection connection) throws XMLDBException, EXistException, FileNotFoundException;
+ void execute(Connection connection) throws XMLDBException, EXistException;
String getDescription();
Modified: trunk/eXist/test/src/org/exist/performance/actions/DataGenerator.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/DataGenerator.java 2006-12-29 18:23:09 UTC (rev 5095)
+++ trunk/eXist/test/src/org/exist/performance/actions/DataGenerator.java 2006-12-29 18:37:45 UTC (rev 5096)
@@ -108,7 +108,7 @@
}
- public void execute(Connection connection) throws XMLDBException, EXistException, FileNotFoundException {
+ public void execute(Connection connection) throws XMLDBException, EXistException {
Collection collection = connection.getCollection("/db");
XQueryService service = (XQueryService) collection.getService("XQueryService", "1.0");
service.declareVariable("filename", "");
Modified: trunk/eXist/test/src/org/exist/performance/actions/StoreInline.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/StoreInline.java 2006-12-29 18:23:09 UTC (rev 5095)
+++ trunk/eXist/test/src/org/exist/performance/actions/StoreInline.java 2006-12-29 18:37:45 UTC (rev 5096)
@@ -76,7 +76,7 @@
content = writer.toString();
}
- public void execute(Connection connection) throws XMLDBException, EXistException, FileNotFoundException {
+ public void execute(Connection connection) throws XMLDBException, EXistException {
Collection collection = connection.getCollection(collectionPath);
if (collection == null)
throw new EXistException("Collection not found: " + collectionPath);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-29 18:23:12
|
Revision: 5095
http://svn.sourceforge.net/exist/?rev=5095&view=rev
Author: wolfgang_m
Date: 2006-12-29 10:23:09 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
Performance test suite:
* added "generate" action to generate XML files using XQuery.
* new function random-text()
* added "store" action to store inline XML
* added "setup" and "tear-down" sections
* support for test "groups"
Modified Paths:
--------------
trunk/eXist/test/src/org/exist/performance/ActionThread.java
trunk/eXist/test/src/org/exist/performance/Runner.java
trunk/eXist/test/src/org/exist/performance/TestResultWriter.java
trunk/eXist/test/src/org/exist/performance/actions/Action.java
trunk/eXist/test/src/org/exist/performance/log2html.xql
trunk/eXist/test/src/org/exist/performance/test.xml
Added Paths:
-----------
trunk/eXist/test/src/org/exist/performance/Group.java
trunk/eXist/test/src/org/exist/performance/actions/DataGenerator.java
trunk/eXist/test/src/org/exist/performance/actions/StoreInline.java
trunk/eXist/test/src/org/exist/performance/xquery/
trunk/eXist/test/src/org/exist/performance/xquery/PerfTestModule.java
trunk/eXist/test/src/org/exist/performance/xquery/RandomText.java
Modified: trunk/eXist/test/src/org/exist/performance/ActionThread.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/ActionThread.java 2006-12-29 18:23:05 UTC (rev 5094)
+++ trunk/eXist/test/src/org/exist/performance/ActionThread.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -50,9 +50,9 @@
try {
execute(this.connection);
} catch (XMLDBException e) {
-
+ e.printStackTrace();
} catch (EXistException e) {
-
+ e.printStackTrace();
}
long elapsed = System.currentTimeMillis() - start;
}
@@ -61,7 +61,11 @@
return name;
}
+ public void setName(String name) {
+ this.name = name;
+ }
+
public String getId() {
return name;
}
Added: trunk/eXist/test/src/org/exist/performance/Group.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/Group.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/Group.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -0,0 +1,116 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance;
+
+import org.exist.EXistException;
+import org.exist.Namespaces;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xmldb.api.base.XMLDBException;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Stack;
+
+public class Group {
+
+ private String name;
+
+ private List threads = new ArrayList();
+
+ private ActionThread setupAction = null;
+
+ private ActionThread tearDownAction = null;
+
+ private Runner runner;
+
+ public Group(Runner runner, Element config) throws EXistException {
+ this.runner = runner;
+
+ if (!config.hasAttribute("name"))
+ throw new EXistException("group element requires an attribute 'name'");
+ name = config.getAttribute("name");
+
+ NodeList nl = config.getElementsByTagNameNS(Namespaces.EXIST_NS, "setup");
+ if (nl.getLength() > 0) {
+ Element elem = (Element) nl.item(0);
+ setupAction = new ActionThread();
+ setupAction.setName("setup");
+ setupAction.configure(runner, null, elem);
+ }
+
+ nl = config.getElementsByTagNameNS(Namespaces.EXIST_NS, "tear-down");
+ if (nl.getLength() > 0) {
+ Element elem = (Element) nl.item(0);
+ tearDownAction = new ActionThread();
+ tearDownAction.setName("tear-down");
+ tearDownAction.configure(runner, null, elem);
+ }
+
+ nl = config.getElementsByTagNameNS(Namespaces.EXIST_NS, "thread");
+ for (int i = 0; i < nl.getLength(); i++) {
+ Element elem = (Element) nl.item(i);
+ ActionThread action = new ActionThread();
+ action.configure(runner, null, elem);
+ threads.add(action);
+ }
+ }
+
+ public void run() throws XMLDBException, EXistException {
+ runner.getResults().groupStart(this);
+
+ if (setupAction != null) {
+ System.out.println("Running setup ...");
+ setupAction.run();
+ System.out.println("Setup done ...");
+ }
+
+ Stack stack = new Stack();
+ for (Iterator i = threads.iterator(); i.hasNext(); ) {
+ ActionThread thread = (ActionThread) i.next();
+ Thread t = new Thread(thread, thread.getName());
+ t.start();
+ stack.push(t);
+ }
+
+ while (!stack.isEmpty()) {
+ Thread t = (Thread) stack.pop();
+ try {
+ t.join();
+ } catch (InterruptedException e) {
+ }
+ }
+
+ if (tearDownAction != null) {
+ System.out.println("Tearing down ...");
+ tearDownAction.run();
+ System.out.println("Done.");
+ }
+
+ runner.getResults().groupEnd(this);
+ }
+
+ public String getName() {
+ return name;
+ }
+}
Modified: trunk/eXist/test/src/org/exist/performance/Runner.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/Runner.java 2006-12-29 18:23:05 UTC (rev 5094)
+++ trunk/eXist/test/src/org/exist/performance/Runner.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -23,6 +23,7 @@
import org.exist.EXistException;
import org.exist.Namespaces;
+import org.exist.performance.actions.Action;
import org.exist.xmldb.CollectionImpl;
import org.exist.xmldb.DatabaseInstanceManager;
import org.w3c.dom.Document;
@@ -48,7 +49,7 @@
private Map classes = new HashMap();
- private List threads = new ArrayList();
+ private List groups = new ArrayList();
private TestResultWriter resultWriter;
@@ -83,31 +84,20 @@
connections.put(con.getId(), con);
}
- nl = root.getElementsByTagNameNS(Namespaces.EXIST_NS, "thread");
+ nl = root.getElementsByTagNameNS(Namespaces.EXIST_NS, "group");
+ System.out.println("Groups: " + nl.getLength());
for (int i = 0; i < nl.getLength(); i++) {
Element elem = (Element) nl.item(i);
- ActionThread action = new ActionThread();
- action.configure(this, null, elem);
- threads.add(action);
+ Group group = new Group(this, elem);
+ groups.add(group);
}
}
public void run() throws XMLDBException, EXistException {
- Stack stack = new Stack();
- for (Iterator i = threads.iterator(); i.hasNext(); ) {
- ActionThread thread = (ActionThread) i.next();
- Thread t = new Thread(thread, thread.getName());
- t.start();
- stack.push(t);
+ for (Iterator iterator = groups.iterator(); iterator.hasNext();) {
+ Group group = (Group) iterator.next();
+ group.run();
}
-
- while (!stack.isEmpty()) {
- Thread t = (Thread) stack.pop();
- try {
- t.join();
- } catch (InterruptedException e) {
- }
- }
}
public Connection getConnection(String connection) {
Modified: trunk/eXist/test/src/org/exist/performance/TestResultWriter.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/TestResultWriter.java 2006-12-29 18:23:05 UTC (rev 5094)
+++ trunk/eXist/test/src/org/exist/performance/TestResultWriter.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -51,6 +51,7 @@
private static final QName DESCRIPTION_ATTRIB = new QName("description", "", "");
private static final QName ID_ATTRIB = new QName("id", "", "");
private static final QName PARENT_ATTRIB = new QName("parent", "", "");
+ private static final QName GROUP_ELEMENT = new QName("group", Namespaces.EXIST_NS, "");
private final static Properties defaultProperties = new Properties();
@@ -106,6 +107,24 @@
}
}
+ public synchronized void groupStart(Group group) {
+ AttrList attribs = new AttrList();
+ attribs.addAttribute(NAME_ATTRIB, group.getName());
+ try {
+ serializer.startElement(GROUP_ELEMENT, attribs);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public synchronized void groupEnd(Group group) {
+ try {
+ serializer.endElement(GROUP_ELEMENT);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ }
+ }
+
public void close() {
try {
serializer.endElement(ROOT_ELEMENT);
Modified: trunk/eXist/test/src/org/exist/performance/actions/Action.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/Action.java 2006-12-29 18:23:05 UTC (rev 5094)
+++ trunk/eXist/test/src/org/exist/performance/actions/Action.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -6,6 +6,8 @@
import org.w3c.dom.Element;
import org.xmldb.api.base.XMLDBException;
+import java.io.FileNotFoundException;
+
/*
* eXist Open Source Native XML Database
* Copyright (C) 2001-06 The eXist Project
@@ -32,7 +34,7 @@
void configure(Runner runner, Action parent, Element config) throws EXistException;
- void execute(Connection connection) throws XMLDBException, EXistException;
+ void execute(Connection connection) throws XMLDBException, EXistException, FileNotFoundException;
String getDescription();
Added: trunk/eXist/test/src/org/exist/performance/actions/DataGenerator.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/DataGenerator.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/actions/DataGenerator.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -0,0 +1,138 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.actions;
+
+import org.exist.performance.AbstractAction;
+import org.exist.performance.Runner;
+import org.exist.performance.Connection;
+import org.exist.EXistException;
+import org.exist.xquery.value.IntegerValue;
+import org.exist.xmldb.XQueryService;
+import org.exist.util.serializer.DOMSerializer;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.base.Collection;
+import org.xmldb.api.base.CompiledExpression;
+import org.xmldb.api.base.ResourceSet;
+import org.xmldb.api.base.ResourceIterator;
+import org.xmldb.api.base.Resource;
+
+import javax.xml.transform.TransformerException;
+import java.io.StringWriter;
+import java.io.File;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.io.OutputStreamWriter;
+import java.io.FileOutputStream;
+import java.io.FileNotFoundException;
+import java.io.UnsupportedEncodingException;
+import java.io.IOException;
+import java.util.Properties;
+
+public class DataGenerator extends AbstractAction {
+
+ private final static String IMPORT =
+ "import module namespace pt='http://exist-db.org/xquery/test/performance' " +
+ "at 'java:org.exist.performance.xquery.PerfTestModule';\n" +
+ "declare variable $filename external;\n" +
+ "declare variable $count external;\n";
+
+ private String xqueryContent;
+
+ private String prefix = "";
+
+ private File directory;
+
+ private int count = 1;
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ super.configure(runner, parent, config);
+
+ if (config.hasAttribute("count")) {
+ try {
+ count = Integer.parseInt(config.getAttribute("count"));
+ } catch (NumberFormatException e) {
+ throw new EXistException("invalid value for attribute 'count': " + config.getAttribute("count"), e);
+ }
+ }
+
+ if (!config.hasAttribute("todir"))
+ throw new EXistException("generate requires an attribute 'todir'");
+ directory = new File(config.getAttribute("todir"));
+ if (!(directory.exists() && directory.isDirectory()))
+ throw new EXistException(directory.getAbsolutePath() + " does not exist or is not a directory");
+
+ if (config.hasAttribute("prefix"))
+ prefix = config.getAttribute("prefix");
+
+ NodeList children = config.getChildNodes();
+ Element root = null;
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ root = (Element) node;
+ break;
+ }
+ }
+ if (root == null)
+ throw new EXistException("no content element found for generate");
+ StringWriter writer = new StringWriter();
+ DOMSerializer serializer = new DOMSerializer(writer, new Properties());
+ try {
+ serializer.serialize(root);
+ } catch (TransformerException e) {
+ throw new EXistException("exception while serializing generate content: " + e.getMessage(), e);
+ }
+ xqueryContent = writer.toString();
+ }
+
+
+ public void execute(Connection connection) throws XMLDBException, EXistException, FileNotFoundException {
+ Collection collection = connection.getCollection("/db");
+ XQueryService service = (XQueryService) collection.getService("XQueryService", "1.0");
+ service.declareVariable("filename", "");
+ service.declareVariable("count", "0");
+ String query = IMPORT + xqueryContent;
+ System.out.println("query: " + query);
+ CompiledExpression compiled = service.compile(query);
+ try {
+ for (int i = 0; i < count; i++) {
+ File nextFile = new File(directory, prefix + i + ".xml");
+
+ service.declareVariable("filename", nextFile.getName());
+ service.declareVariable("count", new IntegerValue(i));
+ ResourceSet results = service.execute(compiled);
+
+ Writer out = new OutputStreamWriter(new FileOutputStream(nextFile), "UTF-8");
+ for (ResourceIterator iter = results.getIterator(); iter.hasMoreResources(); ) {
+ Resource r = iter.nextResource();
+ out.write(r.getContent().toString());
+ }
+ out.close();
+ }
+ } catch (IOException e) {
+ throw new EXistException("exception while storing generated data: " + e.getMessage(), e);
+ }
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/actions/StoreInline.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/StoreInline.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/actions/StoreInline.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -0,0 +1,87 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.actions;
+
+import org.exist.performance.AbstractAction;
+import org.exist.performance.Connection;
+import org.exist.performance.Runner;
+import org.exist.EXistException;
+import org.exist.util.serializer.DOMSerializer;
+import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.base.Collection;
+import org.xmldb.api.modules.XMLResource;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+
+import javax.xml.transform.TransformerException;
+import java.io.FileNotFoundException;
+import java.io.StringWriter;
+import java.util.Properties;
+
+public class StoreInline extends AbstractAction {
+
+ private String collectionPath;
+ private String name;
+ private String content;
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ super.configure(runner, parent, config);
+
+ if (!config.hasAttribute("collection"))
+ throw new EXistException(StoreInline.class.getName() + " requires an attribute 'collection'");
+ collectionPath = config.getAttribute("collection");
+
+ if (!config.hasAttribute("name"))
+ throw new EXistException(StoreInline.class.getName() + " requires an attribute 'name'");
+ name = config.getAttribute("name");
+
+ NodeList children = config.getChildNodes();
+ Element root = null;
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ root = (Element) node;
+ break;
+ }
+ }
+ if (root == null)
+ throw new EXistException("no content element found for store");
+ StringWriter writer = new StringWriter();
+ DOMSerializer serializer = new DOMSerializer(writer, new Properties());
+ try {
+ serializer.serialize(root);
+ } catch (TransformerException e) {
+ throw new EXistException("exception while serializing content to store: " + e.getMessage(), e);
+ }
+ content = writer.toString();
+ }
+
+ public void execute(Connection connection) throws XMLDBException, EXistException, FileNotFoundException {
+ Collection collection = connection.getCollection(collectionPath);
+ if (collection == null)
+ throw new EXistException("Collection not found: " + collectionPath);
+ XMLResource resource = (XMLResource) collection.createResource(name, "XMLResource");
+ resource.setContent(content);
+ collection.storeResource(resource);
+ }
+}
Modified: trunk/eXist/test/src/org/exist/performance/log2html.xql
===================================================================
--- trunk/eXist/test/src/org/exist/performance/log2html.xql 2006-12-29 18:23:05 UTC (rev 5094)
+++ trunk/eXist/test/src/org/exist/performance/log2html.xql 2006-12-29 18:23:09 UTC (rev 5095)
@@ -2,7 +2,7 @@
declare namespace t="http://exist.sourceforge.net/NS/exist";
-declare function t:process-action($action as element(t:action)+) {
+declare function t:process-action($group as element(t:group), $action as element(t:action)+) {
let $isSeq := ($action/@name = "org.exist.performance.ActionSequence")
return (
<tr>
@@ -14,14 +14,14 @@
if ($isSeq) then
<tr>
<td colspan="4" class="nested">
- {t:process-sequence($action[1])}
+ {t:process-sequence($group, $action[1])}
</td>
</tr>
else ()
)
};
-declare function t:process-sequence($group as element(t:action)) {
+declare function t:process-sequence($group as element(t:group), $sequence as element(t:action)) {
<table>
<tr>
<th>Action</th>
@@ -30,18 +30,18 @@
<th class="desc">Description</th>
</tr>
{
- if ($group/@name = "org.exist.performance.ActionSequence") then
- let $actions := distinct-values(//t:action[@parent = $group/@id]/@id)
+ if ($sequence/@name = "org.exist.performance.ActionSequence") then
+ let $actions := distinct-values($group//t:action[@parent = $sequence/@id]/@id)
for $action in $actions
return
- t:process-action(//t:action[@id = $action])
+ t:process-action($group, $group//t:action[@id = $action])
else
- t:process-action($group)
+ t:process-action($group, $sequence)
}
</table>
};
-declare function t:process-thread($thread as xs:string) {
+declare function t:process-thread($group as element(t:group), $thread as xs:string) {
<div class="thread">
<h1>Thread: {$thread}</h1>
@@ -53,9 +53,9 @@
<th class="desc">Description</th>
</tr>
{
- for $action in //t:action[@thread = $thread][not(@parent)]
+ for $action in $group//t:action[@thread = $thread][not(@parent)]
return
- t:process-action($action)
+ t:process-action($group, $action)
}
</table>
</div>
@@ -69,9 +69,16 @@
</head>
<body>
{
- for $thread in distinct-values(//t:action/@thread)
+ for $group in //t:group
return
- t:process-thread($thread)
+ <div class="group">
+ <h1>Group {string($group/@name)}</h1>
+ {
+ for $thread in distinct-values($group//t:action/@thread)
+ return
+ t:process-thread($group, $thread)
+ }
+ </div>
}
</body>
</html>
\ No newline at end of file
Modified: trunk/eXist/test/src/org/exist/performance/test.xml
===================================================================
--- trunk/eXist/test/src/org/exist/performance/test.xml 2006-12-29 18:23:05 UTC (rev 5094)
+++ trunk/eXist/test/src/org/exist/performance/test.xml 2006-12-29 18:23:09 UTC (rev 5095)
@@ -7,17 +7,58 @@
<action name="create-collection" class="org.exist.performance.actions.CreateCollection"/>
<action name="remove-collection" class="org.exist.performance.actions.RemoveCollection"/>
<action name="store-files" class="org.exist.performance.actions.StoreFromFile"/>
+ <action name="store" class="org.exist.performance.actions.StoreInline"/>
+ <action name="generate" class="org.exist.performance.actions.DataGenerator"/>
<action name="xquery" class="org.exist.performance.actions.XQuery"/>
</configuration>
- <thread name="thread1" connection="con">
- <sequence description="store shakespeare files">
- <create-collection parent="/db" name="test1"/>
- <store-files dir="samples/shakespeare" includes="**/*.xml" collection="/db/test1"/>
- </sequence>
- <sequence repeat="20" description="query resources">
- <xquery collection="/db" query="//SPEECH[SPEAKER='HAMLET']"/>
- <xquery collection="/db" query="//SPEECH[LINE &= 'love']"/>
- </sequence>
- <remove-collection parent="/db" collection="test1" description="remove /db/test1"/>
- </thread>
+ <group name="simple">
+ <setup connection="con">
+ <create-collection parent="/db" name="test"/>
+ <create-collection parent="/db/test" name="shakespeare"/>
+ <store-files dir="samples/shakespeare" includes="hamlet.xml" collection="/db/test/shakespeare"/>
+ <create-collection parent="/db/system/config" name="db"/>
+ <store collection="/db/system/config/db" name="collection.xconf">
+ <collection xmlns="http://exist-db.org/collection-config/1.0">
+ <index>
+ <fulltext default="all" attributes="false">
+ </fulltext>
+
+ <create path="//book/@id" type="xs:string"/>
+ <create path="//book/@n" type="xs:integer"/>
+ <create path="//section/@id" type="xs:string"/>
+ </index>
+ </collection>
+ </store>
+ <generate count="10000" todir="test/benchmark/temp" prefix="book">
+ <book xmlns="" id="{$filename}" n="{$count}">
+ <chapter>
+ <title>{pt:random-text(7)}</title>
+
+ {
+ for $section in 1 to 8 return
+ <section id="sect{$section}">
+ <title>{pt:random-text(7)}</title>
+ {
+ for $para in 1 to 20 return
+ <para>{pt:random-text(40)}</para>
+ }
+ </section>
+ }
+ </chapter>
+ </book>
+ </generate>
+ </setup>
+ <thread name="thread1" connection="con">
+ <store-files dir="test/benchmark/temp" includes="**/*.xml" collection="/db/test"/>
+ <sequence repeat="20" description="query resources">
+ <xquery collection="/db" query="//book[@id = 'book100.xml']"/>
+ <xquery collection="/db" query="//book[@n = 100]"/>
+ <xquery collection="/db" query="//chapter[title &= 'k*']"/>
+ <xquery collection="/db" query="//chapter[para &= 'is']"/>
+ </sequence>
+ </thread>
+ <tear-down connection="con">
+ <remove-collection parent="/db" collection="test" description="remove /db/test"/>
+ </tear-down>
+ </group>
</test>
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/performance/xquery/PerfTestModule.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/xquery/PerfTestModule.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/xquery/PerfTestModule.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -0,0 +1,62 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.xquery;
+
+import org.exist.xquery.AbstractInternalModule;
+import org.exist.xquery.FunctionDef;
+
+public class PerfTestModule extends AbstractInternalModule {
+
+ public final static String NAMESPACE_URI = "http://exist-db.org/xquery/test/performance";
+
+ public final static String PREFIX = "pt";
+
+ public final static FunctionDef[] functions = {
+ new FunctionDef(RandomText.signature, RandomText.class)
+ };
+
+
+ public PerfTestModule() {
+ super(functions);
+ }
+
+
+ /* (non-Javadoc)
+* @see org.exist.xquery.Module#getNamespaceURI()
+*/
+ public String getNamespaceURI() {
+ return NAMESPACE_URI;
+ }
+
+
+ /* (non-Javadoc)
+* @see org.exist.xquery.Module#getDefaultPrefix()
+*/
+ public String getDefaultPrefix() {
+ return PREFIX;
+ }
+
+
+ public String getDescription() {
+ return "Helper functions for the performance test suite.";
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/xquery/RandomText.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/xquery/RandomText.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/xquery/RandomText.java 2006-12-29 18:23:09 UTC (rev 5095)
@@ -0,0 +1,92 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.xquery;
+
+import org.exist.dom.DocumentSet;
+import org.exist.dom.QName;
+import org.exist.security.PermissionDeniedException;
+import org.exist.util.Occurrences;
+import org.exist.xquery.BasicFunction;
+import org.exist.xquery.Cardinality;
+import org.exist.xquery.FunctionSignature;
+import org.exist.xquery.XPathException;
+import org.exist.xquery.XQueryContext;
+import org.exist.xquery.functions.util.UtilModule;
+import org.exist.xquery.value.IntegerValue;
+import org.exist.xquery.value.Sequence;
+import org.exist.xquery.value.SequenceType;
+import org.exist.xquery.value.StringValue;
+import org.exist.xquery.value.Type;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+public class RandomText extends BasicFunction {
+
+ public final static FunctionSignature signature = new FunctionSignature(
+ new QName("random-text", PerfTestModule.NAMESPACE_URI, PerfTestModule .PREFIX),
+ "",
+ new SequenceType[] {
+ new SequenceType(Type.INT, Cardinality.EXACTLY_ONE)
+ },
+ new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE));
+
+ private String[] words = null;
+
+ private Random random = new Random();
+
+ public RandomText(XQueryContext context) {
+ super(context, signature);
+ }
+
+ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
+ if (words == null)
+ generateWordList();
+ int max = ((IntegerValue)args[0].itemAt(0)).getInt();
+ max = random.nextInt(max) + 1;
+ StringBuffer text = new StringBuffer();
+ for (int i = 0; i < max; i++) {
+ if (text.length() > 0)
+ text.append(' ');
+ text.append(words[random.nextInt(words.length)]);
+ }
+ return new StringValue(text.toString());
+ }
+
+ private void generateWordList() throws XPathException {
+ try {
+ DocumentSet docs = new DocumentSet();
+ docs = context.getBroker().getAllXMLResources(docs);
+ Occurrences[] occurrences =
+ context.getBroker().getTextEngine().scanIndexTerms(docs, docs.toNodeSet(), null, null);
+ List list = new ArrayList();
+ for (int i = 0; i < occurrences.length; i++) {
+ list.add(occurrences[i].getTerm().toString());
+ }
+ words = new String[list.size()];
+ list.toArray(words);
+ } catch (PermissionDeniedException e) {
+ throw new XPathException(getASTNode(), e.getMessage(), e);
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2006-12-29 18:23:07
|
Revision: 5094
http://svn.sourceforge.net/exist/?rev=5094&view=rev
Author: brihaye
Date: 2006-12-29 10:23:05 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
Fixed string representation of in-memory attributes : let $attr := attribute d { "xxx" } return string($attr)
Modified Paths:
--------------
trunk/eXist/src/org/exist/memtree/AttributeImpl.java
Modified: trunk/eXist/src/org/exist/memtree/AttributeImpl.java
===================================================================
--- trunk/eXist/src/org/exist/memtree/AttributeImpl.java 2006-12-29 16:20:54 UTC (rev 5093)
+++ trunk/eXist/src/org/exist/memtree/AttributeImpl.java 2006-12-29 18:23:05 UTC (rev 5094)
@@ -120,6 +120,10 @@
public String getNodeValue() throws DOMException {
return document.attrValue[nodeNumber];
}
+
+ public String getStringValue() throws DOMException {
+ return document.attrValue[nodeNumber];
+ }
/* (non-Javadoc)
* @see org.w3c.dom.Attr#setValue(java.lang.String)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-29 16:20:55
|
Revision: 5093
http://svn.sourceforge.net/exist/?rev=5093&view=rev
Author: dizzzz
Date: 2006-12-29 08:20:54 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
Fix for [1573314] HTML: cardinality issue in browse:main
https://sourceforge.net/tracker/index.php?func=detail&aid=1573314&group_id=17691&atid=117691
Modified Paths:
--------------
trunk/eXist/webapp/admin/admin.xql
Modified: trunk/eXist/webapp/admin/admin.xql
===================================================================
--- trunk/eXist/webapp/admin/admin.xql 2006-12-29 15:55:21 UTC (rev 5092)
+++ trunk/eXist/webapp/admin/admin.xql 2006-12-29 16:20:54 UTC (rev 5093)
@@ -52,7 +52,7 @@
$credentials is either an empty sequence or a pair (user, password).
:)
declare function admin:main($credentials as xs:string*) as element()+ {
- if(empty($credentials)) then
+ if( empty($credentials) or (count($credentials)!=2) ) then
admin:display-login-form()
else
admin:panel($credentials[1], $credentials[2])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-29 15:55:22
|
Revision: 5092
http://svn.sourceforge.net/exist/?rev=5092&view=rev
Author: dizzzz
Date: 2006-12-29 07:55:21 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
webDAV improved error messages on 'PUT' (see https://sourceforge.net/tracker/?func=detail&atid=117691&aid=1620747&group_id=17691). Could not tackle the issue however, MSIE client issue.
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/webdav/methods/Get.java
Modified: trunk/eXist/src/org/exist/http/webdav/methods/Get.java
===================================================================
--- trunk/eXist/src/org/exist/http/webdav/methods/Get.java 2006-12-29 15:19:21 UTC (rev 5091)
+++ trunk/eXist/src/org/exist/http/webdav/methods/Get.java 2006-12-29 15:55:21 UTC (rev 5092)
@@ -148,8 +148,7 @@
} catch (PermissionDeniedException e) {
LOG.error(e);
- response.sendError(HttpServletResponse.SC_FORBIDDEN, READ_PERMISSION_DENIED,
- e.getMessage());
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, READ_PERMISSION_DENIED);
return;
} finally {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-29 15:19:22
|
Revision: 5091
http://svn.sourceforge.net/exist/?rev=5091&view=rev
Author: dizzzz
Date: 2006-12-29 07:19:21 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
webDAV improved error messages on 'PUT' (see https://sourceforge.net/tracker/?func=detail&atid=117691&aid=1620747&group_id=17691). Could not tackle the issue however, MSIE client issue.
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/webdav/methods/Get.java
trunk/eXist/src/org/exist/http/webdav/methods/Lock.java
trunk/eXist/src/org/exist/http/webdav/methods/Put.java
Modified: trunk/eXist/src/org/exist/http/webdav/methods/Get.java
===================================================================
--- trunk/eXist/src/org/exist/http/webdav/methods/Get.java 2006-12-29 12:12:54 UTC (rev 5090)
+++ trunk/eXist/src/org/exist/http/webdav/methods/Get.java 2006-12-29 15:19:21 UTC (rev 5091)
@@ -148,7 +148,8 @@
} catch (PermissionDeniedException e) {
LOG.error(e);
- response.sendError(HttpServletResponse.SC_FORBIDDEN, READ_PERMISSION_DENIED);
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, READ_PERMISSION_DENIED,
+ e.getMessage());
return;
} finally {
Modified: trunk/eXist/src/org/exist/http/webdav/methods/Lock.java
===================================================================
--- trunk/eXist/src/org/exist/http/webdav/methods/Lock.java 2006-12-29 12:12:54 UTC (rev 5090)
+++ trunk/eXist/src/org/exist/http/webdav/methods/Lock.java 2006-12-29 15:19:21 UTC (rev 5091)
@@ -191,7 +191,7 @@
resource = broker.getXMLResource(path, org.exist.storage.lock.Lock.READ_LOCK);
} catch (PermissionDeniedException ex) {
LOG.error(ex);
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+ response.sendError(HttpServletResponse.SC_UNAUTHORIZED, ex.getMessage());
return;
}
Modified: trunk/eXist/src/org/exist/http/webdav/methods/Put.java
===================================================================
--- trunk/eXist/src/org/exist/http/webdav/methods/Put.java 2006-12-29 12:12:54 UTC (rev 5090)
+++ trunk/eXist/src/org/exist/http/webdav/methods/Put.java 2006-12-29 15:19:21 UTC (rev 5091)
@@ -171,25 +171,25 @@
} catch (PermissionDeniedException e) {
transact.abort(txn);
LOG.debug(e);
- response.sendError(HttpServletResponse.SC_FORBIDDEN);
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, e.getMessage());
return;
} catch (TriggerException e) {
transact.abort(txn);
LOG.debug(e);
- response.sendError(HttpServletResponse.SC_FORBIDDEN);
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, e.getMessage());
return;
} catch (SAXException e) {
transact.abort(txn);
LOG.debug(e);
- response.sendError(HttpServletResponse.SC_BAD_REQUEST);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
return;
} catch (LockException e) {
transact.abort(txn);
LOG.debug(e);
- response.sendError(HttpServletResponse.SC_CONFLICT);
+ response.sendError(HttpServletResponse.SC_CONFLICT, e.getMessage());
return;
} finally {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2006-12-29 12:12:56
|
Revision: 5090
http://svn.sourceforge.net/exist/?rev=5090&view=rev
Author: brihaye
Date: 2006-12-29 04:12:54 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
Fixed class cast exception in : let $x := 1.1 return $x div xs:double(4)
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/value/DecimalValue.java
Modified: trunk/eXist/src/org/exist/xquery/value/DecimalValue.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/value/DecimalValue.java 2006-12-28 20:50:26 UTC (rev 5089)
+++ trunk/eXist/src/org/exist/xquery/value/DecimalValue.java 2006-12-29 12:12:54 UTC (rev 5090)
@@ -312,6 +312,10 @@
case Type.INTEGER:
return div((ComputableValue) other.convertTo(getType()));
default:
+ if (!(other instanceof DecimalValue)) {
+ final ComputableValue n = (ComputableValue)this.convertTo(other.getType());
+ return ((ComputableValue)n).div(other);
+ }
//Copied from Saxon 8.6.1
int scale = Math.max(DIVIDE_PRECISION, Math.max(value.scale(), ((DecimalValue)other).value.scale()));
BigDecimal result = value.divide(((DecimalValue)other).value, scale, BigDecimal.ROUND_HALF_DOWN);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-28 20:50:30
|
Revision: 5089
http://svn.sourceforge.net/exist/?rev=5089&view=rev
Author: dizzzz
Date: 2006-12-28 12:50:26 -0800 (Thu, 28 Dec 2006)
Log Message:
-----------
Reformat of xml configuration file, added (but commented out) all modules.
Modified Paths:
--------------
trunk/eXist/conf.xml.tmpl
Modified: trunk/eXist/conf.xml.tmpl
===================================================================
--- trunk/eXist/conf.xml.tmpl 2006-12-28 17:33:38 UTC (rev 5088)
+++ trunk/eXist/conf.xml.tmpl 2006-12-28 20:50:26 UTC (rev 5089)
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
This is the central configuration file for the database. If the database
is running in a servlet-context, the configuration file will be read from
@@ -48,7 +47,7 @@
events based on these collections, colon is the separator char when
more than one collection is added.
- - journalDir
+ - journalDir:
specifies the folder where the eXist cluster node saves its journal
file. Directory is automatically created if it doesn't exist. If no
journaldir is specified, journal is disabled.
@@ -76,9 +75,9 @@
- collectionCache:
maximum amount of memory (in megabytes) to use for collection caches.
- Memory calculation is just approximate. If your collections are very different
- in size, it might be possible that the actual amount of memory used exceeds
- the specified limit. You should thus be careful with this setting.
+ Memory calculation is just approximate. If your collections are very different
+ in size, it might be possible that the actual amount of memory used exceeds
+ the specified limit. You should thus be careful with this setting.
- database:
selects a database backend. Currently, "native" and "native_cluster"
@@ -108,17 +107,18 @@
-->
<db-connection cacheSize="48M" collectionCache="24M" database="@database@"
files="webapp/WEB-INF/data" free_mem_min="5" pageSize="4096">
-
+
<!--
Specifies the default permissions for all resources and collections
in eXist (see User Authentication and Access Control). When this is
not configured, the default "mod" (similar to the Unix "chmod"
command) is set to 0775 in the resources and collections attributes.
+
A different default value may be set for a database instance, and
local overrides are also possible.
-->
<!--default-permissions collection="0775" resource="0775" /-->
-
+
<!--
Settings for the database connection pool:
@@ -185,16 +185,16 @@
-->
<recovery enabled="yes" group-commit="no"
journal-dir="webapp/WEB-INF/data" size="100M" sync-on-commit="no" />
-
+
<!--
The <security> element in the <db-connection> node is used to select
the security manager Class and control the database of users and
groups.
- class:
- this attribute is required, and specifies a Java class name used
- to implement the org.exist.security.SecurityManager interface,
- as in the following example:
+ this attribute is required, and specifies a Java class name used
+ to implement the org.exist.security.SecurityManager interface,
+ as in the following example:
Example: <security> class Attribute (LDAP)
<security class="org.exist.security.LDAPSecurityManager" />
@@ -202,13 +202,13 @@
eXist is distributed with the following built-in security manager
implementations:
- - org.exist.security.XMLSecurityManager
+ - org.exist.security.XMLSecurityManager
stores the user information in the database. This is the
default manager if the <security> element is not included
in <db-connection>.
- - org.exist.security.LDAPSecurityManager
+ - org.exist.security.LDAPSecurityManager
retrieves the user and groups from the LDAP database. This
requires addition configuration parameters which are
@@ -231,7 +231,7 @@
challenges.
-->
<!-- security class="org.exist.security.LDAPSecurityManager" /-->
-
+
<!--
Tasks used for system maintenance. System tasks require the database
to be in a consistent state. All database operations will be stopped
@@ -245,26 +245,27 @@
</system-task-->
<!-- Automatically creates a backup of the database every 6 hours.
- Parameters:
- dir: The directory into which the backup will be written.
- suffix:
- File suffix for the generated backup file or directory. Specify .zip to write the
- backup into a .zip. Otherwise, the backup will be written to a plain directory.
- The name of the final backup file or directory will be:
+ Parameters:
+ dir:
+ The directory into which the backup will be written.
+ suffix:
+ File suffix for the generated backup file or directory. Specify .zip to write the
+ backup into a .zip. Otherwise, the backup will be written to a plain directory.
+ The name of the final backup file or directory will be:
+ prefix + current-date + suffix.
+ prefix:
+ File prefix for the generated backup file or directory.
- prefix + current-date + suffix.
- prefix:File prefix for the generated backup file or directory.
+ -->
+ <!--system-task class="org.exist.storage.BackupSystemTask" cron-trigger="0 0 */6 * * ?">
- -->
- <!--system-task class="org.exist.storage.BackupSystemTask" cron-trigger="0 0 */6 * * ?">
-
- <parameter name="dir" value="backup"/>
- <parameter name="suffix" value=".zip"/>
- <parameter name="prefix" value="backup-"/>
- <parameter name="collection" value="/db"/>
- <parameter name="user" value="admin"/>
+ <parameter name="dir" value="backup"/>
+ <parameter name="suffix" value=".zip"/>
+ <parameter name="prefix" value="backup-"/>
+ <parameter name="collection" value="/db"/>
+ <parameter name="user" value="admin"/>
<parameter name="password" value=""/>
- </system-task-->
+ </system-task-->
<!--
This is the global configuration for the query watchdog. The
@@ -287,35 +288,35 @@
-->
<watchdog output-size-limit="10000" query-timeout="-1" />
-
+
</db-connection>
-
+
<!--
Settings for the indexer:
- - caseSensitive
+ - caseSensitive:
should equality comparisons between strings be case-sensitive or
insensitive: "yes" or "no".
- - index-depth
+ - index-depth:
defines the maximum nesting depth of nodes which will be indexed
in the DOM index. Nodes below the specified nesting depth will
not be indexed in the DOM file. This has only an effect when
retrieving query results or for some types of XPath subexpressions,
like equality comparisons.
- - stemming
+ - stemming:
eXist includes a very simple english language stemmer, based on
Porter's algorithm. Set the "stemming"-option to "true" if you
would like to use stemming. This does only work for english.
- - suppress-whitespace
+ - suppress-whitespace:
should leading or trailing whitespace be removed from a text node?
Set to "leading", "trailing", "both" or "none".
Changing the parameter will only have an effect on newly loaded
files, not old ones.
- - suppress-whitespace-mixed-content
+ - suppress-whitespace-mixed-content:
preserve the white space inside a mixed content node
- tokenizer:
@@ -339,13 +340,13 @@
suppress-whitespace="both"
tokenizer="org.exist.storage.analysis.SimpleTokenizer"
track-term-freq="yes" validation="auto">
-
+
<!--
The file for this element points to a file containing a list of
stopwords. Note that stopwords are NOT added to the fullext index.
-->
<stopwords file="stopword" />
-
+
<!--
Default index settings. Default settings apply if there's no
collection-specific configuration for a collection.
@@ -355,7 +356,7 @@
<exclude path="/auth" />
</fulltext>
</index>
-
+
<!--
Specify the location of one or more catalog files.
Catalogs are used to resolve external entities in XML documents.
@@ -364,7 +365,7 @@
<catalog file="webapp/WEB-INF/catalog.xml" />
</entity-resolver>
</indexer>
-
+
<!--
Default settings for the serializer. Most of these can be changed
by client code:
@@ -407,11 +408,11 @@
Set the parameter to "yes" to disable this feature.
-->
- <serializer add-exist-id="none" compress-output="no" enable-xinclude="yes"
- enable-xsl="no" indent="yes" match-tagging-attributes="no"
- match-tagging-elements="yes" />
+ <serializer add-exist-id="none" compress-output="no" enable-xinclude="yes"
+ enable-xsl="no" indent="yes" match-tagging-attributes="no"
+ match-tagging-elements="yes" />
- <!--
+ <!--
Default settings for the XSLT Transformer. Allow's for a choice of
implementation:
@@ -419,10 +420,11 @@
the name of the class that implements javax.xml.transform.TransformerFactory
for Saxon (XSLT 2.0 support) - net.sf.saxon.TransformerFactoryImpl
- You will need to copy saxon8.jar saxon8-dom.jar and saxon8-xpath.jar
- into lib/endorsed.
- You can get these from http://sourceforge.net/projects/saxon
+ You will need to copy saxon8.jar saxon8-dom.jar and saxon8-xpath.jar
+ into lib/endorsed.
+ You can get these from http://sourceforge.net/projects/saxon
+
for Xalan (XSLT 1.0 support) - org.apache.xalan.processor.TransformerFactoryImpl
@@ -430,8 +432,8 @@
-->
<transformer class="org.apache.xalan.processor.TransformerFactoryImpl" />
-
-
+
+
<!--
Define modules that contain xQuery functions.
@@ -457,16 +459,36 @@
uri="http://exist-db.org/xquery/text" />
<module class="org.exist.xquery.modules.example.ExampleModule"
uri="http://exist-db.org/xquery/examples" />
- <module class="org.exist.xquery.functions.validation.ValidationModule"
+ <module
+ class="org.exist.xquery.functions.validation.ValidationModule"
uri="http://exist-db.org/xquery/validation" />
<module class="org.exist.xquery.functions.system.SystemModule"
uri="http://exist-db.org/xquery/system" />
+
+ <!-- Optional Modules -->
+ <!--module class="org.exist.xquery.modules.example.ExampleModule"
+ uri="http://exist-db.org/xquery/examples" />
+ <module class="org.exist.xquery.modules.image.ImageModule"
+ uri="http://exist-db.org/xquery/image" />
+ <module class="org.exist.xquery.modules.mail.MailModule"
+ uri="http://exist-db.org/xquery/mail" />
+ <module class="org.exist.xquery.modules.simpleql.SimpleQLModule"
+ uri="http://exist-db.org/xquery/simple-ql" />
+ <module class="org.exist.xquery.modules.sql.SQLModule"
+ uri="http://exist-db.org/xquery/sql" />
+ <module class="org.exist.xquery.modules.xmldiff.XmlDiffModule"
+ uri="http://exist-db.org/xquery/xmldiff" />
+ <module class="org.exist.xquery.modules.math.MathModule"
+ uri="http://exist-db.org/xquery/math" />
+ <module class="org.exist.xquery.modules.scheduler.SchedulerModule"
+ uri="http://exist-db.org/xquery/scheduler" /-->
+
</builtin-modules>
</xquery>
<!--
- During XUpdates, the database needs to do a partial reindex of the
+ During XUpdates, the database needs to do a partial reindex of the
document whenever the internal node-id structure has changed. Reindex
runs can occur quite frequently and slow down the XUpdate process.
@@ -478,7 +500,7 @@
defines the maximum number of page splits allowed within a document
before a defragmentation run will be triggered.
- - enable-consistency-checks:
+ - enable-consistency-checks:
for debugging only. If the parameter is set to "yes", a consistency
check will be run on every modified document after every XUpdate
request. It checks if the persistent DOM is complete and all
@@ -492,7 +514,7 @@
to be aware that leaving spare ids also limits the maximum size of
a document that can be indexed.
- -->
+ -->
<xupdate allowed-fragmentation="5" enable-consistency-checks="no"
growth-factor="20" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-28 17:33:40
|
Revision: 5088
http://svn.sourceforge.net/exist/?rev=5088&view=rev
Author: dizzzz
Date: 2006-12-28 09:33:38 -0800 (Thu, 28 Dec 2006)
Log Message:
-----------
Continued fix for http://sourceforge.net/tracker/index.php?func=detail&aid=1535514&group_id=17691&atid=317691 ([ 1535514 ] decoding resources names in webadmin interface)
Creating collections with special chars......
Modified Paths:
--------------
trunk/eXist/webapp/admin/browse.xqm
Modified: trunk/eXist/webapp/admin/browse.xqm
===================================================================
--- trunk/eXist/webapp/admin/browse.xqm 2006-12-28 16:58:39 UTC (rev 5087)
+++ trunk/eXist/webapp/admin/browse.xqm 2006-12-28 17:33:38 UTC (rev 5088)
@@ -168,9 +168,9 @@
<ul>
{
if($newcol) then
- let $col := xdb:create-collection($parent, $newcol)
+ let $col := xdb:create-collection($parent, xdb:encode-uri($newcol))
return
- <li>Created collection: {util:collection-name($col)}.</li>
+ <li>Created collection: {xdb:decode-uri(xs:anyURI(util:collection-name($col)))}.</li>
else
<li>No name specified for new collection!</li>
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-28 16:58:41
|
Revision: 5087
http://svn.sourceforge.net/exist/?rev=5087&view=rev
Author: wolfgang_m
Date: 2006-12-28 08:58:39 -0800 (Thu, 28 Dec 2006)
Log Message:
-----------
util:binary-doc-available should return false if the document exists but is not a binary resource.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/util/BinaryDoc.java
Modified: trunk/eXist/src/org/exist/xquery/functions/util/BinaryDoc.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/BinaryDoc.java 2006-12-28 16:52:29 UTC (rev 5086)
+++ trunk/eXist/src/org/exist/xquery/functions/util/BinaryDoc.java 2006-12-28 16:58:39 UTC (rev 5087)
@@ -77,7 +77,7 @@
if (doc == null)
return defaultReturn;
if (doc.getResourceType() != DocumentImpl.BINARY_FILE)
- throw new XPathException(getASTNode(), path + " exists but is not a binary resource");
+ return defaultReturn;
if (isCalledAs("binary-doc")) {
BinaryDocument bin = (BinaryDocument) doc;
byte[] data = context.getBroker().getBinaryResource(bin);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-28 16:52:32
|
Revision: 5086
http://svn.sourceforge.net/exist/?rev=5086&view=rev
Author: dizzzz
Date: 2006-12-28 08:52:29 -0800 (Thu, 28 Dec 2006)
Log Message:
-----------
Continued fix for http://sourceforge.net/tracker/index.php?func=detail&aid=1535514&group_id=17691&atid=317691 ([ 1535514 ] decoding resources names in webadmin interface)
Uploading documents with strange names.....
Modified Paths:
--------------
trunk/eXist/webapp/admin/browse.xqm
Modified: trunk/eXist/webapp/admin/browse.xqm
===================================================================
--- trunk/eXist/webapp/admin/browse.xqm 2006-12-27 19:31:47 UTC (rev 5085)
+++ trunk/eXist/webapp/admin/browse.xqm 2006-12-28 16:52:29 UTC (rev 5086)
@@ -93,7 +93,7 @@
<ul>
<li>Storing uploaded content to: {$docName}</li>
{
- xdb:store($collection, $docName, $file)
+ xdb:decode-uri(xs:anyURI(xdb:store($collection, xdb:encode-uri($docName), $file)))
}
</ul>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-27 19:31:48
|
Revision: 5085
http://svn.sourceforge.net/exist/?rev=5085&view=rev
Author: dizzzz
Date: 2006-12-27 11:31:47 -0800 (Wed, 27 Dec 2006)
Log Message:
-----------
Continued fix for http://sourceforge.net/tracker/index.php?func=detail&aid=1535514&group_id=17691&atid=317691 ([ 1535514 ] decoding resources names in webadmin interface)
Removal of binary doc now ok......
Modified Paths:
--------------
trunk/eXist/webapp/admin/browse.xqm
Modified: trunk/eXist/webapp/admin/browse.xqm
===================================================================
--- trunk/eXist/webapp/admin/browse.xqm 2006-12-27 19:25:37 UTC (rev 5084)
+++ trunk/eXist/webapp/admin/browse.xqm 2006-12-27 19:31:47 UTC (rev 5085)
@@ -149,7 +149,7 @@
let $doc := if ($isBinary) then $resource else doc($resource)
return
if($doc) then (
- <li>Removing document: {$resource} ...</li>,
+ <li>Removing document: {xdb:decode-uri(xs:anyURI($resource))} ...</li>,
xdb:remove(util:collection-name($doc), util:document-name($doc))
) else (
<li>Removing collection: {xdb:decode-uri(xs:anyURI($resource))} ...</li>,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-27 19:25:39
|
Revision: 5084
http://svn.sourceforge.net/exist/?rev=5084&view=rev
Author: dizzzz
Date: 2006-12-27 11:25:37 -0800 (Wed, 27 Dec 2006)
Log Message:
-----------
Continued fix for http://sourceforge.net/tracker/index.php?func=detail&aid=1535514&group_id=17691&atid=317691 ([ 1535514 ] decoding resources names in webadmin interface)
Removal of collection now ok......
Modified Paths:
--------------
trunk/eXist/webapp/admin/browse.xqm
Modified: trunk/eXist/webapp/admin/browse.xqm
===================================================================
--- trunk/eXist/webapp/admin/browse.xqm 2006-12-27 18:02:24 UTC (rev 5083)
+++ trunk/eXist/webapp/admin/browse.xqm 2006-12-27 19:25:37 UTC (rev 5084)
@@ -152,7 +152,7 @@
<li>Removing document: {$resource} ...</li>,
xdb:remove(util:collection-name($doc), util:document-name($doc))
) else (
- <li>Removing collection: {$resource} ...</li>,
+ <li>Removing collection: {xdb:decode-uri(xs:anyURI($resource))} ...</li>,
xdb:remove($resource)
)
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-27 18:02:27
|
Revision: 5083
http://svn.sourceforge.net/exist/?rev=5083&view=rev
Author: dizzzz
Date: 2006-12-27 10:02:24 -0800 (Wed, 27 Dec 2006)
Log Message:
-----------
Fix for benchmark suite. Suite can be run now from commandline. Added antlib.xml files. Wolf please review? Perig you can continue......
Modified Paths:
--------------
trunk/eXist/build/scripts/performance.xml
trunk/eXist/build.xml
Property Changed:
----------------
trunk/eXist/test/
Modified: trunk/eXist/build/scripts/performance.xml
===================================================================
--- trunk/eXist/build/scripts/performance.xml 2006-12-27 15:33:41 UTC (rev 5082)
+++ trunk/eXist/build/scripts/performance.xml 2006-12-27 18:02:24 UTC (rev 5083)
@@ -4,36 +4,45 @@
<!-- eXist build file : Run jUnit tests -->
<!-- ======================================================================= -->
<project basedir="../.." default="benchmark" name="performance tests">
-
+
<description>Performance tests for eXist</description>
-
- <typedef resource="org/exist/performance/ant/antlib.xml" uri="http://exist-db.org/test">
- <classpath refid="classpath.junit"/>
- <classpath refid="classpath.core"/>
- </typedef>
-
- <typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
- <classpath refid="classpath.core"/>
- </typedef>
-
+
<property name="benchmark.output" value="${junit.reports}/benchmark"/>
<property name="benchmark.src" value="${junit.reports}/src"/>
-
- <target name="benchmark" depends="run-benchmark, post-process-benchmark"/>
-
+
+ <!-- Don't forget build clean all before calling this target -->
+ <target name="benchmark" depends="prepare-benchmark,run-benchmark, post-process-benchmark"/>
+
+ <target name="prepare-benchmark" >
+ <copy todir="${junit.reports}/classes">
+ <fileset dir="${junit.reports}/src">
+ <include name="**/antlib.xml"/>
+ </fileset>
+ </copy>
+ </target>
+
<target name="run-benchmark" xmlns:test="http://exist-db.org/test">
+ <typedef resource="org/exist/performance/ant/antlib.xml" uri="http://exist-db.org/test">
+ <classpath refid="classpath.core"/>
+ <classpath refid="classpath.junit"/>
+ </typedef>
+
<mkdir dir="${benchmark.output}"/>
<test:benchmark outputFile="${benchmark.output}/results.xml"
- source="${benchmark.src}/org/exist/performance/test.xml"/>
+ source="${benchmark.src}/org/exist/performance/test.xml"/>
</target>
-
+
<target name="post-process-benchmark" xmlns:xdb="http://exist-db.org/ant">
+ <typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
+ <classpath refid="classpath.core"/>
+ </typedef>
+
<xdb:store uri="xmldb:exist:///db/bench" createcollection="true" initdb="true">
- <fileset dir="${benchmark.output}" includes="results.xml"/>
- </xdb:store>
+ <fileset dir="${benchmark.output}" includes="results.xml"/>
+ </xdb:store>
<xdb:xquery uri="xmldb:exist:///db/bench"
- queryFile="${benchmark.src}/org/exist/performance/log2html.xql"
- outputProperty="benchmark.result"/>
+ queryFile="${benchmark.src}/org/exist/performance/log2html.xql"
+ outputProperty="benchmark.result"/>
<echo file="${benchmark.output}/results.html" message="${benchmark.result}"/>
<copy todir="${benchmark.output}" file="${benchmark.src}/org/exist/performance/style.css"/>
</target>
Modified: trunk/eXist/build.xml
===================================================================
--- trunk/eXist/build.xml 2006-12-27 15:33:41 UTC (rev 5082)
+++ trunk/eXist/build.xml 2006-12-27 18:02:24 UTC (rev 5083)
@@ -37,7 +37,7 @@
<!-- Additional scripts -->
<import file="build/scripts/junit.xml" />
- <!--import file="build/scripts/performance.xml" /-->
+ <import file="build/scripts/performance.xml" />
<import file="build/scripts/quality.xml" />
<import file="build/scripts/demoserver.xml" />
<import file="build/scripts/subversion.xml" />
Property changes on: trunk/eXist/test
___________________________________________________________________
Name: svn:ignore
- classes
junit
+ classes
junit
benchmark
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-12-27 15:33:42
|
Revision: 5082
http://svn.sourceforge.net/exist/?rev=5082&view=rev
Author: dizzzz
Date: 2006-12-27 07:33:41 -0800 (Wed, 27 Dec 2006)
Log Message:
-----------
Fix build.xml ; last change made the build scripts fail from command line:
build.xml:29: The following error occurred while executing this line:
build\scripts\build-impl.xml:12: The following error occurred while executing this line:
build.xml:40: The following error occurred while executing this line:
build\scripts\performance.xml:10: D:\Sources\eXist-1.1\${lib.core} not found.
Modified Paths:
--------------
trunk/eXist/build.xml
Modified: trunk/eXist/build.xml
===================================================================
--- trunk/eXist/build.xml 2006-12-26 22:56:38 UTC (rev 5081)
+++ trunk/eXist/build.xml 2006-12-27 15:33:41 UTC (rev 5082)
@@ -37,7 +37,7 @@
<!-- Additional scripts -->
<import file="build/scripts/junit.xml" />
- <import file="build/scripts/performance.xml" />
+ <!--import file="build/scripts/performance.xml" /-->
<import file="build/scripts/quality.xml" />
<import file="build/scripts/demoserver.xml" />
<import file="build/scripts/subversion.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-26 22:56:39
|
Revision: 5081
http://svn.sourceforge.net/exist/?rev=5081&view=rev
Author: wolfgang_m
Date: 2006-12-26 14:56:38 -0800 (Tue, 26 Dec 2006)
Log Message:
-----------
The beginnings of a dedicated performance test suite (work in progress - to be continued). Currently lacks some serious test data. Call with "build.sh benchmark". Output goes into test/benchmark.
Modified Paths:
--------------
trunk/eXist/build.xml
Modified: trunk/eXist/build.xml
===================================================================
--- trunk/eXist/build.xml 2006-12-26 22:35:18 UTC (rev 5080)
+++ trunk/eXist/build.xml 2006-12-26 22:56:38 UTC (rev 5081)
@@ -37,6 +37,7 @@
<!-- Additional scripts -->
<import file="build/scripts/junit.xml" />
+ <import file="build/scripts/performance.xml" />
<import file="build/scripts/quality.xml" />
<import file="build/scripts/demoserver.xml" />
<import file="build/scripts/subversion.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-26 22:35:19
|
Revision: 5080
http://svn.sourceforge.net/exist/?rev=5080&view=rev
Author: wolfgang_m
Date: 2006-12-26 14:35:18 -0800 (Tue, 26 Dec 2006)
Log Message:
-----------
The beginnings of a dedicated performance test suite (work in progress - to be continued). Currently lacks some serious test data. Call with "build.sh benchmark". Output goes into test/benchmark.
Added Paths:
-----------
trunk/eXist/test/src/org/exist/performance/log2html.xql
trunk/eXist/test/src/org/exist/performance/style.css
trunk/eXist/test/src/org/exist/performance/test.xml
Added: trunk/eXist/test/src/org/exist/performance/log2html.xql
===================================================================
--- trunk/eXist/test/src/org/exist/performance/log2html.xql (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/log2html.xql 2006-12-26 22:35:18 UTC (rev 5080)
@@ -0,0 +1,77 @@
+xquery version "1.0";
+
+declare namespace t="http://exist.sourceforge.net/NS/exist";
+
+declare function t:process-action($action as element(t:action)+) {
+ let $isSeq := ($action/@name = "org.exist.performance.ActionSequence")
+ return (
+ <tr>
+ <td class="{if ($isSeq) then 'sequence' else ''}">{string($action[1]/@name)}</td>
+ <td class="timing">{round(avg($action/@elapsed))}</td>
+ <td class="timing">{sum($action/@elapsed)}</td>
+ <td class="desc">{string($action[1]/@description)}</td>
+ </tr>,
+ if ($isSeq) then
+ <tr>
+ <td colspan="4" class="nested">
+ {t:process-sequence($action[1])}
+ </td>
+ </tr>
+ else ()
+ )
+};
+
+declare function t:process-sequence($group as element(t:action)) {
+ <table>
+ <tr>
+ <th>Action</th>
+ <th class="timing">Avg. time</th>
+ <th class="timing">Total time</th>
+ <th class="desc">Description</th>
+ </tr>
+ {
+ if ($group/@name = "org.exist.performance.ActionSequence") then
+ let $actions := distinct-values(//t:action[@parent = $group/@id]/@id)
+ for $action in $actions
+ return
+ t:process-action(//t:action[@id = $action])
+ else
+ t:process-action($group)
+ }
+ </table>
+};
+
+declare function t:process-thread($thread as xs:string) {
+ <div class="thread">
+ <h1>Thread: {$thread}</h1>
+
+ <table>
+ <tr>
+ <th>Action</th>
+ <th class="timing">Avg. time</th>
+ <th class="timing">Total time</th>
+ <th class="desc">Description</th>
+ </tr>
+ {
+ for $action in //t:action[@thread = $thread][not(@parent)]
+ return
+ t:process-action($action)
+ }
+ </table>
+ </div>
+};
+
+<html>
+ <head>
+ <title>Performance Test Results</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ </head>
+ <body>
+ {
+ for $thread in distinct-values(//t:action/@thread)
+ return
+ t:process-thread($thread)
+ }
+ </body>
+</html>
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/performance/style.css
===================================================================
--- trunk/eXist/test/src/org/exist/performance/style.css (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/style.css 2006-12-26 22:35:18 UTC (rev 5080)
@@ -0,0 +1,58 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ font: 100% Verdana, Arial, Helvetica, sans-serif;
+ margin: 20px;
+}
+
+table {
+ width: 100%;
+}
+
+h1 {
+ font-size: 100%;
+ margin-bottom: 10px;
+}
+
+tr {
+ background-color: white;
+}
+
+th, td {
+ padding: 8px 1.5em 0 0;
+ font-size: 80%;
+ border: 1px solid #AAA;
+}
+
+th {
+ background-color: #C3D9FF;
+ text-align: left;
+}
+
+.desc {
+ padding: 5px 0 0 0;
+}
+
+.sequence {
+
+}
+
+.nested {
+ padding: 5px 0 0 20px;
+ background-color: #EEE;
+}
+
+.nested th {
+ background-color: #B4EEBD;
+}
+
+.timing {
+ text-align:right;
+}
+
+.thread {
+ margin-bottom: 15px;
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/performance/test.xml
===================================================================
--- trunk/eXist/test/src/org/exist/performance/test.xml (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/test.xml 2006-12-26 22:35:18 UTC (rev 5080)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<test xmlns="http://exist.sourceforge.net/NS/exist">
+ <configuration>
+ <connection id="con" user="admin" password="" base="xmldb:exist://embedded-eXist-server"/>
+ <!--<connection id="con" user="admin" password="" base="xmldb:exist://localhost:8080/exist/xmlrpc/"/>-->
+ <action name="sequence" class="org.exist.performance.ActionSequence"/>
+ <action name="create-collection" class="org.exist.performance.actions.CreateCollection"/>
+ <action name="remove-collection" class="org.exist.performance.actions.RemoveCollection"/>
+ <action name="store-files" class="org.exist.performance.actions.StoreFromFile"/>
+ <action name="xquery" class="org.exist.performance.actions.XQuery"/>
+ </configuration>
+ <thread name="thread1" connection="con">
+ <sequence description="store shakespeare files">
+ <create-collection parent="/db" name="test1"/>
+ <store-files dir="samples/shakespeare" includes="**/*.xml" collection="/db/test1"/>
+ </sequence>
+ <sequence repeat="20" description="query resources">
+ <xquery collection="/db" query="//SPEECH[SPEAKER='HAMLET']"/>
+ <xquery collection="/db" query="//SPEECH[LINE &= 'love']"/>
+ </sequence>
+ <remove-collection parent="/db" collection="test1" description="remove /db/test1"/>
+ </thread>
+</test>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-12-26 22:30:21
|
Revision: 5079
http://svn.sourceforge.net/exist/?rev=5079&view=rev
Author: wolfgang_m
Date: 2006-12-26 14:30:17 -0800 (Tue, 26 Dec 2006)
Log Message:
-----------
The beginnings of a dedicated performance test suite (work in progress - to be continued). Currently lacks some serious test data. Call with "build.sh benchmark". Output goes into test/benchmark.
Added Paths:
-----------
trunk/eXist/build/scripts/performance.xml
trunk/eXist/test/src/org/exist/performance/
trunk/eXist/test/src/org/exist/performance/AbstractAction.java
trunk/eXist/test/src/org/exist/performance/ActionSequence.java
trunk/eXist/test/src/org/exist/performance/ActionThread.java
trunk/eXist/test/src/org/exist/performance/Connection.java
trunk/eXist/test/src/org/exist/performance/Runner.java
trunk/eXist/test/src/org/exist/performance/TestResultWriter.java
trunk/eXist/test/src/org/exist/performance/actions/
trunk/eXist/test/src/org/exist/performance/actions/Action.java
trunk/eXist/test/src/org/exist/performance/actions/CreateCollection.java
trunk/eXist/test/src/org/exist/performance/actions/RemoveCollection.java
trunk/eXist/test/src/org/exist/performance/actions/StoreFromFile.java
trunk/eXist/test/src/org/exist/performance/actions/XQuery.java
trunk/eXist/test/src/org/exist/performance/ant/
trunk/eXist/test/src/org/exist/performance/ant/AntTask.java
trunk/eXist/test/src/org/exist/performance/ant/antlib.xml
Added: trunk/eXist/build/scripts/performance.xml
===================================================================
--- trunk/eXist/build/scripts/performance.xml (rev 0)
+++ trunk/eXist/build/scripts/performance.xml 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ======================================================================= -->
+<!-- eXist build file : Run jUnit tests -->
+<!-- ======================================================================= -->
+<project basedir="../.." default="benchmark" name="performance tests">
+
+ <description>Performance tests for eXist</description>
+
+ <typedef resource="org/exist/performance/ant/antlib.xml" uri="http://exist-db.org/test">
+ <classpath refid="classpath.junit"/>
+ <classpath refid="classpath.core"/>
+ </typedef>
+
+ <typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
+ <classpath refid="classpath.core"/>
+ </typedef>
+
+ <property name="benchmark.output" value="${junit.reports}/benchmark"/>
+ <property name="benchmark.src" value="${junit.reports}/src"/>
+
+ <target name="benchmark" depends="run-benchmark, post-process-benchmark"/>
+
+ <target name="run-benchmark" xmlns:test="http://exist-db.org/test">
+ <mkdir dir="${benchmark.output}"/>
+ <test:benchmark outputFile="${benchmark.output}/results.xml"
+ source="${benchmark.src}/org/exist/performance/test.xml"/>
+ </target>
+
+ <target name="post-process-benchmark" xmlns:xdb="http://exist-db.org/ant">
+ <xdb:store uri="xmldb:exist:///db/bench" createcollection="true" initdb="true">
+ <fileset dir="${benchmark.output}" includes="results.xml"/>
+ </xdb:store>
+ <xdb:xquery uri="xmldb:exist:///db/bench"
+ queryFile="${benchmark.src}/org/exist/performance/log2html.xql"
+ outputProperty="benchmark.result"/>
+ <echo file="${benchmark.output}/results.html" message="${benchmark.result}"/>
+ <copy todir="${benchmark.output}" file="${benchmark.src}/org/exist/performance/style.css"/>
+ </target>
+</project>
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/performance/AbstractAction.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/AbstractAction.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/AbstractAction.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,58 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance;
+
+import org.exist.performance.actions.Action;
+import org.exist.EXistException;
+import org.w3c.dom.Element;
+
+public abstract class AbstractAction implements Action {
+
+ protected Action parent = null;
+
+ protected String description = null;
+
+ protected String id;
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ this.parent = parent;
+ if (config.hasAttribute("description"))
+ description = config.getAttribute("description");
+ if (config.hasAttribute("id"))
+ id = config.getAttribute("id");
+ else
+ id = "A" + runner.getNextId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public Action getParent() {
+ return parent;
+ }
+
+
+ public String getDescription() {
+ return description;
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/ActionSequence.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/ActionSequence.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/ActionSequence.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,92 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * \$Id\$
+ */
+package org.exist.performance;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+import org.exist.EXistException;
+import org.exist.Namespaces;
+import org.exist.performance.actions.Action;
+import org.xmldb.api.base.XMLDBException;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class ActionSequence extends AbstractAction {
+
+ protected int repeat = 1;
+ protected List actions = new ArrayList();
+ protected Runner runner;
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ super.configure(runner, parent, config);
+ this.runner = runner;
+ if (config.hasAttribute("repeat")) {
+ String repeatParam = config.getAttribute("repeat");
+ try {
+ repeat = Integer.parseInt(repeatParam);
+ } catch (NumberFormatException e) {
+ throw new EXistException(getClass().getName() +
+ ": value of attribute repeat should be an integer. found: " + repeatParam);
+ }
+ }
+ NodeList nl = config.getChildNodes();
+ for (int i = 0; i < nl.getLength(); i++) {
+ Node node = nl.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ Element elem = (Element) node;
+ if (elem.getNamespaceURI().equals(Namespaces.EXIST_NS)) {
+ Class clazz = runner.getClassForAction(elem.getLocalName());
+ if (clazz == null)
+ throw new EXistException("no class defined for action: " + elem.getLocalName());
+ if (!Action.class.isAssignableFrom(clazz))
+ throw new EXistException("class " + clazz.getName() + " does not implement interface Action");
+ try {
+ Action instance = (Action) clazz.newInstance();
+ instance.configure(runner, this, elem);
+ actions.add(instance);
+ } catch (InstantiationException e) {
+ throw new EXistException("failed to create instance of class " + clazz.getName(), e);
+ } catch (IllegalAccessException e) {
+ throw new EXistException("failed to create instance of class " + clazz.getName(), e);
+ }
+ }
+ }
+ }
+ }
+
+ public void execute(Connection connection) throws XMLDBException, EXistException {
+ for (int i = 0; i < repeat; i++) {
+ for (Iterator iterator = actions.iterator(); iterator.hasNext();) {
+ Action action = (Action) iterator.next();
+ long start = System.currentTimeMillis();
+ System.out.println('[' + Thread.currentThread().getName() + "] " + action.getClass().getName());
+ action.execute(connection);
+ long elapsed = System.currentTimeMillis() - start;
+ System.out.println('[' + Thread.currentThread().getName() + "] " + action.getClass().getName() + " took " + elapsed + "ms.");
+ runner.getResults().report(action, null, elapsed);
+ }
+ }
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/ActionThread.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/ActionThread.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/ActionThread.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,68 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * \$Id\$
+ */
+package org.exist.performance;
+
+import org.w3c.dom.Element;
+import org.exist.EXistException;
+import org.exist.performance.actions.Action;
+import org.xmldb.api.base.XMLDBException;
+
+public class ActionThread extends ActionSequence implements Runnable {
+
+ private String name;
+
+ private Connection connection;
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ name = config.getAttribute("name");
+ String con = config.getAttribute("connection");
+ if (con.length() == 0)
+ throw new EXistException("thread needs a connection");
+ connection = runner.getConnection(con);
+ if (connection == null)
+ throw new EXistException("unknown connection " + con +
+ " referenced by thread " + name);
+ super.configure(runner, null, config);
+ }
+
+ public void run() {
+ runner.getResults().threadStarted(this);
+ long start = System.currentTimeMillis();
+ try {
+ execute(this.connection);
+ } catch (XMLDBException e) {
+
+ } catch (EXistException e) {
+
+ }
+ long elapsed = System.currentTimeMillis() - start;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+
+ public String getId() {
+ return name;
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/Connection.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/Connection.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/Connection.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,66 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance;
+
+import org.w3c.dom.Element;
+import org.exist.EXistException;
+import org.xmldb.api.base.Collection;
+import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.DatabaseManager;
+
+public class Connection {
+
+ private String id;
+ private String base = "xmldb:exist://localhost:8080/exist/xmlrpc";
+ private String user = "guest";
+ private String password = "guest";
+
+ public Connection(Element config) throws EXistException, XMLDBException {
+ id = config.getAttribute("id");
+ if (id.length() == 0)
+ throw new EXistException("connection element needs an id");
+ base = config.getAttribute("base");
+ user = config.getAttribute("user");
+ password = config.getAttribute("password");
+ getCollection("/db");
+ }
+
+ public Collection getCollection(String relativePath) throws XMLDBException {
+ return DatabaseManager.getCollection(base + '/' + relativePath, user, password);
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getBase() {
+ return base;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/Runner.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/Runner.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/Runner.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,182 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * \$Id\$
+ */
+package org.exist.performance;
+
+import org.exist.EXistException;
+import org.exist.Namespaces;
+import org.exist.xmldb.CollectionImpl;
+import org.exist.xmldb.DatabaseInstanceManager;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xmldb.api.DatabaseManager;
+import org.xmldb.api.base.Database;
+import org.xmldb.api.base.XMLDBException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+
+public class Runner {
+
+ private Map connections = new HashMap();
+
+ private Map classes = new HashMap();
+
+ private List threads = new ArrayList();
+
+ private TestResultWriter resultWriter;
+
+ private int nextId = 0;
+
+ public Runner(Element root, TestResultWriter reporter) throws EXistException, XMLDBException {
+ this.resultWriter = reporter;
+ initDb();
+
+ NodeList nl = root.getElementsByTagNameNS(Namespaces.EXIST_NS, "configuration");
+ if (nl.getLength() == 0)
+ throw new EXistException("no configuration element found");
+ if (nl.getLength() > 1)
+ throw new EXistException("found more than one configuration element");
+ Element config = (Element) nl.item(0);
+
+ nl = config.getElementsByTagNameNS(Namespaces.EXIST_NS, "action");
+ for (int i = 0; i < nl.getLength(); i++) {
+ Element elem = (Element) nl.item(i);
+ try {
+ Class clazz = Class.forName(elem.getAttribute("class"));
+ classes.put(elem.getAttribute("name"), clazz);
+ } catch (ClassNotFoundException e) {
+ throw new EXistException("Class not found: " + elem.getAttribute("class"));
+ }
+ }
+
+ nl = config.getElementsByTagNameNS(Namespaces.EXIST_NS, "connection");
+ for (int i = 0; i < nl.getLength(); i++) {
+ Element elem = (Element) nl.item(i);
+ Connection con = new Connection(elem);
+ connections.put(con.getId(), con);
+ }
+
+ nl = root.getElementsByTagNameNS(Namespaces.EXIST_NS, "thread");
+ for (int i = 0; i < nl.getLength(); i++) {
+ Element elem = (Element) nl.item(i);
+ ActionThread action = new ActionThread();
+ action.configure(this, null, elem);
+ threads.add(action);
+ }
+ }
+
+ public void run() throws XMLDBException, EXistException {
+ Stack stack = new Stack();
+ for (Iterator i = threads.iterator(); i.hasNext(); ) {
+ ActionThread thread = (ActionThread) i.next();
+ Thread t = new Thread(thread, thread.getName());
+ t.start();
+ stack.push(t);
+ }
+
+ while (!stack.isEmpty()) {
+ Thread t = (Thread) stack.pop();
+ try {
+ t.join();
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+
+ public Connection getConnection(String connection) {
+ return (Connection) connections.get(connection);
+ }
+
+ public Class getClassForAction(String action) {
+ return (Class) classes.get(action);
+ }
+
+ public TestResultWriter getResults() {
+ return resultWriter;
+ }
+
+ public int getNextId() {
+ return ++nextId;
+ }
+
+ public void shutdown() {
+ resultWriter.close();
+ try {
+ shutdownDb();
+ } catch (XMLDBException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void initDb() throws EXistException {
+ try {
+ Class clazz = Class.forName("org.exist.xmldb.DatabaseImpl");
+ Database database = (Database)clazz.newInstance();
+ database.setProperty("create-database", "true");
+ DatabaseManager.registerDatabase(database);
+ } catch (Exception e) {
+ throw new EXistException(e.getMessage(), e);
+ }
+ }
+
+ private void shutdownDb() throws XMLDBException {
+ for (Iterator iterator = connections.values().iterator(); iterator.hasNext();) {
+ Connection connection = (Connection) iterator.next();
+ CollectionImpl collection = (CollectionImpl) connection.getCollection("/db");
+ if (!collection.isRemoteCollection()) {
+ DatabaseInstanceManager mgr = (DatabaseInstanceManager)
+ collection.getService("DatabaseInstanceManager", "1.0");
+ mgr.shutdown();
+ }
+ }
+ }
+
+ public static void main(String[] args) {
+ String xmlFile = args[0];
+ Runner runner = null;
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ factory.setValidating(false);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.parse(new File(xmlFile));
+
+ TestResultWriter writer = new TestResultWriter("out.xml");
+ runner = new Runner(doc.getDocumentElement(), writer);
+ runner.run();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.err.println("ERROR: " + e.getMessage());
+ } finally {
+ if (runner != null)
+ runner.shutdown();
+ }
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/TestResultWriter.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/TestResultWriter.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/TestResultWriter.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,116 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance;
+
+import org.exist.util.serializer.SAXSerializer;
+import org.exist.util.serializer.AttrList;
+import org.exist.EXistException;
+import org.exist.Namespaces;
+import org.exist.performance.actions.Action;
+import org.exist.dom.QName;
+import org.xml.sax.SAXException;
+
+import javax.xml.transform.OutputKeys;
+import java.io.File;
+import java.io.Writer;
+import java.io.OutputStreamWriter;
+import java.io.BufferedOutputStream;
+import java.io.FileOutputStream;
+import java.io.FileNotFoundException;
+import java.io.UnsupportedEncodingException;
+import java.io.IOException;
+import java.util.Properties;
+
+public class TestResultWriter {
+
+ private static final QName ROOT_ELEMENT = new QName("test-result", Namespaces.EXIST_NS, "");
+ private static final QName ACTION_ELEMENT = new QName("action", Namespaces.EXIST_NS, "");
+ private static final QName THREAD_ELEMENT = new QName("thread", Namespaces.EXIST_NS, "");
+ private static final QName NAME_ATTRIB = new QName("name", "", "");
+ private static final QName THREAD_ATTRIB = new QName("thread", "", "");
+ private static final QName ELAPSED_ATTRIB = new QName("elapsed", "", "");
+ private static final QName DESCRIPTION_ATTRIB = new QName("description", "", "");
+ private static final QName ID_ATTRIB = new QName("id", "", "");
+ private static final QName PARENT_ATTRIB = new QName("parent", "", "");
+
+ private final static Properties defaultProperties = new Properties();
+
+ static {
+ defaultProperties.setProperty(OutputKeys.INDENT, "yes");
+ defaultProperties.setProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
+ }
+
+ private SAXSerializer serializer;
+ private Writer writer;
+
+ public TestResultWriter(String outFile) throws EXistException {
+ File file = new File(outFile);
+ try {
+ writer = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file)), "UTF-8");
+ serializer = new SAXSerializer(writer, defaultProperties);
+ serializer.startDocument();
+ AttrList attribs = new AttrList();
+ serializer.startElement(ROOT_ELEMENT, attribs);
+ } catch (Exception e) {
+ throw new EXistException("error while configuring test output file: " + file.getAbsolutePath(), e);
+ }
+ }
+
+ public synchronized void report(Action action, String message, long elapsed) {
+ AttrList attribs = new AttrList();
+ attribs.addAttribute(THREAD_ATTRIB, Thread.currentThread().getName());
+ attribs.addAttribute(NAME_ATTRIB, action.getClass().getName());
+ attribs.addAttribute(ELAPSED_ATTRIB, Long.toString(elapsed));
+ attribs.addAttribute(ID_ATTRIB, action.getId());
+ if (action.getParent() != null && !(action.getParent() instanceof ActionThread))
+ attribs.addAttribute(PARENT_ATTRIB, action.getParent().getId());
+ if (action.getDescription() != null)
+ attribs.addAttribute(DESCRIPTION_ATTRIB, action.getDescription());
+ try {
+ serializer.startElement(ACTION_ELEMENT, attribs);
+ if (message != null)
+ serializer.characters(message);
+ serializer.endElement(ACTION_ELEMENT);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public synchronized void threadStarted(ActionThread thread) {
+ AttrList attribs = new AttrList();
+ attribs.addAttribute(NAME_ATTRIB, thread.getName());
+ try {
+ serializer.startElement(THREAD_ELEMENT, attribs);
+ serializer.endElement(ACTION_ELEMENT);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void close() {
+ try {
+ serializer.endElement(ROOT_ELEMENT);
+ writer.close();
+ } catch (Exception e) {
+ }
+ }
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/performance/actions/Action.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/Action.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/actions/Action.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,42 @@
+package org.exist.performance.actions;
+
+import org.exist.performance.Connection;
+import org.exist.performance.Runner;
+import org.exist.EXistException;
+import org.w3c.dom.Element;
+import org.xmldb.api.base.XMLDBException;
+
+/*
+* eXist Open Source Native XML Database
+* Copyright (C) 2001-06 The eXist Project
+* http://exist-db.org
+*
+* This program 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
+* of the License, or (at your option) any later version.
+*
+* This program 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 program; if not, write to the Free Software
+* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*
+* $Id$
+*/
+
+public interface Action {
+
+ void configure(Runner runner, Action parent, Element config) throws EXistException;
+
+ void execute(Connection connection) throws XMLDBException, EXistException;
+
+ String getDescription();
+
+ String getId();
+
+ Action getParent();
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/performance/actions/CreateCollection.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/CreateCollection.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/actions/CreateCollection.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,56 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.actions;
+
+import org.exist.performance.Connection;
+import org.exist.performance.Runner;
+import org.exist.performance.AbstractAction;
+import org.exist.EXistException;
+import org.w3c.dom.Element;
+import org.xmldb.api.base.Collection;
+import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.modules.CollectionManagementService;
+
+public class CreateCollection extends AbstractAction {
+
+ private String parentCol;
+ private String name;
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ super.configure(runner, parent, config);
+ parentCol = config.getAttribute("parent");
+ if (parentCol.length() == 0)
+ throw new EXistException("create-collection requires an attribute 'parent'.");
+ name = config.getAttribute("name");
+ if (name.length() == 0)
+ throw new EXistException("create-collection requires an attribute 'name'.");
+ }
+
+ public void execute(Connection connection) throws XMLDBException, EXistException {
+ Collection col = connection.getCollection(parentCol);
+ if (col == null)
+ throw new EXistException("Collection " + parentCol + " not found.");
+ CollectionManagementService mgr = (CollectionManagementService)
+ col.getService("CollectionManagementService", "1.0");
+ mgr.createCollection(name);
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/actions/RemoveCollection.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/RemoveCollection.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/actions/RemoveCollection.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,57 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.actions;
+
+import org.exist.EXistException;
+import org.exist.performance.Connection;
+import org.exist.performance.Runner;
+import org.exist.performance.AbstractAction;
+import org.w3c.dom.Element;
+import org.xmldb.api.base.Collection;
+import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.modules.CollectionManagementService;
+
+public class RemoveCollection extends AbstractAction {
+
+ private String collectionPath;
+ private String parentPath;
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ super.configure(runner, parent, config);
+ System.out.println(config.getNodeName());
+ if (!config.hasAttribute("parent"))
+ throw new EXistException(RemoveCollection.class.getName() + " requires an attribute 'parent'");
+ parentPath = config.getAttribute("parent");
+ if (!config.hasAttribute("collection"))
+ throw new EXistException(RemoveCollection.class.getName() + " requires an attribute 'collection'");
+ collectionPath = config.getAttribute("collection");
+ }
+
+ public void execute(Connection connection) throws XMLDBException, EXistException {
+ Collection collection = connection.getCollection(parentPath);
+ if (collection == null)
+ throw new EXistException(RemoveCollection.class.getName() + ": collection " + parentPath + " not found");
+ CollectionManagementService mgr = (CollectionManagementService)
+ collection.getService("CollectionManagementService", "1.0");
+ mgr.removeCollection(collectionPath);
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/actions/StoreFromFile.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/StoreFromFile.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/actions/StoreFromFile.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,116 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.actions;
+
+import org.w3c.dom.Element;
+import org.exist.EXistException;
+import org.exist.xmldb.EXistResource;
+import org.exist.util.DirectoryScanner;
+import org.exist.util.MimeTable;
+import org.exist.util.MimeType;
+import org.exist.performance.Connection;
+import org.exist.performance.Runner;
+import org.exist.performance.AbstractAction;
+import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.base.Collection;
+import org.xmldb.api.base.Resource;
+import org.xmldb.api.modules.CollectionManagementService;
+
+import java.io.File;
+import java.util.StringTokenizer;
+
+public class StoreFromFile extends AbstractAction {
+
+ private String collectionPath;
+ private String dir;
+ private String includes;
+ private String mimeType = "text/xml";
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ super.configure(runner, parent, config);
+ if (!config.hasAttribute("collection"))
+ throw new EXistException(StoreFromFile.class.getName() + " requires an attribute 'collection'");
+ collectionPath = config.getAttribute("collection");
+ if (!config.hasAttribute("dir"))
+ throw new EXistException(StoreFromFile.class.getName() + " requires an attribute 'dir'");
+ dir = config.getAttribute("dir");
+ includes = config.getAttribute("includes");
+ if (config.hasAttribute("mime-type"))
+ mimeType = config.getAttribute("mime-type");
+ }
+
+ public void execute(Connection connection) throws XMLDBException, EXistException {
+ Collection collection = connection.getCollection(collectionPath);
+ if (collection == null)
+ throw new EXistException("collection " + collectionPath + " not found");
+
+ String resourceType = getResourceType();
+ File baseDir = new File(dir);
+ File[] files = DirectoryScanner.scanDir(baseDir, includes);
+ Collection col = collection;
+ String relDir, prevDir = null;
+ for(int j = 0; j < files.length; j++) {
+ String relPath = files[j].toString().substring( baseDir.toString().length() );
+ int p = relPath.lastIndexOf( File.separatorChar );
+ relDir = relPath.substring( 0, p );
+ relDir = relDir.replace(File.separatorChar, '/');
+ if (prevDir == null || ( !relDir.equals(prevDir) ) ) {
+ col = makeColl(collection, relDir);
+ prevDir = relDir;
+ }
+ //TODO : these probably need to be encoded
+ Resource resource =
+ col.createResource(files[j].getName(), resourceType);
+ resource.setContent(files[j]);
+ if("BinaryResource".equals(resourceType))
+ ((EXistResource)resource).setMimeType(mimeType);
+ col.storeResource(resource);
+ System.out.println("Storing " + col.getName() + "/" + resource.getId());
+ }
+ }
+
+ private String getResourceType() {
+ String resourceType = "XMLResource";
+ MimeType mime = MimeTable.getInstance().getContentType(mimeType);
+ if (mime != null)
+ resourceType = mime.isXMLType() ? "XMLResource" : "BinaryResource";
+ return resourceType;
+ }
+
+ private Collection makeColl(Collection parentColl, String relPath)
+ throws XMLDBException {
+ CollectionManagementService mgtService;
+ Collection current = parentColl, c;
+ String token;
+ StringTokenizer tok = new StringTokenizer(relPath, "/");
+ while (tok.hasMoreTokens()) {
+ token = tok.nextToken();
+ c = current.getChildCollection(token);
+ if (c == null) {
+ mgtService = (CollectionManagementService) current.getService("CollectionManagementService", "1.0");
+ current = mgtService.createCollection(token);
+ } else
+ current = c;
+ }
+ return current;
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/actions/XQuery.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/XQuery.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/actions/XQuery.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,73 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.actions;
+
+import org.exist.performance.AbstractAction;
+import org.exist.performance.Connection;
+import org.exist.performance.Runner;
+import org.exist.EXistException;
+import org.exist.xmldb.XQueryService;
+import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.base.Collection;
+import org.xmldb.api.base.ResourceSet;
+import org.xmldb.api.base.ResourceIterator;
+import org.xmldb.api.base.Resource;
+import org.w3c.dom.Element;
+
+public class XQuery extends AbstractAction {
+
+ private String query = null;
+ private String collectionPath;
+ private boolean retrieve = false;
+
+ public void configure(Runner runner, Action parent, Element config) throws EXistException {
+ super.configure(runner, parent, config);
+ if (config.hasAttribute("query"))
+ query = config.getAttribute("query");
+ if (!config.hasAttribute("collection"))
+ throw new EXistException(StoreFromFile.class.getName() + " requires an attribute 'collection'");
+ collectionPath = config.getAttribute("collection");
+ if (config.hasAttribute("retrieve-results")) {
+ String option = config.getAttribute("retrieve-results");
+ retrieve = option.equalsIgnoreCase("yes") || option.equalsIgnoreCase("true");
+ }
+ }
+
+ public void execute(Connection connection) throws XMLDBException, EXistException {
+ Collection collection = connection.getCollection(collectionPath);
+ if (collection == null)
+ throw new EXistException("collection " + collectionPath + " not found");
+ XQueryService service = (XQueryService) collection.getService("XQueryService", "1.0");
+ ResourceSet result = service.query(query);
+ if (retrieve) {
+ for (ResourceIterator i = result.getIterator(); i.hasMoreResources(); ) {
+ Resource r = i.nextResource();
+ System.out.println(r.getContent());
+ }
+ }
+ }
+
+
+ public String getDescription() {
+ return (description == null ? query : description);
+ }
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/performance/ant/AntTask.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/ant/AntTask.java (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/ant/AntTask.java 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,80 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-06 The eXist Project
+ * http://exist-db.org
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+package org.exist.performance.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import org.exist.performance.Runner;
+import org.exist.performance.TestResultWriter;
+import org.w3c.dom.Document;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.File;
+
+public class AntTask extends Task {
+
+ private String source;
+ private String outputFile;
+
+ public void execute() throws BuildException {
+ File src = new File(source);
+ if (!(src.canRead() && src.isFile()))
+ throw new BuildException("Cannot read input file: " + source);
+
+ File outFile = new File(outputFile);
+
+ Runner runner = null;
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ factory.setValidating(false);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.parse(src);
+
+ TestResultWriter writer = new TestResultWriter(outFile.getAbsolutePath());
+ runner = new Runner(doc.getDocumentElement(), writer);
+ runner.run();
+ } catch (Exception e) {
+ throw new BuildException("ERROR: " + e.getMessage(), e);
+ } finally {
+ if (runner != null)
+ runner.shutdown();
+ }
+ }
+
+ public String getOutputFile() {
+ return outputFile;
+ }
+
+ public void setOutputFile(String outputFile) {
+ this.outputFile = outputFile;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+}
Added: trunk/eXist/test/src/org/exist/performance/ant/antlib.xml
===================================================================
--- trunk/eXist/test/src/org/exist/performance/ant/antlib.xml (rev 0)
+++ trunk/eXist/test/src/org/exist/performance/ant/antlib.xml 2006-12-26 22:30:17 UTC (rev 5079)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<antlib>
+ <typedef name="benchmark" classname="org.exist.performance.ant.AntTask"/>
+</antlib>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|