< prev index next >

test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -101,18 +101,13 @@
 
         System.out.println("EmptyDomainNotificationTest-main: ask to send a notif ...");
         mbsc.invoke(mbean, "emitNotification", null, null);
 
         System.out.println("EmptyDomainNotificationTest-main: waiting notif...");
-        final long stopTime = System.currentTimeMillis() + 2000;
         synchronized(li) {
-            long toWait = stopTime - System.currentTimeMillis();
-
-            while (li.received < 1 && toWait > 0) {
-                li.wait(toWait);
-
-                toWait = stopTime - System.currentTimeMillis();
+            while (li.received < 1) {
+                li.wait(100);
             }
         }
 
         if (li.received < 1) {
             throw new RuntimeException("No notif received!");
< prev index next >