Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ref #872, #873, #817

- More cleanup and class/sus names consistencies
- Remove deprecation warnings
- Remove junit references, import cleanups
  • Loading branch information...
commit 1f54b5da14174b33c0b768db4adf18e5b265d597 1 parent 91c7a82
@indrajitr indrajitr authored
Showing with 189 additions and 239 deletions.
  1. +1 −2  core/util/src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala
  2. +2 −2 persistence/mapper/src/test/scala/net/liftweb/mapper/DBProviders.scala
  3. +11 −2 persistence/mapper/src/test/scala/net/liftweb/mapper/MapperSpec.scala
  4. +0 −1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/CustomSerializersSpec.scala
  5. +0 −1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoFieldSpecs.scala
  6. +0 −1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoRecordExamplesSpec.scala
  7. +0 −1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoRecordSpec.scala
  8. +0 −1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/field/EnumFieldSpec.scala
  9. +0 −1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/field/EnumNameFieldSpec.scala
  10. +20 −20 persistence/squeryl-record/src/test/scala/net/liftweb/squerylrecord/Fixtures.scala
  11. +3 −4 persistence/squeryl-record/src/test/scala/net/liftweb/squerylrecord/SquerylRecordSpec.scala
  12. +5 −6 project/build/LiftFrameworkProject.scala
  13. +0 −2  web/testkit/src/test/scala/net/liftweb/http/testing/MockHttpRequestSpec.scala
  14. +8 −8 web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgSpec.scala
  15. +13 −13 web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgsSpec.scala
  16. +14 −14 web/webkit/src/test/scala/net/liftweb/http/BindingsSpec.scala
  17. +10 −14 web/webkit/src/test/scala/net/liftweb/http/ReqSpec.scala
  18. +8 −10 web/webkit/src/test/scala/net/liftweb/http/ResourceServerSpec.scala
  19. +8 −6 web/webkit/src/test/scala/net/liftweb/http/SnippetSpec.scala
  20. +7 −6 web/webkit/src/test/scala/net/liftweb/http/js/JsExpSpec.scala
  21. +12 −16 web/webkit/src/test/scala/net/liftweb/http/js/extcore/ExtCoreArtifactsSpec.scala
  22. +13 −19 web/webkit/src/test/scala/net/liftweb/http/rest/XMLApiSpec.scala
  23. +7 −11 web/webkit/src/test/scala/net/liftweb/mockweb/MockWebSpec.scala
  24. +0 −5 web/webkit/src/test/scala/net/liftweb/mockweb/WebSpecSpec.scala
  25. +10 −14 web/webkit/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala
  26. +13 −17 web/webkit/src/test/scala/net/liftweb/webapptest/MemoizeSpec.scala
  27. +9 −19 web/webkit/src/test/scala/net/liftweb/webapptest/OneShot.scala
  28. +11 −15 web/webkit/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala
  29. +4 −8 web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala
