Skip to content

Commit

Permalink
Ensure forward compatibility by executing the tests with Java 17 & 21
Browse files Browse the repository at this point in the history
Note that the goal is not to require Java 21, just to make sure that
WindowBuilder that it can be executed with the current LTS.

Some of the beans test have to be adjusted, because Java 21 introduces
new "first" and "last" properties for sequenced collections.
  • Loading branch information
ptziegler committed Oct 20, 2023
1 parent 7b5f89a commit 48a13a7
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
java: [ 17 ]
java: [ 17, 21 ]
runs-on: ${{ matrix.os }}
name: OS ${{ matrix.os }} Java ${{ matrix.java }} compile
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
- name: Set up JDK 17/21
uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,12 @@ public void test_children_properties() throws Exception {
//
List<IObserveInfo> listProperties =
observes.get(2).getChildren(ChildrenContext.ChildrenForPropertiesTable);
assertEquals(3, listProperties.size());

if (Runtime.version().feature() >= 21) {
assertEquals(5, listProperties.size());
} else {
assertEquals(3, listProperties.size());
}
//
assertBindable(
CollectionPropertyBindableInfo.class,
Expand All @@ -235,6 +240,22 @@ public void test_children_properties() throws Exception {
false,
"empty|\"empty\"|boolean",
listProperties.get(2));
//
if (Runtime.version().feature() >= 21) {
assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
true,
"first|\"first\"|java.lang.Object",
listProperties.get(3));
//
assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
true,
"last|\"last\"|java.lang.Object",
listProperties.get(4));
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,48 +177,69 @@ public void test_direct() throws Exception {
//
List<IObserveInfo> listProperties =
observes.get(2).getChildren(ChildrenContext.ChildrenForPropertiesTable);
assertEquals(6, listProperties.size());
if (Runtime.version().feature() >= 21) {
assertEquals(8, listProperties.size());
} else {
assertEquals(6, listProperties.size());
}
//
int index = 0;
BeanBindableTest.assertBindable(
DirectPropertyBindableInfo.class,
null,
false,
"Object as IObservableList||org.eclipse.core.databinding.observable.list.IObservableList",
listProperties.get(0));
listProperties.get(index++));
//
BeanBindableTest.assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
false,
"disposed|\"disposed\"|boolean",
listProperties.get(1));
listProperties.get(index++));
BeanBindableTest.assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
true,
"elementType|\"elementType\"|java.lang.Object",
listProperties.get(2));
listProperties.get(index++));
//
BeanBindableTest.assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
false,
"empty|\"empty\"|boolean",
listProperties.get(3));
listProperties.get(index++));
//
if (Runtime.version().feature() >= 21) {
BeanBindableTest.assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
true,
"first|\"first\"|java.lang.Object",
listProperties.get(index++));
//
BeanBindableTest.assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
true,
"last|\"last\"|java.lang.Object",
listProperties.get(index++));
}
//
BeanBindableTest.assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
true,
"realm|\"realm\"|org.eclipse.core.databinding.observable.Realm",
listProperties.get(4));
listProperties.get(index++));
//
BeanBindableTest.assertBindable(
BeanPropertyDescriptorBindableInfo.class,
null,
false,
"stale|\"stale\"|boolean",
listProperties.get(5));
listProperties.get(index++));
// ----------------------------------------------
BeanBindableTest.assertBindable(
FieldBeanBindableInfo.class,
Expand Down

0 comments on commit 48a13a7

Please sign in to comment.