コード例 #1
0
 protected static OrderParameter create(String name, String value) {
   OrderParameter model = new OrderParameter();
   model.setLabel(name);
   model.setFriendlyLabel(name);
   model.setFriendlyValue(value);
   model.setValue(value);
   return model;
 }
コード例 #2
0
  @Test
  public void testPersistObject() throws Exception {
    _logger.info("Starting persist OrderParameter test");

    OrderParameter model = new OrderParameter();
    model.setLabel("foo");
    model.setFriendlyLabel("my friendly name");
    model.setFriendlyValue("my friendly value");
    model.setUserInput(false);
    model.setValue("my value");

    save(model);
    model = findById(model.getId());

    Assert.assertNotNull(model);
    Assert.assertEquals("foo", model.getLabel());
    Assert.assertEquals("my friendly name", model.getFriendlyLabel());
    Assert.assertEquals("my friendly value", model.getFriendlyValue());
    Assert.assertEquals(false, model.getUserInput());
    Assert.assertEquals("my value", model.getValue());
  }