Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First prepare applications (or change your current app to support test mode) which can populate your TreeView with specific data. The entity which will provide fake data for TreeView will be your <strong>mock</strong> object for specific data. It should look like a service from TreeView point of view, which means you need to extract common methods from your services class into interface and make TreeView use this interface instead of concrete class. </p> <p>To handle UI testing you can you use <a href="https://jemmy.java.net/JemmyFXGuide/jemmy-guide.html#inst" rel="nofollow">JemmyFX</a> library. You can create simple test which will verify any UI properties of your TestView or imitate user actions like mouse clicks or text input. You may not worry about threading issues, jemmy will handle it for you.</p> <p>It can look next way (I use junit as test harness here):</p> <pre><code>public class TreeTest { @BeforeClass public static void setUpClass() throws Exception { // running your specially crafted FX application with mock service data // you can do it any way, e.g. by calling main() method with some parameters AppExecutor.executeNoBlock(TreeApp.class); } @Test // this is junit annotation for test public void fooTest() { // here we are receiving special jemmyfx entity which knows how to handle // tree views and is attached to your TreeView // (if you app has only one TreeView, you may need additional logic for several ones) TreeViewDock tree = new TreeViewDock(new SceneDock().asParent()); // this way we can find some item which you expected to see in you TreeView // because you've created you mock data this way. // Note that underlying code will respect UI threading, // will understand that UI can have delay and will give it certain time without blocking // and will throw descriptive exception in case expected item wasn't found tree.asTree().selector().select(new ByToStringLookup("item1")); // you can find subitems tree.asTree().selector().select(new ByToStringLookup("item1"), new ByToStringLookup("subitem1"); // and perform operations on them, e.g. expand: new TreeItemDock(tree.asItemParent(), new EqualsLookup("item2")).asTreeItem().expand(); //etc } </code></pre> <p>You can find more info on site on just by code completion hints</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload