use of org.exoplatform.container.TestExoContainer.MyMTClass in project kernel by exoplatform.
the class TestExoContainerThreadSafety method getComponentInstance.
@Test
@PerfTest(invocations = TOTAL_THREADS, threads = TOTAL_THREADS)
public void getComponentInstance() throws InterruptedException, BrokenBarrierException {
// Needed to make sure that all threads start at the same time
startSignal.await();
MyMTClass value = (MyMTClass) container.getComponentInstance(MyMTClass.class);
currentMyClass.compareAndSet(null, value);
assertEquals(currentMyClass.get(), container.getComponentInstance(MyMTClass.class));
}
use of org.exoplatform.container.TestExoContainer.MyMTClass in project kernel by exoplatform.
the class TestExoContainerThreadSafety method getComponentInstanceOfType.
@Test
@PerfTest(invocations = TOTAL_THREADS, threads = TOTAL_THREADS)
public void getComponentInstanceOfType() throws InterruptedException, BrokenBarrierException {
// Needed to make sure that all threads start at the same time
startSignal.await();
MyMTClass value = (MyMTClass) container.getComponentInstanceOfType(MyMTClass.class);
currentMyClass.compareAndSet(null, value);
assertEquals(currentMyClass.get(), container.getComponentInstanceOfType(MyMTClass.class));
}