@Test public void startDateIsSpreadAccordingToRunPeriod() { JmxTransformer jmxTransformer = createJmxTransformer(new JmxTransConfiguration()); Date now = new Date(); assertThat(jmxTransformer.computeSpreadStartDate(60)) .isBetween(now, new Date(now.getTime() + MILLISECONDS.convert(60, SECONDS))); }
@VisibleForTesting Date computeSpreadStartDate(int runPeriod) { long spread = random.nextLong(MILLISECONDS.convert(runPeriod, SECONDS)); return new Date(new Date().getTime() + spread); }
JmxTransformer implements WatchedCallback { @VisibleForTesting Date computeSpreadStartDate(int runPeriod) { long spread = random.nextLong(MILLISECONDS.convert(runPeriod, SECONDS)); return new Date(new Date().getTime() + spread); } }
JmxTransformer implements WatchedCallback { @VisibleForTesting Date computeSpreadStartDate(int runPeriod) { long spread = random.nextLong(MILLISECONDS.convert(runPeriod, SECONDS)); return new Date(new Date().getTime() + spread); } @Inject  JmxTransformer(
			@Nonnull ServerScheduler serverScheduler,
			JmxTransConfiguration configuration,
			ConfigurationParser configurationParser,
			Injector injector,
			@Nonnull @Named("queryExecutorRepository") ExecutorRepository queryExecutorRepository,
			@Nonnull @Named("resultExecutorRepository") ExecutorRepository resultExecutorRepository,
			@Nonnull ScheduledExecutorService scheduledExecutor
	); }
JmxTransformer implements WatchedCallback { @VisibleForTesting Date computeSpreadStartDate(int runPeriod) { long spread = random.nextLong(MILLISECONDS.convert(runPeriod, SECONDS)); return new Date(new Date().getTime() + spread); } @Inject  JmxTransformer(
			@Nonnull ServerScheduler serverScheduler,
			JmxTransConfiguration configuration,
			ConfigurationParser configurationParser,
			Injector injector,
			@Nonnull @Named("queryExecutorRepository") ExecutorRepository queryExecutorRepository,
			@Nonnull @Named("resultExecutorRepository") ExecutorRepository resultExecutorRepository,
			@Nonnull ScheduledExecutorService scheduledExecutor
	); static void main(String[] args); static JmxTransformer create(JmxTransConfiguration configuration); synchronized void start(); synchronized void stop(); void executeStandalone(JmxProcess process); @Override void fileModified(File file); @Override void fileDeleted(File file); @Override void fileAdded(File file); }
JmxTransformer implements WatchedCallback { @VisibleForTesting Date computeSpreadStartDate(int runPeriod) { long spread = random.nextLong(MILLISECONDS.convert(runPeriod, SECONDS)); return new Date(new Date().getTime() + spread); } @Inject  JmxTransformer(
			@Nonnull ServerScheduler serverScheduler,
			JmxTransConfiguration configuration,
			ConfigurationParser configurationParser,
			Injector injector,
			@Nonnull @Named("queryExecutorRepository") ExecutorRepository queryExecutorRepository,
			@Nonnull @Named("resultExecutorRepository") ExecutorRepository resultExecutorRepository,
			@Nonnull ScheduledExecutorService scheduledExecutor
	); static void main(String[] args); static JmxTransformer create(JmxTransConfiguration configuration); synchronized void start(); synchronized void stop(); void executeStandalone(JmxProcess process); @Override void fileModified(File file); @Override void fileDeleted(File file); @Override void fileAdded(File file);  }