threadPoolExecutor.shutdown();
}
public void testProxyingProperties1() throws Exception {
ContextService service = getContextService();
MyTask task1 = new MyTask();
Object expected = "foo123bar";
TestContextHandler.setCurrentObject(expected);
Runnable task2 = (Runnable)service.createContextObject(task1, new Class[] {Runnable.class});
assertEquals(expected, TestContextHandler.getCurrentObject());
TestContextHandler.setCurrentObject(null);
assertNull(TestContextHandler.getCurrentObject());
task2.run();
assertEquals(Arrays.asList(expected), task1.getList());
Map<String, String> props = null;
props = new HashMap<String, String>();
props.put(TestContextHandler.SKIP, "true");
service.setProperties(task2, props);
task1.getList().clear();
task2.run();
assertEquals(Arrays.asList("skipped"), task1.getList());
props = new HashMap<String, String>();
props.put(TestContextHandler.SKIP, "false");
service.setProperties(task2, props);
task1.getList().clear();
task2.run();
assertEquals(Arrays.asList(expected), task1.getList());