Skip to content

Commit 87d0f99

Browse files
Ajit GeorgeAjit George
authored andcommitted
Git 396 - Added verification to make sure that server transforms have
occurred.
1 parent d47ba90 commit 87d0f99

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test-complete/src/test/java/com/marklogic/client/functionaltest/TestBulkWriteWithTransformations.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public void testBulkXQYTransformWithTrans() throws Exception {
209209
transMgr.writeXQueryTransform("add-attr-xquery-transform", transformHandle, metadata);
210210
ServerTransform transform = new ServerTransform("add-attr-xquery-transform");
211211
transform.put("name", "Lang");
212-
transform.put("value", "English");
212+
transform.put("value", "testBulkXQYTransformWithTrans");
213213
int count=1;
214214
XMLDocumentManager docMgr = client.newXMLDocumentManager();
215215
HashMap<String,String> map= new HashMap<String,String>();
@@ -259,10 +259,14 @@ public void testBulkXQYTransformWithTrans() throws Exception {
259259
count=0;
260260
DocumentPage page = docMgr.read(uris);
261261
DOMHandle dh = new DOMHandle();
262+
// To verify that transformation did run on all docs.
263+
String verifyAttrValue = null;
262264
while(page.hasNext()){
263265
DocumentRecord rec = page.next();
264266
rec.getContent(dh);
265267
assertTrue("Element has attribure ? :",dh.get().getElementsByTagName("foo").item(0).hasAttributes());
268+
verifyAttrValue = dh.get().getElementsByTagName("foo").item(0).getAttributes().getNamedItem("Lang").getNodeValue();
269+
assertTrue("Server Transform did not go through ",verifyAttrValue.equalsIgnoreCase("testBulkXQYTransformWithTrans"));
266270
count++;
267271
}
268272
}catch(Exception e) {

0 commit comments

Comments
 (0)