Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDO-835 Fixed concurrency issue when running ResultClassRequirementsMap query… #94

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

/**
* <B>Title:</B> Result Class Requirements. <br>
Expand Down Expand Up @@ -72,15 +74,7 @@ public class ResultClassRequirementsMap extends QueryTest {

/** */
@Test
// @Execution(ExecutionMode.CONCURRENT)
// ToDo: Wrong query result when exceuted in parallel
// query: SELECT personid AS id, lastname AS name INTO java.util.Map
// FROM org.apache.jdo.tck.pc.company.FullTimeEmployee
// expected: java.util.ArrayList of size 3
// [{name=emp1Last, id=1}, {name=emp2Last, id=2}, {name=emp5Last, id=5}]
// got: java.util.ArrayList of size 3
// [{personid=5, lastname=emp5Last}, {personid=2, lastname=emp2Last},
// {personid=1, lastname=emp1Last}]
@Execution(ExecutionMode.CONCURRENT)
public void testMap() {
Object expected =
Arrays.asList(
Expand All @@ -90,7 +84,7 @@ public void testMap() {
PersistenceManager pm = getPMF().getPersistenceManager();
try {
JDOQLTypedQuery<FullTimeEmployee> query = pm.newJDOQLTypedQuery(FullTimeEmployee.class);
QFullTimeEmployee cand = QFullTimeEmployee.candidate();
QFullTimeEmployee cand = QFullTimeEmployee.candidate("this");
// JDOQLTypedQuery API: Map Result
query.result(false, cand.personid.as("id"), cand.lastname.as("name"));

Expand Down Expand Up @@ -122,21 +116,7 @@ public void testMap() {

/** */
@Test
// @Execution(ExecutionMode.CONCURRENT)
// ToDo: Wrong query result when exceuted in parallel
// query: SELECT personid, lastname INTO org.apache.jdo.tck.query.result.classes.PublicPutMethod
// FROM org.apache.jdo.tck.pc.company.FullTimeEmployee
// expected: java.util.ArrayList of size 3
// [org.apache.jdo.tck.query.result.classes.PublicPutMethod(
// {personid=1, lastname=emp1Last}),
// org.apache.jdo.tck.query.result.classes.PublicPutMethod(
// {personid=2, lastname=emp2Last}),
// org.apache.jdo.tck.query.result.classes.PublicPutMethod(
// {personid=5, lastname=emp5Last})]
// got: java.util.ArrayList of size 3
// [org.apache.jdo.tck.query.result.classes.PublicPutMethod({name=emp5Last, id=5}),
// org.apache.jdo.tck.query.result.classes.PublicPutMethod({name=emp2Last, id=2}),
// org.apache.jdo.tck.query.result.classes.PublicPutMethod({name=emp1Last, id=1})]
@Execution(ExecutionMode.CONCURRENT)
public void testPut() {
Object expected =
Arrays.asList(
Expand All @@ -146,7 +126,7 @@ public void testPut() {
PersistenceManager pm = getPMF().getPersistenceManager();
try {
JDOQLTypedQuery<FullTimeEmployee> query = pm.newJDOQLTypedQuery(FullTimeEmployee.class);
QFullTimeEmployee cand = QFullTimeEmployee.candidate();
QFullTimeEmployee cand = QFullTimeEmployee.candidate("this");
// JDOQLTypedQuery API: constructor
query.result(false, cand.personid.as("personid"), cand.lastname.as("lastname"));

Expand Down