本文整理汇总了Java中edu.umd.cs.mtc.MultithreadedTestCase类的典型用法代码示例。如果您正苦于以下问题:Java MultithreadedTestCase类的具体用法?Java MultithreadedTestCase怎么用?Java MultithreadedTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MultithreadedTestCase类属于edu.umd.cs.mtc包,在下文中一共展示了MultithreadedTestCase类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testThreading
import edu.umd.cs.mtc.MultithreadedTestCase; //导入依赖的package包/类
@Test
public void testThreading() throws Throwable {
TestFramework.runOnce(new MultithreadedTestCase()
{
// public void initialize()
// {
//
// }
public void thread1() {
mutableTestContributors.get(1).setDirty(true);
Assert.assertEquals(expectedPrivilegeCount, manager.listPrivileges().size());
}
public void thread2() {
Assert.assertEquals(expectedPrivilegeCount, manager.listPrivileges().size());
}
public void thread3() {
mutableTestContributors.get(3).setDirty(true);
Assert.assertEquals(expectedPrivilegeCount, manager.listPrivileges().size());
}
public void thread4() {
Assert.assertEquals(expectedPrivilegeCount, manager.listPrivileges().size());
}
public void thread5() {
mutableTestContributors.get(5).setDirty(true);
Assert.assertEquals(expectedPrivilegeCount, manager.listPrivileges().size());
}
});// , Integer.MAX_VALUE, Integer.MAX_VALUE ); // uncomment this for debugging, if you don't the framework
// will timeout and close your debug session
for (MutableTestSecurityContributor contributor : mutableTestContributors) {
Assert.assertTrue(
"Get config should be called on each contributor after any changed: " + contributor.getId(),
contributor.wasConfigRequested());
}
}