Created
September 12, 2014 23:30
-
-
Save ryanjaeb/0222f5169a2ec944059e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fx.fxml.view.fxml; | |
import javafx.fxml.FXMLLoader; | |
import javafx.scene.Parent; | |
import org.junit.Test; | |
import org.loadui.testfx.GuiTest; | |
import org.mockito.Mockito; | |
import java.io.IOException; | |
public class MainPaneControllerTest extends GuiTest { | |
private MainPaneController controller; | |
@Override | |
protected Parent getRootNode() { | |
FXMLLoader loader = new FXMLLoader(); | |
loader.setLocation(MainPaneController.class.getResource("MainPane.fxml")); | |
loader.setControllerFactory(type -> Mockito.spy(new MainPaneController())); | |
try { | |
Parent root = loader.load(); | |
controller = loader.getController(); | |
return root; | |
} | |
catch (IOException e) { | |
throw new RuntimeException(e); | |
} | |
} | |
@Test | |
public void selectedLeftItemIsBound() { | |
controller.getLeftListView().getItems().add("test item"); | |
click("test item"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment