From 93517ab9fbed527295c59503cc6085480377b516 Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 3 Jun 2021 08:36:23 +0200 Subject: [PATCH] Disable Native tests for module 022 because #quarkus/17653 Adding external properties on Native make the app fail to start. Reported by https://github.com/quarkusio/quarkus/issues/17653 sd --- 022-quarkus-properties-config-all/pom.xml | 5 +++++ .../qe/providers/CustomConfigSource.java | 19 ++++++++----------- .../qe/bulk/NativeBulkOfPropertiesIT.java | 3 +++ .../quarkus/qe/bulk/NativeConfigValueIT.java | 3 +++ .../VariousConfigurationSourcesTestIT.java | 3 +++ .../NativeConfigMappingResourceIT.java | 3 +++ 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/022-quarkus-properties-config-all/pom.xml b/022-quarkus-properties-config-all/pom.xml index 3ef18f5c..fba4622e 100644 --- a/022-quarkus-properties-config-all/pom.xml +++ b/022-quarkus-properties-config-all/pom.xml @@ -20,6 +20,11 @@ native + + + native + + native -H:ResourceConfigurationFiles=resources-config.json diff --git a/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/providers/CustomConfigSource.java b/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/providers/CustomConfigSource.java index 44d74eb7..b74683e4 100644 --- a/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/providers/CustomConfigSource.java +++ b/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/providers/CustomConfigSource.java @@ -1,6 +1,7 @@ package io.quarkus.qe.providers; import java.io.FileNotFoundException; +import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.Set; @@ -15,7 +16,7 @@ public class CustomConfigSource implements ConfigSource { private final Properties customProperties = new Properties(); - public CustomConfigSource() { + public CustomConfigSource() throws IOException { loadProperties(); } @@ -39,16 +40,12 @@ public String getName() { return "Custom Config Source"; } - public void loadProperties() { - try { - InputStream in = CustomConfigSource.class.getResourceAsStream(PROPERTIES_FILE); - if (in != null) { - customProperties.load(in); - } else { - throw new FileNotFoundException("Property file " + PROPERTIES_FILE + " not found in the classpath"); - } - } catch (Exception e) { - e.printStackTrace(); + public void loadProperties() throws IOException { + InputStream in = CustomConfigSource.class.getResourceAsStream(PROPERTIES_FILE); + if (in != null) { + customProperties.load(in); + } else { + throw new FileNotFoundException("Property file " + PROPERTIES_FILE + " not found in the classpath"); } } } diff --git a/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/bulk/NativeBulkOfPropertiesIT.java b/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/bulk/NativeBulkOfPropertiesIT.java index 44963b50..270bc1f3 100644 --- a/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/bulk/NativeBulkOfPropertiesIT.java +++ b/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/bulk/NativeBulkOfPropertiesIT.java @@ -1,7 +1,10 @@ package io.quarkus.qe.bulk; +import org.junit.jupiter.api.Disabled; + import io.quarkus.test.junit.NativeImageTest; +@Disabled("TODO: Can't add configsource.properties because of https://github.com/quarkusio/quarkus/issues/17653") @NativeImageTest public class NativeBulkOfPropertiesIT extends BulkOfPropertiesTest { diff --git a/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/bulk/NativeConfigValueIT.java b/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/bulk/NativeConfigValueIT.java index a86871ab..ae03ddc7 100644 --- a/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/bulk/NativeConfigValueIT.java +++ b/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/bulk/NativeConfigValueIT.java @@ -1,7 +1,10 @@ package io.quarkus.qe.bulk; +import org.junit.jupiter.api.Disabled; + import io.quarkus.test.junit.NativeImageTest; +@Disabled("TODO: Can't add configsource.properties because of https://github.com/quarkusio/quarkus/issues/17653") @NativeImageTest public class NativeConfigValueIT extends ConfigValueTest { diff --git a/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/config/VariousConfigurationSourcesTestIT.java b/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/config/VariousConfigurationSourcesTestIT.java index 5bd3eea5..bd8dc139 100644 --- a/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/config/VariousConfigurationSourcesTestIT.java +++ b/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/config/VariousConfigurationSourcesTestIT.java @@ -1,7 +1,10 @@ package io.quarkus.qe.config; +import org.junit.jupiter.api.Disabled; + import io.quarkus.test.junit.NativeImageTest; +@Disabled("TODO: Can't add configsource.properties because of https://github.com/quarkusio/quarkus/issues/17653") @NativeImageTest public class VariousConfigurationSourcesTestIT extends VariousConfigurationSourcesTest { diff --git a/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/configmapping/NativeConfigMappingResourceIT.java b/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/configmapping/NativeConfigMappingResourceIT.java index a93bb357..5e0840e7 100644 --- a/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/configmapping/NativeConfigMappingResourceIT.java +++ b/022-quarkus-properties-config-all/src/test/java/io/quarkus/qe/configmapping/NativeConfigMappingResourceIT.java @@ -1,7 +1,10 @@ package io.quarkus.qe.configmapping; +import org.junit.jupiter.api.Disabled; + import io.quarkus.test.junit.NativeImageTest; +@Disabled("TODO: Can't add configsource.properties because of https://github.com/quarkusio/quarkus/issues/17653") @NativeImageTest public class NativeConfigMappingResourceIT extends ConfigMappingResourceTest { }