12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6809322
27 * @summary Test for missing notifications in a high concurrency environment
28 * @author Jaroslav Bachorik
29 * @run clean MissingNotificationTest
30 * @run build MissingNotificationTest
31 * @run main MissingNotificationTest
32 */
33
34 import java.util.Date;
35 import java.util.Random;
36 import java.util.concurrent.ExecutorService;
37 import java.util.concurrent.Executors;
38 import java.util.concurrent.TimeUnit;
39 import javax.management.timer.Timer;
40 import javax.management.Notification;
41 import javax.management.NotificationListener;
42
43 public class MissingNotificationTest {
44 private static int TASK_COUNT = 10000;
45 private static long fixedDelay = 0;// anything bigger than 100 and no alarms remain unfired
46
47 private static class NotifListener implements NotificationListener {
48
49 int count;
50
51 public synchronized void handleNotification(Notification notification, Object handback) {
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6809322
27 * @summary Test for missing notifications in a high concurrency environment
28 * @author Jaroslav Bachorik
29 * @run clean MissingNotificationTest
30 * @run build MissingNotificationTest
31 * @run main MissingNotificationTest
32 * @key randomness
33 */
34
35 import java.util.Date;
36 import java.util.Random;
37 import java.util.concurrent.ExecutorService;
38 import java.util.concurrent.Executors;
39 import java.util.concurrent.TimeUnit;
40 import javax.management.timer.Timer;
41 import javax.management.Notification;
42 import javax.management.NotificationListener;
43
44 public class MissingNotificationTest {
45 private static int TASK_COUNT = 10000;
46 private static long fixedDelay = 0;// anything bigger than 100 and no alarms remain unfired
47
48 private static class NotifListener implements NotificationListener {
49
50 int count;
51
52 public synchronized void handleNotification(Notification notification, Object handback) {
|