Search in sources :

Example 1 with LogScenario

use of com.insightfullogic.honest_profiler.framework.scenario.LogScenario in project honest-profiler by jvm-profiling-tools.

the class HPFXUtil method newProfileTab.

// Profile Creation
public static final void newProfileTab(FxRobot robot, JavaFXApplication application, int expectedIndex, String name, LogScenario scenario, ProfileMode mode) {
    TabPane tabPane = robot.lookup("#profileTabs").query();
    waitUntil(() -> tabPane.isVisible());
    assertEquals(expectedIndex, tabPane.getTabs().size());
    ProfileContextGenerator gen = new ProfileContextGenerator(application, name, mode);
    waitUntil(asyncFx(() -> gen.createNewProfile(scenario)));
    waitUntil(() -> tabPane.getTabs().size() == expectedIndex + 1);
    Tab tab = tabPane.getTabs().get(expectedIndex);
    waitUntil(() -> ((Parent) tab.getGraphic()).getChildrenUnmodifiable().stream().filter(node -> node instanceof Label && name.equals(((Label) node).getText())).findFirst().isPresent());
}
Also used : EventHandler(javafx.event.EventHandler) Button(javafx.scene.control.Button) DiffEntry(com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffEntry) WaitForAsyncUtils.asyncFx(org.testfx.util.WaitForAsyncUtils.asyncFx) ThreadGrouping(com.insightfullogic.honest_profiler.core.aggregation.grouping.ThreadGrouping) MouseButton(javafx.scene.input.MouseButton) Node(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node) Control(javafx.scene.control.Control) MouseEvent(javafx.scene.input.MouseEvent) TimeoutException(java.util.concurrent.TimeoutException) Callable(java.util.concurrent.Callable) ProfileContextGenerator(com.insightfullogic.honest_profiler.framework.generator.ProfileContextGenerator) WaitForAsyncUtils.waitFor(org.testfx.util.WaitForAsyncUtils.waitFor) Parent(javafx.scene.Parent) Future(java.util.concurrent.Future) TreeTableView(javafx.scene.control.TreeTableView) TabPane(javafx.scene.control.TabPane) JavaFXApplication(com.insightfullogic.honest_profiler.ports.javafx.JavaFXApplication) ContextMenu(javafx.scene.control.ContextMenu) Entry(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Entry) FxRobot(org.testfx.api.FxRobot) Assert.fail(org.junit.Assert.fail) TableView(javafx.scene.control.TableView) FrameGrouping(com.insightfullogic.honest_profiler.core.aggregation.grouping.FrameGrouping) DiffNode(com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffNode) ViewType(com.insightfullogic.honest_profiler.ports.javafx.ViewType) PRIMARY(javafx.scene.input.MouseButton.PRIMARY) LogScenario(com.insightfullogic.honest_profiler.framework.scenario.LogScenario) Label(javafx.scene.control.Label) MenuItem(javafx.scene.control.MenuItem) Boolean.getBoolean(java.lang.Boolean.getBoolean) ChoiceBox(javafx.scene.control.ChoiceBox) DOWN(javafx.scene.input.KeyCode.DOWN) SECONDARY(javafx.scene.input.MouseButton.SECONDARY) ENTER(javafx.scene.input.KeyCode.ENTER) ProfileMode(com.insightfullogic.honest_profiler.ports.javafx.model.ProfileContext.ProfileMode) Tab(javafx.scene.control.Tab) SECONDS(java.util.concurrent.TimeUnit.SECONDS) Assert.assertEquals(org.junit.Assert.assertEquals) TabPane(javafx.scene.control.TabPane) Tab(javafx.scene.control.Tab) Label(javafx.scene.control.Label) ProfileContextGenerator(com.insightfullogic.honest_profiler.framework.generator.ProfileContextGenerator)

Aggregations

FrameGrouping (com.insightfullogic.honest_profiler.core.aggregation.grouping.FrameGrouping)1 ThreadGrouping (com.insightfullogic.honest_profiler.core.aggregation.grouping.ThreadGrouping)1 DiffEntry (com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffEntry)1 DiffNode (com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffNode)1 Entry (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Entry)1 Node (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node)1 ProfileContextGenerator (com.insightfullogic.honest_profiler.framework.generator.ProfileContextGenerator)1 LogScenario (com.insightfullogic.honest_profiler.framework.scenario.LogScenario)1 JavaFXApplication (com.insightfullogic.honest_profiler.ports.javafx.JavaFXApplication)1 ViewType (com.insightfullogic.honest_profiler.ports.javafx.ViewType)1 ProfileMode (com.insightfullogic.honest_profiler.ports.javafx.model.ProfileContext.ProfileMode)1 Boolean.getBoolean (java.lang.Boolean.getBoolean)1 Callable (java.util.concurrent.Callable)1 Future (java.util.concurrent.Future)1 SECONDS (java.util.concurrent.TimeUnit.SECONDS)1 TimeoutException (java.util.concurrent.TimeoutException)1 EventHandler (javafx.event.EventHandler)1 Parent (javafx.scene.Parent)1 Button (javafx.scene.control.Button)1 ChoiceBox (javafx.scene.control.ChoiceBox)1