Weird thing is that I'm able to mock "MetaTeam":
---
trait MetaTeam extends Team with LongKeyedMetaMapper[Team] {
def findByUser(user:User): List[Team]
}
object Team extends MetaTeam {
def findByUser(user:User): List[Team] =
UserTeam.findAll(
By(UserTeam.user, user.id),
OrderBy(UserTeam.team, Ascending)).map(_.team.obj.open_!)
}
---
- Erik
On Apr 28, 12:19 am, "[email protected]"
<[email protected]> wrote:
> Hi,
>
> I have set of specs test and I'm using mockito
>
> I noticed that if I have a list of Users (pretty much same class that
> is coming from archetype) and do following test:
>
> users(1).firstName must beEqualTo(name2)
>
> Then I get :
> [WARNING] Exception in thread "main" java.lang.RuntimeException:
> malformed Scala signature of User at 13798; reference type _5 of
> <none> refers to nonexisting symbol.
>
> If the line is changed to:
>
> (users(1).firstName == name2) must beTrue
>
> it compiles really nicely. Based on previous posts here it seams to be
> that this is scala bug (I use 2.7.4|3)
>
> Much bigger problem for me is that when trying to mock the User:
>
> var userDbMock = mock[MetaUser]
>
> causes the same issue:
> [WARNING] Exception in thread "main" java.lang.RuntimeException:
> malformed Scala signature of User at 13798; reference type _5 of
> <none> refers to nonexisting symbol.
>
> MetaUser is trait:
>
> object User extends MetaUser {
>
> override def dbTableName = "users" // define the DB table name
> override def screenWrap = Full(<lift:surround with="default"
> at="content">
> <lift:bind /></lift:surround>)
> // define the order fields will appear in forms and output
> override def fieldOrder = List(id, firstName, lastName, email,
> locale, timezone, password, textArea)
>
> // comment this line out to require email validations
> override def skipEmailValidation = true
>
> }
>
> trait MetaUser extends User with MetaMegaProtoUser[User] {
>
> }
>
> Have anybody encountered similar problem when mocking or even found a
> workaround for this case?
>
> br,
> - Erik
>
> PS. Weirdest thing is that I'm able to run the test cases in
> Eclipse...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" 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/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---