protected void tearDown() throws Exception { try { super.tearDown(); } finally { SessionTestUtil.clearDistributedCacheManagerFactory(); // Restore any system properties we set in setUp if (jgroupsSupport != null) { jgroupsSupport.restoreProperties(); } for (PojoCache cache : caches) { // Try to clean up so we avoid loading sessions // from storage in later tests try { log.info("Removing /JSESSION from " + cache.getCache().getLocalAddress()); cache.getCache().removeNode(Fqn.fromString("/JSESSION")); } catch (Exception e) { log.error("Cache " + cache.getCache().getLocalAddress() + ": " + e.getMessage(), e); } try { cache.stop(); cache.destroy(); } catch (Exception e) { log.error("Cache " + cache.getCache().getLocalAddress() + ": " + e.getMessage(), e); } } caches.clear(); } }
protected void setUp() throws Exception { super.setUp(); // Set system properties to properly bind JGroups channels jgroupsSupport = new JGroupsSystemPropertySupport(); jgroupsSupport.setUpProperties(); }