Hi, it seems some people have luck with grails running in GAE using
the plugin. I have the latest versions of groovy, the grails gae
plugin, grails, and app engine. Just wrote a simple test. Basically
it appears the id doesn't get generated and or saved. Below are the
details. I'd appreciate any guidance on the this issue, it seems to
me that the ID should be generated, but being that im running this
against GAE maybe not? I guess my bigger question is Grails something
that a lot of success running on GAE? I know it would be anecdotal,
but I'd appreciate hearing about it.
Thanks,
domain:
import javax.persistence.*;
// import com.google.appengine.api.datastore.Key;
@Entity
class UserProfile implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Long id
@Basic
String email
static constraints = {
id visible:false
}
}
test:
void testFirstSave(){
def user = new UserProfile(email:'[email protected]')
assertNotNull user.save()
assertNotNull user.id //line 21
def foundUser = UserProfile.get(user.id)
assertEquals '[email protected]', foundUser.email
}
result:
<testcase classname="me.bagitfor.domain.UserProfileIntegrationTests"
name="testFirstSave" time="0.135">
<failure
type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError
at
my.domain.UserProfileIntegrationTests.testFirstSave(UserProfileIntegrationTests.groovy:
21)
at junit.framework.Test$run.call(Unknown Source)
</failure>
</testcase>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.