Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
1 package org.apidesign.openfixed;
3 import java.util.concurrent.CountDownLatch;
5 /** Test the Calculator.createPending() behavior.
7 * @author Jaroslav Tulach <jtulach@netbeans.org>
9 public final class PostTest extends PendingTest {
11 public PostTest(String testName) {
16 protected Calculator create() {
17 return Calculator.createBatch();
20 public void testPostModificationEvents() throws Exception {
21 // BEGIN: openfixed.usemount
22 class PostListener extends BlockingListener
23 implements PostModificationListener {
27 public synchronized void modification(ModificationEvent ev) {
28 // registers for callback when batch processing is over:
30 super.modification(ev);
34 public synchronized void postProcess(PostModificationEvent ev) {
35 // called when batch processing is over
38 // FINISH: openfixed.usemount
40 public synchronized void assertPostProcess(String msg, int expected) throws InterruptedException {
41 for (int i = 0; i < 10; i++) {
42 if (cnt >= expected) {
47 assertEquals(msg, expected, cnt);
51 PostListener bl = new PostListener();
53 Calculator calc = create();
54 calc.addModificationListener(bl);
64 bl.assertPostProcess("Two postprocessings (one for 10), then for the rest", 2);