KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > jmx > client > NotificationProcessorTest


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.jmx.client;
5
6 import junit.framework.TestCase;
7
8 public class NotificationProcessorTest extends TestCase {
9
10     public void test1() throws Exception JavaDoc {
11         final NotificationProcessor np = new NotificationProcessor();
12         
13         class R implements Runnable JavaDoc {
14             boolean ran;
15             public void run() {
16                 ran = true;
17                 np.interrupt();
18             }
19         }
20         R r = new R();
21         
22         
23         np.start();
24         
25         np.enqueue(r);
26         
27         np.join();
28         
29         assertTrue(r.ran);
30     }
31 }
32
Popular Tags