Skip to content

Commit

Permalink
Restores execution of JavaFX tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Jun 14, 2020
1 parent b20eccd commit d09142e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 32 deletions.
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,22 @@
</build>

<profiles>
<profile>
<id>enables-javafx-tests-for-jdk11-and-up</id>
<activation>
<jdk>[11,)</jdk>
</activation>

<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>14.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>

<profile>
<id>adds-module-checks-and-linting-for-java9-and-up</id>
<activation>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
package nl.jqno.equalsverifier.integration.extended_contract;

import static org.junit.Assume.*;

import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.testhelpers.StringCompilerTestBase;
import org.junit.Before;
import org.junit.Test;

// CHECKSTYLE OFF: DeclarationOrder

public class JavaFxClassesTest extends StringCompilerTestBase {
@Before
public void setup() {
assumeTrue(isJavaFxAvailable());
}

@Test
public void successfullyInstantiatesAJavaFxClass_whenJavaFxIsAvailable() {
if (!isJavaFxAvailable()) {
return;
}

Class<?> javafxClass = compile(JAVAFX_CLASS_NAME, JAVAFX_CLASS);
EqualsVerifier.forClass(javafxClass).verify();
}

@Test
public void succeed_whenEqualsLooksAtObservableListFieldsGenericContent() {
if (!isJavaFxAvailable()) {
return;
}

Class<?> type =
compile(
JAVAFX_OBSERVABLELIST_CONTAINER_CLASS_NAME,
Expand All @@ -32,10 +30,6 @@ public void succeed_whenEqualsLooksAtObservableListFieldsGenericContent() {

@Test
public void succeed_whenEqualsLooksAtObservableMapFieldsGenericContent() {
if (!isJavaFxAvailable()) {
return;
}

Class<?> type =
compile(
JAVAFX_OBSERVABLEMAP_CONTAINER_CLASS_NAME,
Expand All @@ -45,10 +39,6 @@ public void succeed_whenEqualsLooksAtObservableMapFieldsGenericContent() {

@Test
public void succeed_whenEqualsLooksAtObservableSetFieldsGenericContent() {
if (!isJavaFxAvailable()) {
return;
}

Class<?> type =
compile(
JAVAFX_OBSERVABLESET_CONTAINER_CLASS_NAME,
Expand All @@ -58,10 +48,6 @@ public void succeed_whenEqualsLooksAtObservableSetFieldsGenericContent() {

@Test
public void succeed_whenEqualsLooksAtListPropertyFieldsGenericContent() {
if (!isJavaFxAvailable()) {
return;
}

Class<?> type =
compile(
JAVAFX_LISTPROPERTY_CONTAINER_CLASS_NAME,
Expand All @@ -71,10 +57,6 @@ public void succeed_whenEqualsLooksAtListPropertyFieldsGenericContent() {

@Test
public void succeed_whenEqualsLooksAtMapPropertyFieldsGenericContent() {
if (!isJavaFxAvailable()) {
return;
}

Class<?> type =
compile(
JAVAFX_MAPPROPERTY_CONTAINER_CLASS_NAME,
Expand All @@ -84,10 +66,6 @@ public void succeed_whenEqualsLooksAtMapPropertyFieldsGenericContent() {

@Test
public void succeed_whenEqualsLooksAtSetPropertyFieldsGenericContent() {
if (!isJavaFxAvailable()) {
return;
}

Class<?> type =
compile(
JAVAFX_SETPROPERTY_CONTAINER_CLASS_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class RecordsTest extends StringCompilerTestBase {

@Before
public void setup() {
assumeTrue(determineIsRecordsAvailable());
assumeTrue(isRecordsAvailable());
}

@Test
Expand Down Expand Up @@ -101,7 +101,7 @@ public void fail_whenRecordAccessorThrowsNpe() {
EqualsVerifier.forClass(type).verify();
}

public boolean determineIsRecordsAvailable() {
public boolean isRecordsAvailable() {
if (!isTypeAvailable("java.lang.Record")) {
return false;
}
Expand Down

0 comments on commit d09142e

Please sign in to comment.