Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
ignored pagination Riak tests since this feature is not implemented y…
Browse files Browse the repository at this point in the history
…et in Riak
  • Loading branch information
graemerocher committed Nov 28, 2011
1 parent e5a1ceb commit cc4dad4
Showing 1 changed file with 57 additions and 0 deletions.
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()
}
}

0 comments on commit cc4dad4

Please sign in to comment.