public void test_noResourcesDoesNotWait_predeclareLocks_synchronousQueue() throws Exception {
  final Properties properties=new Properties();
  final int ntasks=1000;
  final int corePoolSize=5;
  final int maxPoolSize=ntasks;
  properties.setProperty(TestOptions.SYNCHRONOUS_QUEUE,"true");
  properties.setProperty(TestOptions.CORE_POOL_SIZE,"" + corePoolSize);
  properties.setProperty(TestOptions.MAX_POOL_SIZE,"" + maxPoolSize);
  properties.setProperty(TestOptions.NTASKS,"" + ntasks);
  properties.setProperty(TestOptions.NRESOURCES,"10");
  properties.setProperty(TestOptions.MIN_LOCKS,"0");
  properties.setProperty(TestOptions.MAX_LOCKS,"0");
  properties.setProperty(TestOptions.PREDECLARE_LOCKS,"true");
  properties.setProperty(TestOptions.SORT_LOCK_REQUESTS,"true");
  final Result result=doComparisonTest(properties);
  assertEquals("nsuccess",ntasks,Integer.parseInt(result.get("nsuccess")));
  final int maxrunning=Integer.parseInt(result.get("maxrunning"));
  assertTrue("maxrunning=" + maxrunning,corePoolSize <= maxrunning);
}

public void test_noResourcesDoesNotWait_predeclareLocks_synchronousQueue ( ) throws Exception { final Properties properties = new Properties ( ) ; final int ntasks = 1000 ; final int corePoolSize = 5 ; final int maxPoolSize = ntasks ; properties . setProperty ( TestOptions . SYNCHRONOUS_QUEUE , "true" ) ; properties . setProperty ( TestOptions . CORE_POOL_SIZE , "" + corePoolSize ) ; properties . setProperty ( TestOptions . MAX_POOL_SIZE , "" + maxPoolSize ) ; properties . setProperty ( TestOptions . NTASKS , "" + ntasks ) ; properties . setProperty ( TestOptions . NRESOURCES , "10" ) ; properties . setProperty ( TestOptions . MIN_LOCKS , "0" ) ; properties . setProperty ( TestOptions . MAX_LOCKS , "0" ) ; properties . setProperty ( TestOptions . PREDECLARE_LOCKS , "true" ) ; properties . setProperty ( TestOptions . SORT_LOCK_REQUESTS , "true" ) ; final Result result = doComparisonTest ( properties ) ; assertEquals ( "nsuccess" , ntasks , Integer . parseInt ( result . get ( "nsuccess" ) ) ) ; final int maxrunning = Integer . parseInt ( result . get ( "maxrunning" ) ) ; assertTrue ( "maxrunning=" + maxrunning , corePoolSize <= maxrunning ) ; }
test where no locks are declared . this should run all tasks with the maximum concurrency . since there is no timeout , all tasks should complete successfully .
