Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Nightly Builds
-
None
-
None
-
Operating System: Linux
Platform: PC
-
13380
Description
I'm trying to iterate pointers, and set values. However any values I set using
this method are ignored. This sounds similar to COM-72
Note: It would be great if you like this test to add it to the suite.
Thanks!
To see the bug, add this function to NestedTestbean :
public void setName(String name)
{ this.name = name; }Then, add this function to JXPathTestCase:
public void testIteratePointerSetValue() {
JXPathContext context = JXPathContext.newContext(bean);
testGetValue(context, "/beans[1]/name", "Name 1");
testGetValue(context, "/beans[2]/name", "Name 2");
// Test setting via context
context.setValue("/beans[2]/name", "Name 2 set");
testGetValue(context, "/beans[2]/name", "Name 2 set");
// Restore original value
context.setValue("/beans[2]/name", "Name 2");
testGetValue(context, "/beans[2]/name", "Name 2");
int iter_count = 0;
Iterator iter = context.iteratePointers("/beans/name");
while (iter.hasNext())
assertEquals("Iteration count", 2, iter_count);
testGetValue(context, "/beans[1]/name", "Name 1suffix");
testGetValue(context, "/beans[2]/name", "Name 2suffix");
}