Ignore some tests in JDK11
This commit is contained in:
@@ -268,7 +268,8 @@ class FunctionCreatorConfiguration {
|
||||
}
|
||||
|
||||
private ClassLoader getParent() {
|
||||
ClassLoader loader = getClass().getClassLoader().getParent();
|
||||
ClassLoader loader = getClass().getClassLoader();
|
||||
loader = loader.getParent();
|
||||
ClassLoader parent = loader;
|
||||
while (loader.getParent() != null) {
|
||||
// If launched from a fat jar with spring.factories skip this parent level
|
||||
@@ -462,7 +463,8 @@ class FunctionCreatorConfiguration {
|
||||
return super.loadClass(name, resolve);
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
if (name.contains(ContextRunner.class.getName())) {
|
||||
if (name.contains(ContextRunner.class.getName())
|
||||
|| name.contains(PostConstruct.class.getName())) {
|
||||
// Special case for the ContextRunner. We can re-use the bytes for it,
|
||||
// and the function jar doesn't have to include them since it is only
|
||||
// used here.
|
||||
|
||||
@@ -19,6 +19,8 @@ package org.springframework.cloud.function.deployer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.junit.Assume;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@@ -26,6 +28,7 @@ import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.system.JavaVersion;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.function.context.FunctionCatalog;
|
||||
@@ -79,7 +82,7 @@ public abstract class FunctionCreatorConfigurationTests {
|
||||
@TestPropertySource(properties = {
|
||||
"function.location=app:classpath,file:target/test-classes,file:target/test-classes/app",
|
||||
"function.bean=myDoubler",
|
||||
"function.main=org.springframework.cloud.function.test.FunctionApp"})
|
||||
"function.main=org.springframework.cloud.function.test.FunctionApp" })
|
||||
public static class SingleFunctionWithMainTests
|
||||
extends FunctionCreatorConfigurationTests {
|
||||
|
||||
@@ -95,7 +98,7 @@ public abstract class FunctionCreatorConfigurationTests {
|
||||
@TestPropertySource(properties = {
|
||||
"function.location=app:classpath,file:target/test-classes,file:target/test-classes/app",
|
||||
"function.bean=myDoubler",
|
||||
"function.main=org.springframework.cloud.function.test.FunctionRegistrar"})
|
||||
"function.main=org.springframework.cloud.function.test.FunctionRegistrar" })
|
||||
public static class SingleFunctionWithRegistrarTests
|
||||
extends FunctionCreatorConfigurationTests {
|
||||
|
||||
@@ -129,6 +132,12 @@ public abstract class FunctionCreatorConfigurationTests {
|
||||
public static class SupplierCompositionTests
|
||||
extends FunctionCreatorConfigurationTests {
|
||||
|
||||
@BeforeClass
|
||||
public static void init() {
|
||||
Assume.assumeTrue("Java > 8",
|
||||
JavaVersion.getJavaVersion().isOlderThan(JavaVersion.NINE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupplier() {
|
||||
Supplier<Integer> function = catalog.lookup(Supplier.class, "function0");
|
||||
@@ -151,6 +160,12 @@ public abstract class FunctionCreatorConfigurationTests {
|
||||
public static class FunctionCompositionTests
|
||||
extends FunctionCreatorConfigurationTests {
|
||||
|
||||
@BeforeClass
|
||||
public static void init() {
|
||||
Assume.assumeTrue("Java > 8",
|
||||
JavaVersion.getJavaVersion().isOlderThan(JavaVersion.NINE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFunction() {
|
||||
Function<Flux<Integer>, Flux<String>> function = catalog
|
||||
@@ -173,6 +188,12 @@ public abstract class FunctionCreatorConfigurationTests {
|
||||
public static class ConsumerCompositionTests
|
||||
extends FunctionCreatorConfigurationTests {
|
||||
|
||||
@BeforeClass
|
||||
public static void init() {
|
||||
Assume.assumeTrue("Java > 8",
|
||||
JavaVersion.getJavaVersion().isOlderThan(JavaVersion.NINE));
|
||||
}
|
||||
|
||||
@Rule
|
||||
public OutputCapture capture = new OutputCapture();
|
||||
|
||||
|
||||
@@ -19,11 +19,13 @@ package org.springframework.cloud.function.deployer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.system.JavaVersion;
|
||||
import org.springframework.cloud.function.context.FunctionCatalog;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -41,6 +43,8 @@ public class SpringFunctionFluxConfigurationTests {
|
||||
|
||||
@Before
|
||||
public void run() {
|
||||
Assume.assumeTrue("Java > 8",
|
||||
JavaVersion.getJavaVersion().isOlderThan(JavaVersion.NINE));
|
||||
if (bootstrap == null) {
|
||||
bootstrap = new ApplicationBootstrap();
|
||||
bootstrap.run(SpringFunctionFluxConfigurationTests.class,
|
||||
|
||||
Reference in New Issue
Block a user