Skip to content
Browse files

lift-ldap

  • Loading branch information...
1 parent 0b20cc8 commit 47e4dbd522c00cf818489c69212f51164e2ec981 @nafg nafg committed Jul 31, 2012
Showing with 10 additions and 8 deletions.
  1. +10 −8 persistence/ldap/src/test/scala/net/liftweb/ldap/LdapSpec.scala
View
18 persistence/ldap/src/test/scala/net/liftweb/ldap/LdapSpec.scala
@@ -30,7 +30,8 @@ import org.apache.directory.server.xdbm.Index
import org.apache.directory.server.core.entry.ServerEntry
import org.apache.directory.shared.ldap.name.LdapDN
-import org.specs.Specification
+import org.specs2.mutable.Specification
+import org.specs2.specification.{ AfterExample, BeforeExample }
import common._
import util.Helpers.tryo
@@ -39,7 +40,10 @@ import util.Helpers.tryo
/**
* Systems under specification for Ldap.
*/
-object LdapSpec extends Specification("LDAP Specification") {
+object LdapSpec extends Specification with AfterExample with BeforeExample {
+ "LDAP Specification".title
+ sequential
+
val ROOT_DN = "dc=ldap,dc=liftweb,dc=net"
// Thanks to Francois Armand for pointing this utility out!
@@ -54,7 +58,7 @@ object LdapSpec extends Specification("LDAP Specification") {
* http://directory.apache.org/apacheds/1.5/41-embedding-apacheds-into-an-application.html
* http://stackoverflow.com/questions/1560230/running-apache-ds-embedded-in-my-application
*/
- doBeforeSpec {
+ def before = {
(try {
// Disable changelog
service.getChangeLog.setEnabled(false)
@@ -66,7 +70,7 @@ object LdapSpec extends Specification("LDAP Specification") {
val dir = new java.io.File(d)
dir.mkdirs
service.setWorkingDirectory(dir)
- case _ => fail("No working dir set for ApacheDS!")
+ case _ => failure("No working dir set for ApacheDS!")
}
// Set up a partition
@@ -102,12 +106,10 @@ object LdapSpec extends Specification("LDAP Specification") {
ldap.start()
- }) must not(throwAn[Exception]).orSkipExample
+ }) must not(throwAn[Exception]).orSkip
}
"LDAPVendor" should {
- shareVariables()
-
object myLdap extends LDAPVendor
myLdap.configure(Map("ldap.url" -> "ldap://localhost:%d/".format(service_port),
@@ -136,7 +138,7 @@ object LdapSpec extends Specification("LDAP Specification") {
}
- doAfterSpec {
+ def after = {
ldap.stop()
service.shutdown()

0 comments on commit 47e4dbd

Please sign in to comment.
Something went wrong with that request. Please try again.