-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #601 from JordanMartinez/cleanupIntegrationTest
Cleanup integration test
- Loading branch information
Showing
22 changed files
with
1,135 additions
and
978 deletions.
There are no files selected for viewing
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
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
117 changes: 117 additions & 0 deletions
117
richtextfx/src/integrationTest/java/org/fxmisc/richtext/RichTextFXTestBase.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
package org.fxmisc.richtext; | ||
|
||
import javafx.geometry.Pos; | ||
import javafx.scene.Node; | ||
import javafx.scene.Scene; | ||
import javafx.stage.Window; | ||
import org.testfx.framework.junit.ApplicationTest; | ||
import org.testfx.service.query.PointQuery; | ||
|
||
import static org.junit.Assume.assumeTrue; | ||
|
||
/** | ||
* Provides useful static fields and helper methods for RichTextFX integration tests. | ||
* | ||
* <ul> | ||
* <li> | ||
* Helps determine which OS is currently running the test and whether to run/skip a test on that OS | ||
* </li> | ||
* <li> | ||
* Getting the position o | ||
* </li> | ||
* </ul> | ||
*/ | ||
public abstract class RichTextFXTestBase extends ApplicationTest { | ||
|
||
static { | ||
String osName = System.getProperty("os.name").toLowerCase(); | ||
|
||
IS_WINDOWS = osName.startsWith("win"); | ||
IS_MAC = osName.startsWith("mac"); | ||
IS_LINUX = osName.startsWith("linux"); | ||
} | ||
|
||
/* *********************************************** * | ||
* OS-RELATED | ||
* *********************************************** */ | ||
|
||
public static final boolean IS_WINDOWS; | ||
public static final boolean IS_MAC; | ||
public static final boolean IS_LINUX; | ||
|
||
/** | ||
* If not on Windows environment, calling this in @Before method will skip the entire test suite whereas calling | ||
* this in @Test will skip just that test method | ||
*/ | ||
public final void run_only_on_windows() { | ||
assumeTrue(IS_WINDOWS); | ||
} | ||
|
||
/** | ||
* If not on Linux environment, calling this in @Before method will skip the entire test suite whereas calling | ||
* this in @Test will skip just that test method | ||
*/ | ||
public final void run_only_on_linux() { | ||
assumeTrue(IS_LINUX); | ||
} | ||
|
||
/** | ||
* If not on Mac environment, calling this in @Before method will skip the entire test suite whereas calling | ||
* this in @Test will skip just that test method | ||
*/ | ||
public final void run_only_on_mac() { | ||
assumeTrue(IS_MAC); | ||
} | ||
|
||
/** | ||
* If on Windows environment, calling this in @Before method will skip the entire test suite whereas calling | ||
* this in @Test will skip just that test method | ||
*/ | ||
public final void skip_if_on_windows() { | ||
assumeTrue(!IS_WINDOWS); | ||
} | ||
|
||
/** | ||
* If on Linux environment, calling this in @Before method will skip the entire test suite whereas calling | ||
* this in @Test will skip just that test method | ||
*/ | ||
public final void skip_if_on_linux() { | ||
assumeTrue(!IS_LINUX); | ||
} | ||
|
||
/** | ||
* If on Mac environment, calling this in @Before method will skip the entire test suite whereas calling | ||
* this in @Test will skip just that test method | ||
*/ | ||
public final void skip_if_on_mac() { | ||
assumeTrue(!IS_MAC); | ||
} | ||
|
||
/* *********************************************** * | ||
* Position-Related | ||
* *********************************************** */ | ||
|
||
/** | ||
* Returns a specific position in the scene, starting at {@code pos} and offsetting from that place by | ||
* {@code xOffset} and {@code yOffset} | ||
*/ | ||
public final PointQuery position(Scene scene, Pos pos, double xOffset, double yOffset) { | ||
return point(scene).atPosition(pos).atOffset(xOffset, yOffset); | ||
} | ||
|
||
/** | ||
* Returns a specific position in the window, starting at {@code pos} and offsetting from that place by | ||
* {@code xOffset} and {@code yOffset} | ||
*/ | ||
public final PointQuery position(Window window, Pos pos, double xOffset, double yOffset) { | ||
return point(window).atPosition(pos).atOffset(xOffset, yOffset); | ||
} | ||
|
||
/** | ||
* Returns a specific position in the node, starting at {@code pos} and offsetting from that place by | ||
* {@code xOffset} and {@code yOffset} | ||
*/ | ||
public final PointQuery position(Node node, Pos pos, double xOffset, double yOffset) { | ||
return point(node).atPosition(pos).atOffset(xOffset, yOffset); | ||
} | ||
} |
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
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
49 changes: 0 additions & 49 deletions
49
richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/ClipboardTests.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.