Ejemplo n.º 1
0
 @Test
 public void testSetPreferences() {
   XenonConfiguration g = new XenonConfiguration();
   ImmutableMap<String, String> prefs = ImmutableMap.of("mykey", "myval");
   g.setPreferences(prefs);
   assertThat(g.getPreferences()).isEqualTo(prefs);
 }
Ejemplo n.º 2
0
  @Test
  public void testGetPreferences_Filled() throws URISyntaxException {
    ImmutableMap<String, String> prefs =
        ImmutableMap.of("xenon.adaptors.local.queue.multi.maxConcurrentJobs", "1");

    XenonConfiguration config = sampleConfig();

    assertThat(config.getPreferences()).isEqualTo(prefs);
  }
Ejemplo n.º 3
0
  @Test
  public void deserializesFromJson() throws IOException, URISyntaxException {
    XenonConfiguration actual =
        fromJson(jsonFixture("fixtures/xenon.json"), XenonConfiguration.class);

    ImmutableMap<String, String> emptyProps = ImmutableMap.of();
    SchedulerConfiguration expectedScheduler =
        new SchedulerConfiguration("local", null, "multi", emptyProps);
    assertThat(actual.getScheduler()).isEqualTo(expectedScheduler);

    SandboxConfiguration expectedSandbox =
        new SandboxConfiguration("file", "/", "/tmp/sandboxes", emptyProps);
    assertThat(actual.getSandbox()).isEqualTo(expectedSandbox);

    ImmutableMap<String, String> prefs =
        ImmutableMap.of("xenon.adaptors.local.queue.multi.maxConcurrentJobs", "4");
    assertThat(actual.getPreferences()).isEqualTo(prefs);
    PollConfiguration expected_poll = new PollConfiguration(500, 3600000, 43200000);
    assertThat(actual.getPoll()).isEqualTo(expected_poll);
  }
Ejemplo n.º 4
0
 @Test
 public void testGetPreferences_Empty() {
   XenonConfiguration g = new XenonConfiguration();
   ImmutableMap<String, String> expected = ImmutableMap.of();
   assertThat(g.getPreferences()).isEqualTo(expected);
 }