Skip to content

Commit

Permalink
chore: replace usages of deprecated methods in org.jboss.shrinkwrap.d…
Browse files Browse the repository at this point in the history
…escriptor.api.DescriptorImporter (#479)

Co-authored-by: Scott M Stark <starksm64@gmail.com>
  • Loading branch information
chengfang and starksm64 authored Nov 13, 2023
1 parent 8019ddd commit 1a15120
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ private ArquillianDescriptor create() {
private ArquillianDescriptor create(String xml) throws Exception {
validateXML(desc);

return Descriptors.importAs(ArquillianDescriptor.class).from(xml);
return Descriptors.importAs(ArquillianDescriptor.class).fromString(xml);
}

private void validateXML(String xml) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ private ArquillianDescriptor create() {
private ArquillianDescriptor create(String xml) throws Exception {
validateXML(desc.exportAsString());

return Descriptors.importAs(ArquillianDescriptor.class).from(xml);
return Descriptors.importAs(ArquillianDescriptor.class).fromString(xml);
}

private void validateXML(String xml) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private Archive<?> handleArchive(EnterpriseArchive applicationArchive, Collectio
.addAsModule(wrappedWar);

if (applicationArchive.contains(APPLICATION_XML_PATH)) {
ApplicationDescriptor applicationXml = Descriptors.importAs(ApplicationDescriptor.class).from(
ApplicationDescriptor applicationXml = Descriptors.importAs(ApplicationDescriptor.class).fromStream(
applicationArchive.get(APPLICATION_XML_PATH).getAsset().openStream());

applicationXml.webModule(wrappedWar.getName(), ServletUtil.calculateContextRoot(wrappedWar.getName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Archive<?> generateDeployment(TestDeployment testDeployment, Collection<P
private Archive<?> handleArchive(WebArchive applicationArchive, Collection<Archive<?>> auxiliaryArchives,
WebArchive protocol, Processor processor) {
if (applicationArchive.contains(WEB_XML_PATH)) {
WebAppDescriptor applicationWebXml = Descriptors.importAs(WebAppDescriptor.class).from(
WebAppDescriptor applicationWebXml = Descriptors.importAs(WebAppDescriptor.class).fromStream(
applicationArchive.get(WEB_XML_PATH).getAsset().openStream());

// SHRINKWRAP-187, to eager on not allowing overrides, delete it first
Expand Down Expand Up @@ -154,7 +154,7 @@ private Archive<?> handleArchive(EnterpriseArchive applicationArchive, Collectio
new StringAsset(WebUtils.createNewDescriptor().exportAsString())));

if (applicationArchive.contains(APPLICATION_XML_PATH)) {
ApplicationDescriptor applicationXml = Descriptors.importAs(ApplicationDescriptor.class).from(
ApplicationDescriptor applicationXml = Descriptors.importAs(ApplicationDescriptor.class).fromStream(
applicationArchive.get(APPLICATION_XML_PATH).getAsset().openStream());

applicationXml.webModule(protocol.getName(), ServletUtil.calculateContextRoot(protocol.getName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private Archive<?> handleArchive(EnterpriseArchive applicationArchive, Collectio
.addAsModule(wrappedWar);

if (applicationArchive.contains(APPLICATION_XML_PATH)) {
ApplicationDescriptor applicationXml = Descriptors.importAs(ApplicationDescriptor.class).from(
ApplicationDescriptor applicationXml = Descriptors.importAs(ApplicationDescriptor.class).fromStream(
applicationArchive.get(APPLICATION_XML_PATH).getAsset().openStream());

applicationXml.webModule(wrappedWar.getName(), ServletUtil.calculateContextRoot(wrappedWar.getName()));
Expand Down

0 comments on commit 1a15120

Please sign in to comment.