@@ -0,0 +1,1431 @@
+/*%0A * This file is covered by the terms of the Common Public License v1.0.%0A *%0A * Copyright (c) SZEDER G%C3%A1bor%0A *%0A * Parts of this software were developed within the JEOPARD research%0A * project, which received funding from the European Union's Seventh%0A * Framework Programme under grant agreement No. 216682.%0A */%0A%0Apackage de.fzi.cjunit.util;%0A%0Aimport java.util.concurrent.BrokenBarrierException;%0Aimport java.util.concurrent.CyclicBarrier;%0A%0A%0A/**%0A * Minimalistic helper class to implement a cyclic barrier for concurrent%0A * unit tests.%0A * %3Cp%3E%0A * The goal is to provide a very simple synchronization aid that allows all%0A * threads of a concurrent test case to wait for each other to reach a%0A * common barrier point.  No initialization, no resets, no interruptions, no%0A * %3Ccode%3Etry %7B await() %7D catch (InterruptedException) %7B%7D%3C/code%3E blocks or%0A * %3Ccode%3Ethrows InterruptedException%3C/code%3E declarations.%0A * %3Cp%3E%0A * It is automatically initialized to wait for all threads in a concurrent%0A * test case.  Can only be used in concurrent test cases with the%0A * %3Ccode%3EthreadCount%3C/code%3E or %3Ccode%3EthreadGroup%3C/code%3E annotations.%0A */%0Apublic class TestBarrier %7B%0A%0A%09protected static CyclicBarrier barrier;%0A%0A%09/**%0A%09 * Waits until all threads of a concurrent test case have invoked%0A%09 * %3Ccode%3Eawait()%3C/code%3E.%0A%09 */%0A%09public static void await() %7B%0A%09%09try %7B%0A%09%09%09barrier.await();%0A%09%09%7D catch (InterruptedException e) %7B%0A%09%09%7D catch (BrokenBarrierException e) %7B%0A%09%09%7D%0A%09%7D;%0A%7D%0A

Add TestBarrier API helper class