public void test_singleResourceLocking_serialized_highConcurrency_lockTimeout() throws Exception {
  Properties properties=new Properties();
  properties.setProperty(TestOptions.NTHREADS,"100");
  properties.setProperty(TestOptions.NTASKS,"100");
  properties.setProperty(TestOptions.NRESOURCES,"1");
  properties.setProperty(TestOptions.MIN_LOCKS,"1");
  properties.setProperty(TestOptions.MAX_LOCKS,"1");
  properties.setProperty(TestOptions.LOCK_TIMEOUT,"1000");
  properties.setProperty(TestOptions.PREDECLARE_LOCKS,"false");
  properties.setProperty(TestOptions.SORT_LOCK_REQUESTS,"false");
  Result result=doComparisonTest(properties);
  assertEquals("ndeadlock","0",result.get("ndeadlock"));
}

public void test_singleResourceLocking_serialized_highConcurrency_lockTimeout ( ) throws Exception { Properties properties = new Properties ( ) ; properties . setProperty ( TestOptions . NTHREADS , "100" ) ; properties . setProperty ( TestOptions . NTASKS , "100" ) ; properties . setProperty ( TestOptions . NRESOURCES , "1" ) ; properties . setProperty ( TestOptions . MIN_LOCKS , "1" ) ; properties . setProperty ( TestOptions . MAX_LOCKS , "1" ) ; properties . setProperty ( TestOptions . LOCK_TIMEOUT , "1000" ) ; properties . setProperty ( TestOptions . PREDECLARE_LOCKS , "false" ) ; properties . setProperty ( TestOptions . SORT_LOCK_REQUESTS , "false" ) ; Result result = doComparisonTest ( properties ) ; assertEquals ( "ndeadlock" , "0" , result . get ( "ndeadlock" ) ) ; }
test where each operation locks only a single resource and there is only one resource to be locked so that all operations must be serialized with a non - zero lock timeout . this test stresses the logic in lock ( ) that is responsible for backing out a lock request on timeout .
