Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ref #872 specs work better with SBT, remove junit references, import …

…cleanups
  • Loading branch information...
commit 675bac933ca1735ebe116d11d1a4e0c41802ce77 1 parent af1ede5
@indrajitr indrajitr authored
View
15 imaging/src/test/scala/net/liftweb/imaging/ImageResizerSpec.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,15 +14,13 @@
* limitations under the License.
*/
-package net.liftweb {
-package imaging {
+package net.liftweb
+package imaging
-import _root_.org.specs._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
+import org.specs.Specification
+
-class ImageResizerTest extends JUnit4(ImageResizerSpec)
object ImageResizerSpec extends Specification {
"ImageResizer scaledMaxDim function" should {
@@ -41,6 +39,3 @@ object ImageResizerSpec extends Specification {
}
}
}
-
-}
-}
View
0  oauth-mapper/src/test/scala/net/liftweb/oauth/.keep
No changes.
View
0  oauth/src/test/scala/net/liftweb/oauth/.keep
No changes.
View
25 oauth/src/test/scala/net/liftweb/oauth/OAuthSignatureMethodSpec.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 oauth {
+package net.liftweb
+package oauth
-import _root_.org.specs._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
+import java.util.Date
-import net.liftweb.http.GetRequest
+import org.specs.Specification
+
+import common.{Full,Empty}
+import http.GetRequest
+
+import OAuthUtil.Parameter
-import net.liftweb.oauth.OAuthUtil.Parameter
-import net.liftweb.common.{Box,Full,Empty}
-import java.util.Date
-
-class OAuthSignatureMethodSpecTest extends Runner(OAuthSignatureMethodSpec) with JUnit with Console
object OAuthSignatureMethodSpec extends Specification {
val oauthAccessor = OAuthAccessor(FakeConsumer("dpf43f3p2l4k3l03","kd94hf93k423kf44"), Full("pfkkdhi9sl3r4s00"), Empty)
val hmacSha1 = HMAC_SHA1(oauthAccessor)
@@ -77,6 +75,3 @@ object OAuthSignatureMethodSpec extends Specification {
def xdatetime: Date = new Date(0)
}
}
-
-}
-}
View
0  openid/src/test/scala/net/liftweb/openid/.keep
No changes.
View
36 openid/src/test/scala/net/liftweb/openid/RawHelperSpec.scala
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.liftweb
+package openid
+
+import java.util.{List, ArrayList}
+
+import org.specs.Specification
+
+
+object RawHelperSpec extends Specification {
+ "RawUtils" should {
+ "Convert a java.util.List" in {
+ val org: List[Object] = new ArrayList[Object]()
+
+ org.add("Hello")
+ org.add("Woof")
+
+ RawHelper.rawJUL2List[String](org) must_== scala.List("Hello", "Woof")
+ }
+ }
+}
View
48 openid/src/test/scala/net/liftweb/openid/RawHelperSpecs.scala
@@ -1,48 +0,0 @@
-/*
- * Copyright 2010 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.liftweb {
-package openid {
-
-import _root_.org.specs._
-import _root_.net.liftweb.common.Box._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
-import _root_.org.specs.ScalaCheck
-import _root_.org.scalacheck.Gen._
-import _root_.org.scalacheck._
-import _root_.org.scalacheck.Arbitrary._
-import _root_.org.scalacheck.Prop.{forAll}
-
-
-class RawHelperAsTest extends JUnit3(RawHelperSpecs)
-object RawHelperRunner extends ConsoleRunner(RawHelperSpecs)
-
-object RawHelperSpecs extends Specification {
- "RawUtils" should {
- "Convert a java.util.List" in {
- val org: java.util.List[Object] = new java.util.ArrayList[Object]()
-
- org.add("Hello")
- org.add("Woof")
-
- RawHelper.rawJUL2List[String](org) must_== List("Hello", "Woof")
- }
- }
-}
-
-}
-}
View
31 project/build/LiftModulesProject.scala
@@ -26,11 +26,11 @@ class LiftModulesProject(info: ProjectInfo) extends ParentProject(info) with Lif
object LiftDependencies {
// Lift dependencies
lazy val lift_common = "net.liftweb" %% "lift-common" % liftVersion
- lazy val lift_actor = "net.liftweb" %% "lift-actor" % liftVersion
- lazy val lift_json = "net.liftweb" %% "lift-jason" % liftVersion
- lazy val lift_util = "net.liftweb" %% "lift-util" % liftVersion
+ lazy val lift_actor = "net.liftweb" %% "lift-actor" % liftVersion
+ lazy val lift_json = "net.liftweb" %% "lift-jason" % liftVersion
+ lazy val lift_util = "net.liftweb" %% "lift-util" % liftVersion
lazy val lift_webkit = "net.liftweb" %% "lift-webkit" % liftVersion
- lazy val lift_db = "net.liftweb" %% "lift-db" % liftVersion
+ lazy val lift_db = "net.liftweb" %% "lift-db" % liftVersion
lazy val lift_mapper = "net.liftweb" %% "lift-mapper" % liftVersion
}
@@ -71,32 +71,15 @@ class LiftModulesProject(info: ProjectInfo) extends ParentProject(info) with Lif
// ------------
class ModulesProject(info: ProjectInfo, libs: ModuleID*) extends DefaultProject(info) with LiftDefaultProject {
- override def libraryDependencies = super.libraryDependencies ++ libs ++ Seq(TestScope.junit)
+ override def libraryDependencies = super.libraryDependencies ++ libs
- // TODO: Remove these and resort to LiftDefaultProject settings
- override def compileOptions = Seq("-Xwarninit", "-encoding", "utf8").map(CompileOption)
-
- // System property hack for derby.log, webapptests
+ // System properties necessary during test
override def testAction =
super.testAction dependsOn
task {
- System.setProperty("derby.stream.error.file", (outputPath / "derby.log").absString)
- System.setProperty("net.liftweb.webapptest.src.test.webapp", (testSourcePath / "webapp").absString)
+ System.setProperty("textile.relax", "true")
None
}
-
- // FIXME: breaks with SBT
- override def testOptions =
- ExcludeTests(
- // Core tests
- "net.liftweb.util.ActorPingUnit" :: "net.liftweb.util.ActorPingSpec" ::
- // Web tests
- "net.liftweb.webapptest.OneShot" :: "net.liftweb.webapptest.ToHeadUsages" :: "net.liftweb.http.SnippetSpec" ::
- // Persistence tests
- "net.liftweb.mapper.MapperSpecs" :: "net.liftweb.squerylrecord.SquerylRecordSpecs" ::
- // LDAP
- "net.liftweb.ldap.LdapSpecs" :: Nil) ::
- super.testOptions.toList
}
}
View
23 ...src/test/scala/net/lift/textile/TextileSpec.scala → .../test/scala/net/liftweb/textile/TextileSpec.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2010 WorldWide Conferencing, LLC
+ * Copyright 2008-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,17 @@
* limitations under the License.
*/
-package net.liftweb {
-package textile {
+package net.liftweb
+package textile
-import _root_.org.specs._
-import _root_.org.specs.runner._
-import _root_.org.specs.Sugar._
+import xml._
-import _root_.scala.xml._
+import org.specs.Specification
+
+import common._
+import util._
-import _root_.net.liftweb.common._
-import _root_.net.liftweb.util._
-class TextileSpecTest extends Runner(TextileSpec) with JUnit with Console
object TextileSpec extends Specification {
val shouldRelax = (java.lang.Boolean.getBoolean("textile.relax"))
@@ -38,7 +36,7 @@ object TextileSpec extends Specification {
toHtml("foo __bar__") must ==/(<p>foo <i>bar</i></p> )
}
- "multi-line div" in {
+ "deal with multi-line div" in {
val div =
"""<div class="vcard">
<div class="fn">Joe Doe</div>
@@ -507,6 +505,3 @@ We use CSS(Cascading Style Sheets).
"""
}
-
-}
-}
Please sign in to comment.
Something went wrong with that request. Please try again.