@Before
  public void buildAllUnits() {
    // unit hierarchy = one-->two-->three
    one = new Unit();
    one.setUnitNumber(ONE);

    two = new Unit();
    two.setUnitNumber(TWO);
    two.setParentUnitNumber(ONE);

    three = new Unit();
    three.setUnitNumber(THREE);
    three.setParentUnitNumber(TWO);

    // other unit hierachy = one-->other-->another
    other = new Unit();
    other.setUnitNumber(OTHER);
    other.setParentUnitNumber(ONE);

    another = new Unit();
    another.setUnitNumber(ANOTHER);
    another.setParentUnitNumber(OTHER);
  }
Example #2
0
  @Before
  public void buildAllUnits() {
    // unit hierarchy = one-->two-->three
    one = new Unit();
    one.setUnitNumber("ONE");

    two = new Unit();
    two.setUnitNumber("TWO");
    two.setParentUnitNumber("ONE");

    three = new Unit();
    three.setUnitNumber("THREE");
    three.setParentUnitNumber("TWO");

    allUnits =
        new ArrayList<Unit>() {
          {
            add(one);
            add(two);
            add(three);
          }
        };
  }