Lifty-generated tests

53 views
Skip to first unread message

Paul Butcher

unread,
Dec 22, 2011, 6:23:51 PM12/22/11
to li...@googlegroups.com
Mads,

I've just stumbled across Lifty - very nice, and many thanks for your hard work.

What is the status of the tests generated by "lifty create lift project"? When I run the sbt "test" task, I get errors in both RunWebApp.scala:

> [error] RunWebApp.scala:1: object mortbay is not a member of package org
> [error] import org.mortbay.jetty.{Connector, Server}
> [error] ^


and HelloWorldTest.scala:

> [error] HelloWorldTest.scala:4: object specs is not a member of package org
> [error] import org.specs._
> [error] ^


If I delete those two files, it compiles OK (although I get a deprecation warning from LiftConsole.scala):

> [warn] LiftConsole.scala:13: method exit in object Predef is deprecated: Use sys.exit(status) instead
> [warn] exit(0)
> [warn] ^


but it doesn't seem to notice that there are any tests in AppTest.scala:

> [info] No tests to run for test:test

Are these supposed to work "out of the box"? Am I missing anything?

While we're on the subject of the code in the test tree - how does one (can one?) run the console defined in LiftConsole from sbt?

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

Paul Butcher

unread,
Dec 22, 2011, 7:08:46 PM12/22/11
to li...@googlegroups.com
FWIW, based on my (very shaky) understanding of Lift, I suspect that:

- LiftConsole is defunct if you use sbt - instead one should use the sbt "console" command? So the right solution is to simply delete LiftConsole.scala?

- RunWebApp is defunct if you use sbt - instead one should use the xsbt-web-plugin "container:start" command? So the right solution is to simply delete RunWebApp.scala?

Does this sound about right?

The JUnit tests can be run by adding:

> libraryDependencies += "com.novocode" % "junit-interface" % "0.7" % "test->default"

to build.sbt.

Mads Hartmann

unread,
Dec 28, 2011, 10:40:27 AM12/28/11
to li...@googlegroups.com
Hi Paul,

I'm happy you find Lifty useful :) I'll take a look at your comments and the code and find a solution. 

/Mads

Mads Hartmann

unread,
Dec 28, 2011, 11:31:58 AM12/28/11
to li...@googlegroups.com
Okay, it should be fixed now :) 

Because of a bug in Lifty I just found you have to delete the lift recipe and install it again. Running "> lifty upgrade lift" won't work. 

So you can remove and reinstall the lift recipe by running the following in the SBT shell. 

> lifty delete lift     

You can see the commit changes here if you want to update your current project manually: 


Thanks for reporting the issue. 

/Mads

Paul Butcher

unread,
Dec 28, 2011, 5:16:27 PM12/28/11
to li...@googlegroups.com
On 28 Dec 2011, at 16:31, Mads Hartmann wrote:
> Okay, it should be fixed now :)

Thanks Mads. There's still one discrepancy - the template creates AppTest.scala containing a couple of JUnit tests (testOK and testXml). But these tests aren't run because the JUnit interface isn't included in the sbt project. I guess that either it should be deleted or the JUnit interface should be included?

Thanks!

Reply all
Reply to author
Forward
0 new messages