1515 */
1616package org .openrewrite .java .migrate .jakarta ;
1717
18- import org .junit .jupiter .api .Disabled ;
1918import org .junit .jupiter .api .Nested ;
2019import org .junit .jupiter .api .Test ;
20+ import org .openrewrite .DocumentExample ;
21+ import org .openrewrite .Issue ;
2122import org .openrewrite .test .RecipeSpec ;
2223import org .openrewrite .test .RewriteTest ;
2324
@@ -35,84 +36,102 @@ void noMigrate() {
3536 xml (
3637 //language=xml
3738 """
38- <?xml version="1.0" encoding="UTF-8"?>
39- <jxb:bindings version="3.0"
40- xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
41- xmlns:xs="http://www.w3.org/2001/XMLSchema">
42- </jxb:bindings>
39+ <?xml version="1.0" encoding="UTF-8"?>
40+ <jxb:bindings version="3.0"
41+ xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
42+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
43+ </jxb:bindings>
44+ """
45+ )
46+ );
47+ }
48+
49+ @ Test
50+ @ Issue ("https://github.com/openrewrite/rewrite-migrate-java/pull/741" )
51+ void noMigrateIBMFiles () {
52+ rewriteRun (
53+ //language=xml
54+ xml (
4355 """
56+ <?xml version="1.0" encoding="UTF-8"?>
57+ <jxb:bindings version="1.0"
58+ xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
59+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
60+ xmlns:ibm="http://websphere.ibm.com/xml/ns/javaee">
61+ </jxb:bindings>
62+ """
4463 )
4564 );
4665 }
4766
4867 @ Nested
4968 class Migrate {
50- @ Disabled // temporarily disabling this to make the project build as we need a release.
69+
5170 @ Test
52- void version () {
71+ @ DocumentExample
72+ void both () {
5373 rewriteRun (
5474 //language=xml
5575 xml (
5676 """
57- <?xml version="1.0" encoding="UTF-8"?>
58- <jxb:bindings version="1.0"
59- xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
60- xmlns:xs="http://www.w3.org/2001/XMLSchema">
61- </jxb:bindings>
62- """ ,
63- """
64- <?xml version="1.0" encoding="UTF-8"?>
65- <jxb:bindings version="3.0"
66- xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
67- xmlns:xs="http://www.w3.org/2001/XMLSchema">
68- </jxb:bindings>
77+ <?xml version="1.0" encoding="UTF-8"?>
78+ <jxb:bindings version="1.0"
79+ xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
80+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
81+ </jxb:bindings>
82+ """ ,
6983 """
84+ <?xml version="1.0" encoding="UTF-8"?>
85+ <jxb:bindings version="3.0"
86+ xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
87+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
88+ </jxb:bindings>
89+ """
7090 )
7191 );
7292 }
73-
7493 @ Test
75- void namespace () {
94+ void version () {
7695 rewriteRun (
7796 //language=xml
7897 xml (
7998 """
80- <?xml version="1.0" encoding="UTF-8"?>
81- <jxb:bindings version="3.0"
82- xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
83- xmlns:xs="http://www.w3.org/2001/XMLSchema">
84- </jxb:bindings>
85- """ ,
86- """
87- <?xml version="1.0" encoding="UTF-8"?>
88- <jxb:bindings version="3.0"
89- xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
90- xmlns:xs="http://www.w3.org/2001/XMLSchema">
91- </jxb:bindings>
99+ <?xml version="1.0" encoding="UTF-8"?>
100+ <jxb:bindings version="1.0"
101+ xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
102+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
103+ </jxb:bindings>
104+ """ ,
92105 """
106+ <?xml version="1.0" encoding="UTF-8"?>
107+ <jxb:bindings version="3.0"
108+ xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
109+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
110+ </jxb:bindings>
111+ """
93112 )
94113 );
95114 }
96115
97116 @ Test
98- void both () {
117+ void namespace () {
99118 rewriteRun (
100119 //language=xml
101120 xml (
102121 """
103- <?xml version="1.0" encoding="UTF-8"?>
104- <jxb:bindings version="1.0"
105- xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
106- xmlns:xs="http://www.w3.org/2001/XMLSchema">
107- </jxb:bindings>
108- """ ,
109- """
110- <?xml version="1.0" encoding="UTF-8"?>
111- <jxb:bindings version="3.0"
112- xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
113- xmlns:xs="http://www.w3.org/2001/XMLSchema">
114- </jxb:bindings>
122+ <?xml version="1.0" encoding="UTF-8"?>
123+ <jxb:bindings version="3.0"
124+ xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
125+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
126+ </jxb:bindings>
127+ """ ,
115128 """
129+ <?xml version="1.0" encoding="UTF-8"?>
130+ <jxb:bindings version="3.0"
131+ xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
132+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
133+ </jxb:bindings>
134+ """
116135 )
117136 );
118137 }
0 commit comments