本文整理汇总了Java中edu.umd.cs.mtc.TestFramework类的典型用法代码示例。如果您正苦于以下问题:Java TestFramework类的具体用法?Java TestFramework怎么用?Java TestFramework使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TestFramework类属于edu.umd.cs.mtc包,在下文中一共展示了TestFramework类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
/**
* @param args
*/
public static void main(String[] args) throws Throwable {
/*
* Create a Test object
*/
ProducerConsumerTest test=new ProducerConsumerTest();
/*
* Execute the test
*/
System.out.printf("Main: Starting the test\n");
TestFramework.runOnce(test);
System.out.printf("Main: The test has finished\n");
}
示例2: readOnlyAbort
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void readOnlyAbort() throws Throwable {
// System.out.println("START2");
// Map<Thread, StackTraceElement[]> th = Thread.getAllStackTraces();
// for (Thread i : th.keySet()) {
// System.out.println(i.getName());
// for (StackTraceElement j : th.get(i)) {
// System.out.println(j.getClassName() + " " + j.getMethodName() +
// " " + j.getLineNumber());
// }
// System.out.println();
// }
// System.out.println();
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
// System.out.println("POST2");
// for (Thread i : Thread.getAllStackTraces().keySet()) {
// System.out.println(i.getName());
// }
// System.out.println();
Assert.assertEquals(0, state("x"));
}
示例3: readOnlyReleaseAtStart
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void readOnlyReleaseAtStart() throws Throwable {
// System.out.println("START5");
// for (Thread i : Thread.getAllStackTraces().keySet()) {
// System.out.println(i.getName());
// }
// System.out.println();
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
// System.out.println("POST5");
// for (Thread i : Thread.getAllStackTraces().keySet()) {
// System.out.println(i.getName());
// }
// System.out.println();
Assert.assertEquals(1, state("x"));
}
示例4: readOnlyBufferedRead
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void readOnlyBufferedRead() throws Throwable {
// System.out.println("START4");
// for (Thread i : Thread.getAllStackTraces().keySet()) {
// System.out.println(i.getName());
// }
// System.out.println();
TaskController.emergencyStart();
Heartbeat.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
// System.out.println("POST4");
// for (Thread i : Thread.getAllStackTraces().keySet()) {
// System.out.println(i.getName());
// }
// System.out.println();
Assert.assertEquals(1, state("x"));
}
示例5: readOnlyAbort
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void readOnlyAbort() throws Throwable {
// System.out.println("START3");
// for (Thread i : Thread.getAllStackTraces().keySet()) {
// System.out.println(i.getName());
// }
// System.out.println();
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
// System.out.println("POST3");
// for (Thread i : Thread.getAllStackTraces().keySet()) {
// System.out.println(i.getName());
// }
// System.out.println();
Assert.assertEquals(0, state("x"));
}
示例6: testWrite
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void testWrite()
throws Throwable
{
ConcurrentFileWrite concurrentFileWrite = new ConcurrentFileWrite( fileLockManager );
//concurrentFileWrite.setTrace( true );
TestFramework.runOnce( concurrentFileWrite );
logger.info( "success: {}", concurrentFileWrite.success );
Assert.assertEquals( 10, concurrentFileWrite.success.intValue() );
}
示例7: releaseAfterOneBufferedWriteToRWTransaction
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterOneBufferedWriteToRWTransaction() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(0, state("x"));
}
示例8: releaseAfterReadInRWTransactionToWRTransaction
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterReadInRWTransactionToWRTransaction() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(2, state("x"));
}
示例9: releaseAfterReadInRWTransactionToWRTransactionAndAbort
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterReadInRWTransactionToWRTransactionAndAbort() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(0, state("x"));
}
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterReadInRWTransactionToWRTransactionAndAbort.java
示例10: releaseAfterReadInRWTransactionToRWTransaction
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterReadInRWTransactionToRWTransaction() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(2, state("x"));
}
示例11: releaseAfterReadAndWriteToRWTransactionAndAbort
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterReadAndWriteToRWTransactionAndAbort() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(0, state("x"));
}
示例12: releaseAfterOneBufferedWriteToRWTransaction
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterOneBufferedWriteToRWTransaction() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(2, state("x"));
}
示例13: releaseAfterOneBufferedWriteToWRTransaction
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterOneBufferedWriteToWRTransaction() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(2, state("x"));
}
示例14: releaseAfterReadInRWTransactionToRWTransactionAndAbort
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterReadInRWTransactionToRWTransactionAndAbort() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(0, state("x"));
}
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterReadInRWTransactionToRWTransactionAndAbort.java
示例15: releaseAfterReadAndWriteToRWTransaction
import edu.umd.cs.mtc.TestFramework; //导入依赖的package包/类
@Test
public void releaseAfterReadAndWriteToRWTransaction() throws Throwable {
TaskController.emergencyStart();
Heartbeat.emergencyStart();
TestFramework.runOnce(new Threads());
Assert.assertEquals(2, state("x"));
}