当前位置: 首页>>代码示例>>Java>>正文


Java TestFramework类代码示例

本文整理汇总了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");

}
 
开发者ID:PacktPublishing,项目名称:Java-9-Concurrency-Cookbook-Second-Edition,代码行数:19,代码来源:Main.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:27,代码来源:ReadOnlyAbort.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:21,代码来源:ReadOnlyReleaseAtStart.java

示例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"));
	}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:21,代码来源:ReadOnlyBuferredRead.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:21,代码来源:ReadOnlyAbortCooperation.java

示例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() );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:11,代码来源:DefaultFileLockManagerTest.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterOneBufferedWriteToRWTransactionAndAbort.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterReadInRWTransactionToWRTransaction.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterReadInRWTransactionToRWTransaction.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterReadAndWriteToRWTransactionAndAbort.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterOneBufferedWriteToRWTransaction.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterMoreBufferedWritesToWRTransaction.java

示例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"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterReadAndWriteToRWTransaction.java


注:本文中的edu.umd.cs.mtc.TestFramework类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。