This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ignored pagination Riak tests since this feature is not implemented y…
…et in Riak
- Loading branch information
1 parent
e5a1ceb
commit cc4dad4
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
grails-datastore-gorm-riak/src/test/groovy/grails/gorm/tests/PagedResultSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package grails.gorm.tests | ||
|
||
import grails.gorm.PagedResultList | ||
import spock.lang.Ignore | ||
|
||
/** | ||
* TODO: Pagination not implemented correctly with Riak | ||
*/ | ||
@Ignore | ||
class PagedResultSpec extends GormDatastoreSpec{ | ||
|
||
|
||
void "Test that a paged result list is returned from the list() method with pagination params"() { | ||
given:"Some people" | ||
createPeople() | ||
when:"The list method is used with pagination params" | ||
def results = Person.list(offset:2, max:2) | ||
then:"You get a paged result list back" | ||
results instanceof PagedResultList | ||
results.size() == 2 | ||
results[0].firstName == "Bart" | ||
results[1].firstName == "Lisa" | ||
results.totalCount == 6 | ||
} | ||
void "Test that a paged result list is returned from the critera with pagination params"() { | ||
given:"Some people" | ||
createPeople() | ||
when:"The list method is used with pagination params" | ||
def results = Person.createCriteria().list(offset:1, max:2) { | ||
eq 'lastName', 'Simpson' | ||
} | ||
then:"You get a paged result list back" | ||
results instanceof PagedResultList | ||
results.size() == 2 | ||
results[0].firstName == "Marge" | ||
results[1].firstName == "Bart" | ||
results.totalCount == 4 | ||
} | ||
protected def createPeople() { | ||
new Person(firstName: "Homer", lastName: "Simpson", age:45).save() | ||
new Person(firstName: "Marge", lastName: "Simpson", age:40).save() | ||
new Person(firstName: "Bart", lastName: "Simpson", age:9).save() | ||
new Person(firstName: "Lisa", lastName: "Simpson", age:7).save() | ||
new Person(firstName: "Barney", lastName: "Rubble", age:35).save() | ||
new Person(firstName: "Fred", lastName: "Flinstone", age:41).save() | ||
} | ||
} |