From e4d7c2a9cd3d31e5a7d6348db05b73f21a9e936a Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Mon, 29 Apr 2024 20:29:38 +0200 Subject: [PATCH] Fix some tests to allow cascade constraints syntax --- .../annotations/joinTable/Client.java | 20 ++++--------------- .../annotations/orderColumn/Client.java | 1 + .../annotations/secondaryTable/Client.java | 1 + 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/joinTable/Client.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/joinTable/Client.java index 98582996f6..23e9d9a92e 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/joinTable/Client.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/joinTable/Client.java @@ -185,22 +185,10 @@ public void joinTableTest() throws Exception { * SCHEMAGENCOURSE (COURSEID) */ - pass2a = findDataInFile(f2, new LinkedList() { - private static final long serialVersionUID = 22L; - { - add("ALTER TABLE"); - add("SCHEMAGEN_COURSE_STUDENT DROP"); - add("STUDENTIDCONSTRAINT"); - } - }); - pass2b = findDataInFile(f2, new LinkedList() { - private static final long serialVersionUID = 22L; - { - add("ALTER TABLE"); - add("SCHEMAGEN_COURSE_STUDENT DROP"); - add("COURSEIDCONSTRAINT"); - } - }); + pass2a = findDataInFile(f2, List.of("ALTER TABLE", "SCHEMAGEN_COURSE_STUDENT DROP", "STUDENTIDCONSTRAINT")); + pass2a = pass2a || findDataInFile(f2, List.of("DROP TABLE", "SCHEMAGEN_COURSE_STUDENT", "CASCADE CONSTRAINTS")); + pass2b = findDataInFile(f2, List.of("ALTER TABLE", "SCHEMAGEN_COURSE_STUDENT DROP", "COURSEIDCONSTRAINT")); + pass2b = pass2b || findDataInFile(f2, List.of("DROP TABLE", "SCHEMAGEN_COURSE_STUDENT", "CASCADE CONSTRAINTS")); expected.clear(); expected.add("DROP TABLE"); expected.add("SCHEMAGEN_COURSE_STUDENT"); diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/orderColumn/Client.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/orderColumn/Client.java index 29d42b9473..259cd7d948 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/orderColumn/Client.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/orderColumn/Client.java @@ -171,6 +171,7 @@ public void orderColumnTest() throws Exception { expected.add("ALTER TABLE"); expected.add("SCHEMAGENEMP DROP"); pass2c = findDataInFile(f2, expected); + pass2c = pass2c || findDataInFile(f2, List.of("DROP TABLE", "SCHEMAGENEMP", "CASCADE CONSTRAINTS")); logger.log(Logger.Level.TRACE, "Execute the create script"); props = getPersistenceUnitProperties(); diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/secondaryTable/Client.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/secondaryTable/Client.java index c81e98863d..7eafea44ee 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/secondaryTable/Client.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/schemaGeneration/annotations/secondaryTable/Client.java @@ -159,6 +159,7 @@ public void secondaryTableTest() throws Exception { expected.add("ALTER TABLE"); expected.add("SCHEMAGENSIMPLE_SECOND DROP"); pass2a = findDataInFile(f2, expected); + pass2a = pass2a || findDataInFile(f2, List.of("DROP TABLE", "SCHEMAGENSIMPLE_SECOND", "CASCADE CONSTRAINTS")); expected.clear(); expected.add("DROP TABLE"); expected.add("SCHEMAGENSIMPLE");