|
From: Jean-Marc V. <jm...@fr...> - 2003-04-02 18:36:51
|
I have commited a new JUnit test (that triggers the error mentioned
yesterday
in org.exist.xpath.FunPosition.eval() ) :
- org.exist.xmldb.test.ResourceSetTest
It tests 2 new classes in org.exist.xmldb :
- MapResourceSet.java
- ResourceSetHelper.java
The latter does an intersection of 2 ResourceSet and makes use of the
former.
I also added more tests in :
- CreateCollectionsTest.java
- ResourceTest.java ( given by Kevin O'Neill on Mon, 2003-03-31 at 14:13 )
I also commited this small helper for debugging based on bin/run.sh :
bin/jdb.sh
Below is sample session with bin/jdb.sh . We debug the new
ResourceSetTest (that reveals the FunPosition bug ) run by JUnit .
Notes:
- user commands in jdb are preceded by > or main[1]
- the "catch all" command is essential otherwise JUnit catches itself
all Exceptions (normal, JUnit has to run all tests whatever happens)
- I didn't solve the problem -:((
[jmv@protea eXist-1.0]$ bin/jdb.sh junit.textui.TestRunner
org.exist.xmldb.test.ResourceSetTest
Initializing jdb ...
> catch all java.lang.ClassCastException
Deferring all java.lang.ClassCastException.
It will be set after the class is loaded.
> run
run junit.textui.TestRunner org.exist.xmldb.test.ResourceSetTest
Set uncaught java.lang.Throwable
Set deferred all java.lang.ClassCastException
Set deferred uncaught java.lang.Throwable
>
VM Started: .setUp: query1:
document('/db/test/hamlet.xml')/*/*[position()>=5 ]
Loading catalog:
/home/jmv/binaries/eclipse/workspace/eXist-1.0/./samples/xcatalog.xml
.....
02 avr. 2003 08:35:19,522 DEBUG (BrokerPool.java [initialize]:255) -
database engine initialized.
02 avr. 2003 08:35:20,008 DEBUG (NativeBroker.java [getCollection]:595)
- loading collection /db/test took 19ms.
query1: document('/db/test/hamlet.xml')/*/*[position()>=5 ]
Exception occurred: java.lang.ClassCastException (to be caught at:
junit.framework.TestCase.runBare(), line=129 bci=11)"thread=main",
org.exist.xpath.FunPosition.eval(), line=50 bci=7
50 NodeSet set = ((ArraySet)context).getChildren(doc,
node.getGID());
main[1] where
[1] org.exist.xpath.FunPosition.eval (FunPosition.java:50)
[2] org.exist.xpath.OpEquals.numberCompare (OpEquals.java:319)
[3] org.exist.xpath.OpEquals.eval (OpEquals.java:200)
....
main[1] locals
Method arguments:
docs = instance of org.exist.dom.DocumentSet(id=925)
context = instance of org.exist.dom.VirtualNodeSet(id=926)
node = instance of org.exist.dom.NodeProxy(id=927)
Local variables:
doc = instance of org.exist.dom.DocumentImpl(id=928)
main[1] print context
context = instance of org.exist.dom.VirtualNodeSet(id=926)
main[1] dump context
context = {
axis: 3
test: instance of org.exist.xpath.TypeTest(id=929)
context: instance of org.exist.dom.VirtualNodeSet(id=930)
realSet: instance of org.exist.dom.ArraySet(id=931)
org.exist.dom.NodeSet.ANCESTOR: 0
org.exist.dom.NodeSet.DESCENDANT: 1
org.exist.dom.NodeSet.EMPTY_SET: instance of
org.exist.dom.EmptyNodeSet(id=932)
}
main[1] dump context.realSet
context.realSet = {
ANCESTOR: 0
DESCENDANT: 1
LOG: instance of org.apache.log4j.Logger(id=933)
counter: 2
length: 100
nodes: instance of org.exist.dom.NodeProxy[100] (id=934)
sorted: true
class$org$exist$dom$ArraySet: instance of java.lang.Class(reflected
class=org.exist.dom.ArraySet, id=844)
org.exist.dom.NodeSet.ANCESTOR: 0
org.exist.dom.NodeSet.DESCENDANT: 1
org.exist.dom.NodeSet.EMPTY_SET: instance of
org.exist.dom.EmptyNodeSet(id=932)
}
--
Jean-Marc Vanel
jm...@fr...
http://jmvanel.free.fr/ ===) CV, software resources
Worldwide Botanical Knowledge Base
http://wwbota.free.fr/
Demo.: 8500 species of the Flora of China with Cocoon and eXist:
http://jmvanel.free.fr/protea.html
|