Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
/*******************************************************************************
* Copyright 2026 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
*******************************************************************************/
package com.ibm.ws.security.fat.common.actions;

import java.util.Set;

import com.ibm.websphere.simplicity.Machine;
import com.ibm.websphere.simplicity.OperatingSystem;
import com.ibm.websphere.simplicity.log.Log;

import componenttest.custom.junit.runner.TestModeFilter;
import componenttest.custom.junit.runner.Mode.TestMode;
import componenttest.rules.repeater.JakartaEE11Action;

public class SecurityTestFeatureEE11RepeatAction extends JakartaEE11Action {

public static Class<?> thisClass = SecurityTestFeatureEE11RepeatAction.class;

protected String complexId = JakartaEE11Action.ID;
private TestMode testRunMode = TestModeFilter.FRAMEWORK_TEST_MODE;
private boolean notAllowedOnWindows = false;

public SecurityTestFeatureEE11RepeatAction() {

super();
complexId = JakartaEE11Action.ID;
Log.info(thisClass, "instance", complexId);
testRunMode = TestModeFilter.FRAMEWORK_TEST_MODE;
notAllowedOnWindows = false;
withID(complexId);

}

public SecurityTestFeatureEE11RepeatAction(String inNameExtension) {

super();
complexId = JakartaEE11Action.ID + "_" + inNameExtension;
Log.info(thisClass, "instance", complexId);
testRunMode = TestModeFilter.FRAMEWORK_TEST_MODE;
notAllowedOnWindows = false;
withID(complexId);
}

@Override
public SecurityTestFeatureEE11RepeatAction withID(String id) {
return (SecurityTestFeatureEE11RepeatAction) super.withID(id);
}

@Override
public boolean isEnabled() {

Log.info(thisClass, "isEnabled", "testRunMode: " + testRunMode);
Log.info(thisClass, "isEnabled", "complexId: " + complexId);
Log.info(thisClass, "isEnabled", "Overall test mode: " + TestModeFilter.FRAMEWORK_TEST_MODE);
// allow if mode matches or mode not set
if (testRunMode != null && (TestModeFilter.FRAMEWORK_TEST_MODE != testRunMode)) {
Log.info(thisClass, "isEnabled", "Skipping action '" + toString() + "' because the test mode " + testRunMode +
" is not valid for current mode " + TestModeFilter.FRAMEWORK_TEST_MODE);
return false;
}

// perform standard checks
if (!super.isEnabled()) {
return false;
}

// Some Security projects restrict some tests from running in certain modes on windows
OperatingSystem currentOS = null;
try {
currentOS = Machine.getLocalMachine().getOperatingSystem();
} catch (Exception e) {
Log.info(thisClass, "isEnabled", "Encountered and exception trying to determine OS type - assume we'll need to run: " + e.getMessage());
}
Log.info(thisClass, "isEnabled", "OS: " + currentOS.toString());
if (OperatingSystem.WINDOWS == currentOS && notAllowedOnWindows) {
Log.info(thisClass, "isEnabled", "Skipping action '" + toString() + "' because the tests are disabled on Windows");
return false;
}
return true;
}

@Override
public SecurityTestFeatureEE11RepeatAction liteFATOnly() {
testRunMode = TestMode.LITE;
return this;
}

@Override
public SecurityTestFeatureEE11RepeatAction fullFATOnly() {
testRunMode = TestMode.FULL;
return this;
}

public SecurityTestFeatureEE11RepeatAction notOnWindows() {

Log.info(thisClass, "notOnWindows", "set disallow on windows");
notAllowedOnWindows = true;
return this;
}

@Override
public SecurityTestFeatureEE11RepeatAction addFeature(String addFeature) {
return (SecurityTestFeatureEE11RepeatAction) super.addFeature(addFeature);
}

@Override
public SecurityTestFeatureEE11RepeatAction alwaysAddFeatures(Set<String> alwaysAddedFeatures) {
return (SecurityTestFeatureEE11RepeatAction) super.alwaysAddFeatures(alwaysAddedFeatures);
}

@Override
public SecurityTestFeatureEE11RepeatAction alwaysAddFeature(String alwaysAddedFeature) {
Log.info(thisClass, "alwaysAddedFeature", alwaysAddedFeature);
return (SecurityTestFeatureEE11RepeatAction) super.alwaysAddFeature(alwaysAddedFeature);
}

@Override
public SecurityTestFeatureEE11RepeatAction forServerConfigPaths(String... serverPaths) {
return (SecurityTestFeatureEE11RepeatAction) super.forServerConfigPaths(serverPaths);
}

@Override
public SecurityTestFeatureEE11RepeatAction forceAddFeatures(boolean force) {
return (SecurityTestFeatureEE11RepeatAction) super.forceAddFeatures(force);
}

/*
* (non-Javadoc)
*
* @see componenttest.rules.repeater.RepeatTestAction#getID()
*/
@Override
public String getID() {
Log.info(thisClass, "getID", "complexId: " + complexId);
return complexId;
}

}
8 changes: 3 additions & 5 deletions dev/com.ibm.ws.security.jwt_fat.consumer/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#*******************************************************************************
# Copyright (c) 2019, 2025 IBM Corporation and others.
# Copyright (c) 2019, 2026 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
Expand All @@ -29,7 +26,8 @@ src: \
fat.project: true
tested.features:\
jwt-1.0, restfulwsclient-3.0, restfulws-3.0, jsonp-2.0, pages-3.0,\
restfulws-3.1, pages-3.1, jsonp-2.1
restfulws-3.1, pages-3.1, jsonp-2.1,\
restfulws-4.0, pages-4.0


