commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michele Vivoda (JIRA)" <>
Subject [jira] [Created] (JXPATH-165) Test order and JXPathContextReferenceImpl.removeNodePointerFactory
Date Tue, 04 Feb 2014 00:07:06 GMT
Michele Vivoda created JXPATH-165:

             Summary: Test order and JXPathContextReferenceImpl.removeNodePointerFactory
                 Key: JXPATH-165
             Project: Commons JXPath
          Issue Type: Improvement
            Reporter: Michele Vivoda
            Priority: Minor

Running the test folder with Eclipse 'run as junit test' one JXPath test failed: {{LazyDynaBeanTest.testLazyProperty()}}.
The test does not fail when run in isolation.   This happens because there is an other test
{{testStrictLazyDynaBeanPropertyFactory()}} in the same file that registers a {{StrictLazyDynaBeanPointerFactory}},
if the test order is not source order then test fails. 

Splitting in two test files does not help, still order dependent. 

For this reason I suggest to create a new {{removeNodePointerFactory}} method in {{JXPathContextReferenceImpl}}
 that could be used in a finally block to restore the initial environment. 

Implementation should be straightforward observing the existing code of {{addNodePointerFactory}}:
      public static void removeNodePointerFactory(NodePointerFactory factory) {
        synchronized (nodeFactories) {
            nodeFactoryArray = null;

This message was sent by Atlassian JIRA

View raw message