Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cjobinabo committed Aug 11, 2023
1 parent ee2837c commit e561b2d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/META-INF/rewrite/was-to-liberty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void replaceVersion14Test() {
</application>
""",
"""
<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4">
<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.4">
<description> DayTrader Stock Trading Performance Benchmark Sample </description>
<display-name>Trade</display-name>
<module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void replaceVersion15Test() {
</connector>
""",
"""
<connector xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" version="1.5">
<connector xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.5">
<display-name>Generic JCA</display-name>
<vendor-name>adam-bien.com</vendor-name>
<eis-type>Generic JCA</eis-type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ void replaceVersion33Test() {
</ejb-jar>
""",
"""
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_3.xsd" version="3.3">
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="3.3">
<description>Enterprise JavaBeans 3.1</description>
<display-name>Enterprise JavaBeans 3.1</display-name>
<enterprise-beans>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void replaceVersion32Test() {
//language=xml
xml(
"""
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_2.xsd" id="WebApp_ID">
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_ID">
<display-name>testWebDDNamespace</display-name>
</web-app>
""",
Expand Down

0 comments on commit e561b2d

Please sign in to comment.