Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to versionless tests #30457

Open
wants to merge 1 commit into
base: integration
Choose a base branch
from
Open
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
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023 IBM Corporation and others.
* Copyright (c) 2023, 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
Expand Down Expand Up @@ -286,12 +286,6 @@ public void validatePlatformSettings() {
List<String> cohort = cohorts.get(featureBaseName);
//loops through each version of a platform
for (String version : cohort) {
// We are only doing javaee-8.0 platform and not doing jakartaee-8.0 platform
// If that changes this condition should be removed.
if (baseName.equals("jakartaee") && version.equals("8.0")) {
continue;
}

boolean isMP = baseName.equals("microProfile");
String featureName = featureBaseName + "-" + version;
String featureShortName = baseName + "-" + version;
Expand Down Expand Up @@ -336,6 +330,8 @@ public void validatePlatformSettings() {
// jdbc is special
featureToPlatformMapping.get("com.ibm.websphere.appserver.jdbc-4.1").remove("javaee-8.0");
featureToPlatformMapping.get("com.ibm.websphere.appserver.jdbc-4.2").add("javaee-8.0");
featureToPlatformMapping.get("com.ibm.websphere.appserver.jdbc-4.1").remove("jakartaee-8.0");
featureToPlatformMapping.get("com.ibm.websphere.appserver.jdbc-4.2").add("jakartaee-8.0");
featureToPlatformMapping.get("com.ibm.websphere.appserver.jdbc-4.2").remove("jakartaee-11.0");
Set<String> jdbc43Platform = new HashSet<>();
jdbc43Platform.add("jakartaee-11.0");
Expand All @@ -356,9 +352,6 @@ public void validatePlatformSettings() {
if (featurePlatform.equals("javaee-6.0")) {
continue;
}
if(featurePlatform.equals("jakartaee-8.0") && platforms.contains("javaee-8.0")){
continue;
}
if (platforms.contains(featurePlatform)) {
matches++;
} else {
Expand All @@ -373,9 +366,6 @@ public void validatePlatformSettings() {
}
}
}
if(platforms.contains("javaee-8.0") && !featurePlatforms.contains("jakartaee-8.0")){
errorMessage.append(featureName).append(" is missing platform jakartaee-8.0\n");
}
}

// Special private features that also should have platforms listed in them
Expand Down Expand Up @@ -548,7 +538,7 @@ public void listSelectorDetails() {

String errorOutput = "There are versionless features that need to be created. " +
"Templates for the needed features have been created in the 'build/versionless' directory.\n" +
"Keep in mind the templates are not guarenteed to be correct and are solely meant to " +
"Keep in mind the templates are not guaranteed to be correct and are solely meant to " +
"act as a helpful starting point for creating a versionless feature.\n" +
"Verify the data inside the feature files are correct, then copy the features from 'build/versionless' into 'visibility'.\n" + createdFeatures;

Expand Down Expand Up @@ -587,10 +577,6 @@ public Map<String, List<String>> getSelectorCohorts() {
return selectorCohorts;
}

/**
* Presently the Jakarta Container features (jsonbContainer, jsonpContainer, [jsf|faces]Container and [jpa|persistence]Container
* are not created as versionless features. To be determined if they should.
*/
public static List<String> skipFeatures = new ArrayList<String>(Arrays.asList("webProfile",
"noShip",
"monitor",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*******************************************************************************
* Copyright (c) 2023, 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
*******************************************************************************/
package com.ibm.ws.feature.utils;

import java.io.BufferedWriter;
Expand Down Expand Up @@ -326,15 +335,15 @@ private boolean validatePrivateLinkingFeature(String featureName, String feature
}

File featureFile = feature.getFeatureFile();
boolean checkForMpVersion = (mpVersionBase != null && mpVersionTolerates != null);
boolean checkForMpVersion = (mpVersionBase != null);
boolean containsVersionedFeature = false;
boolean containsMpVersion = false;
try {
Scanner myReader = new Scanner(featureFile);
while (myReader.hasNextLine()) {
String s = myReader.nextLine();

if(checkForMpVersion && s.trim().equals(mpVersionBase + "-" + mpVersionTolerates + ", \\")){
if(checkForMpVersion && s.trim().equals(mpVersionTolerates == null ? mpVersionBase : (mpVersionBase + "-" + mpVersionTolerates) + ", \\")){
containsMpVersion = true;
}
else if(s.trim().equals(versionedFeatureName)){
Expand Down