コード例 #1
0
  @Test
  public void testSetProperty() {
    JerseyConfiguration instance = new JerseyConfiguration();
    assertTrue(instance.getProperties().isEmpty());

    instance.setProperty("name", "value");
    assertFalse(instance.getProperties().isEmpty());
    assertEquals(1, instance.getProperties().size());
    assertEquals("value", instance.getProperty("name"));
  }
コード例 #2
0
  @Test
  public void testGetProperties() {
    JerseyConfiguration instance = new JerseyConfiguration();
    Map result = instance.getProperties();
    assertNotNull(result);

    instance.setProperty("name", "value");
    assertEquals("value", result.get("name"));

    try {
      result.remove("name");
      fail("UnsupportedOperationException expected");
    } catch (UnsupportedOperationException ex) {
      // ok
    }
  }