From e561b2d32fe03572959351f8bbe0009190cd5aa1 Mon Sep 17 00:00:00 2001 From: cjobinabo Date: Fri, 11 Aug 2023 11:42:25 -0500 Subject: [PATCH] fix tests --- .../java/liberty/ChangeMethodInvocation.java | 2 ++ .../resources/META-INF/rewrite/was-to-liberty.yml | 12 ++++++++++++ .../openrewrite/xml/liberty/AppDDNamespaceTest.java | 2 +- .../xml/liberty/ConnectorDDNamespaceTest.java | 2 +- .../openrewrite/xml/liberty/EJBDDNamespaceTest.java | 2 +- .../openrewrite/xml/liberty/WebDDNamespaceTest.java | 2 +- 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openrewrite/java/liberty/ChangeMethodInvocation.java b/src/main/java/org/openrewrite/java/liberty/ChangeMethodInvocation.java index 4a8dea1..a87074f 100644 --- a/src/main/java/org/openrewrite/java/liberty/ChangeMethodInvocation.java +++ b/src/main/java/org/openrewrite/java/liberty/ChangeMethodInvocation.java @@ -36,6 +36,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import org.openrewrite.xml.ChangeNamespaceValue; + /* Development in this class is not complete */ diff --git a/src/main/resources/META-INF/rewrite/was-to-liberty.yml b/src/main/resources/META-INF/rewrite/was-to-liberty.yml index 26afc72..4887967 100644 --- a/src/main/resources/META-INF/rewrite/was-to-liberty.yml +++ b/src/main/resources/META-INF/rewrite/was-to-liberty.yml @@ -56,14 +56,17 @@ recipeList: elementName: application newValue: http://java.sun.com/xml/ns/j2ee versionMatcher: 1.4 + searchAllNamespaces: false - org.openrewrite.xml.ChangeNamespaceValue: elementName: application newValue: http://java.sun.com/xml/ns/javaee versionMatcher: 5,6 + searchAllNamespaces: false - org.openrewrite.xml.ChangeNamespaceValue: elementName: application newValue: http://xmlns.jcp.org/xml/ns/javaee versionMatcher: 7+ + searchAllNamespaces: false --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.xml.liberty.ConnectorDDNamespaceRule @@ -72,14 +75,17 @@ recipeList: elementName: connector newValue: http://java.sun.com/xml/ns/j2ee versionMatcher: 1.5 + searchAllNamespaces: false - org.openrewrite.xml.ChangeNamespaceValue: elementName: connector newValue: http://java.sun.com/xml/ns/javaee versionMatcher: 1.6 + searchAllNamespaces: false - org.openrewrite.xml.ChangeNamespaceValue: elementName: connector newValue: http://xmlns.jcp.org/xml/ns/javaee versionMatcher: 1.7+ + searchAllNamespaces: false --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.xml.liberty.EJBDDNamespaceRule @@ -88,14 +94,17 @@ recipeList: elementName: ejb-jar newValue: http://java.sun.com/xml/ns/j2ee versionMatcher: 2.1 + searchAllNamespaces: false - org.openrewrite.xml.ChangeNamespaceValue: elementName: ejb-jar newValue: http://java.sun.com/xml/ns/javaee versionMatcher: 3.0,3.1 + searchAllNamespaces: false - org.openrewrite.xml.ChangeNamespaceValue: elementName: ejb-jar newValue: http://xmlns.jcp.org/xml/ns/javaee versionMatcher: 3.2+ + searchAllNamespaces: false --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.xml.liberty.PersistenceXmlLocationRule @@ -109,11 +118,14 @@ recipeList: elementName: web-app newValue: http://java.sun.com/xml/ns/j2ee versionMatcher: 2.4 + searchAllNamespaces: false - org.openrewrite.xml.ChangeNamespaceValue: elementName: web-app newValue: http://java.sun.com/xml/ns/java versionMatcher: 2.5,3.0 + searchAllNamespaces: false - org.openrewrite.xml.ChangeNamespaceValue: elementName: web-app newValue: http://xmlns.jcp.org/xml/ns/javaee versionMatcher: 3.1+ + searchAllNamespaces: false diff --git a/src/test/java/org/openrewrite/xml/liberty/AppDDNamespaceTest.java b/src/test/java/org/openrewrite/xml/liberty/AppDDNamespaceTest.java index 2398991..1aac361 100644 --- a/src/test/java/org/openrewrite/xml/liberty/AppDDNamespaceTest.java +++ b/src/test/java/org/openrewrite/xml/liberty/AppDDNamespaceTest.java @@ -60,7 +60,7 @@ void replaceVersion14Test() { """, """ - + DayTrader Stock Trading Performance Benchmark Sample Trade diff --git a/src/test/java/org/openrewrite/xml/liberty/ConnectorDDNamespaceTest.java b/src/test/java/org/openrewrite/xml/liberty/ConnectorDDNamespaceTest.java index ea39984..58e508a 100644 --- a/src/test/java/org/openrewrite/xml/liberty/ConnectorDDNamespaceTest.java +++ b/src/test/java/org/openrewrite/xml/liberty/ConnectorDDNamespaceTest.java @@ -64,7 +64,7 @@ void replaceVersion15Test() { """, """ - + Generic JCA adam-bien.com Generic JCA diff --git a/src/test/java/org/openrewrite/xml/liberty/EJBDDNamespaceTest.java b/src/test/java/org/openrewrite/xml/liberty/EJBDDNamespaceTest.java index 6ab77e6..d3e6cc5 100644 --- a/src/test/java/org/openrewrite/xml/liberty/EJBDDNamespaceTest.java +++ b/src/test/java/org/openrewrite/xml/liberty/EJBDDNamespaceTest.java @@ -283,7 +283,7 @@ void replaceVersion33Test() { """, """ - + Enterprise JavaBeans 3.1 Enterprise JavaBeans 3.1 diff --git a/src/test/java/org/openrewrite/xml/liberty/WebDDNamespaceTest.java b/src/test/java/org/openrewrite/xml/liberty/WebDDNamespaceTest.java index 4c37884..3286aa9 100644 --- a/src/test/java/org/openrewrite/xml/liberty/WebDDNamespaceTest.java +++ b/src/test/java/org/openrewrite/xml/liberty/WebDDNamespaceTest.java @@ -116,7 +116,7 @@ void replaceVersion32Test() { //language=xml xml( """ - + testWebDDNamespace """,