# To define a global minimum java level for the FAT, use the following property.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/*******************************************************************************
* Copyright (c) 2018, 2023 IBM Corporation and others.
* Copyright (c) 2018, 2026 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
*******************************************************************************/
package com.ibm.ws.security.jwt.fat.consumer;

Expand All @@ -18,6 +15,7 @@
import org.junit.runners.Suite.SuiteClasses;

import com.ibm.ws.security.fat.common.actions.SecurityTestFeatureEE10RepeatAction;
import com.ibm.ws.security.fat.common.actions.SecurityTestFeatureEE11RepeatAction;
import com.ibm.ws.security.fat.common.actions.SecurityTestFeatureEE9RepeatAction;
import com.ibm.ws.security.fat.common.actions.SecurityTestRepeatAction;

Expand All @@ -42,12 +40,13 @@
public class FATSuite {

/*
* Run EE9 and EE10 tests in LITE mode (but not on Windows) and run all tests in FULL mode.
* Run EE9/EE10/EE11 tests in LITE mode (but not on Windows) and run all tests in FULL mode.
*/
@ClassRule
public static RepeatTests repeat = RepeatTests.with(new EmptyAction().fullFATOnly())
.andWith(new SecurityTestRepeatAction().onlyOnWindows().liteFATOnly())
.andWith(new SecurityTestFeatureEE9RepeatAction().notOnWindows().forServerConfigPaths("publish/servers", "publish/shared/config").liteFATOnly())
.andWith(new SecurityTestFeatureEE10RepeatAction().notOnWindows().forServerConfigPaths("publish/servers", "publish/shared/config").liteFATOnly());
.andWith(new SecurityTestFeatureEE10RepeatAction().notOnWindows().forServerConfigPaths("publish/servers", "publish/shared/config").liteFATOnly())
.andWith(new SecurityTestFeatureEE11RepeatAction().notOnWindows().forServerConfigPaths("publish/servers", "publish/shared/config").liteFATOnly());

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/*******************************************************************************
* Copyright (c) 2018, 2022 IBM Corporation and others.
* Copyright (c) 2018, 2026 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
*******************************************************************************/
package com.ibm.ws.security.jwtsso.fat.utils;

Expand Down Expand Up @@ -51,4 +48,5 @@ public class JwtFatConstants extends JwtConstants {
public static final String NO_MPJWT = "noMpJwt";
public static final String NO_MPJWT_EE9 = "noMpJwt_ee9";
public static final String NO_MPJWT_EE10 = "noMpJwt_ee10";
public static final String NO_MPJWT_EE11 = "noMpJwt_ee11";
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/*******************************************************************************
* Copyright (c) 2018, 2023 IBM Corporation and others.
* Copyright (c) 2018, 2026 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
*******************************************************************************/
package com.ibm.ws.security.jwtsso.fat.utils;

Expand Down Expand Up @@ -60,18 +57,22 @@ public JsonObject extractJwtPrincipalFromString(String response) throws Exceptio
public void updateFeatureFileForEE9(LibertyServer server) throws Exception {

String version = RepeatTestFilter.getMostRecentRepeatAction().getID();
// try to replace the EE9 or EE10 noMpJwt repeat instance name with noMpJwt_ee9 or noMpJwt_ee9 respectively
// try to replace the EE9/EE10/EE11 noMpJwt repeat instance name with noMpJwt_(ee9/ee10/ee11) respectively
// if this is a different repeat action this will do nothing
version = version.replace(JakartaEEAction.EE9_ACTION_ID + "_" + JwtFatConstants.NO_MPJWT, JwtFatConstants.NO_MPJWT_EE9);
version = version.replace(JakartaEEAction.EE10_ACTION_ID + "_" + JwtFatConstants.NO_MPJWT, JwtFatConstants.NO_MPJWT_EE10);
// if the EE9 or EE10 repeat instance is still in the the action, remove it
version = version.replace(JakartaEEAction.EE11_ACTION_ID + "_" + JwtFatConstants.NO_MPJWT, JwtFatConstants.NO_MPJWT_EE11);
// if the EE9/EE10/EE11 repeat instance is still in the the action, remove it
version = version.replace(JakartaEEAction.EE9_ACTION_ID + "_", "");
version = version.replace(JakartaEEAction.EE10_ACTION_ID + "_", "");
version = version.replace(JakartaEEAction.EE11_ACTION_ID + "_", "");
updateFeatureFile(server, "jwtSsoFeatures", version);
if (JakartaEEAction.isEE9Active()) {
updateFeatureFile(server, "featuresWithoutJwtSso", "ee9");
} else if (JakartaEEAction.isEE10OrLaterActive()) {
} else if (JakartaEEAction.isEE10Active()) {
updateFeatureFile(server, "featuresWithoutJwtSso", "ee10");
} else if (JakartaEEAction.isEE11Active()) {
updateFeatureFile(server, "featuresWithoutJwtSso", "ee11");
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
Copyright 2026 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
-->
<server>

<featureManager>
<feature>pages-4.0</feature>
<feature>appSecurity-6.0</feature>
<feature>componenttest-2.0</feature>
</featureManager>

</server>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
Copyright 2026 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
-->
<server>

<featureManager>
<feature>pages-4.0</feature>
<feature>jwtSso-1.0</feature>
<feature>componenttest-2.0</feature>
</featureManager>

</server>
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/*******************************************************************************
* Copyright (c) 2018, 2023 IBM Corporation and others.
* Copyright (c) 2018, 2026 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
*******************************************************************************/
package com.ibm.ws.security.jwtsso.fat;

Expand All @@ -18,6 +15,7 @@
import org.junit.runners.Suite.SuiteClasses;

import com.ibm.ws.security.fat.common.actions.SecurityTestFeatureEE10RepeatAction;
import com.ibm.ws.security.fat.common.actions.SecurityTestFeatureEE11RepeatAction;
import com.ibm.ws.security.fat.common.actions.SecurityTestFeatureEE9RepeatAction;
import com.ibm.ws.security.fat.common.actions.SecurityTestRepeatAction;
import com.ibm.ws.security.jwtsso.fat.utils.JwtFatConstants;
Expand All @@ -44,6 +42,7 @@ public class FATSuite {
@ClassRule
public static RepeatTests r = RepeatTests.with(new SecurityTestRepeatAction(JwtFatConstants.NO_MPJWT))
.andWith(new SecurityTestFeatureEE9RepeatAction(JwtFatConstants.NO_MPJWT).notOnWindows().liteFATOnly())
.andWith(new SecurityTestFeatureEE10RepeatAction(JwtFatConstants.NO_MPJWT).notOnWindows().liteFATOnly());
.andWith(new SecurityTestFeatureEE10RepeatAction(JwtFatConstants.NO_MPJWT).notOnWindows().liteFATOnly())
.andWith(new SecurityTestFeatureEE11RepeatAction(JwtFatConstants.NO_MPJWT).notOnWindows().liteFATOnly());

}
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
#*******************************************************************************
# Copyright (c) 2022, 2025 IBM Corporation and others.
# Copyright (c) 2022, 2026 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

tested.features: jsp-2.2, servlet-3.1, transportsecurity-1.0, appsecurity-4.0, expressionlanguage-4.0, servlet-5.0, cdi-3.0, pages-3.0, jsonp-2.0,\
appsecurity-5.0, pages-3.1
appsecurity-5.0, pages-3.1,\
appsecurity-6.0, pages-4.0

src: \
fat/src
Expand Down
Loading