Skip to content

Commit a11bdae

Browse files
authored
GitHub issue template and Maven archetypes for testcases (#2021)
1 parent 149e9ce commit a11bdae

File tree

26 files changed

+1320
-0
lines changed

26 files changed

+1320
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
Useful resources are
13+
- Log messages
14+
- Stack trace
15+
- Heap dump or some Java object histogram
16+
17+
**To Reproduce**
18+
Steps/resources to reproduce the behavior:
19+
20+
- EclipseLink version
21+
- Java/JDK version
22+
- Entity source (mainly applied annotations)
23+
1. For problem in persistence (JPA)
24+
- JPA context like ``persistence.xml`` settings or related system properties (in case of JPA)
25+
- Database provider/version
26+
- JDBC driver provider/version (it should be useful if bug is related with some "specific" datatype e.g. JSON)
27+
2. For problem in MOXy (JAXB implementation)
28+
- JAXBContext creation (in case of MOXy)
29+
- Other context description in case of SDO, DBWS or others
30+
- Other additional context like AspectJ pre-compiler, Spring FW, JEE Server, Lombok annotations....
31+
- Code example which leads into bug like:
32+
33+
```
34+
...
35+
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("test-jpa-pu");
36+
EntityManager em = entityManagerFactory.createEntityManager();
37+
em.getTransaction().begin();
38+
TestEntityMaster entity = new TestEntityMaster(10, "Persist Master 1");
39+
em.persist(entity);
40+
em.getTransaction().commit();
41+
...
42+
```
43+
44+
**Expected behavior**
45+
A clear and concise description of what you expected to happen.
46+
47+
**Additional context**
48+
Add any other context about the problem here.
49+
50+
**Note**
51+
The best way to describe a bug is to give us a test case.
52+
To simplify this process there are Maven archetypes in `etc/archetypes/bug_test_case` project directory which can be built locally by "mvn install".
53+
Initial test project can then be generated from these archetypes by:
54+
55+
`mvn archetype:generate -DarchetypeGroupId=org.eclipse.persistence -DarchetypeArtifactId=org.eclipse.persistence.bug.jpa-archetype -DarchetypeVersion=5.0.0-SNAPSHOT -DgroupId=eclipselink.bug.testcase -DartifactId=jpa-testcase`
56+
57+
`mvn archetype:generate -DarchetypeGroupId=org.eclipse.persistence -DarchetypeArtifactId=org.eclipse.persistence.bug.moxy-archetype -DarchetypeVersion=5.0.0-SNAPSHOT -DgroupId=eclipselink.bug.testcase -DartifactId=moxy-testcase`
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
5+
6+
This program and the accompanying materials are made available under the
7+
terms of the Eclipse Public License v. 2.0 which is available at
8+
http://www.eclipse.org/legal/epl-2.0,
9+
or the Eclipse Distribution License v. 1.0 which is available at
10+
http://www.eclipse.org/org/documents/edl-v10.php.
11+
12+
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
13+
14+
-->
15+
16+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
20+
<name>EclipseLink JPA Bug Test Case (Maven Archetype)</name>
21+
<groupId>org.eclipse.persistence</groupId>
22+
<artifactId>org.eclipse.persistence.bug.jpa-archetype</artifactId>
23+
<packaging>maven-archetype</packaging>
24+
25+
<parent>
26+
<groupId>org.eclipse.persistence</groupId>
27+
<artifactId>org.eclipse.persistence.parent</artifactId>
28+
<version>5.0.0-SNAPSHOT</version>
29+
<relativePath>../../../../pom.xml</relativePath>
30+
</parent>
31+
<build>
32+
<resources>
33+
<resource>
34+
<directory>src/main/resources/META-INF/maven</directory>
35+
<targetPath>META-INF/maven</targetPath>
36+
</resource>
37+
<resource>
38+
<directory>src/main/resources/archetype-resources</directory>
39+
<filtering>true</filtering>
40+
<targetPath>archetype-resources</targetPath>
41+
</resource>
42+
</resources>
43+
<extensions>
44+
<extension>
45+
<groupId>org.apache.maven.archetype</groupId>
46+
<artifactId>archetype-packaging</artifactId>
47+
<version>3.1.1</version>
48+
</extension>
49+
</extensions>
50+
</build>
51+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
5+
6+
This program and the accompanying materials are made available under the
7+
terms of the Eclipse Public License v. 2.0 which is available at
8+
http://www.eclipse.org/legal/epl-2.0,
9+
or the Eclipse Distribution License v. 1.0 which is available at
10+
http://www.eclipse.org/org/documents/edl-v10.php.
11+
12+
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
13+
14+
-->
15+
16+
<archetype-descriptor
17+
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0 https://maven.apache.org/xsd/archetype-descriptor-1.1.0.xsd"
19+
name="quickstart">
20+
<fileSets>
21+
<fileSet filtered="true">
22+
<directory>src/main/java</directory>
23+
</fileSet>
24+
<fileSet filtered="true">
25+
<directory>src/main/resources</directory>
26+
</fileSet>
27+
<fileSet>
28+
<directory>src/test/java</directory>
29+
</fileSet>
30+
</fileSets>
31+
</archetype-descriptor>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
EclipseLink JPA Bug testcase
2+
Initial files in this Maven project should be used as a template for JPA bug test case.
3+
There are various JDBC driver dependencies declared in the POM and related connections in `persistence.xml`.
4+
Database objects should be created by `init.sql` script.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
5+
6+
This program and the accompanying materials are made available under the
7+
terms of the Eclipse Public License v. 2.0 which is available at
8+
http://www.eclipse.org/legal/epl-2.0,
9+
or the Eclipse Distribution License v. 1.0 which is available at
10+
http://www.eclipse.org/org/documents/edl-v10.php.
11+
12+
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
13+
14+
-->
15+
16+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
<groupId>${groupId}</groupId>
20+
<artifactId>${artifactId}</artifactId>
21+
<version>${version}</version>
22+
23+
<name>${artifactId}</name>
24+
25+
<properties>
26+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
27+
<!-- Minimum required JDK version -->
28+
<maven.compiler.release>17</maven.compiler.release>
29+
<maven.compiler.testRelease>17</maven.compiler.testRelease>
30+
31+
<eclipselink.bug.version>${project.version}</eclipselink.bug.version>
32+
<jpa.api.bug.version>${jpa.api.version}</jpa.api.bug.version>
33+
<asm.bug.version>${asm.version}</asm.bug.version>
34+
<eclipselink.asm.bug.version>${eclipselink.asm.version}</eclipselink.asm.bug.version>
35+
<junit.bug.version>${junit.version}</junit.bug.version>
36+
37+
<derby.bug.version>${derby.version}</derby.bug.version>
38+
<h2.bug.version>2.2.224</h2.bug.version>
39+
<mssql.bug.version>${mssql.version}</mssql.bug.version>
40+
<mysql.bug.version>${mysql.version}</mysql.bug.version>
41+
<oracle.jdbc.bug.version>${oracle.jdbc.version}</oracle.jdbc.bug.version>
42+
<postgresql.bug.version>${pgsql.version}</postgresql.bug.version>
43+
44+
</properties>
45+
46+
<dependencies>
47+
<dependency>
48+
<groupId>jakarta.persistence</groupId>
49+
<artifactId>jakarta.persistence-api</artifactId>
50+
<version>${jpa.api.bug.version}</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.eclipse.persistence</groupId>
54+
<artifactId>eclipselink</artifactId>
55+
<version>${eclipselink.bug.version}</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.eclipse.persistence</groupId>
59+
<artifactId>org.eclipse.persistence.asm</artifactId>
60+
<version>${eclipselink.asm.bug.version}</version>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.ow2.asm</groupId>
64+
<artifactId>asm</artifactId>
65+
<version>${asm.bug.version}</version>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.ow2.asm</groupId>
69+
<artifactId>asm-commons</artifactId>
70+
<version>${asm.bug.version}</version>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.ow2.asm</groupId>
74+
<artifactId>asm-tree</artifactId>
75+
<version>${asm.bug.version}</version>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.ow2.asm</groupId>
79+
<artifactId>asm-util</artifactId>
80+
<version>${asm.bug.version}</version>
81+
</dependency>
82+
<dependency>
83+
<groupId>junit</groupId>
84+
<artifactId>junit</artifactId>
85+
<version>${junit.bug.version}</version>
86+
<scope>test</scope>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.apache.derby</groupId>
90+
<artifactId>derbyclient</artifactId>
91+
<version>${derby.bug.version}</version>
92+
<scope>test</scope>
93+
</dependency>
94+
<dependency>
95+
<groupId>org.apache.derby</groupId>
96+
<artifactId>derbytools</artifactId>
97+
<version>${derby.bug.version}</version>
98+
<scope>test</scope>
99+
</dependency>
100+
<dependency>
101+
<groupId>com.h2database</groupId>
102+
<artifactId>h2</artifactId>
103+
<version>${h2.bug.version}</version>
104+
</dependency>
105+
<dependency>
106+
<groupId>com.microsoft.sqlserver</groupId>
107+
<artifactId>mssql-jdbc</artifactId>
108+
<version>${mssql.bug.version}</version>
109+
<scope>test</scope>
110+
</dependency>
111+
<dependency>
112+
<groupId>org.postgresql</groupId>
113+
<artifactId>postgresql</artifactId>
114+
<version>${postgresql.bug.version}</version>
115+
<scope>test</scope>
116+
</dependency>
117+
<dependency>
118+
<groupId>com.mysql</groupId>
119+
<artifactId>mysql-connector-j</artifactId>
120+
<version>${mysql.bug.version}</version>
121+
<scope>test</scope>
122+
</dependency>
123+
<dependency>
124+
<groupId>com.oracle.database.jdbc</groupId>
125+
<artifactId>ojdbc11</artifactId>
126+
<version>${oracle.jdbc.bug.version}</version>
127+
<scope>test</scope>
128+
</dependency>
129+
</dependencies>
130+
131+
<build>
132+
<pluginManagement>
133+
<plugins>
134+
<plugin>
135+
<groupId>org.apache.maven.plugins</groupId>
136+
<artifactId>maven-failsafe-plugin</artifactId>
137+
<version>3.2.2</version>
138+
</plugin>
139+
<plugin>
140+
<groupId>org.carlspring.maven</groupId>
141+
<artifactId>derby-maven-plugin</artifactId>
142+
<version>1.10</version>
143+
<dependencies>
144+
<dependency>
145+
<groupId>org.apache.derby</groupId>
146+
<artifactId>derby</artifactId>
147+
<version>${derby.version}</version>
148+
</dependency>
149+
<dependency>
150+
<groupId>org.apache.derby</groupId>
151+
<artifactId>derbyclient</artifactId>
152+
<version>${derby.version}</version>
153+
</dependency>
154+
<dependency>
155+
<groupId>org.apache.derby</groupId>
156+
<artifactId>derbynet</artifactId>
157+
<version>${derby.version}</version>
158+
</dependency>
159+
</dependencies>
160+
</plugin>
161+
</plugins>
162+
</pluginManagement>
163+
164+
<plugins>
165+
<plugin>
166+
<groupId>org.apache.maven.plugins</groupId>
167+
<artifactId>maven-failsafe-plugin</artifactId>
168+
<configuration>
169+
<workingDirectory>${project.build.directory}/test-classes</workingDirectory>
170+
</configuration>
171+
<executions>
172+
<execution>
173+
<id>integration-test</id>
174+
<goals>
175+
<goal>integration-test</goal>
176+
</goals>
177+
<configuration>
178+
<includes>
179+
<include>*Test*</include>
180+
</includes>
181+
</configuration>
182+
</execution>
183+
<execution>
184+
<id>verify-integration-tests</id>
185+
<goals>
186+
<goal>verify</goal>
187+
</goals>
188+
</execution>
189+
</executions>
190+
</plugin>
191+
<plugin>
192+
<groupId>org.carlspring.maven</groupId>
193+
<artifactId>derby-maven-plugin</artifactId>
194+
<configuration>
195+
<derbyHome>${project.build.directory}/derby</derbyHome>
196+
<username>root</username>
197+
<password>root</password>
198+
<driver>org.apache.derby.jdbc.ClientDriver</driver>
199+
<!--<connectionURL>jdbc:derby://localhost/memory:ecltests;create=true</connectionURL>-->
200+
<connectionURL>jdbc:derby://localhost:1527/ecltests;create=true</connectionURL>
201+
<!--Log SQL statements.-->
202+
<!--<debugStatements>true</debugStatements>-->
203+
</configuration>
204+
<executions>
205+
<execution>
206+
<id>start-derby</id>
207+
<phase>pre-integration-test</phase>
208+
<goals>
209+
<goal>start</goal>
210+
</goals>
211+
</execution>
212+
<execution>
213+
<id>stop-derby</id>
214+
<phase>post-integration-test</phase>
215+
<goals>
216+
<goal>stop</goal>
217+
</goals>
218+
</execution>
219+
</executions>
220+
</plugin>
221+
</plugins>
222+
</build>
223+
</project>

0 commit comments

Comments
 (0)