Merge branch 'stable-5.12'
* stable-5.12:
[releng] Force --release and use BREE to run tests
Change-Id: I6712a5cd4047e056782efede178e3bec1d9284c6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/AllHeadlessTests.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/AllHeadlessTests.java
index 9d2a692..b3f7a11 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/AllHeadlessTests.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/AllHeadlessTests.java
@@ -25,6 +25,7 @@
@SuiteClasses({ ApplicationTest.class, //
AuthorizationTest.class, //
BlobTest.class, //
+ BreeSmokeTest.class, //
CollaboratorServiceTest.class, //
CommentTest.class, //
CommitCommentPayloadTest.class, //
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/BreeSmokeTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/BreeSmokeTest.java
new file mode 100644
index 0000000..ebf3357
--- /dev/null
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/BreeSmokeTest.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (C) 2021 Thomas Wolf <thomas.wolf@paranor.ch>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.egit.github.core.tests;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
+import org.junit.Test;
+
+/**
+ * Simple test to guard against build setup errors such as --release not being
+ * effective.
+ */
+public class BreeSmokeTest {
+
+ @Test
+ public void testByteBuffer() {
+ // This test will fail if compiled against a Java 11 library without
+ // --release 8 and then run on a Java 8 JVM with Java 8 libraries
+ ByteBuffer buffer = ByteBuffer.allocate(10);
+ Buffer flipped = buffer.flip();
+ assertNotNull(flipped);
+ }
+}
diff --git a/pom.xml b/pom.xml
index dd0763c..64c1738 100644
--- a/pom.xml
+++ b/pom.xml
@@ -67,6 +67,24 @@
<profiles>
<profile>
+ <id>compile-jdk-newer-than-8</id>
+ <!-- The release argument is allowed only if the Java version used to run maven is > 1.8 -->
+ <activation>
+ <jdk>[9,]</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <configuration>
+ <release>8</release>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>platform-oxygen</id>
<activation>
<property>
@@ -437,6 +455,7 @@
<version>${tycho-version}</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
+ <useJDK>BREE</useJDK>
</configuration>
</plugin>
<plugin>