public void test_ConstructorLjava_lang_StringLjava_lang_String() { // Regression for HARMONY-178 MyField field = new MyField("day of month", Calendar.ERA); assertEquals("field has wrong name", "day of month", field.getName()); assertEquals("field has wrong Calendar field number", Calendar.ERA, field.getCalendarField()); DateFormat.Field realField = DateFormat.Field .ofCalendarField(Calendar.ERA); assertSame("Modified calendar field with the same field number", DateFormat.Field.ERA, realField); DateFormat.Field realField2 = DateFormat.Field .ofCalendarField(Calendar.DAY_OF_MONTH); assertSame("Modified calendar field with the same field number", DateFormat.Field.DAY_OF_MONTH, realField2); }
/** * @tests java.text.DateFormat$Field#Field(java.lang.String, int) */ public void test_Constructor2() { MyField field = new MyField("day of month", Calendar.ERA); assertEquals("field has wrong name", "day of month", field.getName()); assertEquals("field has wrong Calendar field number", Calendar.ERA, field.getCalendarField()); DateFormat.Field realField = DateFormat.Field .ofCalendarField(Calendar.ERA); assertSame("Modified calendar field with the same field number", DateFormat.Field.ERA, realField); DateFormat.Field realField2 = DateFormat.Field .ofCalendarField(Calendar.DAY_OF_MONTH); assertSame("Modified calendar field with the same field number", DateFormat.Field.DAY_OF_MONTH, realField2); }
/** * @tests java.text.DateFormat$Field#getCalendarField() */ public void test_getCalendarField() { // Test for method int getCalendarField() assertEquals("Field.AM_PM.getCalendarField() returned the wrong value", Calendar.AM_PM, Field.AM_PM.getCalendarField()); // test special cases assertEquals( "Field.TIME_ZONE.getCalendarField() returned the wrong value", -1, Field.TIME_ZONE.getCalendarField()); assertEquals("Field.HOUR0.getCalendarField() returned the wrong value", Calendar.HOUR, Field.HOUR0.getCalendarField()); assertEquals("Field.HOUR1.getCalendarField() returned the wrong value", -1, Field.HOUR1.getCalendarField()); assertEquals( "Field.HOUR_OF_DAY0.getCalendarField() returned the wrong value", Calendar.HOUR_OF_DAY, Field.HOUR_OF_DAY0.getCalendarField()); assertEquals( "Field.HOUR_OF_DAY1.getCalendarField() returned the wrong value", -1, Field.HOUR_OF_DAY1.getCalendarField()); }
private Vector<FieldContainer> getDateVector1() { // "19990913171901" Vector<FieldContainer> v = new Vector<FieldContainer>(); v.add(new FieldContainer(0, 4, Field.YEAR)); v.add(new FieldContainer(4, 6, Field.MONTH)); v.add(new FieldContainer(6, 8, Field.DAY_OF_MONTH)); v.add(new FieldContainer(8, 10, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(10, 12, Field.MINUTE)); v.add(new FieldContainer(12, 14, Field.SECOND)); return v; }
private Vector<FieldContainer> getDateVector2() { // "12 3 5 March 2002 Monday" Vector<FieldContainer> v = new Vector<FieldContainer>(); v.add(new FieldContainer(0, 2, Field.WEEK_OF_YEAR)); v.add(new FieldContainer(3, 4, Field.WEEK_OF_MONTH)); v.add(new FieldContainer(5, 7, Field.DAY_OF_MONTH)); v.add(new FieldContainer(8, 17, Field.MONTH)); v.add(new FieldContainer(18, 22, Field.YEAR)); v.add(new FieldContainer(23, 29, Field.DAY_OF_WEEK)); return v; }
private Vector<FieldContainer> getDateVector3() { // "5:19 GMT-05:00" Vector<FieldContainer> v = new Vector<FieldContainer>(); v.add(new FieldContainer(0, 1, Field.HOUR1)); v.add(new FieldContainer(2, 4, Field.MINUTE)); v.add(new FieldContainer(5, 14, Field.TIME_ZONE)); return v; }
private Vector<FieldContainer> getDateVector5() { // "5:19 -0400" Vector<FieldContainer> v = new Vector<FieldContainer>(); v.add(new FieldContainer(0, 1, Field.HOUR1)); v.add(new FieldContainer(2, 4, Field.MINUTE)); v.add(new FieldContainer(5, 10, Field.TIME_ZONE)); return v; }
private Vector<FieldContainer> getDateVector3() { // "5:19 EDT" Vector<FieldContainer> v = new Vector<FieldContainer>(); v.add(new FieldContainer(0, 1, Field.HOUR1)); v.add(new FieldContainer(2, 4, Field.MINUTE)); v.add(new FieldContainer(5, 14, Field.TIME_ZONE)); return v; }
/** * @tests java.text.DateFormat$Field#Field(java.lang.String, int) */ public void test_ConstructorLjava_lang_StringI() { MyField field = new MyField("a field", Calendar.DAY_OF_WEEK); assertEquals("field has wrong name", "a field", field.getName()); assertEquals("field has wrong Calendar field number", Calendar.DAY_OF_WEEK, field.getCalendarField()); DateFormat.Field realField = DateFormat.Field .ofCalendarField(Calendar.DAY_OF_WEEK); assertSame("Modified calendar field with the same field number", DateFormat.Field.DAY_OF_WEEK, realField); }
private Vector<FieldContainer> getDateVector3() { // "5:19 EDT" Vector<FieldContainer> v = new Vector<FieldContainer>(); v.add(new FieldContainer(0, 1, Field.HOUR1)); v.add(new FieldContainer(2, 4, Field.MINUTE)); v.add(new FieldContainer(5, 8, Field.TIME_ZONE)); return v; }
@Test public void testExecuteJobsForSingleEngine() { // configure and build a process engine StandaloneProcessEngineConfiguration standaloneProcessEngineConfiguration = new StandaloneInMemProcessEngineConfiguration(); standaloneProcessEngineConfiguration.setProcessEngineName(getClass().getName() + "-engine1"); standaloneProcessEngineConfiguration.setJdbcUrl("jdbc:h2:mem:jobexecutor-test-engine"); standaloneProcessEngineConfiguration.setJobExecutorActivate(false); standaloneProcessEngineConfiguration.setJobExecutor(jobExecutor); standaloneProcessEngineConfiguration.setDbMetricsReporterActivate(false); ProcessEngine engine = standaloneProcessEngineConfiguration.buildProcessEngine(); createdProcessEngines.add(engine); engine.getRepositoryService().createDeployment() .addClasspathResource(PROCESS_RESOURCE) .deploy(); jobExecutor.shutdown(); engine.getRuntimeService() .startProcessInstanceByKey("intermediateTimerEventExample"); Assert.assertEquals(1, engine.getManagementService().createJobQuery().count()); Calendar calendar = Calendar.getInstance(); calendar.add(Field.DAY_OF_YEAR.getCalendarField(), 6); ClockUtil.setCurrentTime(calendar.getTime()); jobExecutor.start(); waitForJobExecutorToProcessAllJobs(10000, 100, jobExecutor, engine.getManagementService(), true); Assert.assertEquals(0, engine.getManagementService().createJobQuery().count()); }
private void CopyTestModelToStorage() { try { //get working folder of the app on the mobile String fileDirPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/"+ getApplicationContext().getString(R.string.app_name) ; //create the folder if it does not exist File allfiles = new File(fileDirPath); if (!allfiles.exists()) { //if the folder does not exist if (allfiles.mkdirs()) { //create the folder } else { //failed Toast.makeText( getApplicationContext(), "Cannot Create Folder to Store Test Model!", Toast.LENGTH_LONG).show(); return; } } //copy the files (test models) in res/raw one by one to the storage of the mobile Resources res = getResources(); java.lang.reflect.Field[] fields=R.raw.class.getFields(); for (int count=0; count < fields.length; count++) { int resourceId=res.getIdentifier(fields[count].getName(), "raw", getPackageName()); //get full file name TypedValue value = new TypedValue(); getResources().getValue(resourceId, value, true); String filename = value.string.toString(); filename = filename.split("res/raw/")[1]; String eachFilePathInStorage = fileDirPath + "/" + filename; File eachfile = new File(eachFilePathInStorage); //read out the file stream and copy it to the storage InputStream ins = res.openRawResource(resourceId); FileOutputStream fos = new FileOutputStream(eachfile); byte[] buffer = new byte[8192]; int count1 = 0; while ((count1 = ins.read(buffer)) > 0) { fos.write(buffer, 0, count1); } fos.close(); ins.close(); } } catch (Exception e) { e.printStackTrace(); Toast.makeText( getApplicationContext(), "Some Errors When Copying Test Models to Storage. Contact the Author!", Toast.LENGTH_LONG).show(); } }
private Vector<FieldContainer> getDateVector4() { Vector<FieldContainer> v = new Vector<FieldContainer>(); // BEGIN android-changed // Datetime pattern 'y' for year 1999 is 1999 not 99. See http://unicode.org/reports/tr35/. // "AD AD 1999 99 1999 9 09 Sep September 13 13 013 17 17 017 17 17 017 5 // 05 // 005 19 019 1 01 001 0 00 000 Mon Monday 256 256 256 2 02 38 038 3 003 // PM // PM 5 005 GMT-05:00 GMT-05:00 -0500 -0500" v.add(new FieldContainer(0, 2, Field.ERA)); v.add(new FieldContainer(3, 5, Field.ERA)); v.add(new FieldContainer(6, 10, Field.YEAR)); v.add(new FieldContainer(11, 13, Field.YEAR)); v.add(new FieldContainer(14, 18, Field.YEAR)); v.add(new FieldContainer(19, 20, Field.MONTH)); v.add(new FieldContainer(21, 23, Field.MONTH)); v.add(new FieldContainer(24, 27, Field.MONTH)); v.add(new FieldContainer(28, 37, Field.MONTH)); v.add(new FieldContainer(38, 40, Field.DAY_OF_MONTH)); v.add(new FieldContainer(41, 43, Field.DAY_OF_MONTH)); v.add(new FieldContainer(44, 47, Field.DAY_OF_MONTH)); v.add(new FieldContainer(48, 50, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(51, 53, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(54, 57, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(58, 60, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(61, 63, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(64, 67, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(68, 69, Field.HOUR1)); v.add(new FieldContainer(70, 72, Field.HOUR1)); v.add(new FieldContainer(73, 76, Field.HOUR1)); v.add(new FieldContainer(77, 79, Field.MINUTE)); v.add(new FieldContainer(80, 83, Field.MINUTE)); v.add(new FieldContainer(84, 85, Field.SECOND)); v.add(new FieldContainer(86, 88, Field.SECOND)); v.add(new FieldContainer(89, 92, Field.SECOND)); v.add(new FieldContainer(93, 94, Field.MILLISECOND)); v.add(new FieldContainer(95, 97, Field.MILLISECOND)); v.add(new FieldContainer(98, 101, Field.MILLISECOND)); v.add(new FieldContainer(102, 105, Field.DAY_OF_WEEK)); v.add(new FieldContainer(106, 112, Field.DAY_OF_WEEK)); v.add(new FieldContainer(113, 116, Field.DAY_OF_YEAR)); v.add(new FieldContainer(117, 120, Field.DAY_OF_YEAR)); v.add(new FieldContainer(121, 124, Field.DAY_OF_YEAR)); v.add(new FieldContainer(125, 126, Field.DAY_OF_WEEK_IN_MONTH)); v.add(new FieldContainer(127, 129, Field.DAY_OF_WEEK_IN_MONTH)); v.add(new FieldContainer(130, 132, Field.WEEK_OF_YEAR)); v.add(new FieldContainer(133, 136, Field.WEEK_OF_YEAR)); v.add(new FieldContainer(137, 138, Field.WEEK_OF_MONTH)); v.add(new FieldContainer(139, 142, Field.WEEK_OF_MONTH)); v.add(new FieldContainer(143, 145, Field.AM_PM)); v.add(new FieldContainer(147, 149, Field.AM_PM)); v.add(new FieldContainer(151, 152, Field.HOUR0)); v.add(new FieldContainer(153, 156, Field.HOUR0)); v.add(new FieldContainer(157, 166, Field.TIME_ZONE)); v.add(new FieldContainer(167, 176, Field.TIME_ZONE)); v.add(new FieldContainer(177, 182, Field.TIME_ZONE)); v.add(new FieldContainer(183, 188, Field.TIME_ZONE)); // END android-changed return v; }
private Vector<FieldContainer> getDateVector4() { Vector<FieldContainer> v = new Vector<FieldContainer>(); // "AD AD 99 99 1999 9 09 Sep September 13 13 013 17 17 017 17 17 017 5 // 05 // 005 19 019 1 01 001 0 00 000 Mon Monday 256 256 256 2 02 38 038 3 003 // PM // PM 5 005 EDT Eastern Daylight Time -0400 -0400" v.add(new FieldContainer(0, 2, Field.ERA)); v.add(new FieldContainer(3, 5, Field.ERA)); v.add(new FieldContainer(6, 8, Field.YEAR)); v.add(new FieldContainer(9, 11, Field.YEAR)); v.add(new FieldContainer(12, 16, Field.YEAR)); v.add(new FieldContainer(17, 18, Field.MONTH)); v.add(new FieldContainer(19, 21, Field.MONTH)); v.add(new FieldContainer(22, 25, Field.MONTH)); v.add(new FieldContainer(26, 35, Field.MONTH)); v.add(new FieldContainer(36, 38, Field.DAY_OF_MONTH)); v.add(new FieldContainer(39, 41, Field.DAY_OF_MONTH)); v.add(new FieldContainer(42, 45, Field.DAY_OF_MONTH)); v.add(new FieldContainer(46, 48, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(49, 51, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(52, 55, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(56, 58, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(59, 61, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(62, 65, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(66, 67, Field.HOUR1)); v.add(new FieldContainer(68, 70, Field.HOUR1)); v.add(new FieldContainer(71, 74, Field.HOUR1)); v.add(new FieldContainer(75, 77, Field.MINUTE)); v.add(new FieldContainer(78, 81, Field.MINUTE)); v.add(new FieldContainer(82, 83, Field.SECOND)); v.add(new FieldContainer(84, 86, Field.SECOND)); v.add(new FieldContainer(87, 90, Field.SECOND)); v.add(new FieldContainer(91, 92, Field.MILLISECOND)); v.add(new FieldContainer(93, 95, Field.MILLISECOND)); v.add(new FieldContainer(96, 99, Field.MILLISECOND)); v.add(new FieldContainer(100, 103, Field.DAY_OF_WEEK)); v.add(new FieldContainer(104, 110, Field.DAY_OF_WEEK)); v.add(new FieldContainer(111, 114, Field.DAY_OF_YEAR)); v.add(new FieldContainer(115, 118, Field.DAY_OF_YEAR)); v.add(new FieldContainer(119, 122, Field.DAY_OF_YEAR)); v.add(new FieldContainer(123, 124, Field.DAY_OF_WEEK_IN_MONTH)); v.add(new FieldContainer(125, 127, Field.DAY_OF_WEEK_IN_MONTH)); v.add(new FieldContainer(128, 130, Field.WEEK_OF_YEAR)); v.add(new FieldContainer(131, 134, Field.WEEK_OF_YEAR)); v.add(new FieldContainer(135, 136, Field.WEEK_OF_MONTH)); v.add(new FieldContainer(137, 140, Field.WEEK_OF_MONTH)); v.add(new FieldContainer(141, 143, Field.AM_PM)); v.add(new FieldContainer(145, 147, Field.AM_PM)); v.add(new FieldContainer(149, 150, Field.HOUR0)); v.add(new FieldContainer(151, 154, Field.HOUR0)); v.add(new FieldContainer(155, 164, Field.TIME_ZONE)); v.add(new FieldContainer(165, 174, Field.TIME_ZONE)); v.add(new FieldContainer(175, 180, Field.TIME_ZONE)); v.add(new FieldContainer(181, 186, Field.TIME_ZONE)); return v; }
private Vector<FieldContainer> getDateVector4() { Vector<FieldContainer> v = new Vector<FieldContainer>(); // "AD AD 99 99 1999 9 09 Sep September 13 13 013 17 17 017 17 17 017 5 // 05 // 005 19 019 1 01 001 0 00 000 Mon Monday 256 256 256 2 02 38 038 3 003 // PM // PM 5 005 EDT Eastern Daylight Time -0400 -0400" v.add(new FieldContainer(0, 2, Field.ERA)); v.add(new FieldContainer(3, 5, Field.ERA)); v.add(new FieldContainer(6, 8, Field.YEAR)); v.add(new FieldContainer(9, 11, Field.YEAR)); v.add(new FieldContainer(12, 16, Field.YEAR)); v.add(new FieldContainer(17, 18, Field.MONTH)); v.add(new FieldContainer(19, 21, Field.MONTH)); v.add(new FieldContainer(22, 25, Field.MONTH)); v.add(new FieldContainer(26, 35, Field.MONTH)); v.add(new FieldContainer(36, 38, Field.DAY_OF_MONTH)); v.add(new FieldContainer(39, 41, Field.DAY_OF_MONTH)); v.add(new FieldContainer(42, 45, Field.DAY_OF_MONTH)); v.add(new FieldContainer(46, 48, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(49, 51, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(52, 55, Field.HOUR_OF_DAY1)); v.add(new FieldContainer(56, 58, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(59, 61, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(62, 65, Field.HOUR_OF_DAY0)); v.add(new FieldContainer(66, 67, Field.HOUR1)); v.add(new FieldContainer(68, 70, Field.HOUR1)); v.add(new FieldContainer(71, 74, Field.HOUR1)); v.add(new FieldContainer(75, 77, Field.MINUTE)); v.add(new FieldContainer(78, 81, Field.MINUTE)); v.add(new FieldContainer(82, 83, Field.SECOND)); v.add(new FieldContainer(84, 86, Field.SECOND)); v.add(new FieldContainer(87, 90, Field.SECOND)); v.add(new FieldContainer(91, 92, Field.MILLISECOND)); v.add(new FieldContainer(93, 95, Field.MILLISECOND)); v.add(new FieldContainer(96, 99, Field.MILLISECOND)); v.add(new FieldContainer(100, 103, Field.DAY_OF_WEEK)); v.add(new FieldContainer(104, 110, Field.DAY_OF_WEEK)); v.add(new FieldContainer(111, 114, Field.DAY_OF_YEAR)); v.add(new FieldContainer(115, 118, Field.DAY_OF_YEAR)); v.add(new FieldContainer(119, 122, Field.DAY_OF_YEAR)); v.add(new FieldContainer(123, 124, Field.DAY_OF_WEEK_IN_MONTH)); v.add(new FieldContainer(125, 127, Field.DAY_OF_WEEK_IN_MONTH)); v.add(new FieldContainer(128, 130, Field.WEEK_OF_YEAR)); v.add(new FieldContainer(131, 134, Field.WEEK_OF_YEAR)); v.add(new FieldContainer(135, 136, Field.WEEK_OF_MONTH)); v.add(new FieldContainer(137, 140, Field.WEEK_OF_MONTH)); v.add(new FieldContainer(141, 143, Field.AM_PM)); v.add(new FieldContainer(145, 147, Field.AM_PM)); v.add(new FieldContainer(149, 150, Field.HOUR0)); v.add(new FieldContainer(151, 154, Field.HOUR0)); v.add(new FieldContainer(155, 158, Field.TIME_ZONE)); v.add(new FieldContainer(159, 180, Field.TIME_ZONE)); v.add(new FieldContainer(181, 186, Field.TIME_ZONE)); v.add(new FieldContainer(187, 192, Field.TIME_ZONE)); return v; }
@Test public void testExecuteJobsForTwoEnginesSameAcquisition() { // configure and build a process engine StandaloneProcessEngineConfiguration engineConfiguration1 = new StandaloneInMemProcessEngineConfiguration(); engineConfiguration1.setProcessEngineName(getClass().getName() + "-engine1"); engineConfiguration1.setJdbcUrl("jdbc:h2:mem:activiti1"); engineConfiguration1.setJobExecutorActivate(false); engineConfiguration1.setJobExecutor(jobExecutor); engineConfiguration1.setDbMetricsReporterActivate(false); ProcessEngine engine1 = engineConfiguration1.buildProcessEngine(); createdProcessEngines.add(engine1); // and a second one StandaloneProcessEngineConfiguration engineConfiguration2 = new StandaloneInMemProcessEngineConfiguration(); engineConfiguration2.setProcessEngineName(getClass().getName() + "engine2"); engineConfiguration2.setJdbcUrl("jdbc:h2:mem:activiti2"); engineConfiguration2.setJobExecutorActivate(false); engineConfiguration2.setJobExecutor(jobExecutor); engineConfiguration2.setDbMetricsReporterActivate(false); ProcessEngine engine2 = engineConfiguration2.buildProcessEngine(); createdProcessEngines.add(engine2); // stop the acquisition jobExecutor.shutdown(); // deploy the processes engine1.getRepositoryService().createDeployment() .addClasspathResource(PROCESS_RESOURCE) .deploy(); engine2.getRepositoryService().createDeployment() .addClasspathResource(PROCESS_RESOURCE) .deploy(); // start one instance for each engine: engine1.getRuntimeService().startProcessInstanceByKey("intermediateTimerEventExample"); engine2.getRuntimeService().startProcessInstanceByKey("intermediateTimerEventExample"); Assert.assertEquals(1, engine1.getManagementService().createJobQuery().count()); Assert.assertEquals(1, engine2.getManagementService().createJobQuery().count()); Calendar calendar = Calendar.getInstance(); calendar.add(Field.DAY_OF_YEAR.getCalendarField(), 6); ClockUtil.setCurrentTime(calendar.getTime()); jobExecutor.start(); // assert task completed for the first engine waitForJobExecutorToProcessAllJobs(10000, 100, jobExecutor, engine1.getManagementService(), true); jobExecutor.start(); // assert task completed for the second engine waitForJobExecutorToProcessAllJobs(10000, 100, jobExecutor, engine2.getManagementService(), true); Assert.assertEquals(0, engine1.getManagementService().createJobQuery().count()); Assert.assertEquals(0, engine2.getManagementService().createJobQuery().count()); }
@Test public void testJobAddedGuardForTwoEnginesSameAcquisition() throws InterruptedException { // configure and build a process engine StandaloneProcessEngineConfiguration engineConfiguration1 = new StandaloneInMemProcessEngineConfiguration(); engineConfiguration1.setProcessEngineName(getClass().getName() + "-engine1"); engineConfiguration1.setJdbcUrl("jdbc:h2:mem:activiti1"); engineConfiguration1.setJobExecutorActivate(false); engineConfiguration1.setJobExecutor(jobExecutor); engineConfiguration1.setDbMetricsReporterActivate(false); ProcessEngine engine1 = engineConfiguration1.buildProcessEngine(); createdProcessEngines.add(engine1); // and a second one StandaloneProcessEngineConfiguration engineConfiguration2 = new StandaloneInMemProcessEngineConfiguration(); engineConfiguration2.setProcessEngineName(getClass().getName() + "engine2"); engineConfiguration2.setJdbcUrl("jdbc:h2:mem:activiti2"); engineConfiguration2.setJobExecutorActivate(false); engineConfiguration2.setJobExecutor(jobExecutor); engineConfiguration2.setDbMetricsReporterActivate(false); ProcessEngine engine2 = engineConfiguration2.buildProcessEngine(); createdProcessEngines.add(engine2); // stop the acquisition jobExecutor.shutdown(); // deploy the processes engine1.getRepositoryService().createDeployment() .addClasspathResource(PROCESS_RESOURCE) .deploy(); engine2.getRepositoryService().createDeployment() .addClasspathResource(PROCESS_RESOURCE) .deploy(); // start one instance for each engine: engine1.getRuntimeService().startProcessInstanceByKey("intermediateTimerEventExample"); engine2.getRuntimeService().startProcessInstanceByKey("intermediateTimerEventExample"); Calendar calendar = Calendar.getInstance(); calendar.add(Field.DAY_OF_YEAR.getCalendarField(), 6); ClockUtil.setCurrentTime(calendar.getTime()); Assert.assertEquals(1, engine1.getManagementService().createJobQuery().count()); Assert.assertEquals(1, engine2.getManagementService().createJobQuery().count()); // assert task completed for the first engine jobExecutor.start(); waitForJobExecutorToProcessAllJobs(10000, 100, jobExecutor, engine1.getManagementService(), false); // assert task completed for the second engine jobExecutor.start(); waitForJobExecutorToProcessAllJobs(10000, 100, jobExecutor, engine2.getManagementService(), false); Thread.sleep(2000); Assert.assertFalse(((SequentialJobAcquisitionRunnable) jobExecutor.getAcquireJobsRunnable()).isJobAdded()); Assert.assertEquals(0, engine1.getManagementService().createJobQuery().count()); Assert.assertEquals(0, engine2.getManagementService().createJobQuery().count()); }