}
Sequence seq = xquery.execute("/products", null, AccessContext.TEST);
assertEquals(seq.getItemCount(), 1);
Serializer serializer = broker.getSerializer();
System.out.println(serializer.serialize((NodeValue) seq.itemAt(0)));
seq = xquery.execute("//product", null, AccessContext.TEST);
assertEquals(ITEMS_TO_APPEND, seq.getItemCount());
seq = xquery.execute("//product[@name = 'n20']", null, AccessContext.TEST);
assertEquals(1, seq.getItemCount());
store(broker, "attribs.xml", "<test attr1='aaa' attr2='bbb'>ccc</test>");
query = "update insert attribute attr1 { 'eee' } into /test";
System.out.println("testing duplicate attribute ...");
xquery.execute(query, null, AccessContext.TEST);
seq = xquery.execute("xmldb:document('" + TEST_COLLECTION + "/attribs.xml')/test[@attr1 = 'eee']", null, AccessContext.TEST);
assertEquals(1, seq.getItemCount());
System.out.println(serializer.serialize((NodeValue) seq.itemAt(0)));
System.out.println("testAppendAttributes: PASS");
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());