mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 08:41:22 +00:00
Merge pull request #5596 from gastaldi/remove_substrate_test
Removes deprecated code
This commit is contained in:
@@ -30,14 +30,6 @@ public final class ArchiveRootBuildItem extends SimpleBuildItem {
|
||||
this.excludedFromIndexing = excludedFromIndexing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated in favor of getArchiveLocation()
|
||||
*/
|
||||
@Deprecated
|
||||
public Path getPath() {
|
||||
return getArchiveLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
* If this archive is a jar file it will return the path to the jar file on the file system,
|
||||
* otherwise it will return the directory that this corresponds to.
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package io.quarkus.deployment.builditem;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link NativeImageEnableAllCharsetsBuildItem} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public final class NativeEnableAllCharsetsBuildItem extends MultiBuildItem {
|
||||
|
||||
}
|
||||
@@ -1,207 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.quarkus.deployment.annotations.BuildProducer;
|
||||
import io.quarkus.deployment.annotations.BuildStep;
|
||||
import io.quarkus.deployment.builditem.NativeEnableAllCharsetsBuildItem;
|
||||
import io.quarkus.deployment.builditem.NativeImageEnableAllCharsetsBuildItem;
|
||||
import io.quarkus.deployment.builditem.nativeimage.NativeImageConfigBuildItem;
|
||||
import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
|
||||
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
|
||||
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
|
||||
import io.quarkus.deployment.builditem.nativeimage.NativeImageSystemPropertyBuildItem;
|
||||
|
||||
/**
|
||||
* @deprecated This class is temporarily used to convert classes from the {@link io.quarkus.deployment.builditem.substrate}
|
||||
* package into classes from the {@link io.quarkus.deployment.builditem.nativeimage} package.
|
||||
*/
|
||||
@Deprecated
|
||||
public class DeprecatedBuildItemProcessor {
|
||||
|
||||
@BuildStep
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem> reflectiveClasses(
|
||||
List<ReflectiveClassBuildItem> oldClasses) {
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem> newClasses = new ArrayList<>();
|
||||
for (ReflectiveClassBuildItem oldClass : oldClasses) {
|
||||
String[] classNames = oldClass.getClassNames().toArray(new String[oldClass.getClassNames().size()]);
|
||||
if (oldClass.isWeak()) {
|
||||
newClasses.add(io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem.weakClass(classNames));
|
||||
} else {
|
||||
io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem.Builder builder = io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem
|
||||
.builder(classNames)
|
||||
.constructors(oldClass.isConstructors())
|
||||
.methods(oldClass.isMethods())
|
||||
.fields(oldClass.isFields())
|
||||
.finalFieldsWritable(oldClass.areFinalFieldsWritable());
|
||||
newClasses.add(builder.build());
|
||||
}
|
||||
}
|
||||
return newClasses;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveFieldBuildItem> reflectiveFields(
|
||||
List<ReflectiveFieldBuildItem> oldFields) {
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveFieldBuildItem> newFields = new ArrayList<>();
|
||||
for (ReflectiveFieldBuildItem oldField : oldFields) {
|
||||
if (oldField.getFieldInfo() != null) {
|
||||
newFields
|
||||
.add(new io.quarkus.deployment.builditem.nativeimage.ReflectiveFieldBuildItem(oldField.getFieldInfo()));
|
||||
} else if (oldField.getField() != null) {
|
||||
newFields.add(new io.quarkus.deployment.builditem.nativeimage.ReflectiveFieldBuildItem(oldField.getField()));
|
||||
} else {
|
||||
throw new RuntimeException(
|
||||
"Deprecated " + ReflectiveFieldBuildItem.class.getSimpleName() + " conversion failed");
|
||||
}
|
||||
}
|
||||
return newFields;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem> reflectiveHierarchy(
|
||||
List<ReflectiveHierarchyBuildItem> oldHierarchies) {
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem> newHierarchies = new ArrayList<>();
|
||||
for (ReflectiveHierarchyBuildItem oldHierarchy : oldHierarchies) {
|
||||
newHierarchies.add(new io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem(
|
||||
oldHierarchy.getType(), oldHierarchy.getIndex()));
|
||||
}
|
||||
return newHierarchies;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem> reflectiveHierarchyIgnoreWarning(
|
||||
List<ReflectiveHierarchyIgnoreWarningBuildItem> oldHierarchies) {
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem> newHierarchies = new ArrayList<>();
|
||||
for (ReflectiveHierarchyIgnoreWarningBuildItem oldHierarchy : oldHierarchies) {
|
||||
newHierarchies.add(new io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem(
|
||||
oldHierarchy.getDotName()));
|
||||
}
|
||||
return newHierarchies;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem> reflectiveMethods(
|
||||
List<ReflectiveMethodBuildItem> oldMethods) {
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem> newMethods = new ArrayList<>();
|
||||
for (ReflectiveMethodBuildItem oldMethod : oldMethods) {
|
||||
if (oldMethod.getMethodInfo() != null) {
|
||||
newMethods.add(
|
||||
new io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem(oldMethod.getMethodInfo()));
|
||||
} else if (oldMethod.getMethod() != null) {
|
||||
newMethods
|
||||
.add(new io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem(oldMethod.getMethod()));
|
||||
} else {
|
||||
throw new RuntimeException(
|
||||
"Deprecated " + ReflectiveMethodBuildItem.class.getSimpleName() + " conversion failed");
|
||||
}
|
||||
}
|
||||
return newMethods;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem> runtimeInitializedClass(
|
||||
List<RuntimeInitializedClassBuildItem> oldClasses) {
|
||||
List<io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem> newClasses = new ArrayList<>();
|
||||
for (RuntimeInitializedClassBuildItem oldClass : oldClasses) {
|
||||
newClasses.add(
|
||||
new io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem(oldClass.getClassName()));
|
||||
}
|
||||
return newClasses;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem> runtimeReinitializedClass(
|
||||
List<RuntimeReinitializedClassBuildItem> oldClasses) {
|
||||
List<io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem> newClasses = new ArrayList<>();
|
||||
for (RuntimeReinitializedClassBuildItem oldClass : oldClasses) {
|
||||
newClasses.add(new io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem(
|
||||
oldClass.getClassName()));
|
||||
}
|
||||
return newClasses;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem> serviceProviders(
|
||||
List<ServiceProviderBuildItem> oldProviders) {
|
||||
List<io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem> newProviders = new ArrayList<>();
|
||||
for (ServiceProviderBuildItem oldProvider : oldProviders) {
|
||||
newProviders.add(new io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem(
|
||||
oldProvider.getServiceInterface(), oldProvider.providers()));
|
||||
}
|
||||
return newProviders;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<NativeImageConfigBuildItem> substrateConfigs(List<SubstrateConfigBuildItem> oldConfigs) {
|
||||
List<NativeImageConfigBuildItem> newConfigs = new ArrayList<>();
|
||||
for (SubstrateConfigBuildItem oldConfig : oldConfigs) {
|
||||
NativeImageConfigBuildItem.Builder builder = NativeImageConfigBuildItem.builder();
|
||||
for (String clazz : oldConfig.getRuntimeInitializedClasses()) {
|
||||
builder.addRuntimeInitializedClass(clazz);
|
||||
}
|
||||
for (String clazz : oldConfig.getRuntimeReinitializedClasses()) {
|
||||
builder.addRuntimeReinitializedClass(clazz);
|
||||
}
|
||||
for (String bundle : oldConfig.getResourceBundles()) {
|
||||
builder.addResourceBundle(bundle);
|
||||
}
|
||||
for (List<String> definition : oldConfig.getProxyDefinitions()) {
|
||||
builder.addProxyClassDefinition(definition.toArray(new String[definition.size()]));
|
||||
}
|
||||
for (Map.Entry<String, String> prop : oldConfig.getNativeImageSystemProperties().entrySet()) {
|
||||
builder.addNativeImageSystemProperty(prop.getKey(), prop.getValue());
|
||||
}
|
||||
newConfigs.add(builder.build());
|
||||
}
|
||||
return newConfigs;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<NativeImageProxyDefinitionBuildItem> substrateProxyDefinitions(
|
||||
List<SubstrateProxyDefinitionBuildItem> oldDefinitions) {
|
||||
List<NativeImageProxyDefinitionBuildItem> newDefinitions = new ArrayList<>();
|
||||
for (SubstrateProxyDefinitionBuildItem oldDefinition : oldDefinitions) {
|
||||
newDefinitions.add(new NativeImageProxyDefinitionBuildItem(oldDefinition.getClasses()));
|
||||
}
|
||||
return newDefinitions;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<NativeImageResourceBuildItem> substrateResources(List<SubstrateResourceBuildItem> oldResources) {
|
||||
List<NativeImageResourceBuildItem> newResources = new ArrayList<>();
|
||||
for (SubstrateResourceBuildItem oldResource : oldResources) {
|
||||
newResources.add(new NativeImageResourceBuildItem(oldResource.getResources()));
|
||||
}
|
||||
return newResources;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<NativeImageResourceBundleBuildItem> substrateResourceBundles(List<SubstrateResourceBundleBuildItem> oldBundles) {
|
||||
List<NativeImageResourceBundleBuildItem> newBundles = new ArrayList<>();
|
||||
for (SubstrateResourceBundleBuildItem oldBundle : oldBundles) {
|
||||
newBundles.add(new NativeImageResourceBundleBuildItem(oldBundle.getBundleName()));
|
||||
}
|
||||
return newBundles;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
List<NativeImageSystemPropertyBuildItem> substrateSystemProperties(List<SubstrateSystemPropertyBuildItem> oldProps) {
|
||||
List<NativeImageSystemPropertyBuildItem> newProps = new ArrayList<>();
|
||||
for (SubstrateSystemPropertyBuildItem oldProp : oldProps) {
|
||||
newProps.add(new NativeImageSystemPropertyBuildItem(oldProp.getKey(), oldProp.getValue()));
|
||||
}
|
||||
return newProps;
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
void enableAllCharsets(
|
||||
List<NativeEnableAllCharsetsBuildItem> oldProps,
|
||||
BuildProducer<NativeImageEnableAllCharsetsBuildItem> newProps) {
|
||||
if (!oldProps.isEmpty()) {
|
||||
newProps.produce(new NativeImageEnableAllCharsetsBuildItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import static java.util.Arrays.stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* Used to register a class for reflection in substrate
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem ReflectiveClassBuildItem}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class ReflectiveClassBuildItem extends MultiBuildItem {
|
||||
|
||||
private final List<String> className;
|
||||
private final boolean methods;
|
||||
private final boolean fields;
|
||||
private final boolean constructors;
|
||||
private final boolean finalFieldsWritable;
|
||||
private final boolean weak;
|
||||
|
||||
public ReflectiveClassBuildItem(boolean methods, boolean fields, Class<?>... className) {
|
||||
this(true, methods, fields, className);
|
||||
}
|
||||
|
||||
public ReflectiveClassBuildItem(boolean constructors, boolean methods, boolean fields, Class<?>... className) {
|
||||
this(constructors, methods, fields, false, false, className);
|
||||
}
|
||||
|
||||
private ReflectiveClassBuildItem(boolean constructors, boolean methods, boolean fields, boolean finalFieldsWritable,
|
||||
boolean weak, Class<?>... className) {
|
||||
List<String> names = new ArrayList<>();
|
||||
for (Class<?> i : className) {
|
||||
if (i == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
names.add(i.getName());
|
||||
}
|
||||
this.className = names;
|
||||
this.methods = methods;
|
||||
this.fields = fields;
|
||||
this.constructors = constructors;
|
||||
this.finalFieldsWritable = finalFieldsWritable;
|
||||
this.weak = weak;
|
||||
}
|
||||
|
||||
public ReflectiveClassBuildItem(boolean methods, boolean fields, String... className) {
|
||||
this(true, methods, fields, className);
|
||||
}
|
||||
|
||||
public ReflectiveClassBuildItem(boolean constructors, boolean methods, boolean fields, String... className) {
|
||||
this(constructors, methods, fields, false, false, className);
|
||||
}
|
||||
|
||||
public static ReflectiveClassBuildItem weakClass(String... className) {
|
||||
return new ReflectiveClassBuildItem(true, true, true, false, true, className);
|
||||
}
|
||||
|
||||
private ReflectiveClassBuildItem(boolean constructors, boolean methods, boolean fields, boolean finalFieldsWritable,
|
||||
boolean weak, String... className) {
|
||||
for (String i : className) {
|
||||
if (i == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
}
|
||||
this.className = Arrays.asList(className);
|
||||
this.methods = methods;
|
||||
this.fields = fields;
|
||||
this.constructors = constructors;
|
||||
this.finalFieldsWritable = finalFieldsWritable;
|
||||
this.weak = weak;
|
||||
}
|
||||
|
||||
public List<String> getClassNames() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public boolean isMethods() {
|
||||
return methods;
|
||||
}
|
||||
|
||||
public boolean isFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public boolean isConstructors() {
|
||||
return constructors;
|
||||
}
|
||||
|
||||
public boolean areFinalFieldsWritable() {
|
||||
return finalFieldsWritable;
|
||||
}
|
||||
|
||||
public boolean isWeak() {
|
||||
return weak;
|
||||
}
|
||||
|
||||
public static Builder builder(Class<?>... className) {
|
||||
String[] classNameStrings = stream(className)
|
||||
.map(aClass -> {
|
||||
if (aClass == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
return aClass.getName();
|
||||
})
|
||||
.toArray(String[]::new);
|
||||
|
||||
return new Builder()
|
||||
.className(classNameStrings);
|
||||
}
|
||||
|
||||
public static Builder builder(String... className) {
|
||||
return new Builder()
|
||||
.className(className);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private String[] className;
|
||||
private boolean constructors = true;
|
||||
private boolean methods;
|
||||
private boolean fields;
|
||||
private boolean finalFieldsWritable;
|
||||
|
||||
private Builder() {
|
||||
}
|
||||
|
||||
public Builder className(String[] className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder constructors(boolean constructors) {
|
||||
this.constructors = constructors;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder methods(boolean methods) {
|
||||
this.methods = methods;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder fields(boolean fields) {
|
||||
this.fields = fields;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder finalFieldsWritable(boolean finalFieldsWritable) {
|
||||
this.finalFieldsWritable = finalFieldsWritable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReflectiveClassBuildItem build() {
|
||||
return new ReflectiveClassBuildItem(constructors, methods, fields, finalFieldsWritable, false, className);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import org.jboss.jandex.FieldInfo;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.ReflectiveFieldBuildItem ReflectiveFieldBuildItem}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class ReflectiveFieldBuildItem extends MultiBuildItem {
|
||||
|
||||
final String declaringClass;
|
||||
final String name;
|
||||
private final FieldInfo fieldInfo;
|
||||
private final Field field;
|
||||
|
||||
public ReflectiveFieldBuildItem(FieldInfo field) {
|
||||
this.name = field.name();
|
||||
this.declaringClass = field.declaringClass().name().toString();
|
||||
this.fieldInfo = field;
|
||||
this.field = null;
|
||||
}
|
||||
|
||||
public ReflectiveFieldBuildItem(Field field) {
|
||||
this.name = field.getName();
|
||||
this.declaringClass = field.getDeclaringClass().getName();
|
||||
this.fieldInfo = null;
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public String getDeclaringClass() {
|
||||
return declaringClass;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public FieldInfo getFieldInfo() {
|
||||
return fieldInfo;
|
||||
}
|
||||
|
||||
public Field getField() {
|
||||
return field;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import org.jboss.jandex.IndexView;
|
||||
import org.jboss.jandex.Type;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* Attempts to register a complete type hierarchy for reflection.
|
||||
* <p>
|
||||
* This is intended to be used to register types that are going to be serialized,
|
||||
* e.g. by Jackson or some other JSON mapper.
|
||||
* <p>
|
||||
* This will do 'smart discovery' and in addition to registering the type itself it will also attempt to
|
||||
* register the following:
|
||||
* <p>
|
||||
* - Superclasses
|
||||
* - Component types of collections
|
||||
* - Types used in bean properties if (if method reflection is enabled)
|
||||
* - Field types (if field reflection is enabled)
|
||||
* <p>
|
||||
* This discovery is applied recursively, so any additional types that are registered will also have their dependencies
|
||||
* discovered
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem ReflectiveHierarchyBuildItem}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class ReflectiveHierarchyBuildItem extends MultiBuildItem {
|
||||
|
||||
private final Type type;
|
||||
private IndexView index;
|
||||
|
||||
public ReflectiveHierarchyBuildItem(Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public ReflectiveHierarchyBuildItem(Type type, IndexView index) {
|
||||
this.type = type;
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public IndexView getIndex() {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import org.jboss.jandex.DotName;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* Used by {@link io.quarkus.deployment.builditem.substrate.ReflectiveHierarchyStep} to ignore reflection warning deliberately
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem
|
||||
* ReflectiveHierarchyIgnoreWarningBuildItem} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class ReflectiveHierarchyIgnoreWarningBuildItem extends MultiBuildItem {
|
||||
|
||||
private final DotName dotName;
|
||||
|
||||
public ReflectiveHierarchyIgnoreWarningBuildItem(DotName dotName) {
|
||||
this.dotName = dotName;
|
||||
}
|
||||
|
||||
public DotName getDotName() {
|
||||
return dotName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.jboss.jandex.MethodInfo;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem ReflectiveMethodBuildItem}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class ReflectiveMethodBuildItem extends MultiBuildItem {
|
||||
|
||||
final String declaringClass;
|
||||
final String name;
|
||||
final String[] params;
|
||||
private final MethodInfo methodInfo;
|
||||
private final Method method;
|
||||
|
||||
public ReflectiveMethodBuildItem(MethodInfo methodInfo) {
|
||||
String[] params = new String[methodInfo.parameters().size()];
|
||||
for (int i = 0; i < params.length; ++i) {
|
||||
params[i] = methodInfo.parameters().get(i).name().toString();
|
||||
}
|
||||
this.name = methodInfo.name();
|
||||
this.params = params;
|
||||
this.declaringClass = methodInfo.declaringClass().name().toString();
|
||||
this.methodInfo = methodInfo;
|
||||
this.method = null;
|
||||
}
|
||||
|
||||
public ReflectiveMethodBuildItem(Method method) {
|
||||
String[] params = new String[method.getParameterTypes().length];
|
||||
for (int i = 0; i < params.length; ++i) {
|
||||
params[i] = method.getParameterTypes()[i].getName();
|
||||
}
|
||||
this.params = params;
|
||||
this.name = method.getName();
|
||||
this.declaringClass = method.getDeclaringClass().getName();
|
||||
this.methodInfo = null;
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String[] getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public String getDeclaringClass() {
|
||||
return declaringClass;
|
||||
}
|
||||
|
||||
public MethodInfo getMethodInfo() {
|
||||
return methodInfo;
|
||||
}
|
||||
|
||||
public Method getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
ReflectiveMethodBuildItem that = (ReflectiveMethodBuildItem) o;
|
||||
return Objects.equals(declaringClass, that.declaringClass) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Arrays.equals(params, that.params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
int result = Objects.hash(declaringClass, name);
|
||||
result = 31 * result + Arrays.hashCode(params);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem
|
||||
* RuntimeInitializedClassBuildItem} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class RuntimeInitializedClassBuildItem extends MultiBuildItem {
|
||||
|
||||
private final String className;
|
||||
|
||||
public RuntimeInitializedClassBuildItem(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* A class that will be reinitialized at runtime by Substrate. This will result in the static
|
||||
* initializer running twice.
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem
|
||||
* RuntimeReinitializedClassBuildItem} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class RuntimeReinitializedClassBuildItem extends MultiBuildItem {
|
||||
|
||||
private final String className;
|
||||
|
||||
public RuntimeReinitializedClassBuildItem(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* Represents a Service Provider registration.
|
||||
* When processed, it embeds the service interface descriptor (META-INF/services/...) and allow reflection (instantiation only)
|
||||
* on a set of provider
|
||||
* classes.
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem ServiceProviderBuildItem}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class ServiceProviderBuildItem extends MultiBuildItem {
|
||||
|
||||
@Deprecated
|
||||
public static final String SPI_ROOT = "META-INF/services/";
|
||||
private final String serviceInterface;
|
||||
private final List<String> providers;
|
||||
|
||||
public ServiceProviderBuildItem(String serviceInterfaceClassName, String... providerClassNames) {
|
||||
this(serviceInterfaceClassName, Arrays.asList(providerClassNames));
|
||||
}
|
||||
|
||||
public ServiceProviderBuildItem(String serviceInterfaceClassName, List<String> providers) {
|
||||
this.serviceInterface = Objects.requireNonNull(serviceInterfaceClassName, "The service interface must not be `null`");
|
||||
this.providers = providers;
|
||||
|
||||
// Validation
|
||||
if (serviceInterface.length() == 0) {
|
||||
throw new IllegalArgumentException("The serviceDescriptorFile interface cannot be blank");
|
||||
}
|
||||
|
||||
providers.forEach(s -> {
|
||||
if (s == null || s.length() == 0) {
|
||||
throw new IllegalArgumentException("The provider class name cannot be null or blank");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public String getServiceInterface() {
|
||||
return serviceInterface;
|
||||
}
|
||||
|
||||
public List<String> providers() {
|
||||
return providers;
|
||||
}
|
||||
|
||||
public String serviceDescriptorFile() {
|
||||
return SPI_ROOT + serviceInterface;
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.NativeImageConfigBuildItem NativeImageConfigBuildItem}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class SubstrateConfigBuildItem extends MultiBuildItem {
|
||||
|
||||
private final Set<String> runtimeInitializedClasses;
|
||||
private final Set<String> runtimeReinitializedClasses;
|
||||
private final Set<String> resourceBundles;
|
||||
private final Set<List<String>> proxyDefinitions;
|
||||
private final Map<String, String> nativeImageSystemProperties;
|
||||
|
||||
public SubstrateConfigBuildItem(Builder builder) {
|
||||
this.runtimeInitializedClasses = Collections.unmodifiableSet(builder.runtimeInitializedClasses);
|
||||
this.runtimeReinitializedClasses = Collections.unmodifiableSet(builder.runtimeReinitializedClasses);
|
||||
this.resourceBundles = Collections.unmodifiableSet(builder.resourceBundles);
|
||||
this.proxyDefinitions = Collections.unmodifiableSet(builder.proxyDefinitions);
|
||||
this.nativeImageSystemProperties = Collections.unmodifiableMap(builder.nativeImageSystemProperties);
|
||||
}
|
||||
|
||||
public Iterable<String> getRuntimeInitializedClasses() {
|
||||
return runtimeInitializedClasses;
|
||||
}
|
||||
|
||||
public Iterable<String> getRuntimeReinitializedClasses() {
|
||||
return runtimeReinitializedClasses;
|
||||
}
|
||||
|
||||
public Iterable<String> getResourceBundles() {
|
||||
return resourceBundles;
|
||||
}
|
||||
|
||||
public Iterable<List<String>> getProxyDefinitions() {
|
||||
return proxyDefinitions;
|
||||
}
|
||||
|
||||
public Map<String, String> getNativeImageSystemProperties() {
|
||||
return nativeImageSystemProperties;
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
final Set<String> runtimeInitializedClasses = new HashSet<>();
|
||||
final Set<String> runtimeReinitializedClasses = new HashSet<>();
|
||||
final Set<String> resourceBundles = new HashSet<>();
|
||||
final Set<List<String>> proxyDefinitions = new HashSet<>();
|
||||
final Map<String, String> nativeImageSystemProperties = new HashMap<>();
|
||||
|
||||
public Builder addRuntimeInitializedClass(String className) {
|
||||
runtimeInitializedClasses.add(className);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder addRuntimeReinitializedClass(String className) {
|
||||
runtimeReinitializedClasses.add(className);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder addResourceBundle(String className) {
|
||||
resourceBundles.add(className);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder addProxyClassDefinition(String... classes) {
|
||||
proxyDefinitions.add(Arrays.asList(classes));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder addNativeImageSystemProperty(String key, String value) {
|
||||
nativeImageSystemProperties.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubstrateConfigBuildItem build() {
|
||||
return new SubstrateConfigBuildItem(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* A build item that represents a {@link java.lang.reflect.Proxy} definition
|
||||
* that will be required on substrate. This definition takes the form of an ordered
|
||||
* list of interfaces that this proxy will implement.
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem
|
||||
* NativeImageProxyDefinitionBuildItem} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class SubstrateProxyDefinitionBuildItem extends MultiBuildItem {
|
||||
|
||||
private final List<String> classes;
|
||||
|
||||
public SubstrateProxyDefinitionBuildItem(String... classes) {
|
||||
this.classes = Arrays.asList(classes);
|
||||
}
|
||||
|
||||
public SubstrateProxyDefinitionBuildItem(List<String> classes) {
|
||||
this.classes = new ArrayList<>(classes);
|
||||
}
|
||||
|
||||
public List<String> getClasses() {
|
||||
return classes;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* A build item that indicates that a static resource should be included in the native image
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem NativeImageResourceBuildItem}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class SubstrateResourceBuildItem extends MultiBuildItem {
|
||||
|
||||
private final List<String> resources;
|
||||
|
||||
public SubstrateResourceBuildItem(String... resources) {
|
||||
this.resources = Arrays.asList(resources);
|
||||
}
|
||||
|
||||
public SubstrateResourceBuildItem(List<String> resources) {
|
||||
this.resources = new ArrayList<>(resources);
|
||||
}
|
||||
|
||||
public List<String> getResources() {
|
||||
return resources;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* Indicates that a resource bundle should be included in the native image
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem
|
||||
* NativeImageResourceBundleBuildItem} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class SubstrateResourceBundleBuildItem extends MultiBuildItem {
|
||||
|
||||
private final String bundleName;
|
||||
|
||||
public SubstrateResourceBundleBuildItem(String bundleName) {
|
||||
this.bundleName = bundleName;
|
||||
}
|
||||
|
||||
public String getBundleName() {
|
||||
return bundleName;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package io.quarkus.deployment.builditem.substrate;
|
||||
|
||||
import io.quarkus.builder.item.MultiBuildItem;
|
||||
|
||||
/**
|
||||
* A system property that will be set at native image build time
|
||||
*
|
||||
* @deprecated Use {@link io.quarkus.deployment.builditem.nativeimage.NativeImageSystemPropertyBuildItem
|
||||
* NativeImageSystemPropertyBuildItem} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class SubstrateSystemPropertyBuildItem extends MultiBuildItem {
|
||||
|
||||
private final String key;
|
||||
private final String value;
|
||||
|
||||
public SubstrateSystemPropertyBuildItem(String key, String value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -257,27 +257,17 @@ public class InfinispanClientProducer {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@io.quarkus.infinispan.client.Remote
|
||||
@io.quarkus.infinispan.client.runtime.Remote
|
||||
@Produces
|
||||
public <K, V> RemoteCache<K, V> getRemoteCache(InjectionPoint injectionPoint, RemoteCacheManager cacheManager) {
|
||||
Set<Annotation> annotationSet = injectionPoint.getQualifiers();
|
||||
|
||||
// Deal with the regular annotation first
|
||||
final io.quarkus.infinispan.client.Remote remote = getRemoteAnnotation(annotationSet);
|
||||
|
||||
if (remote != null && !remote.value().isEmpty()) {
|
||||
return cacheManager.getCache(remote.value());
|
||||
}
|
||||
|
||||
// Then deal with the deprecated one
|
||||
final io.quarkus.infinispan.client.runtime.Remote deprecatedRemote = getDeprecatedRemoteAnnotation(annotationSet);
|
||||
|
||||
if (deprecatedRemote != null && !deprecatedRemote.value().isEmpty()) {
|
||||
return cacheManager.getCache(deprecatedRemote.value());
|
||||
}
|
||||
|
||||
return cacheManager.getCache();
|
||||
}
|
||||
|
||||
@@ -319,19 +309,4 @@ public class InfinispanClientProducer {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the deprecated {@link Remote} annotation instance from the set
|
||||
*
|
||||
* @param annotationSet the annotation set.
|
||||
* @return the {@link Remote} annotation instance or {@code null} if not found.
|
||||
*/
|
||||
private io.quarkus.infinispan.client.runtime.Remote getDeprecatedRemoteAnnotation(Set<Annotation> annotationSet) {
|
||||
for (Annotation annotation : annotationSet) {
|
||||
if (annotation instanceof io.quarkus.infinispan.client.runtime.Remote) {
|
||||
return (io.quarkus.infinispan.client.runtime.Remote) annotation;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package io.quarkus.infinispan.client.runtime;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.enterprise.util.Nonbinding;
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
/**
|
||||
* Qualifier used to specify which remote cache will be injected.
|
||||
*
|
||||
* @author William Burns
|
||||
* @deprecated use {@link io.quarkus.infinispan.client.Remote} instead
|
||||
*/
|
||||
@Target({ METHOD, FIELD, PARAMETER, TYPE })
|
||||
@Retention(RUNTIME)
|
||||
@Documented
|
||||
@Qualifier
|
||||
@Deprecated
|
||||
public @interface Remote {
|
||||
/**
|
||||
* The remote cache name. If no value is provided the default cache is assumed.
|
||||
*/
|
||||
@Nonbinding
|
||||
String value() default "";
|
||||
}
|
||||
@@ -218,24 +218,4 @@ public class Sort {
|
||||
public List<Column> getColumns() {
|
||||
return columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an SQL "order by" clause for the current sort columns and directions.
|
||||
*
|
||||
* @return an SQL "order by" clause for the current sort columns and directions.
|
||||
* @deprecated panache-common should be agnostic from the database implementation
|
||||
*/
|
||||
@Deprecated
|
||||
public String toOrderBy() {
|
||||
StringBuilder sb = new StringBuilder(" ORDER BY ");
|
||||
for (int i = 0; i < columns.size(); i++) {
|
||||
Column column = columns.get(i);
|
||||
if (i > 0)
|
||||
sb.append(" , ");
|
||||
sb.append(column.name);
|
||||
if (column.direction != Direction.Ascending)
|
||||
sb.append(" DESC");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,8 @@ import io.quarkus.runtime.StartupEvent;
|
||||
public class TestServlet {
|
||||
private static final Log log = LogFactory.getLog(TestServlet.class);
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Inject
|
||||
@io.quarkus.infinispan.client.runtime.Remote("default")
|
||||
@Remote("default")
|
||||
RemoteCache<String, Book> cache;
|
||||
|
||||
@Inject
|
||||
|
||||
@@ -4,12 +4,10 @@ import static org.hamcrest.Matchers.is;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import io.quarkus.test.junit.SubstrateTest;
|
||||
import io.quarkus.test.junit.NativeImageTest;
|
||||
import io.restassured.RestAssured;
|
||||
|
||||
// TODO replace with @NativeImageTest once @SubstrateTest is removed.
|
||||
// Use @SubstrateTest for now to ensure backward compatibility.
|
||||
@SubstrateTest
|
||||
@NativeImageTest
|
||||
public class FinalFieldReflectionInGraalITCase {
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package io.quarkus.test.junit;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link DisabledOnNativeImage} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface DisabledOnSubstrate {
|
||||
/**
|
||||
* Reason for disabling this test
|
||||
*/
|
||||
public String value() default "";
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package io.quarkus.test.junit;
|
||||
|
||||
import static org.junit.platform.commons.util.AnnotationUtils.findAnnotation;
|
||||
|
||||
import java.lang.reflect.AnnotatedElement;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.junit.jupiter.api.extension.ConditionEvaluationResult;
|
||||
import org.junit.jupiter.api.extension.ExecutionCondition;
|
||||
import org.junit.jupiter.api.extension.ExtensionContext;
|
||||
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
|
||||
import org.junit.jupiter.api.extension.ExtensionContext.Store;
|
||||
import org.junit.platform.commons.util.StringUtils;
|
||||
|
||||
import io.quarkus.test.junit.NativeTestExtension.ExtensionState;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link DisabledOnNativeImageCondition} instead.
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class DisabledOnSubstrateCondition implements ExecutionCondition {
|
||||
|
||||
private static final ConditionEvaluationResult ENABLED = ConditionEvaluationResult
|
||||
.enabled("@DisabledOnSubstrate is not present");
|
||||
|
||||
/**
|
||||
* Containers/tests are disabled if {@code @DisabledOnSubstrate} is present on the test
|
||||
* class or method and we're running on Substrate.
|
||||
*/
|
||||
@Override
|
||||
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) {
|
||||
Optional<AnnotatedElement> element = context.getElement();
|
||||
Optional<DisabledOnSubstrate> disabled = findAnnotation(element, DisabledOnSubstrate.class);
|
||||
if (disabled.isPresent()) {
|
||||
Store store = context.getStore(Namespace.GLOBAL);
|
||||
ExtensionState state = (ExtensionState) store.get(ExtensionState.class.getName());
|
||||
if (state != null) {
|
||||
String reason = disabled.map(DisabledOnSubstrate::value)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.orElseGet(() -> element.get() + " is @DisabledOnSubstrate");
|
||||
return ConditionEvaluationResult.disabled(reason);
|
||||
}
|
||||
}
|
||||
|
||||
return ENABLED;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -131,8 +131,7 @@ public class QuarkusTestExtension
|
||||
return;
|
||||
}
|
||||
if (!failedBoot) {
|
||||
boolean nativeImageTest = context.getRequiredTestClass().isAnnotationPresent(SubstrateTest.class)
|
||||
|| isNativeTest(context);
|
||||
boolean nativeImageTest = isNativeTest(context);
|
||||
runningQuarkusApplication.getClassLoader().loadClass(RestAssuredURLManager.class.getName())
|
||||
.getDeclaredMethod("clearURL").invoke(null);
|
||||
runningQuarkusApplication.getClassLoader().loadClass(TestScopeManager.class.getName())
|
||||
@@ -141,8 +140,7 @@ public class QuarkusTestExtension
|
||||
}
|
||||
|
||||
private boolean isNativeTest(ExtensionContext context) {
|
||||
return context.getRequiredTestClass().isAnnotationPresent(NativeImageTest.class)
|
||||
| context.getRequiredTestClass().isAnnotationPresent(SubstrateTest.class);
|
||||
return context.getRequiredTestClass().isAnnotationPresent(NativeImageTest.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,8 +149,7 @@ public class QuarkusTestExtension
|
||||
return;
|
||||
}
|
||||
if (!failedBoot) {
|
||||
boolean nativeImageTest = context.getRequiredTestClass().isAnnotationPresent(SubstrateTest.class)
|
||||
|| isNativeTest(context);
|
||||
boolean nativeImageTest = isNativeTest(context);
|
||||
if (runningQuarkusApplication != null) {
|
||||
runningQuarkusApplication.getClassLoader().loadClass(RestAssuredURLManager.class.getName())
|
||||
.getDeclaredMethod("setURL", boolean.class).invoke(null, false);
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package io.quarkus.test.junit;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that this test should be run using a native image,
|
||||
* rather than in the JVM. This must also be combined with {@link QuarkusTestExtension}.
|
||||
*
|
||||
* The standard usage pattern is expected to be a base test class that runs the
|
||||
* tests using the JVM version of Quarkus, with a subclass that extends the base
|
||||
* test and is annotated with this annotation to perform the same checks against
|
||||
* the native image.
|
||||
*
|
||||
* Note that it is not possible to mix JVM and native image tests in the same test
|
||||
* run, it is expected that the JVM tests will be standard unit tests that are
|
||||
* executed by surefire, while the native image tests will be integration tests
|
||||
* executed by failsafe.
|
||||
*
|
||||
* @deprecated Use {@link NativeImageTest} instead.
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
@Target(ElementType.TYPE)
|
||||
@ExtendWith({ DisabledOnSubstrateCondition.class, QuarkusTestExtension.class, NativeTestExtension.class })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SubstrateTest {
|
||||
}
|
||||
Reference in New Issue
Block a user