modules/controls/src/test/java/com/sun/javafx/scene/control/inputmap/KeyBindingTest.java
Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization
*** 1,6 ****
! package com.sun.javafx.scene.control.behavior;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import org.junit.Test;
import static org.junit.Assert.*;
--- 1,6 ----
! package com.sun.javafx.scene.control.inputmap;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import org.junit.Test;
import static org.junit.Assert.*;
*** 20,39 ****
//
// Total = 5.
//
int expect = 5;
! KeyBinding uut = new KeyBinding(code, "ShiftEnter").shift().ctrl(OptionalBoolean.ANY);
KeyEvent event = new KeyEvent(KeyEvent.KEY_PRESSED, null,
null, code, true, false, false, false);
! assertEquals(expect, uut.getSpecificity(null, event)); // Gets 6 (fx 2.2, fx 8)
! uut = new KeyBinding(code, "CtrlEnter").shift(OptionalBoolean.ANY).ctrl();
event = new KeyEvent(KeyEvent.KEY_PRESSED, null,
null, code, false, true, false, false);
! assertEquals(expect, uut.getSpecificity(null, event)); // Gets 2 (fx 2.2, fx 8)
}
}
\ No newline at end of file
--- 20,39 ----
//
// Total = 5.
//
int expect = 5;
! KeyBinding uut = new KeyBinding(code).shift().ctrl(KeyBinding.OptionalBoolean.ANY);
KeyEvent event = new KeyEvent(KeyEvent.KEY_PRESSED, null,
null, code, true, false, false, false);
! assertEquals(expect, uut.getSpecificity(event)); // Gets 6 (fx 2.2, fx 8)
! uut = new KeyBinding(code).shift(KeyBinding.OptionalBoolean.ANY).ctrl();
event = new KeyEvent(KeyEvent.KEY_PRESSED, null,
null, code, false, true, false, false);
! assertEquals(expect, uut.getSpecificity(event)); // Gets 2 (fx 2.2, fx 8)
}
}
\ No newline at end of file