File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
src/test/java/cn/byhieg/threadtutorialtest/char05test Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ package cn .byhieg .threadtutorialtest .char05test ;
2+
3+ import cn .byhieg .threadtutorial .char05 .more2more .list .Customer ;
4+ import cn .byhieg .threadtutorial .char05 .more2more .list .MyQueue ;
5+ import cn .byhieg .threadtutorial .char05 .more2more .list .Producer ;
6+ import junit .framework .TestCase ;
7+
8+ /**
9+ * Created by byhieg on 17/2/1.
10+ * Mail to byhieg@gmail.com
11+ */
12+ public class More2moreListTest extends TestCase {
13+
14+ public void testList () throws Exception {
15+ MyQueue queue = new MyQueue ();
16+ new Thread (new Producer (queue )).start ();
17+ new Thread (new Producer (queue )).start ();
18+ new Thread (new Producer (queue )).start ();
19+ new Thread (new Producer (queue )).start ();
20+ new Thread (new Producer (queue )).start ();
21+
22+
23+ new Thread (new Customer (queue )).start ();
24+ new Thread (new Customer (queue )).start ();
25+ new Thread (new Customer (queue )).start ();
26+ new Thread (new Customer (queue )).start ();
27+ new Thread (new Customer (queue )).start ();
28+
29+
30+ Thread .sleep (1000 * 5 );
31+ }
32+
33+ }
You can’t perform that action at this time.
0 commit comments