To test the adapter i using junit and a stateful session bean.
TestSuite: 1. create a collection, 2. store document, 3. retrieve document, 4. query (xpath), 5. query (xupdate), 6. remove document, 7. remove collection
This suite returns sometimes with errors in query (xupdate) part.
The document is: (taken (like the xupdate expressions) from http://www.xmldatabases.org/projects/XUpdate-UseCases/)
<addresses>
<address id= "1">
<!--This is the users name-->
<name>
<first> John</first>
<last> Smith</last>
</name> <city>Houston </city>
<state>Texas </state>
<country> United States</country>
<phone type= "home">333-300-0300 </phone>
<phone type= "work">333-500-9080 </phone>
<note><![CDATA[This is a new user]]></note >
</address>
</addresses>
Here are the "core"-xupdate query-strings used in query (xupdate):
xupdate = "<xupdate:insert-before select=\"/addresses/[EMAIL PROTECTED] = 1]/name/last\" >" +
" <xupdate:element name=\"middle\">Lennox</xupdate:element>" +
"</xupdate:insert-before>";
xupdate = "<xupdate:insert-after select=\"/addresses/[EMAIL PROTECTED] = 1]/[EMAIL PROTECTED]'home']\">" +
" <xupdate:element name=\"phone\"><xupdate:attribute name=\"type\">cell</xupdate:attribute>490-494-4904</xupdate:element>" +
"</xupdate:insert-after>";
xupdate = "<xupdate:append select=\"/addresses/[EMAIL PROTECTED] = 1]\" >" +
" <xupdate:element name=\"zip\">90200</xupdate:element>" +
"</xupdate:append>";
xupdate = "<xupdate:append select=\"/addresses/[EMAIL PROTECTED] = 1]/[EMAIL PROTECTED]'work']\" >" +
" <xupdate:attribute name=\"extension\">223</xupdate:attribute>" +
"</xupdate:append>";
xupdate = "<xupdate:append select=\"/addresses/[EMAIL PROTECTED] = 1]/country\" >" +
" <xupdate:text> of America</xupdate:text>" +
"</xupdate:append>";
xupdate = "<xupdate:append select=\"/addresses\" >" +
" <xupdate:element name=\"address\">" +
" <xupdate:attribute name=\"id\">2</xupdate:attribute>" +
" <name>" +
" <first>Susan</first>" +
" <last>Long</last>" +
" </name>" +
" <city>Tucson</city>" +
" <state>Arizona</state>" +
" <country>United States</country>" +
" <phone type=\"home\">430-304-3040</phone>" +
" </xupdate:element>" +
"</xupdate:append>";
sometimes everything is ok, all xupdates are done. but sometimes i got this error:
java.lang.NullPointerException at org.apache.xindice.core.DocumentCache$CacheKey.equals(DocumentCache.java:171) at java.util.WeakHashMap.eq(WeakHashMap.java:256) at java.util.WeakHashMap.get(WeakHashMap.java:348) at org.apache.xindice.core.DocumentCache.getDocument(DocumentCache.java:79) at org.apache.xindice.core.Collection.getDocument(Collection.java:711) at org.apache.xindice.core.query.XPathQueryResolver$ResultSet.prepareNextNode(XPathQueryResolver.java:1003) at org.apache.xindice.core.query.XPathQueryResolver$ResultSet.<init>(XPathQueryResolver.java:995) at org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.execute(XPathQueryResolver.java:247) at org.apache.xindice.core.query.XPathQueryResolver.query(XPathQueryResolver.java:151) at org.apache.xindice.core.query.QueryEngine.query(QueryEngine.java:147) at org.apache.xindice.core.Collection.queryCollection(Collection.java:847) at org.apache.xindice.core.xupdate.XUpdateImpl.execute(XUpdateImpl.java:185) at org.apache.xindice.core.xupdate.XUpdateQueryResolver$XUpdateQuery.execute(XUpdateQueryResolver.java:172) at org.apache.xindice.core.xupdate.XUpdateQueryResolver.query(XUpdateQueryResolver.java:106) at org.apache.xindice.core.query.QueryEngine.query(QueryEngine.java:147) at org.apache.xindice.core.Collection.queryCollection(Collection.java:847) at org.apache.xindice.client.corba.CollectionServant.queryCollection(CollectionServant.java:424) at org.apache.xindice.client.corba.db.CollectionPOA._invoke(CollectionPOA.java:332) at org.openorb.adapter.poa.POA.dispatch(POA.java:975) at org.openorb.net.AbstractServerRequest.dispatch(AbstractServerRequest.java:750) at org.openorb.net.ServerManagerImpl.serve_request(ServerManagerImpl.java:1467) at org.openorb.net.ServerManagerImpl.thread_pool_main(ServerManagerImpl.java:1410) at org.openorb.net.ServerManagerImpl.access$200(ServerManagerImpl.java:77) at org.openorb.net.ServerManagerImpl$PoolThread.run(ServerManagerImpl.java:1557)
i'm using jdk1.4, linux suse 8.0 xindice birdday 1.0 (precompiled)
thx in advance
jens
