test_class.declarator: cronScheduler = new CronSchedulerImpl(new SchedulerImpl())
test_class.modifier: private final
test_class.original_string: private final CronSchedulerImpl cronScheduler = new CronSchedulerImpl(new SchedulerImpl());
test_class.type: CronSchedulerImpl
test_class.var_name: cronScheduler
test_class.file: bundles/org.openhab.core/src/test/java/org/openhab/core/internal/scheduler/CronSchedulerImplTest.java
test_class.identifier: CronSchedulerImplTest
test_case.body: @Test
      @Timeout(value = 6, unit = TimeUnit.SECONDS)
      public void testCronScheduling() throws Exception {
          long now = System.currentTimeMillis();
          AtomicReference<Object> ref = new AtomicReference<>();
  
          Semaphore s = new Semaphore(0);
          cronScheduler.schedule(foo -> {
              s.release();
              ref.set(foo.get("foo"));
          }, Map.of("foo", "bar"), "#\n" //
                  + "\n" //
                  + " foo = bar \n" //
                  + "# bla bla foo=foo\n" //
                  + "0/2 * * * * *");
          s.acquire(2);
  
          long diff = (System.currentTimeMillis() - now + 50) / 1000;
          assertTrue(diff >= 3 && diff <= 4, "Difference calculation should be between 3 and 4 but was: " + diff);
          assertEquals("bar", ref.get(), "Environment variable 'foo' should be correctly set");
      }
test_case.class_method_signature: CronSchedulerImplTest.testCronScheduling()
test_case.full_signature: @Test @Timeout(value = 6, unit = TimeUnit.SECONDS) public void testCronScheduling()
test_case.identifier: testCronScheduling
test_case.invocations: currentTimeMillis schedule release set get of acquire currentTimeMillis assertTrue assertEquals get
test_case.modifiers: @Test @Timeout(value = 6, unit = TimeUnit.SECONDS) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCronScheduling()
focal_class.declarator: logger = LoggerFactory.getLogger(CronSchedulerImpl.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(CronSchedulerImpl.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: crons = new ArrayList<>()
focal_class.modifier: private final
focal_class.original_string: private final List<Cron> crons = new ArrayList<>();
focal_class.type: List<Cron>
focal_class.var_name: crons
focal_class.declarator: scheduler
focal_class.modifier: private final
focal_class.original_string: private final Scheduler scheduler;
focal_class.type: Scheduler
focal_class.var_name: scheduler
focal_class.file: bundles/org.openhab.core/src/main/java/org/openhab/core/internal/scheduler/CronSchedulerImpl.java
focal_class.identifier: CronSchedulerImpl
focal_class.interfaces: implements CronScheduler
focal_class.class_method_signature: CronSchedulerImpl.CronSchedulerImpl(final @Reference Scheduler scheduler)
focal_class.full_signature: @Activate public  CronSchedulerImpl(final @Reference Scheduler scheduler)
focal_class.identifier: CronSchedulerImpl
focal_class.modifiers: @Activate public
focal_class.parameters: (final @Reference Scheduler scheduler)
focal_class.signature:  CronSchedulerImpl(final @Reference Scheduler scheduler)
focal_class.class_method_signature: CronSchedulerImpl.schedule(SchedulerRunnable runnable, String cronExpression)
focal_class.full_signature: @Override public ScheduledCompletableFuture<@Nullable Void> schedule(SchedulerRunnable runnable, String cronExpression)
focal_class.identifier: schedule
focal_class.modifiers: @Override public
focal_class.parameters: (SchedulerRunnable runnable, String cronExpression)
focal_class.return: ScheduledCompletableFuture<@Nullable Void>
focal_class.signature: ScheduledCompletableFuture<@Nullable Void> schedule(SchedulerRunnable runnable, String cronExpression)
focal_class.class_method_signature: CronSchedulerImpl.schedule(CronJob job, Map<String, Object> config,
              String cronExpression)
focal_class.full_signature: @Override public ScheduledCompletableFuture<@Nullable Void> schedule(CronJob job, Map<String, Object> config,
              String cronExpression)
focal_class.identifier: schedule
focal_class.modifiers: @Override public
focal_class.parameters: (CronJob job, Map<String, Object> config,
              String cronExpression)
focal_class.return: ScheduledCompletableFuture<@Nullable Void>
focal_class.signature: ScheduledCompletableFuture<@Nullable Void> schedule(CronJob job, Map<String, Object> config,
              String cronExpression)
focal_class.class_method_signature: CronSchedulerImpl.addSchedule(CronJob cronJob, Map<String, Object> map)
focal_class.full_signature: @Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MULTIPLE) void addSchedule(CronJob cronJob, Map<String, Object> map)
focal_class.identifier: addSchedule
focal_class.modifiers: @Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MULTIPLE)
focal_class.parameters: (CronJob cronJob, Map<String, Object> map)
focal_class.return: void
focal_class.signature: void addSchedule(CronJob cronJob, Map<String, Object> map)
focal_class.class_method_signature: CronSchedulerImpl.removeSchedule(CronJob s)
focal_class.full_signature:  void removeSchedule(CronJob s)
focal_class.identifier: removeSchedule
focal_class.parameters: (CronJob s)
focal_class.return: void
focal_class.signature: void removeSchedule(CronJob s)
focal_method.body: @Override
      public ScheduledCompletableFuture<@Nullable Void> schedule(SchedulerRunnable runnable, String cronExpression) {
          return schedule(d -> runnable.run(), Collections.emptyMap(), cronExpression);
      }
focal_method.class_method_signature: CronSchedulerImpl.schedule(SchedulerRunnable runnable, String cronExpression)
focal_method.full_signature: @Override public ScheduledCompletableFuture<@Nullable Void> schedule(SchedulerRunnable runnable, String cronExpression)
focal_method.identifier: schedule
focal_method.invocations: schedule run emptyMap
focal_method.modifiers: @Override public
focal_method.parameters: (SchedulerRunnable runnable, String cronExpression)
focal_method.return: ScheduledCompletableFuture<@Nullable Void>
focal_method.signature: ScheduledCompletableFuture<@Nullable Void> schedule(SchedulerRunnable runnable, String cronExpression)