Package org.jasig.portal.test

Examples of org.jasig.portal.test.ThreadGroupRunner.tick()


                    @Override
                    protected void callWithoutResult() {
                        try {
                            final String mutexName = "testConcurrentCreation";
                           
                            threadGroupRunner.tick(1);
                            ClusterMutex mutex = clusterLockDao.getClusterMutex(mutexName);
                            assertNotNull(mutex);
                        }
                        catch (InterruptedException e) {
                            throw new RuntimeException(e);
View Full Code Here


            public void runWithException() throws Throwable {
                executeInTransaction(new CallableWithoutResult() {
                    @Override
                    protected void callWithoutResult() {
                        try {
                            threadGroupRunner.tick(1);
                            try {
                                final ClusterMutex mutex = clusterLockDao.getLock(mutexName);
                                if (mutex != null) {
                                    lockCounter.incrementAndGet();
                                }
View Full Code Here

                                if (mutex != null) {
                                    lockCounter.incrementAndGet();
                                }
                            }
                            finally {
                                threadGroupRunner.tick(3);
                            }
                        }
                        catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
View Full Code Here

            public void runWithException() throws Throwable {
                executeInTransaction(new CallableWithoutResult() {
                    @Override
                    protected void callWithoutResult() {
                        try {
                            threadGroupRunner.tick(1);
                            try {
                                final ClusterMutex mutex = clusterLockDao.getLock(mutexName);
                                if (mutex != null) {
                                    lockCounter.incrementAndGet();
                                }
View Full Code Here

                                if (mutex != null) {
                                    lockCounter.incrementAndGet();
                                }
                            }
                            finally {
                                threadGroupRunner.tick(3);
                            }
                        }
                        catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
View Full Code Here

            @Override
            public void runWithException() throws Throwable {
                execute(new Callable<Object>() {
                    @Override
                    public Object call() throws Exception {
                        threadGroupRunner.tick(1);
                        final TryLockFunctionResult<Object> result = service.doInTryLock(mutexName, new Function<ClusterMutex, Object>() {
                            @Override
                            public Object apply(ClusterMutex input) {
                                if (concurrent.getAndSet(true)) {
                                    fail("Only one thread should be in Function at a time");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.