Search in sources :

Example 1 with NotTest

use of fvarrui.sysadmin.challenger.test.NotTest in project Challenger4SysAdmins by fvarrui.

the class TreeEditorController method addTest.

private void addTest(NotTest parent) {
    TestContextMenu menu = new TestContextMenu();
    menu.show(addButton, Side.BOTTOM, 0, 0);
    menu.setOnHidden(e -> {
        Test childTest = menu.getTest();
        if (childTest != null) {
            parent.setTest(childTest);
            System.out.println("test " + childTest.getName() + " a�adido al test de negaci�n " + parent.getName());
        }
    });
}
Also used : TestContextMenu(fvarrui.sysadmin.editor.components.TestContextMenu) Test(fvarrui.sysadmin.challenger.test.Test) NotTest(fvarrui.sysadmin.challenger.test.NotTest) CommandTest(fvarrui.sysadmin.challenger.test.CommandTest)

Example 2 with NotTest

use of fvarrui.sysadmin.challenger.test.NotTest in project Challenger4SysAdmins by fvarrui.

the class TreeEditorController method removeTest.

private void removeTest(Test test) {
    Object parent = selectedItem.get().getParent().getValue();
    if (parent instanceof Goal) {
        Goal goal = (Goal) parent;
        goal.setTest(null);
        System.out.println("test " + test.getName() + " eliminado del objetivo " + goal.getName());
    } else if (parent instanceof TestGroup) {
        TestGroup compoundTest = (TestGroup) parent;
        compoundTest.getTests().remove(test);
        System.out.println("test " + test.getName() + " eliminado del test " + compoundTest.getName());
    } else if (parent instanceof NotTest) {
        NotTest notTest = (NotTest) parent;
        notTest.setTest(null);
        System.out.println("test " + test.getName() + " eliminado del test de negaci�n " + notTest.getName());
    }
}
Also used : Goal(fvarrui.sysadmin.challenger.Goal) TestGroup(fvarrui.sysadmin.challenger.test.TestGroup) NotTest(fvarrui.sysadmin.challenger.test.NotTest)

Aggregations

NotTest (fvarrui.sysadmin.challenger.test.NotTest)2 Goal (fvarrui.sysadmin.challenger.Goal)1 CommandTest (fvarrui.sysadmin.challenger.test.CommandTest)1 Test (fvarrui.sysadmin.challenger.test.Test)1 TestGroup (fvarrui.sysadmin.challenger.test.TestGroup)1 TestContextMenu (fvarrui.sysadmin.editor.components.TestContextMenu)1