diff --git a/jpa/eclipselink.jpa.test/antbuild.xml b/jpa/eclipselink.jpa.test/antbuild.xml index 358282c24fa..fd5f675fc98 100644 --- a/jpa/eclipselink.jpa.test/antbuild.xml +++ b/jpa/eclipselink.jpa.test/antbuild.xml @@ -526,24 +526,28 @@ + + + + diff --git a/jpa/eclipselink.jpa.test/resource/weblogic/wls_composite_setup.py b/jpa/eclipselink.jpa.test/resource/weblogic/wls_composite_setup.py index c562624562d..408d9e7614d 100644 --- a/jpa/eclipselink.jpa.test/resource/weblogic/wls_composite_setup.py +++ b/jpa/eclipselink.jpa.test/resource/weblogic/wls_composite_setup.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024 Oracle and/or its affiliates. All rights reserved. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0 which is available at @@ -48,6 +48,7 @@ cd('/JDBCSystemResources/EclipseLinkDS/JDBCResource/EclipseLinkDS/JDBCConnectionPoolParams/EclipseLinkDS') cmo.setTestTableName('SQL SELECT 1 FROM DUAL') +cmo.setWrapTypes(false) cd('/JDBCSystemResources/EclipseLinkDS/JDBCResource/EclipseLinkDS/JDBCDriverParams/EclipseLinkDS/Properties/EclipseLinkDS') cmo.createProperty('user') diff --git a/jpa/eclipselink.jpa.test/resource/weblogic/wls_exalogic_setup.py b/jpa/eclipselink.jpa.test/resource/weblogic/wls_exalogic_setup.py index 61f9bc617e4..2af8f6301d8 100644 --- a/jpa/eclipselink.jpa.test/resource/weblogic/wls_exalogic_setup.py +++ b/jpa/eclipselink.jpa.test/resource/weblogic/wls_exalogic_setup.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024 Oracle and/or its affiliates. All rights reserved. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0 which is available at @@ -46,6 +46,7 @@ cd('/JDBCSystemResources/EclipseLinkDS/JDBCResource/EclipseLinkDS/JDBCConnectionPoolParams/EclipseLinkDS') cmo.setTestTableName('SQL SELECT 1 FROM DUAL') +cmo.setWrapTypes(false) cd('/JDBCSystemResources/EclipseLinkDS/JDBCResource/EclipseLinkDS/JDBCDriverParams/EclipseLinkDS/Properties/EclipseLinkDS') cmo.createProperty('user') @@ -85,6 +86,7 @@ cd('/JDBCSystemResources/ELNonJTADS/JDBCResource/ELNonJTADS/JDBCConnectionPoolParams/ELNonJTADS') cmo.setTestTableName('SQL SELECT 1 FROM DUAL') +cmo.setWrapTypes(false) cd('/JDBCSystemResources/ELNonJTADS/JDBCResource/ELNonJTADS/JDBCDriverParams/ELNonJTADS/Properties/ELNonJTADS') cmo.createProperty('user') diff --git a/jpa/eclipselink.jpa.test/resource/weblogic/wls_setup.py b/jpa/eclipselink.jpa.test/resource/weblogic/wls_setup.py index b299b314912..51f5287b87a 100644 --- a/jpa/eclipselink.jpa.test/resource/weblogic/wls_setup.py +++ b/jpa/eclipselink.jpa.test/resource/weblogic/wls_setup.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024 Oracle and/or its affiliates. All rights reserved. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0 which is available at @@ -47,6 +47,7 @@ cd('/JDBCSystemResources/EclipseLinkDS/JDBCResource/EclipseLinkDS/JDBCConnectionPoolParams/EclipseLinkDS') cmo.setTestTableName('SQL SELECT 1 FROM DUAL') + cmo.setWrapTypes(false) cd('/JDBCSystemResources/EclipseLinkDS/JDBCResource/EclipseLinkDS/JDBCDriverParams/EclipseLinkDS/Properties/EclipseLinkDS') cmo.createProperty('user') @@ -89,6 +90,7 @@ cd('/JDBCSystemResources/ELNonJTADS/JDBCResource/ELNonJTADS/JDBCConnectionPoolParams/ELNonJTADS') cmo.setTestTableName('SQL SELECT 1 FROM DUAL') + cmo.setWrapTypes(false) cd('/JDBCSystemResources/ELNonJTADS/JDBCResource/ELNonJTADS/JDBCDriverParams/ELNonJTADS/Properties/ELNonJTADS') cmo.createProperty('user') diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java index 88b26c98c69..75dee80ce88 100644 --- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java +++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -44,6 +44,7 @@ import org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl; import org.eclipse.persistence.logging.DefaultSessionLog; import org.eclipse.persistence.logging.SessionLog; +import org.eclipse.persistence.platform.server.ServerPlatformUtils; import org.eclipse.persistence.sessions.Connector; import org.eclipse.persistence.sessions.DefaultConnector; import org.eclipse.persistence.sessions.JNDIConnector; @@ -51,6 +52,7 @@ import org.eclipse.persistence.sessions.server.ServerSession; import org.eclipse.persistence.testing.framework.server.JEEPlatform; import org.eclipse.persistence.testing.framework.server.ServerPlatform; +import org.eclipse.persistence.testing.framework.server.WebLogicPlatform; import org.eclipse.persistence.testing.framework.server.TestRunner; import org.eclipse.persistence.testing.framework.server.TestRunner1; import org.eclipse.persistence.testing.framework.server.TestRunner2; @@ -298,7 +300,12 @@ public static ServerPlatform getServerPlatform() { if (serverPlatform == null) { String platformClass = System.getProperty("TEST_SERVER_PLATFORM"); if (platformClass == null) { - serverPlatform = new JEEPlatform(); + String detectedServerPlatform = ServerPlatformUtils.detectServerPlatform(null); + if (detectedServerPlatform != null && detectedServerPlatform.contains("WebLogic")) { + serverPlatform = new WebLogicPlatform(); + } else { + serverPlatform = new JEEPlatform(); + } } else { try { serverPlatform = (ServerPlatform)Class.forName(platformClass).newInstance(); diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpaadvancedproperties/JPAAdvPropertiesJUnitTestCase.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpaadvancedproperties/JPAAdvPropertiesJUnitTestCase.java index c3280234387..1fba29512fd 100644 --- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpaadvancedproperties/JPAAdvPropertiesJUnitTestCase.java +++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpaadvancedproperties/JPAAdvPropertiesJUnitTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -363,27 +363,28 @@ public void testSessionXMLProperty() { } public void testLoginEncryptorProperty() { - EntityManager em = createEntityManager(persistenceUnitName); - try { - //Create new customer - beginTransaction(em); - Customer customer = ModelExamples.customerExample1(); - em.persist(customer); - em.flush(); - Integer customerId = customer.getCustomerId(); - commitTransaction(em); - - customer = em.find(org.eclipse.persistence.testing.models.jpa.jpaadvancedproperties.Customer.class, customerId); - //Purge it - beginTransaction(em); - em.remove(customer); - commitTransaction(em); - - assertNotNull(customer); - assertTrue("CustomizedEncryptor.encryptPassword() method wasn't called.", CustomizedEncryptor.encryptPasswordCounter > 0); - assertTrue("CustomizedEncryptor.decryptPassword() method wasn't called.", CustomizedEncryptor.decryptPasswordCounter > 0); - } finally { - closeEntityManager(em); + if (!isOnServer()) { + EntityManager em = createEntityManager(persistenceUnitName); + try { + //Create new customer + beginTransaction(em); + Customer customer = ModelExamples.customerExample1(); + em.persist(customer); + em.flush(); + Integer customerId = customer.getCustomerId(); + commitTransaction(em); + + //Purge it + beginTransaction(em); + em.remove(em.find(org.eclipse.persistence.testing.models.jpa.jpaadvancedproperties.Customer.class, customerId)); + commitTransaction(em); + + assertNotNull(customer); + assertTrue("CustomizedEncryptor.encryptPassword() method wasn't called.", CustomizedEncryptor.encryptPasswordCounter > 0); + assertTrue("CustomizedEncryptor.decryptPassword() method wasn't called.", CustomizedEncryptor.decryptPasswordCounter > 0); + } finally { + closeEntityManager(em); + } } } }