@Test
public void simpleQueries() {
System.out.println("Test simple queries ...");
DocumentSet docs = configureAndStore(COLLECTION_CONFIG1, XML1, "test.xml");
DBBroker broker = null;
try {
broker = pool.get(pool.getSecurityManager().getSystemSubject());
assertNotNull(broker);
checkIndex(docs, broker, new QName[] { new QName("head", "") }, "title", 1);
Occurrences[] o = checkIndex(docs, broker, new QName[]{new QName("p", "")}, "with", 1);
assertEquals(2, o[0].getOccurrences());
checkIndex(docs, broker, new QName[] { new QName("hi", "") }, "just", 1);
checkIndex(docs, broker, null, "in", 1);
QName attrQN = new QName("rend", "");
attrQN.setNameType(ElementValue.ATTRIBUTE);
checkIndex(docs, broker, new QName[] { attrQN }, null, 2);
checkIndex(docs, broker, new QName[] { attrQN }, "center", 1);
checkIndex(docs, broker, new QName[] { attrQN }, "right", 1);
XQuery xquery = broker.getXQueryService();
assertNotNull(xquery);
Sequence seq = xquery.execute("/section[ft:query(p, 'content')]", null, AccessContext.TEST);
assertNotNull(seq);
assertEquals(1, seq.getItemCount());