Open GoogleCodeExporter opened 9 years ago
[deleted comment]
Adding my work contact details.
Swaroop Rath
Desk Phone - 0044-2079484597
Email - swaroop.rath@uk.bp.com
BP Oil International Limited, 20 Canada Square, Canary Wharf, London, E14 5NJ
Original comment by rath.swa...@gmail.com
on 16 Aug 2011 at 11:41
[deleted comment]
[deleted comment]
My earlier workaround suggestion to generate xdbc.property file dynamically in
a static loader in a superclass of all xquery unit test cases might not work.
This is because XQueryTestCase uses "getResourceAsStream" method on "Class" to
load the property file and locations on classpath might not be writeable.
Anyway, its far from neat and should not be attempted.
I instead found an easier workaround solution for the time being. Overload
"setUp" and set the private field "sesssion" in XQueryTestCase using
reflection.
Not very confident if this would work for all class loaders. Example attached
below.
An updated version of XQueryTestCase with session declared with protected
modifier will be much helpful.
Example of workaround solution -
protected void setUp() throws Exception {
ContentSource cs = ContentSourceFactory.newContentSource(mlConnectionUri);
Session mlSession = cs.newSession();
Field fields[] = XQueryTestCase.class.getDeclaredFields();
for (Field field : fields)
{
if (field.getType().equals(Session.class))
{
field.setAccessible(true);
field.set(this, mlSession);
}
}
}
- Swaroop Rath
Original comment by rath.swa...@gmail.com
on 16 Aug 2011 at 3:36
Original issue reported on code.google.com by
rath.swa...@gmail.com
on 16 Aug 2011 at 11:20