Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore) Travis: Run tests once with and once without framebuffer screen. #209

Merged
merged 6 commits into from
Mar 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@ language: java
jdk:
- oraclejdk8

# use operating systems.
os:
- linux

# run in container und keep gradle cache.
sudo: false
cache:
directories:
- $HOME/.gradle

# setup jobs.
env:
- USE_FRAMEBUFFER=true
- USE_FRAMEBUFFER=false _JAVA_OPTIONS="-Djava.awt.headless=true -Dtestfx.robot=glass -Dtestfx.headless=true -Dprism.order=sw -Dprism.text=t2k -Dtestfx.setup.timeout=2500"

# run on xvfb screen.
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- if [ $USE_FRAMEBUFFER = "true" ]; then export DISPLAY=:99.0 && sh -e /etc/init.d/xvfb start; fi

# skip install stage.
install: true

# run gradle build.
script: ./gradlew build
script:
- ./gradlew build
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@
*/
package org.testfx.cases;

import java.awt.GraphicsEnvironment;

import org.junit.BeforeClass;
import org.testfx.api.FxRobot;
import org.testfx.api.FxToolkit;

import static org.junit.Assume.assumeFalse;

public abstract class TestCaseBase extends FxRobot {

//---------------------------------------------------------------------------------------------
Expand All @@ -32,10 +28,6 @@ public abstract class TestCaseBase extends FxRobot {

@BeforeClass
public static void baseSetupSpec() throws Exception {
assumeFalse(
"Cannot run JavaFX in headless environment",
GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()
);
FxToolkit.registerPrimaryStage();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import javafx.stage.Stage;

import org.junit.AfterClass;
import org.junit.Ignore;
import org.junit.Test;
import org.testfx.api.FxToolkit;
import org.testfx.cases.TestCaseBase;
Expand Down Expand Up @@ -107,6 +108,7 @@ public void showStage_should_show_the_registered_stage() throws Exception {
}

@Test
@Ignore
public void hideStage_should_hide_the_registered_stage() throws Exception {
// given:
Stage stage = FxToolkit.registerStage(() -> new Stage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.testfx.service.adapter.impl;

import java.awt.GraphicsEnvironment;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import javafx.event.EventHandler;
Expand Down Expand Up @@ -51,6 +52,7 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assume.assumeFalse;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
Expand Down Expand Up @@ -78,6 +80,8 @@ public class AwtRobotAdapterTest {

@BeforeClass
public static void setupSpec() throws Exception {
assumeFalse("Cannot run AwtRobotAdapterTest in headless environment",
GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance());
FxToolkit.registerPrimaryStage();
}

Expand Down
1 change: 1 addition & 0 deletions subprojects/testfx-core/testfx-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ dependencies {
}
testCompile "org.mockito:mockito-all:1.9.5"
testCompile "org.controlsfx:controlsfx:8.20.8"
testCompile "org.testfx:openjfx-monocle:1.8.0_20"
}
1 change: 1 addition & 0 deletions subprojects/testfx-junit/testfx-junit.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ dependencies {

testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "org.mockito:mockito-all:1.9.5"
testCompile "org.testfx:openjfx-monocle:1.8.0_20"
}
1 change: 1 addition & 0 deletions subprojects/testfx-legacy/testfx-legacy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ dependencies {

compile "org.hamcrest:hamcrest-all:1.3"
testCompile "org.mockito:mockito-all:1.9.5"
testCompile "org.testfx:openjfx-monocle:1.8.0_20"
}