Skip to content

Commit

Permalink
minor fixes for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Eichar committed Sep 21, 2012
1 parent 11cf945 commit ba75a8c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
5 changes: 3 additions & 2 deletions core/src/main/scala/c2c/webspecs/ExecutionContext.scala
Expand Up @@ -19,7 +19,7 @@ object ExecutionContext {
def apply[R](context:ExecutionContext)(f : ExecutionContext => R):R = {
try {f(context)}
finally {
context.httpClient.getConnectionManager.shutdown
context.close
}
}
def withDefault[R] (f : ExecutionContext => R):R =
Expand All @@ -36,7 +36,8 @@ trait ExecutionContext {
def createHttpContext:() => HttpContext
val conn: ClientConnectionManager = httpClient.getConnectionManager
var modifications:List[RequestModification] = Nil
def close() = httpClient.getConnectionManager.shutdown
def close() =
httpClient.getConnectionManager.shutdown
def execute(request:HttpRequestBase) = request match {
case r:LoginRequest if currentUser.exists {_._1.user == r.user} =>
Log.apply(Log.Connection, "Skipping login request since user is already logged in")
Expand Down
Expand Up @@ -10,8 +10,8 @@ import org.junit.runner.RunWith
import org.specs2.runner.JUnitRunner

@RunWith(classOf[JUnitRunner])
class ImportCheMetadataSpec extends GeocatSpecification { def is =

class ImportCheMetadataSpec extends GeocatSpecification { def is =
"This specification tests using the iso19139.CHE schema" ^ Step(setup) ^
"Inserting a CHE metadata" ^ Step(importAndGetMetadata) ^
"Should suceed with a 200 response" ! {importAndGetMetadata must haveA200ResponseCode} ^
Expand Down
Expand Up @@ -16,7 +16,7 @@ import c2c.webspecs.geonetwork.GetRawMetadataXml
@RunWith(classOf[JUnitRunner])
class GM03V1Spec extends GeocatSpecification(UserProfiles.Editor) {
def is = {
"GM03v1 Import / Export test".title ^ Step(setup) ^
"GM03v1 Import - Export test".title ^ Step(setup) ^
"Imports a GM03 v1 metadata and converts it into iso19139.che for storage into the catalogue" ^ Step(importMetadataId) ^
"Gets the previously inserted MD as GM03v2" ! getAsGm03v2 ^
"Gets the previously inserted MD as GM03v2small" ! getAsGm03v2small ^
Expand Down
Expand Up @@ -15,7 +15,7 @@ import c2c.webspecs.GetRequest
@RunWith(classOf[JUnitRunner])
class GM03V2Spec extends GeocatSpecification(UserProfiles.Editor) {
def is = {
"GM03v2 Import / Export test".title ^ Step(setup) ^
"GM03v2 Import - Export test".title ^ Step(setup) ^
"Imports a GM03 v2 metadata and converts it into iso19139.che for storage into the catalogue" ^ Step(importMetadataId) ^
"Gets the previously inserted MD as GM03v2" ! getAsGm03v2 ^
"Gets the previously inserted MD as GM03v2Small" ! getAsGm03v2small ^
Expand Down
Expand Up @@ -15,7 +15,7 @@ import c2c.webspecs.geonetwork.UserProfiles
*/
@RunWith(classOf[JUnitRunner])
class MonitoringSpec extends GeocatSpecification(UserProfiles.Admin) { def is =
"Xsl custom metadata XML output".title ^ Step(setup) ^
"Monioring Specification".title ^ Step(setup) ^
"Add some metadata so that healthchecks will work" ^ Step(importMd) ^
"Get the results of the ${metrics} webservice" ! checkMonitorReport ^
"Get the results of the ${healthcheck} webservice" ! checkMonitorReport ^
Expand Down
Expand Up @@ -70,7 +70,7 @@ class WP1 extends Specification with SpecificationsFinder { def is =
classOf[ImportValidationSpec]
).flatMap{s => createSpecification(s.getName)(Arguments())}
specs.
foldLeft(t.title) { (res, cur) => res ^ link(cur) }
foldLeft(t.title ^ sequential) { (res, cur) => res ^ link(cur) }
}

}
Expand All @@ -84,7 +84,7 @@ class WP2 extends Specification with SpecificationsFinder { def is =
classOf[CompareGeocat1Metadata]
).flatMap{s => createSpecification(s.getName)(Arguments())}
specs.
foldLeft(t.title) { (res, cur) => res ^ link(cur) }
foldLeft(t.title ^ sequential) { (res, cur) => res ^ link(cur) }
}

}
Expand Down Expand Up @@ -217,7 +217,7 @@ class WP10 extends Specification with SpecificationsFinder { def is =
@RunWith(classOf[JUnitRunner])
class WP11_12 extends Specification with SpecificationsFinder { def is =

examplesLinks("WP 11/12: GM03 Import and Export")
examplesLinks("WP 11,12: GM03 Import and Export")

def examplesLinks(t: String) = {
val specs = List(
Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Expand Up @@ -47,7 +47,7 @@ object WebSpecsBuild extends Build
// ------------------------------ Core Project ------------------------------ //

val coreDependencies = Seq(
"org.specs2" %% "specs2" % "1.12",
"org.specs2" %% "specs2" % "1.12.1",
"org.ccil.cowan.tagsoup" % "tagsoup" % "1.2",
"org.apache.httpcomponents" % "httpclient" % "4.1.2",
"org.apache.httpcomponents" % "httpmime" % "4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion sbt
@@ -1,5 +1,5 @@
#!/bin/sh
SBT_OPTS="$SBT_OPTS -Dfile.encoding=UTF8 -Xmx1536M -Xss10M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m"
#SBT_OPTS="$SBT_OPTS -Dadmin.user=admin -Dadmin.pass=Hup9ieBe -Dwebspecs.config=/Users/jeichar/ScalaProject/webspecs/geonetwork/geocat/src/test/resources/geocat/jesse_geocat_config.properties"
SBT_OPTS="$SBT_OPTS -Dadmin.user=admin -Dadmin.pass=admin -Dtest.server=localhost:9624"
SBT_OPTS="$SBT_OPTS -Dadmin.user=admin -Dadmin.pass=admin -Dtest.server=localhost:8190"
exec java ${SBT_OPTS} -jar ./sbt-launch.jar "$@"

0 comments on commit ba75a8c

Please sign in to comment.