[ 
https://issues.apache.org/jira/browse/JDO-843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Bouschen updated JDO-843:
---------------------------------
    Description: 
TCK Class {color:#000000}SampleReadQueries implements the sample queries from 
the JDO specification chapter 14.11.{color}

{color:#000000}Methods testQuery15f and testQuery16f implement the typesafe 
query version. The code uses QFullTimeEmployee.candidate() to access instances 
of the candidate class. The query returns a wrong query result, When replacing 
the call 
  {color}{color:#000000}QFullTimeEmployee.candidate() by 
  QFullTimeEmployee.candidate("this")
The expected query resukt consist of three 
{color}{color:#000000}FullTimeEmployee instances wrapped into a EmpWrapper 
instance (testQuery15f) or {color}EmpInfo instance 
({color:#000000}testQuery16f{color}). Instead the 
{color:#000000}FullTimeEmployee instance is null that gets wrappe into a 
EmpWrapper/EmpInfo.{color}

{color:#000000}Junit Test results when running the test Methods with 
QFullTimeEmployee.candidate("this"):{color}

{color:#000000}{{  JUnit Jupiter:JDO843Test:testQuery15f()}}
{{    MethodSource [className = 'org.apache.jdo.tck.query.api.JDO843Test', 
methodName = 'testQuery15f', methodParameterTypes = '']}}
{{    => org.opentest4j.AssertionFailedError: Assertion (SampleQueries) failed: 
}}
{{Wrong query result: }}
{{query: select into org.apache.jdo.tck.query.api.SampleReadQueries$EmpWrapper 
from org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > :sal}}
{{expected: java.util.ArrayList of size 3}}
[EmpWrapper(FullTimeEmployee:name = Michael), EmpWrapper(FullTimeEmployee:name 
= Craig), EmpWrapper(FullTimeEmployee:name = Tillmann)]
{{got:      java.util.ArrayList of size 3}}
[EmpWrapper(FullTimeEmployee:null), EmpWrapper(FullTimeEmployee:null), 
EmpWrapper(FullTimeEmployee:null)]

{{  JUnit Jupiter:JDO843Test:testQuery16f()}}
{{    MethodSource [className = 'org.apache.jdo.tck.query.api.JDO843Test', 
methodName = 'testQuery16f', methodParameterTypes = '']}}
{{    => org.opentest4j.AssertionFailedError: Assertion (SampleQueries) failed: 
}}
{{Wrong query result: }}
{{query: select into org.apache.jdo.tck.query.api.SampleReadQueries$EmpInfo 
from org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > :sal}}
{{expected: java.util.ArrayList of size 3}}
[EmpInfo(worker:Michael), EmpInfo(worker:Craig), EmpInfo(worker:Tillmann)]
{{got:      java.util.ArrayList of size 3}}
[EmpInfo(worker:null), EmpInfo(worker:null), EmpInfo(worker:null)]{color}

 

  was:
TCK Class {color:#000000}SampleReadQueries implements the sample queries from 
the JDO specification chapter 14.11.{color}

{color:#000000}Methods testQuery15f and testQuery16f implement the typesafe 
query version. The code uses QFullTimeEmployee.candidate() to access instances 
of the candidate class. The query returns a wrong query result, When replacing 
the call 
  {color}{color:#000000}QFullTimeEmployee.candidate() by 
  QFullTimeEmployee.candidate("this")
The expected query resukt consist of three 
{color}{color:#000000}FullTimeEmployee instances wrapped into a EmpWrapper 
instance (testQuery15f) or {color}EmpInfo instance 
({color:#000000}testQuery16f{color}). Instead the 
{color:#000000}FullTimeEmployee instance is null that gets wrappe into a 
EmpWrapper/EmpInfo.{color}

{color:#000000}Junit Test results when running the test Methods with 
QFullTimeEmployee.candidate("this"):{color}

{color:#000000}  JUnit Jupiter:JDO843Test:testQuery15f()
    MethodSource [className = 'org.apache.jdo.tck.query.api.JDO843Test', 
methodName = 'testQuery15f', methodParameterTypes = '']
    => org.opentest4j.AssertionFailedError: Assertion (SampleQueries) failed: 
Wrong query result: 
query: select into org.apache.jdo.tck.query.api.SampleReadQueries$EmpWrapper 
from org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > :sal
expected: java.util.ArrayList of size 3
[EmpWrapper(FullTimeEmployee:name = Michael), EmpWrapper(FullTimeEmployee:name 
= Craig), EmpWrapper(FullTimeEmployee:name = Tillmann)]
got:      java.util.ArrayList of size 3
[EmpWrapper(FullTimeEmployee:null), EmpWrapper(FullTimeEmployee:null), 
EmpWrapper(FullTimeEmployee:null)]

  JUnit Jupiter:JDO843Test:testQuery16f()
    MethodSource [className = 'org.apache.jdo.tck.query.api.JDO843Test', 
methodName = 'testQuery16f', methodParameterTypes = '']
    => org.opentest4j.AssertionFailedError: Assertion (SampleQueries) failed: 
Wrong query result: 
query: select into org.apache.jdo.tck.query.api.SampleReadQueries$EmpInfo from 
org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > :sal
expected: java.util.ArrayList of size 3
[EmpInfo(worker:Michael), EmpInfo(worker:Craig), EmpInfo(worker:Tillmann)]
got:      java.util.ArrayList of size 3
[EmpInfo(worker:null), EmpInfo(worker:null), EmpInfo(worker:null)]{color}

 


> JDOQLTypedQuery: issue with candidate("this") method
> ----------------------------------------------------
>
>                 Key: JDO-843
>                 URL: https://issues.apache.org/jira/browse/JDO-843
>             Project: JDO
>          Issue Type: Bug
>          Components: tck
>    Affects Versions: JDO 3.2.1
>            Reporter: Michael Bouschen
>            Priority: Major
>
> TCK Class {color:#000000}SampleReadQueries implements the sample queries from 
> the JDO specification chapter 14.11.{color}
> {color:#000000}Methods testQuery15f and testQuery16f implement the typesafe 
> query version. The code uses QFullTimeEmployee.candidate() to access 
> instances of the candidate class. The query returns a wrong query result, 
> When replacing the call 
>   {color}{color:#000000}QFullTimeEmployee.candidate() by 
>   QFullTimeEmployee.candidate("this")
> The expected query resukt consist of three 
> {color}{color:#000000}FullTimeEmployee instances wrapped into a EmpWrapper 
> instance (testQuery15f) or {color}EmpInfo instance 
> ({color:#000000}testQuery16f{color}). Instead the 
> {color:#000000}FullTimeEmployee instance is null that gets wrappe into a 
> EmpWrapper/EmpInfo.{color}
> {color:#000000}Junit Test results when running the test Methods with 
> QFullTimeEmployee.candidate("this"):{color}
> {color:#000000}{{  JUnit Jupiter:JDO843Test:testQuery15f()}}
> {{    MethodSource [className = 'org.apache.jdo.tck.query.api.JDO843Test', 
> methodName = 'testQuery15f', methodParameterTypes = '']}}
> {{    => org.opentest4j.AssertionFailedError: Assertion (SampleQueries) 
> failed: }}
> {{Wrong query result: }}
> {{query: select into 
> org.apache.jdo.tck.query.api.SampleReadQueries$EmpWrapper from 
> org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > :sal}}
> {{expected: java.util.ArrayList of size 3}}
> [EmpWrapper(FullTimeEmployee:name = Michael), 
> EmpWrapper(FullTimeEmployee:name = Craig), EmpWrapper(FullTimeEmployee:name = 
> Tillmann)]
> {{got:      java.util.ArrayList of size 3}}
> [EmpWrapper(FullTimeEmployee:null), EmpWrapper(FullTimeEmployee:null), 
> EmpWrapper(FullTimeEmployee:null)]
> {{  JUnit Jupiter:JDO843Test:testQuery16f()}}
> {{    MethodSource [className = 'org.apache.jdo.tck.query.api.JDO843Test', 
> methodName = 'testQuery16f', methodParameterTypes = '']}}
> {{    => org.opentest4j.AssertionFailedError: Assertion (SampleQueries) 
> failed: }}
> {{Wrong query result: }}
> {{query: select into org.apache.jdo.tck.query.api.SampleReadQueries$EmpInfo 
> from org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > :sal}}
> {{expected: java.util.ArrayList of size 3}}
> [EmpInfo(worker:Michael), EmpInfo(worker:Craig), EmpInfo(worker:Tillmann)]
> {{got:      java.util.ArrayList of size 3}}
> [EmpInfo(worker:null), EmpInfo(worker:null), EmpInfo(worker:null)]{color}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to