You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by jaredjstewart <gi...@git.apache.org> on 2017/08/08 16:51:45 UTC

[GitHub] geode pull request #668: GEODE-3306: Remove whitespace StringBuffers/nodes c...

Github user jaredjstewart commented on a diff in the pull request:

    https://github.com/apache/geode/pull/668#discussion_r131966460
  
    --- Diff: geode-core/src/test/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParserJUnitTest.java ---
    @@ -128,9 +128,16 @@ public void testCacheXmlParserWithSimplePool() {
        */
       @Test
       public void testCacheXmlParserWithSimplePoolXerces() {
    -    System.setProperty("javax.xml.parsers.SAXParserFactory",
    +    String prevParserFactory = System.setProperty("javax.xml.parsers.SAXParserFactory",
    --- End diff --
    
    You can make this cleanup of the system properties more robust by using the `RestoreSystemProperties` JUnit rule.  All you need to do is add this as a member variable of the test class: 
    ```
      @Rule
      public final RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();
    ```
    
    (For an example see [LocatorLauncherTest](https://github.com/apache/geode/blob/d1db2f02d2ce45a437b34488934e5b1d53c7b5ca/geode-core/src/test/java/org/apache/geode/distributed/LocatorLauncherTest.java).)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---