Skip to content

Commit

Permalink
Clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfredley committed Aug 22, 2024
1 parent d7068bb commit 37d87a4
Showing 5 changed files with 39 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -170,9 +170,13 @@ class Book {
@Service(value = Book)
interface BookService {

// Cannot implement method for argument [title]. No property exists on domain class [java.lang.String]
//Single<String> findBookAuthor(String title)

// No implementations possible for method 'rx.Observable updateBook(java.lang.String, java.lang.String)'. Please use an abstract class instead and provide an implementation.
//@Query("update ${Book b} set $b.title = $title where $b.title = $oldTitle")

// No implementations possible for method 'rx.Observable updateBook(java.lang.String, java.lang.String)'. Please use an abstract class instead and provide an implementation.
//rx.Observable<Number> updateBook(String oldTitle, String title)

Single<Book> updateBook(Serializable id, String title)
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ import spock.lang.Specification
/**
* Created by graemerocher on 06/02/2017.
*/
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class ServiceImplSpec extends Specification {

@AutoCleanup SimpleMapDatastore datastore = new SimpleMapDatastore(
@@ -310,6 +309,27 @@ class ServiceImplSpec extends Specification {

}

@Ignore('''
java.lang.StackOverflowError
at groovy.lang.Closure.call(Closure.java:435)
at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:319)
at org.grails.datastore.gorm.AbstractDatastoreApi.execute(AbstractDatastoreApi.groovy:40)
at org.grails.datastore.gorm.GormInstanceApi.isAttached(GormInstanceApi.groovy:227)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.isAttached(GormEntity.groovy:176)
at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:60)
at groovy.json.DefaultJsonGenerator.getObjectProperties(DefaultJsonGenerator.java:257)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:234)
at groovy.json.DefaultJsonGenerator.writeMapEntry(DefaultJsonGenerator.java:401)
at groovy.json.DefaultJsonGenerator.writeMap(DefaultJsonGenerator.java:389)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:204)
at groovy.json.DefaultJsonGenerator.writeMapEntry(DefaultJsonGenerator.java:401)
at groovy.json.DefaultJsonGenerator.writeMap(DefaultJsonGenerator.java:389)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:235)
at groovy.json.DefaultJsonGenerator.writeMapEntry(DefaultJsonGenerator.java:401)
at groovy.json.DefaultJsonGenerator.writeMap(DefaultJsonGenerator.java:389)
at groovy.json.DefaultJsonGenerator.writeObject(DefaultJsonGenerator.java:235)
at groovy.json.DefaultJsonGenerator.writeMapEntry(DefaultJsonGenerator.java:401)
at groovy.json.DefaultJsonGenerator.writeMap(DefaultJsonGenerator.java:389)''')
void "test interface projection"() {
given:
ProductService productService = datastore.getService(ProductService)
Original file line number Diff line number Diff line change
@@ -29,7 +29,18 @@ class PartitionMultiTenancySpec extends Specification {
)
@Shared IBookService bookDataService = datastore.getService(IBookService)

@Ignore("java.lang.IllegalStateException: Either class [grails.gorm.services.multitenancy.partitioned.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
@Ignore('''Expected exception of type 'org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException', but got 'java.lang.IllegalStateException\'
at app//org.spockframework.lang.SpecInternals.checkExceptionThrown(SpecInternals.java:84)
at app//org.spockframework.lang.SpecInternals.thrownImpl(SpecInternals.java:71)
at grails.gorm.services.multitenancy.partitioned.PartitionMultiTenancySpec.Test partitioned multi-tenancy with GORM services(PartitionMultiTenancySpec.groovy:42)
Caused by: java.lang.IllegalStateException: Either class [grails.gorm.services.multitenancy.partitioned.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.
at org.grails.datastore.gorm.GormEnhancer.stateException(GormEnhancer.groovy:467)
org.grails.datastore.gorm.GormEnhancer.findDatastore(GormEnhancer.groovy:349)
at org.grails.datastore.gorm.GormEnhancer.findTenantId(GormEnhancer.groovy:263)
at org.grails.datastore.gorm.GormEnhancer.findStaticApi(GormEnhancer.groovy:294)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.currentGormStaticApi(GormEntity.groovy:1370)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.count(GormEntity.groovy:649)
at grails.gorm.services.multitenancy.partitioned.PartitionMultiTenancySpec.Test partitioned multi-tenancy with GORM services(PartitionMultiTenancySpec.groovy:39)''')
void 'Test partitioned multi-tenancy with GORM services'() {
setup:
BookService bookService = new BookService()
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ import spock.lang.Issue
/**
* @author Graeme Rocher
*/
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class DirtyCheckTransformationSpec extends Specification {
@Issue('https://github.com/grails/grails-data-mapping/issues/894')
void "Test transform doesn't make getters require static compilation"() {
@@ -76,7 +75,7 @@ abstract class AbstractGraphDomain {
''')

def child = cls.newInstance()
def child = cls.getDeclaredConstructor().newInstance()

then:"The generic types are retained"
child != null
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@ import spock.lang.Specification
/**
* Created by graemerocher on 03/11/16.
*/
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class TransientInheritanceSpec extends Specification {

void "test inherit transient config from abstract non-entity parent"() {
@@ -29,7 +28,7 @@ class TransientInheritanceSpec extends Specification {
static transients = ['bar']
}

// @Entity
@Entity
static class Child extends Parent{

String one

0 comments on commit 37d87a4

Please sign in to comment.