Lines Matching defs:tpe

43     static void report(ThreadPoolExecutor tpe) {
48 tpe.getTaskCount(),
49 tpe.getCompletedTaskCount(),
50 tpe.getQueue().size(),
51 tpe.getPoolSize(),
52 tpe.getCorePoolSize(),
53 tpe.getMaximumPoolSize());
57 static void report(String label, ThreadPoolExecutor tpe) {
59 report(tpe);
80 static void checkTerminated(final ThreadPoolExecutor tpe) {
82 checkShutdown(tpe);
83 check(tpe.getQueue().isEmpty());
84 check(tpe.isTerminated());
85 check(! tpe.isTerminating());
86 equal(tpe.getActiveCount(), 0);
87 equal(tpe.getPoolSize(), 0);
88 equal(tpe.getTaskCount(), tpe.getCompletedTaskCount());
89 check(tpe.awaitTermination(0, SECONDS));
115 final ThreadPoolExecutor tpe
119 tpe.setThreadFactory(new ThreadFactory() {
127 tpe.prestartAllCoreThreads();
129 equal(tg.activeCount(), tpe.getCorePoolSize());
141 tpe.execute(runRunnableDuJour);
143 while (! tpe.getQueue().isEmpty())
146 tpe.execute(runRunnableDuJour);
149 tpe.execute(runRunnableDuJour);
152 //report("submitted", tpe);
155 equal(tg.activeCount(), tpe.getMaximumPoolSize());
156 equal(tpe.getCorePoolSize(), n);
157 //report("pumped up", tpe);
158 equal(tpe.getMaximumPoolSize(), 3*n);
159 tpe.setMaximumPoolSize(4*n);
160 equal(tpe.getMaximumPoolSize(), 4*n);
161 //report("pumped up2", tpe);
165 tpe.execute(runRunnableDuJour);
168 equal(tg.activeCount(), tpe.getMaximumPoolSize());
169 equal(tpe.getCompletedTaskCount(), 0L);
170 //report("pumped up2", tpe);
173 tpe.setMaximumPoolSize(2*n);
174 //report("after set", tpe);
183 // equal(tg.activeCount(), tpe.getCorePoolSize());
189 equal(tg.activeCount(), tpe.getMaximumPoolSize());
192 //report("draining", tpe);
193 while (tpe.getCompletedTaskCount() < 7*n &&
194 tpe.getCompletedTaskCount() < 7*n)
198 //equal(tg.activeCount(), tpe.getCorePoolSize());
200 equal(tg.activeCount(), tpe.getMaximumPoolSize());
202 equal(tpe.getTaskCount(), 7L*n);
203 equal(tpe.getCompletedTaskCount(), 7L*n);
205 equal(tpe.getKeepAliveTime(MINUTES), 3L);
206 tpe.setKeepAliveTime(7L, MILLISECONDS);
207 equal(tpe.getKeepAliveTime(MILLISECONDS), 7L);
213 //report("idle", tpe);
214 check(! tpe.allowsCoreThreadTimeOut());
215 tpe.allowCoreThreadTimeOut(true);
216 check(tpe.allowsCoreThreadTimeOut());
222 //report("idle", tpe);
224 tpe.shutdown();
225 checkShutdown(tpe);
226 check(tpe.awaitTermination(3L, MINUTES));
227 checkTerminated(tpe);