Skip to content

Commit

Permalink
FMWPLAT was removed from WLS 14+ (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsharpe committed Jul 2, 2021
1 parent c49935f commit 66e56f6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ List<AruPatch> getLatestPsu(AruProduct product, String version, String userId, S
Document aruRecommendations = getRecommendedPatchesMetadata(product, releaseNumber, userId, password);
logger.exiting();
return AruPatch.getPatches(aruRecommendations, "[./psu_bundle]");
} catch (NoPatchesFoundException npe) {
} catch (NoPatchesFoundException | ReleaseNotFoundException ex) {
logger.exiting();
return Collections.emptyList();
} catch (IOException | XPathExpressionException e) {
Expand Down Expand Up @@ -164,7 +164,9 @@ List<AruPatch> getRecommendedPatches(AruProduct product, String version, String
patches.forEach(p -> logger.info("IMG-0068", product.description(), p.patchId(), p.description()));
logger.exiting(patches);
return patches;
} catch (NoPatchesFoundException npe) {
} catch (ReleaseNotFoundException nf) {
return Collections.emptyList();
} catch (NoPatchesFoundException npf) {
logger.info("IMG-0069", product.description(), version);
return Collections.emptyList();
} catch (IOException | XPathExpressionException e) {
Expand Down Expand Up @@ -305,6 +307,7 @@ Document getRecommendedPatchesMetadata(AruProduct product, String releaseNumber,
* @param password OTN credential password
* @return release number for the product and version provided
* @throws AruException if the call to ARU fails, or the response from ARU had an error
* @throws ReleaseNotFoundException if the specified version for the requested product was not found
*/
private String getReleaseNumber(AruProduct product, String version, String userId, String password)
throws AruException {
Expand All @@ -322,7 +325,9 @@ private String getReleaseNumber(AruProduct product, String version, String userI
throw new AruException("Could not extract release number with XPath", xpe);
}
if (Utils.isEmptyString(result)) {
throw new AruException(Utils.getMessage("IMG-0082", product, version));
String msg = Utils.getMessage("IMG-0082", version, product);
logger.info(msg);
throw new ReleaseNotFoundException(msg);
}
logger.exiting(result);
return result;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) 2021, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

package com.oracle.weblogic.imagetool.aru;

/**
* For a given list of patches returned from ARU, the version requested was not found.
*/
public class ReleaseNotFoundException extends AruException {
/**
* The product/version combination was not found in the release table on ARU.
*/
public ReleaseNotFoundException(String message) {
super(message);
}
}
2 changes: 1 addition & 1 deletion imagetool/src/main/resources/ImageTool.properties
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ IMG-0078=Starting build: {0}
IMG-0079=OS Package Manager override, changed from {0} to {1}
IMG-0080=Argument {0} does not match any FmwInstallerType names
IMG-0081=Unable to retrieve list of Oracle releases from Oracle Updates (ARU). Try again later.
IMG-0082=Failed to determine release number for product {0}, version {1}
IMG-0082=Version {0} did not contain {1}, skipping {1}
IMG-0083=Version {0} for patch ID {1} was not found in the available versions: {2}
IMG-0084=No recommended patches found for {0}
IMG-0085=The recommended ADR patch was skipped for the WLS installer, use --patch {0} to apply this patch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,16 @@ void testGetLatestPsu() throws Exception {
List<String> bugs = latestPsu.stream().map(AruPatch::patchId).collect(Collectors.toList());
assertTrue(bugs.contains("31535411"));
}

@Test
void testReleaseNotFound() throws Exception {
// should not throw an exception, and return no patches when release does not exist
List<AruPatch> latestPsu =
AruUtil.rest().getLatestPsu(AruProduct.WLS, "3.0.0.0.0", "x", "x");
assertEquals(0, latestPsu.size());

List<AruPatch> recommendedPatches =
AruUtil.rest().getRecommendedPatches(AruProduct.WLS, "3.0.0.0.0", "x", "x");
assertEquals(0, recommendedPatches.size());
}
}

0 comments on commit 66e56f6

Please sign in to comment.