View
3  core/util/src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala
@@ -83,8 +83,7 @@ object CombParserHelpersSpec extends Specification("CombParserHelpers Specificat
val number: String => Boolean =
(s: String) => {
aNumber(s) match {
- case Success(x, y) =>
- s.toInt == x
+ case Success(x, y) => s.toInt == x
case _ => true
}
}
View
4 persistence/mapper/src/test/scala/net/liftweb/mapper/DBProviders.scala
@@ -25,7 +25,7 @@ import util._
object DbProviders {
- def asList = PostgreSqlProvider :: MySqlProvider :: DerbyProvider :: H2Provider :: H2MemoryProvider :: Nil
+ def asList = PostgreSqlProvider :: MySqlProvider :: DerbyProvider :: H2FileProvider :: H2MemoryProvider :: Nil
// Uncomment to run tests faster, but only against H2 def asList = H2MemoryProvider :: Nil
@@ -132,7 +132,7 @@ object DbProviders {
override def required_? = true
}
- object H2Provider extends Provider with FileDbSetup {
+ object H2FileProvider extends Provider with FileDbSetup {
def name = "H2"
def filePath = "target/tests_h2_lift"
def vendor = new Vendor("org.h2.Driver") {
View
13 persistence/mapper/src/test/scala/net/liftweb/mapper/MapperSpec.scala
@@ -32,7 +32,7 @@ import http.provider.HTTPRequest
/**
* Systems under specification for Mapper.
*/
-object MapperSpecs extends Specification("Mapper Specification") {
+object MapperSpec extends Specification("Mapper Specification") {
val doLog = false
@@ -98,6 +98,7 @@ object MapperSpecs extends Specification("Mapper Specification") {
Schemifier.schemify(true, if (doLog) Schemifier.infoF _ else ignoreLogger _, DbProviders.SnakeConnectionIdentifier, SampleModelSnake, SampleTagSnake)
}
+/*
doBeforeSpec {
providers.foreach(provider => {
try {provider.setupDB} catch { case e if !provider.required_? => skip("Provider %s not available: %s".format(provider, e)) }
@@ -105,12 +106,20 @@ object MapperSpecs extends Specification("Mapper Specification") {
// println("Setup done for =>>> " + provider)
})
}
+*/
providers.foreach(provider => {
("Mapper for " + provider.name) should {
- doBefore { cleanup() }
+ doBefore {
+ (try {
+ provider.setupDB
+ cleanup
+ } catch {
+ case e if !provider.required_? => skip("Provider %s not available: %s".format(provider, e))
+ }) must not(throwAnException[Exception]).orSkipExample
+ }
setSequential()
"schemify" in {
View
1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/CustomSerializersSpec.scala
@@ -29,7 +29,6 @@ import java.util.{Calendar, Date}
import org.bson.types.ObjectId
import org.specs.Specification
-import org.specs.runner.JUnit4
import net.liftweb.record.field._
View
1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoFieldSpecs.scala
@@ -34,7 +34,6 @@ import scala.xml.Text
import org.bson.types.ObjectId
import org.specs.Specification
-import org.specs.runner.JUnit4
import net.liftweb.record._
View
1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoRecordExamplesSpec.scala
@@ -29,7 +29,6 @@ import net.liftweb.record.field._
import net.liftweb.util.TimeHelpers._
import org.specs.Specification
-import org.specs.runner.JUnit4
import com.mongodb._
import org.bson.types.ObjectId
View
1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoRecordSpec.scala
@@ -28,7 +28,6 @@ import java.util.regex.Pattern
import org.bson.types.ObjectId
import org.specs.Specification
-import org.specs.runner.JUnit4
import net.liftweb.record.field.Countries
View
1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/field/EnumFieldSpec.scala
@@ -21,7 +21,6 @@ package field
import org.bson.types.ObjectId
import org.specs.Specification
-import org.specs.runner.JUnit4
import net.liftweb.common._
import net.liftweb.json.ext.EnumSerializer
View
1  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/field/EnumNameFieldSpec.scala
@@ -21,7 +21,6 @@ package field
import org.bson.types.ObjectId
import org.specs.Specification
-import org.specs.runner.JUnit4
import net.liftweb.common._
import net.liftweb.json.ext.EnumNameSerializer
View
40 persistence/squeryl-record/src/test/scala/net/liftweb/squerylrecord/Fixtures.scala
@@ -37,8 +37,8 @@ import java.util.Calendar
object DBHelper {
def initSquerylRecordWithInMemoryDB() {
- SquerylRecord.initWithSquerylSession {
- val session = Session.create(DriverManager.getConnection("jdbc:h2:mem:testSquerylRecordDB;DB_CLOSE_DELAY=-1", "sa", ""), new H2Adapter)
+ SquerylRecord.initWithSquerylSession {
+ val session = Session.create(DriverManager.getConnection("jdbc:h2:mem:testSquerylRecordDB;DB_CLOSE_DELAY=-1"), new H2Adapter)
//session.setLogger(statement => println(statement))
session
}
@@ -50,14 +50,14 @@ object DBHelper {
*/
def createSchema() {
inTransaction {
- try {
- //MySchema.printDdl
- MySchema.dropAndCreate
- MySchema.createTestData
- } catch {
- case e => e.printStackTrace()
- throw e;
- }
+ try {
+ //MySchema.printDdl
+ MySchema.dropAndCreate
+ MySchema.createTestData
+ } catch {
+ case e => e.printStackTrace()
+ throw e;
+ }
}
}
}
@@ -145,13 +145,13 @@ object Employee extends Employee with MetaRecord[Employee]
* Test record: One or more employees can have a room (one-to-many-relation).
*/
class Room private() extends Record[Room] with KeyedRecord[Long] {
- override def meta = Room
-
- override val idField = new LongField(this)
-
- val name = new StringField(this, 50)
-
- lazy val employees = MySchema.roomAssignments.right(this)
+ override def meta = Room
+
+ override val idField = new LongField(this)
+
+ val name = new StringField(this, 50)
+
+ lazy val employees = MySchema.roomAssignments.right(this)
}
object Room extends Room with MetaRecord[Room]
@@ -179,9 +179,9 @@ object MySchema extends Schema {
oneToManyRelation(companies, employees).via((c, e) => c.id === e.companyId)
val roomAssignments = manyToManyRelation(employees, rooms).
- via[RoomAssignment]((employee, room, roomAssignment) =>
- (roomAssignment.employeeId === employee.idField, roomAssignment.roomId === room.idField))
-
+ via[RoomAssignment]((employee, room, roomAssignment) =>
+ (roomAssignment.employeeId === employee.idField, roomAssignment.roomId === room.idField))
+
on(employees)(e =>
declare(e.companyId defineAs (indexed("idx_employee_companyId")),
e.email defineAs indexed("idx_employee_email")))
View
7 persistence/squeryl-record/src/test/scala/net/liftweb/squerylrecord/SquerylRecordSpec.scala
@@ -17,8 +17,7 @@ package squerylrecord
import org.specs.Specification
import record.{BaseField, Record}
import RecordTypeMode._
-import MySchema.{TestData => td}
-import MySchema.{companies, employees, rooms, roomAssignments}
+import MySchema.{TestData => td, _}
/**
@@ -55,7 +54,7 @@ object SquerylRecordSpec extends Specification("SquerylRecord Specification") {
transaction {
val orderedCompanies = from(companies)(c =>
select(c) orderBy (c.name))
- val ids = orderedCompanies.map(c => c.id)
+ val ids = orderedCompanies.map(_.id)
ids must containInOrder(
td.allCompanies.sortBy(_.name.is).map(_.id))
}
@@ -263,7 +262,7 @@ object SquerylRecordSpec extends Specification("SquerylRecord Specification") {
def check(fieldExtractor: (T) => BaseField) {
val f1 = fieldExtractor(r1)
val f2 = fieldExtractor(r2)
- f1.is must_== f2.is
+ f1.get must_== f2.get
f1.name must_== f2.name
}
View
11 project/build/LiftFrameworkProject.scala
@@ -59,8 +59,8 @@ class LiftFrameworkProject(info: ProjectInfo) extends ParentProject(info) with L
lazy val framework_doc = project(".", "lift-framework-doc", new DefaultProject(_) with LiftDefaultDocProject)
- private def coreProject = frameworkProject("core") _
- private def webProject = frameworkProject("web") _
+ private def coreProject = frameworkProject("core") _
+ private def webProject = frameworkProject("web") _
private def persistenceProject = frameworkProject("persistence") _
private def frameworkProject(base: String)(path: String, libs: ModuleID*)(deps: Project*) =
@@ -85,12 +85,12 @@ class LiftFrameworkProject(info: ProjectInfo) extends ParentProject(info) with L
// ------------
class FrameworkProject(info: ProjectInfo, libs: ModuleID*) extends DefaultProject(info) with LiftDefaultProject {
- override def libraryDependencies = super.libraryDependencies ++ libs ++ Seq(TestScope.junit)
+ override def libraryDependencies = super.libraryDependencies ++ libs
// FIXME: Build fails with -Xcheckinit -Xwarninit
override def compileOptions = super.compileOptions.toList -- compileOptions("-Xcheckinit", "-Xwarninit").toList
- // System property hack for derby.log, webapptests
+ // System properties necessary during test
override def testAction =
super.testAction dependsOn
task {
@@ -101,10 +101,9 @@ class LiftFrameworkProject(info: ProjectInfo) extends ParentProject(info) with L
// FIXME: breaks with SBT
override def testOptions =
- // TestFilter((name: String) => name.startsWith("net.liftweb.mapper")) ::
ExcludeTests(
// Web tests
- "net.liftweb.webapptest.OneShot" :: "net.liftweb.webapptest.ToHeadUsages" :: "net.liftweb.http.SnippetSpec" :: Nil) ::
+ "net.liftweb.http.SnippetSpec" :: Nil) ::
super.testOptions.toList
}
View
2  web/testkit/src/test/scala/net/liftweb/http/testing/MockHttpRequestSpec.scala
@@ -126,5 +126,3 @@ object MockHttpRequestSpec extends Specification("MockHttpRequest Specification"
}
}
-
-
View
16 web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgSpec.scala
@@ -17,17 +17,17 @@
package net.liftweb
package builtin.snippet
-import common._
-import http.{LiftRules,LiftSession,S}
+import xml._
+import org.specs.Specification
-import org.specs._
-import runner._
-import Sugar._
+import common._
+import http._
-import scala.xml.{Null,Text,UnprefixedAttribute,XML}
-class MsgSpecTest extends Runner(MsgSpec) with JUnit with Console
-object MsgSpec extends Specification {
+/**
+ * System under specification for Msg.
+ */
+object MsgSpec extends Specification("Msg Specification") {
def withSession[T](f: => T) : T =
S.initIfUninitted(new LiftSession("test", "", Empty))(f)
View
26 web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgsSpec.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 WorldWide Conferencing, LLC
+ * Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,19 +14,21 @@
* limitations under the License.
*/
-package net.liftweb {
-package builtin.snippet {
+package net.liftweb
+package builtin.snippet
-import _root_.org.specs._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
-import _root_.net.liftweb.http.{LiftRules,LiftSession,S}
-import _root_.net.liftweb.common._
+import xml.XML
+import org.specs.Specification
-import _root_.scala.xml.XML
+import common._
+import http._
+
+
+/**
+ * System under specification for Msgs.
+ */
+object MsgsSpec extends Specification("Msgs Specification") {
-class MsgsSpecTest extends Runner(MsgsSpec) with JUnit with Console
-object MsgsSpec extends Specification {
def withSession[T](f: => T) : T =
S.initIfUninitted(new LiftSession("test", "", Empty))(f)
@@ -69,5 +71,3 @@ object MsgsSpec extends Specification {
}
}
}
-
-}} // Close nested packages
View
28 web/webkit/src/test/scala/net/liftweb/http/BindingsSpec.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 WorldWide Conferencing, LLC
+ * Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,20 +14,22 @@
* limitations under the License.
*/
-package net.liftweb {
-package http {
+package net.liftweb
+package http
-import _root_.net.liftweb.util.Helpers._
-import _root_.org.specs._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
-import scala.xml.NodeSeq
-import scala.xml.Text
-import _root_.net.liftweb.common._
+import xml.{NodeSeq, Text}
+import org.specs.Specification
+
+import common._
+import util.Helpers._
import Bindings._
-class BindingsSpecTest extends Runner(BindingsSpec) with JUnit with Console
-object BindingsSpec extends Specification {
+
+/**
+ * System under specification for Bindings.
+ */
+object BindingsSpec extends Specification("Bindings Bindings") {
+
case class MyClass(str: String, i: Int, other: MyOtherClass)
case class MyOtherClass(foo: String)
@@ -106,5 +108,3 @@ object BindingsSpec extends Specification {
}
}
}
-
-}}
View
24 web/webkit/src/test/scala/net/liftweb/http/ReqSpec.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 WorldWide Conferencing, LLC
+ * Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,21 +14,19 @@
* limitations under the License.
*/
-package net.liftweb {
-package http {
+package net.liftweb
+package http
-import _root_.net.liftweb.util.Helpers._
-import _root_.org.specs._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
-import scala.xml.NodeSeq
-import scala.xml.Text
-import Bindings._
+import org.specs.Specification
import common._
-class ReqSpecTest extends Runner(ReqSpec) with JUnit with Console
-object ReqSpec extends Specification {
+
+/**
+ * System under specification for Req.
+ */
+object ReqSpec extends Specification("Req Specification") {
+
private val iPhoneUserAgents =
List("Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16",
"Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5")
@@ -73,5 +71,3 @@ object ReqSpec extends Specification {
}
}
}
-
-}}
View
18 web/webkit/src/test/scala/net/liftweb/http/ResourceServerSpec.scala
@@ -14,21 +14,19 @@
* limitations under the License.
*/
-package net.liftweb {
-package http {
+package net.liftweb
+package http
-import _root_.org.specs._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
+import org.specs.Specification
-class ResourceServerSpecTest extends Runner(ResourceServerSpec) with JUnit with Console
-object ResourceServerSpec extends Specification {
+
+/**
+ * System under specification for ResourceServer.
+ */
+object ResourceServerSpec extends Specification("ResourceServer Specification") {
"ResourceServer.pathRewriter" should {
"default jquery.js to jquery-1.3.2" in {
ResourceServer.pathRewriter("jquery.js"::Nil) must_== List("jquery-1.3.2-min.js")
}
}
}
-
-}
-}
View
14 web/webkit/src/test/scala/net/liftweb/http/SnippetSpec.scala
@@ -17,15 +17,17 @@
package net.liftweb
package http
+import xml._
+import org.specs.Specification
+
import common._
import util.Helpers._
-import org.specs._
-import org.specs.runner._
-import org.specs.Sugar._
-import scala.xml.{NodeSeq,Null,PrefixedAttribute,Text,UnprefixedAttribute}
-class SnippetSpecTest extends Runner(SnippetSpec) with JUnit with Console
-object SnippetSpec extends Specification {
+
+/**
+ * System under specification for SnippetSpec.
+ */
+object SnippetSpec extends Specification("SnippetSpec Specification") {
def makeReq = new Req(Req.NilPath, "", GetRequest, Empty, null,
System.nanoTime, System.nanoTime, false,
() => ParamCalcInfo(Nil, Map.empty, Nil, Empty), Map())
View
13 web/webkit/src/test/scala/net/liftweb/http/js/JsExpSpec.scala
@@ -18,16 +18,17 @@ package net.liftweb
package http
package js
-import common._
+import org.specs.Specification
+
import json._
import JsonDSL._
import util.Helpers._
-import org.specs._
-import org.specs.runner._
-import org.specs.Sugar._
-class JsExpSpecTest extends Runner(JsExpSpec) with JUnit with Console
-object JsExpSpec extends Specification {
+
+/**
+ * System under specification for JsExp.
+ */
+object JsExpSpec extends Specification("JsExp Specification") {
"JsExp" should {
"Deal with lift-json" in {
val json = ("a" -> 4) ~ ("b" -> 44)
View
28 web/webkit/src/test/scala/net/liftweb/http/js/extcore/ExtCoreArtifactsSpec.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,18 +14,19 @@
* limitations under the License.
*/
-package net.liftweb {
-package http {
-package js {
-package extcore {
+package net.liftweb
+package http
+package js
+package extcore
-import _root_.org.specs._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
+import org.specs.Specification
+
+
+/**
+ * System under specification for ExtCoreArtifacts.
+ */
+object ExtCoreArtifactsSpec extends Specification("ExtCoreArtifacts Specification") {
-class ExtCoreArtifactsSpecTest extends Runner(ExtCoreArtifactsSpec) with JUnit with Console
-object ExtCoreArtifactsSpec extends Specification {
-
"ExtCoreArtifacts.toggle" should {
"return the correct javascript expression" in {
ExtCoreArtifacts.toggle("id").toJsCmd must_== """Ext.fly("id").toggle()"""
@@ -56,8 +57,3 @@ object ExtCoreArtifactsSpec extends Specification {
}
}
}
-
-}
-}
-}
-}
View
32 web/webkit/src/test/scala/net/liftweb/http/rest/XMLApiSpec.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 WorldWide Conferencing, LLC
+ * Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,26 +14,24 @@
* limitations under the License.
*/
-package net.liftweb {
-package http {
-package rest {
+package net.liftweb
+package http
+package rest
-import scala.xml.{Elem,Node,NodeSeq,XML}
+import xml._
-import common.{Box,Empty,Failure,Full}
-import util.ControlHelpers.tryo
+import org.specs.Specification
+import org.specs.matcher.Matcher
-import _root_.org.specs._
-import _root_.org.specs.matcher.{Matcher,Matchers}
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
+import common._
+import util.ControlHelpers.tryo
-//import http.{BadResponse,GetRequest,LiftResponse,LiftRules,XmlResponse}
-//import http.rest.XMLApiHelper
+/**
+ * System under specification for XMLApi.
+ */
+object XmlApiSpec extends Specification("XMLApi Specification") {
-class XMLApiSpecTest extends Runner(XMLApiSpec) with JUnit with Console
-object XMLApiSpec extends Specification {
object XMLApiExample extends XMLApiHelper {
// Define our root tag
def createTag(contents : NodeSeq) : Elem = <api>{contents}</api>
@@ -139,7 +137,3 @@ object XMLApiSpec extends Specification {
}
}
}
-
-}
-
-}} // Close packages
View
18 web/webkit/src/test/scala/net/liftweb/mockweb/MockWebSpec.scala
@@ -16,26 +16,22 @@
package net.liftweb
package mockweb
-import javax.servlet.http.Cookie
-
import scala.xml.{Null,Text,UnprefixedAttribute}
+import org.specs.Specification
+
import common._
+import util._
import http._
-import http.provider.servlet.HTTPRequestServlet
+import provider.servlet.HTTPRequestServlet
import mocks.MockHttpServletRequest
-import util._
-
-import org.specs._
-import org.specs.runner._
-class MockWebSpecTest extends Runner(MockWebSpec) with JUnit with Console
/**
- * This spec does double duty as both a spec against the
- * MockWeb object as well as an example of how to use it.
+ * System under specification for MockWeb. This does the double duty as both a spec
+ * against the MockWeb object as well as an example of how to use it.
*/
-object MockWebSpec extends Specification {
+object MockWebSpec extends Specification("MockWeb Specification") {
import MockWeb._
// TODO : Uncomment this code when LiftRules can be scoped
View
5 web/webkit/src/test/scala/net/liftweb/mockweb/WebSpecSpec.scala
@@ -23,11 +23,6 @@ import json._
import json.JsonDSL._
import mocks.MockHttpServletRequest
-import org.specs._
-import org.specs.runner._
-
-
-class WebSpecSpecTest extends Runner(WebSpecSpec) with JUnit with Console
// TODO : Uncomment this code when LiftRules can be scoped
///**
View
24 web/webkit/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,20 +14,19 @@
* limitations under the License.
*/
-package net.liftweb {
-package webapptest {
+package net.liftweb
+package webapptest
-import _root_.org.mortbay.jetty.Server
-//import _root_.org.mortbay.jetty.servlet.Context
-import _root_.org.mortbay.jetty.servlet.ServletHolder
-import _root_.org.mortbay.jetty.webapp.WebAppContext
+import org.mortbay.jetty.Server
+import org.mortbay.jetty.webapp.WebAppContext
+
+import net.sourceforge.jwebunit.junit.WebTester
+import junit.framework.AssertionFailedError
-import _root_.net.sourceforge.jwebunit.junit.WebTester
-import _root_.junit.framework.AssertionFailedError
object JettyTestServer {
private val serverPort_ = System.getProperty("SERVLET_PORT", "8989").toInt
- private var baseUrl_ = "http://localhost:" + serverPort_
+ private var baseUrl_ = "http://127.0.0.1:" + serverPort_
def baseUrl = baseUrl_
@@ -61,7 +60,7 @@ object JettyTestServer {
f(wc)
} catch {
case exc: AssertionFailedError => {
- System.err.println("serveur response: ", wc.getServeurResponse())
+ System.err.println("server response: ", wc.getServerResponse())
throw exc
}
} finally {
@@ -70,6 +69,3 @@ object JettyTestServer {
}
}
-
-}
-}
View
30 web/webkit/src/test/scala/net/liftweb/webapptest/MemoizeSpec.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2010 WorldWide Conferencing, LLC
+ * Copyright 2009-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,20 +14,15 @@
* limitations under the License.
*/
-package net.liftweb {
-package webapptest {
+package net.liftweb
+package webapptest
-import _root_.org.specs._
-import _root_.org.specs.runner.JUnit3
-import _root_.org.specs.runner.ConsoleRunner
-import _root_.net.sourceforge.jwebunit.junit.WebTester
-import _root_.net.liftweb._
-import http._
-import common._
-import _root_.net.liftweb.util._
+import org.specs.Specification
+//import net.sourceforge.jwebunit.junit.WebTester
-class MemoizeTest extends JUnit3(MemoizeSpec)
-object MemoizeRunner extends ConsoleRunner(MemoizeSpec)
+import common._
+import util._
+import http._
object SessionInfo {
lazy val session1 = new LiftSession("/", Helpers.randomString(20), Empty)
@@ -37,7 +32,11 @@ object SessionInfo {
object requestMemo extends RequestMemoize[Int, Int]
}
-object MemoizeSpec extends Specification {
+
+/**
+ * System under specification for Memoize.
+ */
+object MemoizeSpec extends Specification("Memoize Specification") {
import SessionInfo._
@@ -84,6 +83,3 @@ object MemoizeSpec extends Specification {
}
}
-
-}
-}
View
28 web/webkit/src/test/scala/net/liftweb/webapptest/OneShot.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 WorldWide Conferencing, LLC
+ * Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,24 +14,17 @@
* limitations under the License.
*/
-package net.liftweb {
-package webapptest {
-
-import _root_.org.specs._
-import _root_.org.specs.runner.JUnit3
-import _root_.org.specs.runner.ConsoleRunner
-import _root_.net.sourceforge.jwebunit.junit.WebTester
-import _root_.net.liftweb.common._
-import _root_.net.liftweb.http._
-import _root_.net.liftweb.http.testing._
-import _root_.net.liftweb.util._
-import Helpers._
+package net.liftweb
+package webapptest
-import net.liftweb.webapptest.snippet.Counter
+import org.specs.Specification
+import util._
+import http._
+import testing._
+import Helpers._
-class OneShotTest extends JUnit3(OneShot)
-object OneShotRunner extends ConsoleRunner(OneShot)
+import snippet.Counter
object OneShot extends Specification with RequestKit {
@@ -161,6 +154,3 @@ object OneShot extends Specification with RequestKit {
}
}
-
-}
-}
View
26 web/webkit/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,21 +14,20 @@
* limitations under the License.
*/
-package net.liftweb {
-package webapptest {
+package net.liftweb
+package webapptest
-import _root_.org.specs._
-import _root_.org.specs.runner.JUnit3
-import _root_.org.specs.runner.ConsoleRunner
-import _root_.net.sourceforge.jwebunit.junit.WebTester
-import _root_.net.liftweb.http._
-import _root_.net.liftweb.util._
+import org.specs.Specification
-class ToHeadUsagesTest extends JUnit3(ToHeadUsages)
-object ToHeadUsagesRunner extends ConsoleRunner(ToHeadUsages)
+import util._
+import http._
-object ToHeadUsages extends Specification {
+/**
+ * System under specification for ToHeadUsages.
+ */
+object ToHeadUsages extends Specification("ToHeadUsages Specification") {
+
doBeforeSpec(JettyTestServer.start())
doAfterSpec(JettyTestServer.stop())
@@ -173,6 +172,3 @@ object ToHeadUsages extends Specification {
}
}
-
-}
-}
View
12 web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package net.liftweb {
-package webapptest {
-package snippet {
+package net.liftweb
+package webapptest
+package snippet
class HeadTestSnippet {
def withHead = {
@@ -29,7 +29,3 @@ class HeadTestSnippet {
}
}
-
-}
-}
-}
Please sign in to comment.
Something went wrong with that request. Please try again.