Skip to content

Commit 7bdc97c

Browse files
authored
Merge pull request #32711 from njr-11/updates-after-el-beta-10
Updates after EclipseLink beta 10
2 parents cd84d5b + dcd982e commit 7bdc97c

File tree

2 files changed

+37
-32
lines changed
  • dev
    • io.openliberty.data.internal_fat_jpa/test-applications/DataJPATestApp/src/test/jakarta/data/jpa/web
    • io.openliberty.data.internal_fat/test-applications/DataTestApp/src/test/jakarta/data/web

2 files changed

+37
-32
lines changed

dev/io.openliberty.data.internal_fat/test-applications/DataTestApp/src/test/jakarta/data/web/RomanNumeral.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@
1010
*******************************************************************************/
1111
package test.jakarta.data.web;
1212

13-
import java.util.ArrayList;
14-
1513
/**
1614
* A record to use as a result type for selecting attributes of the Prime entity.
15+
* EclipseLink decided to disallow collection attributes such as
16+
* ArrayList<String> romanNumeralSymbols
17+
* so it is omitted from from this record.
1718
*/
1819
public record RomanNumeral(
1920
String name,
20-
String romanNumeral
21-
// , TODO enable once EclipseLink bug #30501 is fixed
22-
// ArrayList<String> romanNumeralSymbols
23-
) {
21+
String romanNumeral) {
2422

2523
/**
2624
* Format in an easy way for tests to compare results.
@@ -30,9 +28,9 @@ public String toString() {
3028
StringBuilder s = new StringBuilder();
3129
s.append(name).append(" ");
3230
s.append(romanNumeral).append(" ( ");
31+
// If collection attributes are ever allowed, the following could become
32+
// for (String symbol : romanNumeralSymbols)
3333
for (char symbol : romanNumeral.toCharArray())
34-
// TODO replace the above with the following once EclipseLink bug #30501 is fixed
35-
//for (String symbol : romanNumeralSymbols)
3634
s.append(symbol).append(' ');
3735
s.append(")");
3836
return s.toString();

dev/io.openliberty.data.internal_fat_jpa/test-applications/DataJPATestApp/src/test/jakarta/data/jpa/web/DataJPATestServlet.java

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,20 +1332,27 @@ Comparator.<ShippingAddress, Long> comparing(o -> o.id)
13321332
.map(a -> a.houseNumber + " " + a.streetName)
13331333
.collect(Collectors.toList()));
13341334

1335-
// TODO Enable once EclipseLink bug #31558 is fixed:
1336-
// List<ShippingAddress> found = shippingAddresses
1337-
// .findByStreetAddressRecipientInfoNotEmpty();
1335+
List<ShippingAddress> found = shippingAddresses
1336+
.findByStreetAddressRecipientInfoNotEmpty();
1337+
ShippingAddress a = null;
1338+
for (ShippingAddress s : found) {
1339+
if (a1.id.equals(s.id))
1340+
a = s;
1341+
}
1342+
// TODO Replace above for loop with the following once EclipseLink bug #31559 is fixed
13381343
// assertEquals(1, found.size());
1339-
// ShippingAddress a = found.get(0);
1340-
// assertEquals(a1.id, a.id);
1341-
// assertEquals(a1.city, a.city);
1342-
// assertEquals(a1.state, a.state);
1343-
// assertEquals(a1.zipCode, a.zipCode);
1344-
// assertEquals(a1.streetAddress.houseNumber, a.streetAddress.houseNumber);
1345-
// assertEquals(a1.streetAddress.streetName, a.streetAddress.streetName);
1346-
// assertEquals(a1.streetAddress.recipientInfo, a.streetAddress.recipientInfo);
1347-
1348-
// assertEquals(3L, shippingAddresses.countByStreetAddressRecipientInfoEmpty());
1344+
// a = found.get(0);
1345+
assertEquals(a1.id, a.id);
1346+
assertEquals(a1.city, a.city);
1347+
assertEquals(a1.state, a.state);
1348+
assertEquals(a1.zipCode, a.zipCode);
1349+
assertEquals(a1.streetAddress.houseNumber, a.streetAddress.houseNumber);
1350+
assertEquals(a1.streetAddress.streetName, a.streetAddress.streetName);
1351+
assertEquals(a1.streetAddress.recipientInfo, a.streetAddress.recipientInfo);
1352+
1353+
long count = shippingAddresses.countByStreetAddressRecipientInfoEmpty();
1354+
// TODO Enable once EclipseLink bug #31559 is fixed:
1355+
// assertEquals(3L, count);
13491356

13501357
// [EclipseLink-4002] Internal Exception: java.sql.SQLIntegrityConstraintViolationException:
13511358
// DELETE on table 'SHIPPINGADDRESS' caused a violation of foreign key constraint 'SHPPNGSHPPNGDDRSSD' for key (1001)
@@ -1439,13 +1446,15 @@ public void testEmbeddableCollection() {
14391446
.map(t -> t.ssn)
14401447
.collect(Collectors.toList()));
14411448

1442-
// TODO enable once issue #31558 and
1443-
// TODO subsequently #32263 is fixed in EclipseLink
1444-
if (false)
1445-
assertIterableEquals(List.of(789007890L),
1446-
taxpayers.findByBankAccountsNotEmpty()
1447-
.map(t -> t.ssn)
1448-
.collect(Collectors.toList()));
1449+
assertEquals(List.of(123001230L,
1450+
234002340L,
1451+
345003450L,
1452+
456004560L,
1453+
567005670L,
1454+
678006780L),
1455+
taxpayers.findByBankAccountsNotEmpty()
1456+
.map(t -> t.ssn)
1457+
.collect(Collectors.toList()));
14491458

14501459
taxpayers.delete();
14511460
}
@@ -2007,8 +2016,7 @@ public void testExistsViaQueryLanguage() {
20072016
/**
20082017
* Verify that JPQL can be used to EXTRACT the DATE from a LocalDateTime.
20092018
*/
2010-
// TODO enable once EclipseLink bug #31802 is fixed
2011-
//@Test
2019+
@Test
20122020
public void testExtractDate() {
20132021
rebates.reset();
20142022

@@ -2131,8 +2139,7 @@ public void testExtractFromDateFunction2() {
21312139
/**
21322140
* Verify that JPQL can be used to EXTRACT the TIME from a LocalDateTime.
21332141
*/
2134-
// TODO enable once EclipseLink bug #31802 is fixed
2135-
//@Test
2142+
@Test
21362143
public void testExtractTime() {
21372144
rebates.reset();
21382145

0 commit comments

Comments
 (0)