Пример #1
0
  @Test
  public void test1() throws Exception {
    ObjectViews views = this.unmarshal("com/axelor/meta/WSTest.xml", ObjectViews.class);
    List<Action> actions = views.getActions();

    Assert.assertNotNull(actions);
    Assert.assertEquals(4, actions.size());

    MetaStore.resister(views);

    Action action = MetaStore.getAction("data.import.1");
    Map<String, Object> context = Maps.newHashMap();

    DateTime dt = new DateTime();
    dt = dt.plus(Period.days(20));

    context.put("dt", dt);

    ActionHandler handler = createHandler("data.import.1", context);
    action.evaluate(handler);
  }
  @Before
  public void setUp() {
    try {
      views = this.unmarshal("com/axelor/meta/Contact.xml", ObjectViews.class);
    } catch (Exception e) {
      throw Throwables.propagate(e);
    }

    assertNotNull(views);
    assertNotNull(views.getActions());

    MetaStore.resister(views);
    ensureContact();
  }