Skip to content

Commit

Permalink
Issue #78: Reduce removed mbean test time to 3 second cache duration …
Browse files Browse the repository at this point in the history
…and 5 second wait.
  • Loading branch information
mk23 committed Sep 16, 2015
1 parent 9d7586b commit 78d9b2f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ public void checkValidHostValidMBeanInvalidAttribute() throws Exception {
/* Custom MBean tests */
@Test
public void checkValidHostRemovedMBean() throws Exception {
final ConnectionManager manager = new ConnectionManager(new JMXProxyApplicationConfiguration().setCacheDuration(Duration.seconds(60))); // 60 second refresh
final ConnectionManager manager = new ConnectionManager(new JMXProxyApplicationConfiguration().setCacheDuration(Duration.seconds(3)));

assertNotNull(manager.getHost(validHost).getMBean(localMBean));

ManagementFactory.getPlatformMBeanServer().unregisterMBean(
new ObjectName(localMBean)
);

java.lang.Thread.sleep(Duration.seconds(65).toMilliseconds()); // sleep 65 seconds to allow cache refresh
java.lang.Thread.sleep(Duration.seconds(5).toMilliseconds());

assertNull(manager.getHost(validHost).getMBean(localMBean));
}
Expand Down

0 comments on commit 78d9b2f

Please sign in to comment.