Example #1
0
  @Test
  @Ignore
  public void testCleanFloating() {
    Vme vme = new Vme();

    MultiLingualString mls = new MultiLingualString();
    vme.setName(mls);
    dao.persist(vme);
    assertEquals(1, dao.loadObjects(MultiLingualString.class).size());

    MultiLingualString mls2 = u.english("car");
    dao.persist(mls2);
    assertEquals(2, dao.loadObjects(MultiLingualString.class).size());
    c.cleanFloating();
    assertEquals(1, dao.loadObjects(MultiLingualString.class).size());
  }
Example #2
0
  public void fix() {

    List<MultiLingualString> l = vmeDao.loadObjects(MultiLingualString.class);
    int fixes = 0;
    for (MultiLingualString m : l) {
      if (m.getStringMap() != null) {
        if (u.getEnglish(m) != null && u.getEnglish(m).equals(MEXICO)) {
          u.replaceEnglish(m, "");
          vmeDao.merge(m);
          fixes++;
        }
      }
    }
    String message =
        "Total amount of MultiLingualStrings "
            + l.size()
            + ". Number of fixes applied: "
            + fixes
            + ".";
    System.out.println(message);
  }