From 7f2ef11960ecdaedf373908b85d29d72e4ce16b7 Mon Sep 17 00:00:00 2001 From: Paul Nicolucci Date: Mon, 11 Mar 2024 18:44:45 -0400 Subject: [PATCH] Repeat websocket-1.0 FAT for Jakarta EE11 --- dev/io.openliberty.wsoc.internal_fat/bnd.bnd | 13 ++++-- .../fat/src/io/openliberty/wsoc/FATSuite.java | 46 ++++++++----------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/dev/io.openliberty.wsoc.internal_fat/bnd.bnd b/dev/io.openliberty.wsoc.internal_fat/bnd.bnd index 18ffcfc0c3d..600a54f73df 100644 --- a/dev/io.openliberty.wsoc.internal_fat/bnd.bnd +++ b/dev/io.openliberty.wsoc.internal_fat/bnd.bnd @@ -1,14 +1,11 @@ #******************************************************************************* -# Copyright (c) 2020, 2023 IBM Corporation and others. +# Copyright (c) 2020, 2024 IBM Corporation and others. # 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 # http://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# IBM Corporation - initial API and implementation #******************************************************************************* -include= ~../cnf/resources/bnd/bundle.props bVersion=1.0 @@ -44,7 +41,13 @@ tested.features: \ xmlbinding-4.0, \ cdi-4.0, \ expressionlanguage-5.0, \ - appsecurity-5.0 + appsecurity-5.0, \ + expressionlanguage-6.0, \ + appsecurity-6.0, \ + websocket-2.2, \ + noship-1.0, \ + cdi-4.1, \ + servlet-6.1 -buildpath: \ com.ibm.websphere.javaee.annotation.1.1;version=latest,\ diff --git a/dev/io.openliberty.wsoc.internal_fat/fat/src/io/openliberty/wsoc/FATSuite.java b/dev/io.openliberty.wsoc.internal_fat/fat/src/io/openliberty/wsoc/FATSuite.java index 6ffd38ffd5f..f119e679264 100644 --- a/dev/io.openliberty.wsoc.internal_fat/fat/src/io/openliberty/wsoc/FATSuite.java +++ b/dev/io.openliberty.wsoc.internal_fat/fat/src/io/openliberty/wsoc/FATSuite.java @@ -1,14 +1,11 @@ /******************************************************************************* - * Copyright (c) 2012, 2022 IBM Corporation and others. + * Copyright (c) 2012, 2024 IBM Corporation and others. * 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 * http://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 * - * Contributors: - * IBM Corporation - initial API and implementation + * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package io.openliberty.wsoc; @@ -23,7 +20,6 @@ import componenttest.rules.repeater.EmptyAction; import componenttest.rules.repeater.FeatureReplacementAction; import componenttest.rules.repeater.RepeatTests; -import componenttest.topology.impl.JavaInfo; import io.openliberty.wsoc.tests.BasicTest; import io.openliberty.wsoc.tests.Cdi12Test; import io.openliberty.wsoc.tests.Cdi20Test; @@ -53,28 +49,24 @@ }) public class FATSuite { - //websocket-1.0 is not part of EE6/7/8, so we need to do a manual replacement + // websocket-1.0 is not part of EE6/7/8, so we need to do a manual replacement + // EE10 requires Java 11. + // EE11 requires Java 17 + // If we only specify EE10/EE11 for lite mode it will cause no tests to run with lower Java versions which causes an error. + // If we are running with a Java version less than 11, have EE9 be the lite mode test to run. @ClassRule - public static RepeatTests repeat; - - - static { - if(JavaInfo.JAVA_VERSION >= 11) { - repeat = RepeatTests.with(new EmptyAction().fullFATOnly()) - .andWith(FeatureReplacementAction.EE9_FEATURES() - .removeFeature("websocket-1.0") - .addFeature("websocket-2.0") - .fullFATOnly()) - .andWith(FeatureReplacementAction.EE10_FEATURES() - .removeFeature("websocket-1.0") - .addFeature("websocket-2.1")); - } else { - repeat = RepeatTests.with(new EmptyAction().fullFATOnly()) - .andWith(FeatureReplacementAction.EE9_FEATURES() - .removeFeature("websocket-1.0") - .addFeature("websocket-2.0")); - } - } + public static RepeatTests repeat = RepeatTests.with(new EmptyAction().fullFATOnly()) + .andWith(FeatureReplacementAction.EE9_FEATURES() + .removeFeature("websocket-1.0") + .addFeature("websocket-2.0") + .conditionalFullFATOnly(FeatureReplacementAction.GREATER_THAN_OR_EQUAL_JAVA_11)) + .andWith(FeatureReplacementAction.EE10_FEATURES() + .removeFeature("websocket-1.0") + .addFeature("websocket-2.1") + .conditionalFullFATOnly(FeatureReplacementAction.GREATER_THAN_OR_EQUAL_JAVA_17)) + .andWith(FeatureReplacementAction.EE11_FEATURES() + .removeFeature("websocket-1.0") + .addFeature("websocket-2.2")); /** * @see {@link FatLogHandler#generateHelpFile()}