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


Java TestFramework.runOnce方法代码示例

本文整理汇总了Java中edu.umd.cs.mtc.TestFramework.runOnce方法的典型用法代码示例。如果您正苦于以下问题:Java TestFramework.runOnce方法的具体用法?Java TestFramework.runOnce怎么用?Java TestFramework.runOnce使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.umd.cs.mtc.TestFramework的用法示例。


在下文中一共展示了TestFramework.runOnce方法的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: writeFirstReadFromBufferOnce

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void writeFirstReadFromBufferOnce() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());

	Assert.assertEquals(2, state("x"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:WriteFirstReadFromBufferOnce.java

示例7: writeBufferCommitOrder

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void writeBufferCommitOrder() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());

	Assert.assertEquals(2, state("x"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:WriteBufferCommitOrder.java

示例8: detectInvalidAccessModeRead

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void detectInvalidAccessModeRead() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());
	Assert.assertEquals(0, state("x"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:8,代码来源:DetectInvalidAccessModeRead.java

示例9: detectInvalidAccessModeAnyWrite

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void detectInvalidAccessModeAnyWrite() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());
	Assert.assertEquals(0, state("x"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:8,代码来源:DetectInvalidAccessModeAnyWrite.java

示例10: writeOnlyTransactionAborting

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void writeOnlyTransactionAborting() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());

	Assert.assertEquals(1, state("x"));
	Assert.assertEquals(0, state("y"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:10,代码来源:WriteOnlyTransactionAborting.java

示例11: writeSeriesFirstReadFromBufferCommitOrder

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void writeSeriesFirstReadFromBufferCommitOrder() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());

	Assert.assertEquals(3, state("x"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:WriteSeriesFirstReadFromBufferCommitOrder.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,代码来源:ReleaseAfterMoreBufferedWritesToRWTransaction.java

示例13: releaseAfterReadAndWriteToWRTransactionAndAbort

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void releaseAfterReadAndWriteToWRTransactionAndAbort() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());

	Assert.assertEquals(0, state("x"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterReadAndWriteToWRTransactionAndAbort.java

示例14: releaseAfterOneBufferedWriteToWRTransactionAndAbort

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void releaseAfterOneBufferedWriteToWRTransactionAndAbort() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());

	Assert.assertEquals(0, state("x"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:9,代码来源:ReleaseAfterOneBufferedWriteToWRTransactionAndAbort.java

示例15: simultaneousWriteOnlyTransactions

import edu.umd.cs.mtc.TestFramework; //导入方法依赖的package包/类
@Test
public void simultaneousWriteOnlyTransactions() throws Throwable {
	TaskController.emergencyStart();
	Heartbeat.emergencyStart();
	TestFramework.runOnce(new Threads());

	Assert.assertEquals(2, state("x"));
	Assert.assertEquals(1, state("y"));
}
 
开发者ID:kondziu,项目名称:AtomicRMI,代码行数:10,代码来源:SimultaneousWriteOnlyTransactionsReverseCommit.java


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