コード例 #1
0
  @Before
  public void setUp() {
    smaaModel = new SMAATRIModel("name");
    crit1 =
        new OutrankingCriterion("o1", true, new ExactMeasurement(0.0), new ExactMeasurement(1.0));
    crit2 =
        new OutrankingCriterion("o2", true, new ExactMeasurement(0.0), new ExactMeasurement(1.0));
    a1 = new Alternative("a1");
    a2 = new Alternative("a2");
    cat1 = new Category("c1");
    cat2 = new Category("c2");

    smaaModel.addAlternative(a1);
    smaaModel.addAlternative(a2);

    smaaModel.addCategory(cat1);
    smaaModel.addCategory(cat2);

    smaaModel.addCriterion(crit1);
    smaaModel.addCriterion(crit2);

    LeftTreeModel treeModel = new LeftTreeModel(smaaModel);
    handler = new LeftTreeTransferHandler(treeModel, smaaModel);
  }
コード例 #2
0
 @Test
 public void testMoveCategory() {
   handler.moveCategory(cat2, 0);
   assertEquals(cat2, smaaModel.getCategories().get(0));
   assertEquals(cat1, smaaModel.getCategories().get(1));
 }
コード例 #3
0
 @Test
 public void testMoveAlternative() {
   handler.moveAlternative(a2, 0);
   assertEquals(a2, smaaModel.getAlternatives().get(0));
   assertEquals(a1, smaaModel.getAlternatives().get(1));
 }
コード例 #4
0
 @Test
 public void testMoveCriterion() {
   handler.moveCriterion(crit2, 0);
   assertEquals(crit2, smaaModel.getCriteria().get(0));
   assertEquals(crit1, smaaModel.getCriteria().get(1));
 }