Skip to content

Commit

Permalink
Move beanvalidation tests to standalone junits
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Jun 27, 2022
1 parent 72436b3 commit 5280830
Show file tree
Hide file tree
Showing 24 changed files with 276 additions and 115 deletions.
1 change: 1 addition & 0 deletions etc/jenkins/pr_verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ spec:
sh """
mvn -B -V clean install -pl :eclipselink
mvn -B -V verify -pl :org.eclipse.persistence.jpa.modelgen.processor,:org.eclipse.persistence.jpa.jse.test,:org.eclipse.persistence.extension,:org.eclipse.persistence.jpa.jpql,:org.eclipse.persistence.jpa.wdf.test,:org.eclipse.persistence.jpars,:org.eclipse.persistence.dbws,:org.eclipse.persistence.dbws.builder,:eclipselink,:org.eclipse.persistence.distribution.tests -P mysql;
mvn -B -V -P mysql -amd verify -pl :org.eclipse.persistence.jpa.testapps;
"""
}
}
Expand Down
26 changes: 0 additions & 26 deletions jpa/eclipselink.jpa.test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@
<item>eclipselink-remote</item>
<item>jpa-performance</item>
<item>jpa-performance2</item>
<item>eclipselink-beanvalidation-model</item>
<item>eclipselink-beanvalidation-dynamic-model</item>
<item>eclipselink-identity-model</item>
<item>eclipselink-jpa22-model</item>
<item>eclipselink-xml-extended-composite-advanced-model</item>
Expand Down Expand Up @@ -498,8 +496,6 @@
<item>eclipselink-metamodel-model</item>
<item>eclipselink-delimited-model</item>
<item>eclipselink-extensibility-model</item>
<item>eclipselink-beanvalidation-model</item>
<item>eclipselink-beanvalidation-dynamic-model</item>
<item>eclipselink-xml-mapping-metadata-complete</item>
<item>eclipselink-xml-composite-advanced-model-member_1</item>
<item>eclipselink-xml-extended-model</item>
Expand Down Expand Up @@ -750,12 +746,6 @@
<puName>default</puName>
</properties>
</itemWithProperty>
<itemWithProperty>
<name>server-test-jpa-beanvalidation</name>
<properties>
<puName>beanvalidation</puName>
</properties>
</itemWithProperty>
<itemWithProperty>
<name>server-test-jpa-cascadedeletes</name>
<properties>
Expand Down Expand Up @@ -1280,8 +1270,6 @@
<additionalClasspathElement>${project.build.directory}/${wave.file.prefix}eclipselink-metamodel-model.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${wave.file.prefix}eclipselink-delimited-model.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${wave.file.prefix}eclipselink-extensibility-model.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${wave.file.prefix}eclipselink-beanvalidation-model.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${wave.file.prefix}eclipselink-beanvalidation-dynamic-model.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/eclipselink-composite-advanced-model.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${wave.file.prefix}eclipselink-composite-advanced-model-member_1.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${wave.file.prefix}eclipselink-composite-advanced-model-member_2.jar</additionalClasspathElement>
Expand Down Expand Up @@ -1644,20 +1632,6 @@
<test-client-class>org.eclipse.persistence.testing.tests.jpa22.advanced.JPA22TestSuite</test-client-class>
</properties>
</profile>
<profile>
<id>server-test-jpa-beanvalidation</id>
<properties>
<skip-test-jpa-srg>true</skip-test-jpa-srg>
<skip-server-test-jpa>false</skip-server-test-jpa>
<skip-jpa-jse-build>true</skip-jpa-jse-build>
<puName>beanvalidation</puName>
<!--modelname property name is used there due substitution string in application.xml-->
<modelname>eclipselink-beanvalidation-model</modelname>
<extra-model>eclipselink-beanvalidation-model</extra-model>
<packageName>beanvalidation</packageName>
<test-client-class>org.eclipse.persistence.testing.tests.jpa.beanvalidation.BeanValidationJunitTest</test-client-class>
</properties>
</profile>
<profile>
<id>server-test-jpa-advanced-multitenantEMF</id>
<properties>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2022 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
http://www.eclipse.org/legal/epl-2.0,
or the Eclipse Distribution License v. 1.0 which is available at
http://www.eclipse.org/org/documents/edl-v10.php.
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>org.eclipse.persistence.jpa.testapps</artifactId>
<groupId>org.eclipse.persistence</groupId>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>org.eclipse.persistence.jpa.testapps.beanvalidation.dynamic</artifactId>

<name>Test - Persistence beanvalidation.dynamic</name>

<dependencies>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand All @@ -20,7 +20,7 @@
<validation-mode>CALLBACK</validation-mode>
<properties>
<property name="eclipselink.weaving" value="static"/>
<property name="jakarta.persistence.schema-generation.database.action" value="create"/>
<property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/>
</properties>
</persistence-unit>
</persistence>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2022 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
Expand Down Expand Up @@ -49,9 +49,7 @@ public BeanValidationDynamicEntityJunitTest(String name) {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.setName("BeanValidationDynamicEntityJunitTest");
if (! JUnitTestCase.isJPA10()) {
suite.addTest(new BeanValidationDynamicEntityJunitTest("testPersistDynamicEntityWithInvalidData"));
}
suite.addTest(new BeanValidationDynamicEntityJunitTest("testPersistDynamicEntityWithInvalidData"));
return suite;
}

Expand All @@ -62,8 +60,7 @@ public static Test suite() {
* 3. Assert - transaction is rolled back
* 4. Assert - The validation exception is due to invalid value given by us.
*/
@SuppressWarnings("unchecked")
public void testPersistDynamicEntityWithInvalidData() {
public void testPersistDynamicEntityWithInvalidData() {
// Create an entity manager factory with a dynamic class loader.
DynamicClassLoader dcl = new ReflectiveDynamicClassLoader(Thread.currentThread().getContextClassLoader());
Map<String,Object> properties = new HashMap<>(getPersistenceProperties());
Expand Down
67 changes: 67 additions & 0 deletions jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2022 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
http://www.eclipse.org/legal/epl-2.0,
or the Eclipse Distribution License v. 1.0 which is available at
http://www.eclipse.org/org/documents/edl-v10.php.
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>org.eclipse.persistence.jpa.testapps</artifactId>
<groupId>org.eclipse.persistence</groupId>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>org.eclipse.persistence.jpa.testapps.beanvalidation</artifactId>

<name>Test - Persistence beanvalidation</name>

<dependencies>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>

<properties>
<argLine/>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-javaagent:${org.eclipse.persistence:org.eclipse.persistence.jpa:jar} @{argLine}</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2022 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2022 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
Expand Down

0 comments on commit 5280830

Please sign in to comment.