This is an automated email from the ASF dual-hosted git repository. pcristof pushed a commit to branch OPENJPA-2940 in repository https://gitbox.apache.org/repos/asf/openjpa.git
commit b4a9abab2b9f51c232bd4c6ddb2334d6356c394f Author: Paulo Cristovão de Araújo Silva Filho <pcris...@gmail.com> AuthorDate: Fri Jul 4 11:10:36 2025 -0300 [OPENJPA-2940][WIP] Intermmediate commit * removed TestSecurityContext because it is terminally deprecated since 17 and already removed in current JDK versions * updated h2-2 test profile jdbc url to remove strict definition * updated openjpa-slice and openjpa-xmlstore pom system variables definitions * updated GH actions workflows to use test-h2-2 profiles --- .github/workflows/ci.yml | 2 +- .github/workflows/pr-validation.yml | 2 +- .../persistence/kernel/TestSecurityContext.java | 250 --------------------- openjpa-slice/pom.xml | 14 +- openjpa-xmlstore/pom.xml | 19 +- pom.xml | 2 +- 6 files changed, 12 insertions(+), 277 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d95f6a10..90126d8cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,6 @@ jobs: key: 'cache' restore-keys: 'cache' - name: 'Build with Maven' - run: mvn -B install --file pom.xml + run: mvn -B -Ptest-h2-2 clean install --file pom.xml - name: 'Remove Snapshots Before Caching' run: find ~/.m2 -name '*SNAPSHOT' | xargs rm -Rf diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index ecbdacdf1..ed78eae3e 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -34,6 +34,6 @@ jobs: key: 'cache' restore-keys: 'cache' - name: 'Build with Maven' - run: mvn -B install --file pom.xml + run: mvn -B -Ptest-h2-2 clean install --file pom.xml - name: 'Remove Snapshots Before Caching' run: find ~/.m2 -name '*SNAPSHOT' | xargs rm -Rf diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestSecurityContext.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestSecurityContext.java deleted file mode 100644 index 2259a51aa..000000000 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestSecurityContext.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * TestSecurityContext.java - * - * Created on October 13, 2006, 5:25 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openjpa.persistence.kernel; - -import java.io.FileDescriptor; -import java.net.InetAddress; -import java.security.Permission; - -import org.apache.openjpa.persistence.OpenJPAEntityManager; -import org.apache.openjpa.persistence.kernel.common.apps.RuntimeTest1; -import org.apache.openjpa.persistence.kernel.common.apps.RuntimeTest2; -import org.apache.openjpa.persistence.kernel.common.apps.RuntimeTest3; - -public class TestSecurityContext extends BaseKernelTest { - - private SecurityManager oldManager; - - /** - * Creates a new instance of TestSecurityContext - */ - public TestSecurityContext() { - } - - public TestSecurityContext(String name) { - super(name); - } - - @Override - public void setUp() throws Exception { - super.setUp(RuntimeTest1.class, RuntimeTest2.class, RuntimeTest3.class); - oldManager = System.getSecurityManager(); - // System.setSecurityManager (ssm = new StrictSecurityManager ()); - } - - @Override - public void tearDown() - throws Exception { - System.setSecurityManager(oldManager); - oldManager = null; - super.tearDown(); - } - - public void testInSecureClassLoader() { - OpenJPAEntityManager pm = getPM(); - startTx(pm); - pm.createExtent(RuntimeTest1.class, true).iterator().hasNext(); - endTx(pm); - endEm(pm); - } - - public class StrictSecurityManager - extends SecurityManager { - - private void debug(String msg) { - // log.debug (msg); - } - - @Override - public void checkAccept(String host, int port) { - debug("checkAccept: " + host + "," + port); - super.checkAccept(host, port); - } - - @Override - public void checkAccess(Thread t) { - debug("checkAccess: " + t); - super.checkAccess(t); - } - - @Override - public void checkAccess(ThreadGroup g) { - debug("checkAccess: " + g); - super.checkAccess(g); - } - - @Override - public void checkConnect(String host, int port) { - debug("checkConnect: " + host + "," + port); - super.checkConnect(host, port); - } - - @Override - public void checkConnect(String host, int port, Object context) { - debug("checkConnect: " + host + "," + port + "," + context); - super.checkConnect(host, port, context); - } - - @Override - public void checkCreateClassLoader() { - debug("checkCreateClassLoader"); - super.checkCreateClassLoader(); - } - - @Override - public void checkDelete(String file) { - debug("checkDelete: " + file); - super.checkDelete(file); - } - - @Override - public void checkExec(String cmd) { - debug("checkExec: " + cmd); - super.checkExec(cmd); - } - - @Override - public void checkExit(int status) { - debug("checkExit: " + status); - super.checkExit(status); - } - - @Override - public void checkLink(String lib) { - debug("checkLink: " + lib); - super.checkLink(lib); - } - - @Override - public void checkListen(int port) { - debug("checkListen: " + port); - super.checkListen(port); - } - - @Override - public void checkMulticast(InetAddress maddr) { - debug("checkMulticast: " + maddr); - super.checkMulticast(maddr); - } - - @Override - public void checkMulticast(InetAddress maddr, byte ttl) { - debug("checkMulticast: " + maddr + "," + ttl); - super.checkMulticast(maddr, ttl); - } - - @Override - public void checkPackageAccess(String pkg) { - debug("checkPackageAccess: " + pkg); - super.checkPackageAccess(pkg); - } - - @Override - public void checkPackageDefinition(String pkg) { - debug("checkPackageDefinition: " + pkg); - super.checkPackageDefinition(pkg); - } - - @Override - public void checkPermission(Permission perm) { - debug("checkPermission: " + perm); - super.checkPermission(perm); - } - - @Override - public void checkPermission(Permission perm, Object context) { - debug("checkPermission: " + perm + "," + context); - super.checkPermission(perm, context); - } - - @Override - public void checkPrintJobAccess() { - debug("checkPrintJobAccess"); - super.checkPrintJobAccess(); - } - - @Override - public void checkPropertiesAccess() { - debug("checkPropertiesAccess"); - super.checkPropertiesAccess(); - } - - @Override - public void checkPropertyAccess(String key) { - debug("checkPropertyAccess: " + key); - super.checkPropertyAccess(key); - } - - @Override - public void checkRead(FileDescriptor fd) { - debug("checkRead: " + fd); - super.checkRead(fd); - } - - @Override - public void checkRead(String file) { - debug("checkRead: " + file); - super.checkRead(file); - } - - @Override - public void checkRead(String file, Object context) { - debug("checkRead: " + file + "," + context); - super.checkRead(file, context); - } - - @Override - public void checkSecurityAccess(String target) { - debug("checkSecurityAccess: " + target); - super.checkSecurityAccess(target); - } - - @Override - public void checkSetFactory() { - debug("checkSetFactory"); - super.checkSetFactory(); - } - - @Override - public void checkWrite(FileDescriptor fd) { - debug("checkWrite: " + fd); - super.checkWrite(fd); - } - - @Override - public void checkWrite(String file) { - debug("checkWrite: " + file); - super.checkWrite(file); - } - - @Override - protected Class[] getClassContext() { - debug("getClassContext"); - return super.getClassContext(); - } - } -} diff --git a/openjpa-slice/pom.xml b/openjpa-slice/pom.xml index 82db692dc..1c880486e 100644 --- a/openjpa-slice/pom.xml +++ b/openjpa-slice/pom.xml @@ -139,16 +139,10 @@ <exclude>org/apache/openjpa/**/*.*.class</exclude> </excludes> - <systemProperties> - <property> - <name>openjpa.Log</name> - <value>${openjpa.Log}</value> - </property> - <property> - <name>derby.stream.error.file</name> - <value>target/derby.log</value> - </property> - </systemProperties> + <systemPropertyVariables> + <openjpa.Log>${openjpa.Log}</openjpa.Log> + <derby.stream.error.file>target/derby.log</derby.stream.error.file> + </systemPropertyVariables> </configuration> </plugin> </plugins> diff --git a/openjpa-xmlstore/pom.xml b/openjpa-xmlstore/pom.xml index 900a2309a..50673c31e 100644 --- a/openjpa-xmlstore/pom.xml +++ b/openjpa-xmlstore/pom.xml @@ -119,20 +119,11 @@ <artifactId>maven-surefire-plugin</artifactId> <configuration> <argLine>${test.jvm.arguments}</argLine> - <systemProperties> - <property> - <name>openjpa.Log</name> - <value>${openjpa.Log}</value> - </property> - <property> - <name>openjpa.DynamicEnhancementAgent</name> - <value>false</value> - </property> - <property> - <name>tests.openjpa.allowfailure</name> - <value>${tests.openjpa.allowfailure}</value> - </property> - </systemProperties> + <systemPropertyVariables> + <openjpa.Log>${openjpa.Log}</openjpa.Log> + <openjpa.DynamicEnhancementAgent>false</openjpa.DynamicEnhancementAgent> + <tests.openjpa.allowfailure>${tests.openjpa.allowfailure}</tests.openjpa.allowfailure> + </systemPropertyVariables> </configuration> </plugin> </plugins> diff --git a/pom.xml b/pom.xml index 6f4768428..f82c0808d 100644 --- a/pom.xml +++ b/pom.xml @@ -480,7 +480,7 @@ <properties> <h2.version>2.3.232</h2.version> <connection.driver.name>org.h2.Driver</connection.driver.name> - <connection.url>jdbc:h2:./target/database/openjpa-h2-database;MODE=STRICT</connection.url> + <connection.url>jdbc:h2:./target/database/openjpa-h2-database</connection.url> <connection.username /> <connection.password /> <!-- TCK specific properties -->