Ejemplo n.º 1
0
  @SuppressWarnings("nls")
  public void testLoad() {
    DialogSettings settings = new DialogSettings("mysettings");

    Criteria criteria = new Criteria();
    criteria.setExpression("test");
    criteria.setLifeLineSelected(true);
    criteria.setSyncMessageSelected(true);

    // Save the criteria to the dialog settings
    criteria.save(settings);

    // Load the criteria from the dialog settings
    Criteria copy = new Criteria();
    copy.load(settings);

    assertTrue("testCompareTo", criteria.compareTo(copy));
    assertTrue("testCompareTo", copy.compareTo(criteria));
  }
Ejemplo n.º 2
0
  @SuppressWarnings("nls")
  public void testSave() {
    DialogSettings settings = new DialogSettings("mysettings");

    Criteria criteria = new Criteria();
    criteria.setExpression("test");
    criteria.setLifeLineSelected(true);
    criteria.setSyncMessageSelected(true);

    // Save the criteria to the dialog settings
    criteria.save(settings);

    // Check if all values are saved as expected
    assertEquals("testSave", "test", settings.get("expression"));
    assertEquals("testSave", "false", settings.get("isCaseSenstiveSelected"));
    assertEquals("testSave", "false", settings.get("isAsyncMessageReturnSelected"));
    assertEquals("testSave", "false", settings.get("isAsyncMessageSelected"));
    assertEquals("testSave", "true", settings.get("isLifeLineSelected"));
    assertEquals("testSave", "false", settings.get("isStopSelected"));
    assertEquals("testSave", "false", settings.get("isSyncMessageReturnSelected"));
    assertEquals("testSave", "true", settings.get("isSyncMessageSelected"));
  }