[Lift] Re: How forms work (the life cycle of request)

2009-05-11 Thread erik.karls...@iki.fi
> Give me a week or some and I think I'll have something that you'll like... > basically, you can register a function that's called when stuff is added to > the function table... and there'll be a "why" associated with the adding. > When you're running in test mode, you can intercept the functions

[Lift] Re: How forms work (the life cycle of request)

2009-05-11 Thread erik.karls...@iki.fi
Hi, > Scala supports true closures which means that variables in scope (including > "this") are bound to the function. > > Lift associates the function passed to SHtml.text(defaultValue, > passedFunction) with a GUID and returns places that GUID in the name > attribute of the generated HTML eleme

[Lift] Re: Write access to the id field of ProtoUser (for testing)

2009-05-11 Thread erik.karls...@iki.fi
That work> A hah!  I had forgotten that I'd done this.  Try the following: > > myUser.runSafe { >   myUser.id(55L) > > } > Now it works and thanks for the explanation!! br, - Erik > Mapper supports read and write access control on a field by field bases. >  You can put in complex logic (e.g.,

[Lift] Re: Write access to the id field of ProtoUser (for testing)

2009-05-11 Thread erik.karls...@iki.fi
Hi, > New users are moderated to avoid spam... on weekends, it may take up to a > day for postings to appear on list. Ok, sorry for the spam then ;) > You should be able to do: > > myUserInstance.id(55L) > > That should set it to 55. I try to do this in my unit test: val u2 = User.create u2.id

[Lift] How forms work (the life cycle of request)

2009-05-10 Thread erik.karls...@iki.fi
Hi, I'm asking some questions again :) This time it is about form handling. I tried to get the idea from source code but I think it would be easier if some one wiser could open it a bit. Here is my understanding, please correct me if it is incorrect: 1. I have snippet (TeamSnippet) with "add" f

[Lift] Write access to the id field of ProtoUser (for testing)

2009-05-10 Thread erik.karls...@iki.fi
Hi, It may happen that this post appears twice to this forum - in that case sorry for the double posting ;) Anyhow, I have following case. For unit test case I would need to be able to define what is the value the id field in ProtoUser returns. I know that I could handle this by just creating a

[Lift] Write access to the id field of ProtoUser (for testing)

2009-05-10 Thread erik.karls...@iki.fi
Hi, I would like to use ProtoUser in my unit test so that I could set it's id's value. One way to do this is that I would create a mock object of the ProtoUser and then define what the id returns. However, I would rather like to use just the real class as it is. Is there a possibility to give the

[Lift] Re: malformed Scala signature of User

2009-04-28 Thread erik.karls...@iki.fi
pe signature wrong on Lists of MappedField. > > On Tue, Apr 28, 2009 at 9:51 AM, erik.karls...@iki.fi < > > > > erik.b.karls...@gmail.com> wrote: > > > hello, > > > Tried to dig a bit more. I noticed that I get the cryptic compile > > error with the m

[Lift] Re: malformed Scala signature of User

2009-04-28 Thread erik.karls...@iki.fi
kirjoitti: > > > Erik, > > > Please do an: > > > mvn clean test > > > From the command line. > > > The Eclipse plugin uses a different version of Scala than does Lift.  There > > will be weird errors like the one you've seen. > > > Thanks,

[Lift] Re: malformed Scala signature of User

2009-04-27 Thread erik.karls...@iki.fi
pse plugin uses a different version of Scala than does Lift. There > will be weird errors like the one you've seen. > > Thanks, > > David > > On Mon, Apr 27, 2009 at 2:24 PM, erik.karls...@iki.fi < > erik.b.karls...@gmail.com> wrote: > > > > > Wei

[Lift] Re: malformed Scala signature of User

2009-04-27 Thread erik.karls...@iki.fi
m.user, user.id), OrderBy(UserTeam.team, Ascending)).map(_.team.obj.open_!) } --- - Erik On Apr 28, 12:19 am, "erik.karls...@iki.fi" 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

[Lift] malformed Scala signature of User

2009-04-27 Thread erik.karls...@iki.fi
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: malfo

[Lift] Re: Mocking multiple models in a Snippet

2009-04-21 Thread erik.karls...@iki.fi
d(0).text must beEqualTo("TeamName2") } } } The point is to create traits that wraps the model's functions and then mock those interfaces. Basic stuff ;) - Erik > > Derek > > On Sun, Apr 19, 2009 at 3:15 AM, erik.karls...@iki.fi < > > erik.b.karls...@gmail

[Lift] Re: Mocking multiple models in a Snippet

2009-04-19 Thread erik.karls...@iki.fi
up a Derby or HSQL DB for test > > purposes in your Boot class work? Usually I use this method combined with > > DBUnit to load test data. > > > Derek > > > On Fri, Apr 17, 2009 at 3:43 PM, erik.karls...@iki.fi < > > erik.b.karls...@gmail.com> wrote: > > >

[Lift] Mocking multiple models in a Snippet

2009-04-17 Thread erik.karls...@iki.fi
Hi, I'm a little bit puzzled about the problem of mocking multiple models in one class. My problem is following: I have a snippet that uses two models. To be able to test the snippet I would need to create Mock objects for both of those models and especially for the object part of the model (to

[Lift] Re: Unit tests for views & snippets

2009-04-05 Thread erik.karls...@iki.fi
> On Apr 4, 5:45 pm, "erik.karls...@iki.fi" > wrote: > > > Hi, > > > First thanks for the great framework. It has been long time when I had > > this fun with web programming :) > > > I have a pretty newbie question about unit testing. Do anybody know &

[Lift] Unit tests for views & snippets

2009-04-04 Thread erik.karls...@iki.fi
those classes but I would be really interested to hear comments about proper/recommended way of handling for example sessions, request properties, states etc. Thanks beforehand! -Erik -- Erik Karlsson erik.karls...@iki.fi --~--~-~--~~~---~--~~ You received this