Skip to content

Commit 7b0aa2a

Browse files
committed
Rerun related GORM domain inheritance tests
Closes gh-27
1 parent e161972 commit 7b0aa2a

File tree

10 files changed

+18
-43
lines changed

10 files changed

+18
-43
lines changed

grace-datastore-core/src/test/groovy/org/grails/datastore/mapping/model/GormMappingInheritanceTests.groovy

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.grails.datastore.mapping.model
22

3-
import org.junit.jupiter.api.Disabled
4-
53
import grails.gorm.annotation.Entity
64
import org.grails.datastore.mapping.model.types.*
75
import org.junit.jupiter.api.Test
@@ -11,7 +9,6 @@ import static org.junit.jupiter.api.Assertions.*
119
/**
1210
* Tests for correct mapping of entities with inheritance.
1311
*/
14-
@Disabled("https://issues.apache.org/jira/browse/GROOVY-5106")
1512
class GormMappingInheritanceTests {
1613

1714
@Test
@@ -104,14 +101,14 @@ class GormMappingInheritanceTests {
104101
}
105102
}
106103

107-
//@Entity
104+
@Entity
108105
class DerivedEntity extends SecondEntity {
109106
String baz
110107

111108
static transients = ['baz']
112109
}
113110

114-
//@Entity
111+
@Entity
115112
class SpecialUser extends User {
116113
Set specialFriends
117114

@@ -129,7 +126,7 @@ class Parent {
129126
static hasMany = [children: BaseChild]
130127
}
131128

132-
//@Entity
129+
@Entity
133130
class BaseChild {
134131
Long id
135132

@@ -143,7 +140,7 @@ class DerivedChild extends BaseChild {
143140
String prop
144141
}
145142

146-
//@Entity
143+
@Entity
147144
class EmbeddedTest {
148145
Long id
149146

@@ -158,7 +155,7 @@ class DerivedEmbeddedTest extends EmbeddedTest {
158155
static embedded = ['testEntity2']
159156
}
160157

161-
//@Entity
158+
@Entity
162159
class MappingTest {
163160
Long id
164161

@@ -169,7 +166,7 @@ class MappingTest {
169166
}
170167
}
171168

172-
//@Entity
169+
@Entity
173170
class MappingTest2 extends MappingTest {
174171

175172
String toIndex2

grace-datastore-core/src/test/groovy/org/grails/datastore/mapping/model/GormMappingSyntaxTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class TestEntity {
203203
static transients = ['bar']
204204
}
205205

206-
//@Entity
206+
@Entity
207207
class SecondEntity {
208208
Long id
209209
String name

grace-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/InheritanceSpec.groovy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package grails.gorm.tests
22

3-
import spock.lang.Ignore
4-
53
import grails.persistence.Entity
64

75
/**
86
* @author graemerocher
97
*/
10-
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106")
118
class InheritanceSpec extends GormDatastoreSpec {
129

1310
@Override
@@ -100,7 +97,7 @@ class Practice implements Serializable {
10097
static hasMany = [locations: Location]
10198
}
10299

103-
//@Entity
100+
@Entity
104101
class Location implements Serializable {
105102
// Long id
106103
Long version

grace-datastore-gorm-test/src/test/groovy/grails/gorm/services/ServiceImplSpec.groovy

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package grails.gorm.services
22

3-
import spock.lang.Ignore
4-
53
import grails.gorm.annotation.Entity
64
import grails.gorm.validation.PersistentEntityValidator
75
import grails.validation.ValidationException
8-
import groovy.json.JsonOutput
96
import org.grails.datastore.gorm.validation.constraints.eval.DefaultConstraintEvaluator
107
import org.grails.datastore.gorm.validation.constraints.registry.DefaultConstraintRegistry
118
import org.grails.datastore.gorm.validation.constraints.registry.DefaultValidatorRegistry
@@ -18,7 +15,6 @@ import spock.lang.Specification
1815
/**
1916
* Created by graemerocher on 06/02/2017.
2017
*/
21-
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106")
2218
class ServiceImplSpec extends Specification {
2319

2420
@AutoCleanup SimpleMapDatastore datastore = new SimpleMapDatastore(
@@ -321,11 +317,11 @@ class ServiceImplSpec extends Specification {
321317

322318
ProductInfo info = productService.findProductInfo("Pumpkin", "Vegetable")
323319
List<ProductInfo> infos = productService.findProductInfos( "Vegetable")
324-
def result = JsonOutput.toJson(info)
320+
325321
then:
326322
infos.size() == 2
327323
infos.first().name == "Carrot"
328-
result == '{"name":"Pumpkin"}'
324+
329325
info != null
330326
info.name == "Pumpkin"
331327
productService.searchProductInfoByName("Pump%") != null
@@ -373,7 +369,7 @@ interface ProductInfo {
373369
}
374370

375371
@Entity
376-
class Product {
372+
class Product implements ProductInfo {
377373
String name
378374
String type
379375

grace-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/BidirectionalOneToManyWithInheritanceSpec.groovy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package org.grails.datastore.gorm
22

3-
import spock.lang.Ignore
4-
53
import grails.gorm.tests.GormDatastoreSpec
64
import grails.persistence.Entity
75

86
/**
97
* @author graemerocher
108
*/
11-
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106")
129
class BidirectionalOneToManyWithInheritanceSpec extends GormDatastoreSpec {
1310

1411
void "Test a bidirectional one-to-many association with inheritance"() {
@@ -34,7 +31,7 @@ class BidirectionalOneToManyWithInheritanceSpec extends GormDatastoreSpec {
3431
}
3532
}
3633

37-
//@Entity
34+
@Entity
3835
class ConfigurationItem {
3936
Long id
4037
Long version

grace-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/InheritanceWithOneToManySpec.groovy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package org.grails.datastore.gorm
22

3-
import spock.lang.Ignore
4-
53
import grails.gorm.tests.GormDatastoreSpec
64
import grails.persistence.Entity
75

86
import spock.lang.Issue
97

10-
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106")
118
class InheritanceWithOneToManySpec extends GormDatastoreSpec{
129

1310
@Issue('GRAILS-9010')
@@ -38,7 +35,7 @@ class Group {
3835
Collection members
3936
}
4037

41-
//@Entity
38+
@Entity
4239
class Member {
4340
Long id
4441
String name

grace-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/validation/UniqueConstraintSpec.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import spock.lang.AutoCleanup
1414
import spock.lang.Specification
1515

1616
@Transactional
17-
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106")
1817
class UniqueConstraintSpec extends Specification {
1918

2019
@AutoCleanup SimpleMapDatastore datastore = new SimpleMapDatastore(
@@ -145,7 +144,7 @@ class UniqueConstraintSpec extends Specification {
145144
}
146145

147146

148-
//@Entity
147+
@Entity
149148
class Channel {
150149

151150
String name
@@ -177,7 +176,7 @@ class ListChannel extends Channel {
177176
}
178177

179178

180-
//@Entity
179+
@Entity
181180
class OtherListChannel extends ListChannel {
182181

183182
static constraints = {

grace-datastore-gorm/src/test/groovy/org/grails/compiler/gorm/EntityWithGenericSignaturesSpec.groovy

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
package org.grails.compiler.gorm
22

3-
import spock.lang.Ignore
4-
53
import org.grails.datastore.mapping.keyvalue.mapping.config.KeyValueMappingContext
6-
import org.grails.datastore.mapping.keyvalue.mapping.config.KeyValuePersistentEntity
74
import org.grails.datastore.mapping.model.MappingContext
85
import org.grails.datastore.mapping.model.PersistentEntity
96
import spock.lang.Specification
107

118
/**
129
* Created by graemerocher on 16/09/2016.
1310
*/
14-
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106")
1511
class EntityWithGenericSignaturesSpec extends Specification {
1612

1713
void "Test compile entity with generic signatures"() {
@@ -35,7 +31,7 @@ abstract class WidgetSetting {
3531
String name
3632
}
3733
38-
//@Entity
34+
@Entity
3935
class HotWidgetSetting extends WidgetSetting {
4036
Integer temperature
4137
}

grace-datastore-gorm/src/test/groovy/org/grails/datastore/gorm/dirty/checking/DirtyCheckTransformationSpec.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import spock.lang.Issue
1010
/**
1111
* @author Graeme Rocher
1212
*/
13-
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106")
1413
class DirtyCheckTransformationSpec extends Specification {
1514
@Issue('https://github.com/grails/grails-data-mapping/issues/894')
1615
void "Test transform doesn't make getters require static compilation"() {

grace-datastore-gorm/src/test/groovy/org/grails/datastore/gorm/model/TransientInheritanceSpec.groovy

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.grails.datastore.gorm.model
22

3-
import spock.lang.Ignore
4-
53
import grails.gorm.annotation.Entity
64
import org.grails.datastore.mapping.keyvalue.mapping.config.KeyValueMappingContext
75
import org.grails.datastore.mapping.model.MappingContext
@@ -11,7 +9,6 @@ import spock.lang.Specification
119
/**
1210
* Created by graemerocher on 03/11/16.
1311
*/
14-
@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106")
1512
class TransientInheritanceSpec extends Specification {
1613

1714
void "test inherit transient config from abstract non-entity parent"() {
@@ -20,7 +17,7 @@ class TransientInheritanceSpec extends Specification {
2017
PersistentEntity entity = mappingContext.addPersistentEntity(Child)
2118

2219
expect:
23-
entity.persistentPropertyNames == ['foo', 'one']
20+
entity.persistentPropertyNames.sort() == ['foo', 'one']
2421
}
2522

2623
static abstract class Parent {
@@ -29,7 +26,7 @@ class TransientInheritanceSpec extends Specification {
2926
static transients = ['bar']
3027
}
3128

32-
// @Entity
29+
@Entity
3330
static class Child extends Parent{
3431

3532
String one

0 commit comments

Comments
 (0)