|
22 | 22 |
|
23 | 23 | import static org.openrewrite.xml.Assertions.xml; |
24 | 24 |
|
| 25 | +@SuppressWarnings({"CheckTagEmptyBody", "JpaConfigDomFacetInspection", "JpaDomInspection"}) |
25 | 26 | class JpaCachePropertiesTest implements RewriteTest { |
26 | 27 | private static final String PERSISTENCE_FILENAME = "persistence.xml"; |
27 | 28 |
|
@@ -53,10 +54,8 @@ void set_set_set1() { |
53 | 54 | """ |
54 | 55 | <?xml version="1.0" encoding="UTF-8"?> |
55 | 56 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
56 | | - <persistence-unit name="set_set_set1"> |
57 | | - <!-- flag --> |
58 | | - <shared-cache-mode>NONE</shared-cache-mode> |
59 | | - <!-- leave --> |
| 57 | + <persistence-unit name="set_set_set1"><!-- flag --> |
| 58 | + <shared-cache-mode>NONE</shared-cache-mode><!-- leave --> |
60 | 59 | <validation-mode>NONE</validation-mode> |
61 | 60 | <properties> |
62 | 61 | <!-- Connection properties --> |
@@ -93,10 +92,8 @@ void set_set_set2() { |
93 | 92 | """ |
94 | 93 | <?xml version="1.0" encoding="UTF-8"?> |
95 | 94 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
96 | | - <persistence-unit name="set_set_set2"> |
97 | | - <!-- flag --> |
98 | | - <shared-cache-mode>ALL</shared-cache-mode> |
99 | | - <!-- leave --> |
| 95 | + <persistence-unit name="set_set_set2"><!-- flag --> |
| 96 | + <shared-cache-mode>ALL</shared-cache-mode><!-- leave --> |
100 | 97 | <validation-mode>NONE</validation-mode> |
101 | 98 | <properties> |
102 | 99 | <!-- Connection properties --> |
@@ -133,10 +130,8 @@ void set_set_set3() { |
133 | 130 | """ |
134 | 131 | <?xml version="1.0" encoding="UTF-8"?> |
135 | 132 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
136 | | - <persistence-unit name="set_set_set3"> |
137 | | - <!-- flag --> |
138 | | - <shared-cache-mode>ALL</shared-cache-mode> |
139 | | - <!-- leave, change to ALL --> |
| 133 | + <persistence-unit name="set_set_set3"><!-- flag --> |
| 134 | + <shared-cache-mode>ALL</shared-cache-mode><!-- leave, change to ALL --> |
140 | 135 | <validation-mode>NONE</validation-mode> |
141 | 136 | <properties> |
142 | 137 | <!-- Connection properties --> |
@@ -173,10 +168,8 @@ void set_set_set4() { |
173 | 168 | """ |
174 | 169 | <?xml version="1.0" encoding="UTF-8"?> |
175 | 170 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
176 | | - <persistence-unit name="set_set_set4"> |
177 | | - <!-- flag --> |
178 | | - <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode> |
179 | | - <!-- leave --> |
| 171 | + <persistence-unit name="set_set_set4"><!-- flag --> |
| 172 | + <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode><!-- leave --> |
180 | 173 | <validation-mode>NONE</validation-mode> |
181 | 174 | <properties> |
182 | 175 | <!-- Connection properties --> |
@@ -212,10 +205,8 @@ void set_set_notset1() { |
212 | 205 | """ |
213 | 206 | <?xml version="1.0" encoding="UTF-8"?> |
214 | 207 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
215 | | - <persistence-unit name="set_set_notset1"> |
216 | | - <!-- flag --> |
217 | | - <shared-cache-mode>NONE</shared-cache-mode> |
218 | | - <!-- leave --> |
| 208 | + <persistence-unit name="set_set_notset1"><!-- flag --> |
| 209 | + <shared-cache-mode>NONE</shared-cache-mode><!-- leave --> |
219 | 210 | <validation-mode>NONE</validation-mode> |
220 | 211 | <properties> |
221 | 212 | <!-- Connection properties --> |
@@ -250,10 +241,8 @@ void set_set_notset2() { |
250 | 241 | """ |
251 | 242 | <?xml version="1.0" encoding="UTF-8"?> |
252 | 243 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
253 | | - <persistence-unit name="set_set_notset2"> |
254 | | - <!-- flag --> |
255 | | - <shared-cache-mode>ALL</shared-cache-mode> |
256 | | - <!-- leave --> |
| 244 | + <persistence-unit name="set_set_notset2"><!-- flag --> |
| 245 | + <shared-cache-mode>ALL</shared-cache-mode><!-- leave --> |
257 | 246 | <validation-mode>NONE</validation-mode> |
258 | 247 | <properties> |
259 | 248 | <!-- Connection properties --> |
@@ -288,10 +277,8 @@ void set_set_notset3() { |
288 | 277 | """ |
289 | 278 | <?xml version="1.0" encoding="UTF-8"?> |
290 | 279 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
291 | | - <persistence-unit name="set_set_notset3"> |
292 | | - <!-- flag --> |
293 | | - <shared-cache-mode>NONE</shared-cache-mode> |
294 | | - <!-- change to NONE --> |
| 280 | + <persistence-unit name="set_set_notset3"><!-- flag --> |
| 281 | + <shared-cache-mode>NONE</shared-cache-mode><!-- change to NONE --> |
295 | 282 | <validation-mode>NONE</validation-mode> |
296 | 283 | <properties> |
297 | 284 | <!-- Connection properties --> |
@@ -326,10 +313,8 @@ void set_set_notset4() { |
326 | 313 | """ |
327 | 314 | <?xml version="1.0" encoding="UTF-8"?> |
328 | 315 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
329 | | - <persistence-unit name="set_set_notset4"> |
330 | | - <!-- flag --> |
331 | | - <shared-cache-mode>ALL</shared-cache-mode> |
332 | | - <!-- leave --> |
| 316 | + <persistence-unit name="set_set_notset4"><!-- flag --> |
| 317 | + <shared-cache-mode>ALL</shared-cache-mode><!-- leave --> |
333 | 318 | <validation-mode>NONE</validation-mode> |
334 | 319 | <properties> |
335 | 320 | <!-- Connection properties --> |
@@ -363,10 +348,8 @@ void set_set_notset5() { |
363 | 348 | """ |
364 | 349 | <?xml version="1.0" encoding="UTF-8"?> |
365 | 350 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
366 | | - <persistence-unit name="set_set_notset5"> |
367 | | - <!-- flag --> |
368 | | - <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode> |
369 | | - <!-- leave --> |
| 351 | + <persistence-unit name="set_set_notset5"><!-- flag --> |
| 352 | + <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode><!-- leave --> |
370 | 353 | <validation-mode>NONE</validation-mode> |
371 | 354 | <properties> |
372 | 355 | <!-- remove --> |
@@ -423,10 +406,8 @@ void set_notset_set2() { |
423 | 406 | """ |
424 | 407 | <?xml version="1.0" encoding="UTF-8"?> |
425 | 408 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
426 | | - <persistence-unit name="set_notset_set2"> |
427 | | - <!-- flag --> |
428 | | - <shared-cache-mode>ALL</shared-cache-mode> |
429 | | - <!-- leave --> |
| 409 | + <persistence-unit name="set_notset_set2"><!-- flag --> |
| 410 | + <shared-cache-mode>ALL</shared-cache-mode><!-- leave --> |
430 | 411 | <validation-mode>NONE</validation-mode> |
431 | 412 | <properties> |
432 | 413 | <!-- Connection properties --> |
@@ -461,10 +442,8 @@ void set_notset_set3() { |
461 | 442 | """ |
462 | 443 | <?xml version="1.0" encoding="UTF-8"?> |
463 | 444 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
464 | | - <persistence-unit name="set_notset_set3"> |
465 | | - <!-- flag --> |
466 | | - <shared-cache-mode>ALL</shared-cache-mode> |
467 | | - <!-- change to ALL --> |
| 445 | + <persistence-unit name="set_notset_set3"><!-- flag --> |
| 446 | + <shared-cache-mode>ALL</shared-cache-mode><!-- change to ALL --> |
468 | 447 | <validation-mode>NONE</validation-mode> |
469 | 448 | <properties> |
470 | 449 | <!-- Connection properties --> |
@@ -498,10 +477,8 @@ void set_notset_set4() { |
498 | 477 | """ |
499 | 478 | <?xml version="1.0" encoding="UTF-8"?> |
500 | 479 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
501 | | - <persistence-unit name="set_notset_set4"> |
502 | | - <!-- flag --> |
503 | | - <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode> |
504 | | - <!-- leave --> |
| 480 | + <persistence-unit name="set_notset_set4"><!-- flag --> |
| 481 | + <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode><!-- leave --> |
505 | 482 | <validation-mode>NONE</validation-mode> |
506 | 483 | <properties> |
507 | 484 | <!-- remove --> \s |
@@ -572,10 +549,8 @@ void set_notset_notset3() { |
572 | 549 | """ |
573 | 550 | <?xml version="1.0" encoding="UTF-8"?> |
574 | 551 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
575 | | - <persistence-unit name="set_notset_notset3"> |
576 | | - <!-- flag --> |
577 | | - <shared-cache-mode>NONE</shared-cache-mode> |
578 | | - <!-- change to NONE --> |
| 552 | + <persistence-unit name="set_notset_notset3"><!-- flag --> |
| 553 | + <shared-cache-mode>NONE</shared-cache-mode><!-- change to NONE --> |
579 | 554 | <validation-mode>NONE</validation-mode> |
580 | 555 | </persistence-unit> |
581 | 556 | </persistence> |
@@ -627,8 +602,7 @@ void notset_set_set1() { |
627 | 602 | """ |
628 | 603 | <?xml version="1.0" encoding="UTF-8"?> |
629 | 604 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
630 | | - <persistence-unit name="notset_set_set1"> |
631 | | - <!-- flag --> |
| 605 | + <persistence-unit name="notset_set_set1"><!-- flag --> |
632 | 606 | <validation-mode>NONE</validation-mode> |
633 | 607 | <properties> |
634 | 608 | <!-- Connection properties --> |
@@ -665,8 +639,7 @@ void notset_set_set2() { |
665 | 639 | """ |
666 | 640 | <?xml version="1.0" encoding="UTF-8"?> |
667 | 641 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
668 | | - <persistence-unit name="notset_set_set2"> |
669 | | - <!-- flag --> |
| 642 | + <persistence-unit name="notset_set_set2"><!-- flag --> |
670 | 643 | <validation-mode>NONE</validation-mode> |
671 | 644 | <properties> |
672 | 645 | <!-- Connection properties --> |
@@ -703,8 +676,7 @@ void notset_set_set3() { |
703 | 676 | """ |
704 | 677 | <?xml version="1.0" encoding="UTF-8"?> |
705 | 678 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
706 | | - <persistence-unit name="notset_set_set3"> |
707 | | - <!-- flag --> |
| 679 | + <persistence-unit name="notset_set_set3"><!-- flag --> |
708 | 680 | <validation-mode>NONE</validation-mode> |
709 | 681 | <properties> |
710 | 682 | <!-- Connection properties --> |
@@ -807,8 +779,7 @@ void notset_set_notset3() { |
807 | 779 | """ |
808 | 780 | <?xml version="1.0" encoding="UTF-8"?> |
809 | 781 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
810 | | - <persistence-unit name="notset_set_notset3"> |
811 | | - <!-- flag --> |
| 782 | + <persistence-unit name="notset_set_notset3"><!-- flag --> |
812 | 783 | <validation-mode>NONE</validation-mode> |
813 | 784 | <properties> |
814 | 785 | <!-- Connection properties --> |
@@ -1099,10 +1070,8 @@ void openjpa_cache1_flagged() { |
1099 | 1070 | """ |
1100 | 1071 | <?xml version="1.0" encoding="UTF-8"?> |
1101 | 1072 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
1102 | | - <persistence-unit name="openjpa_cache1_flagged"> |
1103 | | - <!-- flag --> |
1104 | | - <shared-cache-mode>NONE</shared-cache-mode> |
1105 | | - <!-- set to NONE --> |
| 1073 | + <persistence-unit name="openjpa_cache1_flagged"><!-- flag --> |
| 1074 | + <shared-cache-mode>NONE</shared-cache-mode><!-- set to NONE --> |
1106 | 1075 | <validation-mode>NONE</validation-mode> |
1107 | 1076 | <properties> |
1108 | 1077 | <!-- Connection properties --> |
@@ -1136,10 +1105,8 @@ void openjpa_cache2_flagged() { |
1136 | 1105 | """ |
1137 | 1106 | <?xml version="1.0" encoding="UTF-8"?> |
1138 | 1107 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
1139 | | - <persistence-unit name="openjpa_cache2_flagged"> |
1140 | | - <!-- flag --> |
1141 | | - <shared-cache-mode>ALL</shared-cache-mode> |
1142 | | - <!-- set to ALL --> |
| 1108 | + <persistence-unit name="openjpa_cache2_flagged"><!-- flag --> |
| 1109 | + <shared-cache-mode>ALL</shared-cache-mode><!-- set to ALL --> |
1143 | 1110 | <validation-mode>NONE</validation-mode> |
1144 | 1111 | <properties> |
1145 | 1112 | <!-- remove --> |
@@ -1207,8 +1174,7 @@ void openjpa_cache4_flagged() { |
1207 | 1174 | """ |
1208 | 1175 | <?xml version="1.0" encoding="UTF-8"?> |
1209 | 1176 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
1210 | | - <persistence-unit name="openjpa_cache4_flagged"> |
1211 | | - <!-- flag --> |
| 1177 | + <persistence-unit name="openjpa_cache4_flagged"> <!-- flag --> |
1212 | 1178 | <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode> |
1213 | 1179 | <validation-mode>NONE</validation-mode> |
1214 | 1180 | <properties> |
@@ -1242,8 +1208,7 @@ void openjpa_cache5_flagged() { |
1242 | 1208 | """ |
1243 | 1209 | <?xml version="1.0" encoding="UTF-8"?> |
1244 | 1210 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
1245 | | - <persistence-unit name="openjpa_cache5_flagged"> |
1246 | | - <!-- flag --> |
| 1211 | + <persistence-unit name="openjpa_cache5_flagged"> <!-- flag --> |
1247 | 1212 | <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode> |
1248 | 1213 | <validation-mode>NONE</validation-mode> |
1249 | 1214 | <properties> |
@@ -1276,10 +1241,8 @@ void openjpa_cache6_flagged() { |
1276 | 1241 | """ |
1277 | 1242 | <?xml version="1.0" encoding="UTF-8"?> |
1278 | 1243 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
1279 | | - <persistence-unit name="openjpa_cache6_flagged"> |
1280 | | - <!-- flag --> |
1281 | | - <shared-cache-mode>NONE</shared-cache-mode> |
1282 | | - <!-- change to NONE --> |
| 1244 | + <persistence-unit name="openjpa_cache6_flagged"><!-- flag --> |
| 1245 | + <shared-cache-mode>NONE</shared-cache-mode><!-- change to NONE --> |
1283 | 1246 | <validation-mode>NONE</validation-mode> |
1284 | 1247 | <properties> |
1285 | 1248 | </properties> |
@@ -1355,8 +1318,7 @@ void openjpa_cache9_flagged() { |
1355 | 1318 | """ |
1356 | 1319 | <?xml version="1.0" encoding="UTF-8"?> |
1357 | 1320 | <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
1358 | | - <persistence-unit name="openjpa_cache9_flagged"> |
1359 | | - <!-- flag --> |
| 1321 | + <persistence-unit name="openjpa_cache9_flagged"> <!-- flag --> |
1360 | 1322 | <shared-cache-mode>NONE</shared-cache-mode> |
1361 | 1323 | <validation-mode>NONE</validation-mode> |
1362 | 1324 | <properties> |
|
0 commit comments