Skip to content

Commit

Permalink
Remove file upload edits
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Jan 15, 2013
1 parent ed93184 commit 7fd4f50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 44 deletions.
Expand Up @@ -112,15 +112,9 @@ class FileUploadSupportMaxSizeTestServlet extends ScalatraServlet with FileUploa
}

class FileUploadSupportSpec extends MutableScalatraSpec {
private def addMultipartServlet(servlet: HttpServlet, mapping: String, maxSize: Long) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=395000
val holder = new ServletHolder(servlet)
holder.getRegistration.setMultipartConfig(new MultipartConfigElement("", maxSize, -1, 1024*1024*1024))
servletContextHandler.addServlet(holder, mapping)
}

addMultipartServlet(new FileUploadSupportSpecServlet, "/*", 4096L)
addMultipartServlet(new FileUploadSupportMaxSizeTestServlet, "/max-size/*", 1024L)
mount(new FileUploadSupportSpecServlet, "/*")
mount(new FileUploadSupportMaxSizeTestServlet, "/max-size/*")

def postExample[A](f: => A): A = {
val params = Map("param1" -> "one", "param2" -> "two")
Expand Down
Expand Up @@ -54,13 +54,7 @@ class FileUploadTestHelpersTestServlet extends ScalatraServlet with FileUploadSu
}

class FileUploadTestHelpersTest extends ScalatraFunSuite {
private def addMultipartServlet(servlet: HttpServlet, mapping: String, maxSize: Long = 0L) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=395000
val holder = new ServletHolder(servlet)
holder.getRegistration.setMultipartConfig(new MultipartConfigElement("", maxSize, -1, 1024*1024*1024))
servletContextHandler.addServlet(holder, mapping)
}
addMultipartServlet(new FileUploadTestHelpersTestServlet, "/*")
mount(new FileUploadTestHelpersTestServlet, "/*")

val files = Map(
"textFile" -> new File("core/src/test/resources/org/scalatra/servlet/lorem_ipsum.txt"),
Expand Down
31 changes: 2 additions & 29 deletions project/build.scala
Expand Up @@ -24,7 +24,7 @@ object ScalatraBuild extends Build {
resolvers ++= Seq(sonatypeNexusSnapshots),
(LsKeys.tags in LsKeys.lsync) := Seq("web", "sinatra"),
(LsKeys.docsUrl in LsKeys.lsync) := Some(new URL("http://www.scalatra.org/%s/book/" format majorVersion))
) ++ mavenCentralFrouFrou ++ jettyOrbitHack
) ++ mavenCentralFrouFrou

lazy val scalatraProject = Project(
id = "scalatra-project",
Expand Down Expand Up @@ -263,7 +263,6 @@ object ScalatraBuild extends Build {
// Sort by artifact ID.
lazy val akkaActor: MM = sv => "com.typesafe.akka" % "akka-actor" % akkaVersion(sv)
lazy val akkaTestkit: MM = sv => "com.typesafe.akka" % "akka-testkit" % akkaVersion(sv)
lazy val antiXml: MM = sv => antiXmlGroup(sv) %% "anti-xml" % antiXmlVersion(sv)
lazy val atmosphereRuntime = "org.atmosphere" % "atmosphere-runtime" % "1.0.8"
lazy val base64 = "net.iharder" % "base64" % "2.3.8"
lazy val commonsFileupload = "commons-fileupload" % "commons-fileupload" % "1.2.2"
Expand Down Expand Up @@ -304,27 +303,12 @@ object ScalatraBuild extends Build {

type MM = String => ModuleID

// Now entering Cross Build Hell

private val akkaVersion: String => String = {
case "2.9.1" => "2.0.2"
case "2.9.2" => "2.0.5"
case _ => "2.1.0"
}

private val antiXmlGroup: String => String = {
case sv if sv startsWith "2.8." => "com.codecommit"
case "2.9.0-1" => "com.codecommit"
case "2.9.1" => "com.codecommit"
case _ => "no.arktekk"
}
private val antiXmlVersion: String => String = {
case sv if sv startsWith "2.8." => "0.2"
case "2.9.0-1" => "0.3"
case "2.9.1" => "0.3"
case _ => "0.5.1"
}

private val grizzledSlf4jVersion: String => String = {
case sv if sv startsWith "2.9." => "0.6.10"
case _ => "1.0.1"
Expand Down Expand Up @@ -493,16 +477,5 @@ object ScalatraBuild extends Build {

lazy val doNotPublish = Seq(publish := {}, publishLocal := {})

// http://jira.codehaus.org/browse/JETTY-1493
// https://issues.apache.org/jira/browse/IVY-899
//
// This prevents Ivy from attempting to resolve these dependencies,
// but does not put the exclusions in the pom. For that, every
// module that depends on this atrocity needs an explicit exclude
// statement.
lazy val jettyOrbitHack = Seq(
ivyXML := <dependencies>
<exclude org="org.eclipse.jetty.orbit" />
</dependencies>
)

}

0 comments on commit 7fd4f50

Please sign in to comment.