add tests for avg(index) and avg(element)
This commit is contained in:
parent
3b221b7b18
commit
52c7f61815
|
@ -108,6 +108,16 @@ public class FunctionTests {
|
|||
// .getSingleResult(),
|
||||
is(3.0) );
|
||||
|
||||
//TODO: why does this fail??
|
||||
// assertThat( session.createQuery("select avg(index eol.listOfNumbers) from EntityOfLists eol")
|
||||
// .list().get(0),
|
||||
//// .getSingleResult(),
|
||||
// is(0.5) );
|
||||
assertThat( session.createQuery("select avg(element eol.listOfNumbers) from EntityOfLists eol")
|
||||
.list().get(0),
|
||||
// .getSingleResult(),
|
||||
is(1.5) );
|
||||
|
||||
assertThat( session.createQuery("select max(index eom.numberByNumber) from EntityOfMaps eom")
|
||||
.getSingleResult(), is(1) );
|
||||
assertThat( session.createQuery("select max(element eom.numberByNumber) from EntityOfMaps eom")
|
||||
|
@ -117,6 +127,11 @@ public class FunctionTests {
|
|||
.getSingleResult(), is(1) );
|
||||
assertThat( session.createQuery("select sum(element eom.numberByNumber) from EntityOfMaps eom")
|
||||
.getSingleResult(), is(1.0) );
|
||||
|
||||
assertThat( session.createQuery("select avg(index eom.numberByNumber) from EntityOfMaps eom")
|
||||
.getSingleResult(), is(1) );
|
||||
assertThat( session.createQuery("select avg(element eom.numberByNumber) from EntityOfMaps eom")
|
||||
.getSingleResult(), is(1.0) );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue