Skip to content

Commit

Permalink
Merge branch 'scalatra_2.8-1.2'
Browse files Browse the repository at this point in the history
Conflicts:
	core/pom.xml
	core/src/test/scala/org/scalatra/ScalatraSuite.scala
	example/pom.xml
	pom.xml
	project/build.properties
	project/build/src/ScalatraProject.scala
  • Loading branch information
rossabaker committed Jul 18, 2010
2 parents 65bc2bc + 70e4e06 commit e08f005
Show file tree
Hide file tree
Showing 13 changed files with 250 additions and 577 deletions.
8 changes: 8 additions & 0 deletions README.markdown
Expand Up @@ -105,6 +105,14 @@ Quick Start
You should see "Hello world." You can poke around the example code in example/src/main/scala/TemplateExample.scala to see what's going on.


Maven Repository
================

To make usage of Scalatra as a dependency convenient, Maven hosting is now available courtesy of [Sonatype](https://docs.sonatype.com/display/NX/OSS+Repository+Hosting).

* [Releases](https://oss.sonatype.org/content/repositories/releases)
* [Snapshots](https://oss.sonatype.org/content/repositories/snapshots)

Supported Methods
=================

Expand Down
35 changes: 26 additions & 9 deletions core/pom.xml
Expand Up @@ -13,28 +13,34 @@
<name>scalatra</name>
<description>The core Scalatra library</description>
<dependencies>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-servlet-tester</artifactId>
<version>6.1.22</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5-20081211</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest</artifactId>
<version>1.2-for-scala-2.8.0.RC7-SNAPSHOT</version>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-servlet-tester</artifactId>
<version>6.1.22</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -44,4 +50,15 @@
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
5 changes: 4 additions & 1 deletion core/src/test/scala/org/scalatra/FlashMapTest.scala
Expand Up @@ -2,7 +2,10 @@ package org.scalatra

import org.scalatest.matchers.ShouldMatchers
import org.scalatest.{BeforeAndAfterEach, FunSuite}
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith

@RunWith(classOf[JUnitRunner])
class FlashMapTest extends FunSuite with ShouldMatchers with BeforeAndAfterEach {
var flash: FlashMap = _

Expand Down Expand Up @@ -82,4 +85,4 @@ class FlashMapTest extends FunSuite with ShouldMatchers with BeforeAndAfterEach
flash.now("foo") = "baz"
flash.get("foo") should equal (Some("baz"))
}
}
}
6 changes: 4 additions & 2 deletions core/src/test/scala/org/scalatra/NotEmptyTest.scala
Expand Up @@ -2,8 +2,10 @@ package org.scalatra

import org.scalatest.FunSuite
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith


@RunWith(classOf[JUnitRunner])
class NotEmptyTest extends FunSuite with ShouldMatchers {
test("extracts None from null") {
NotEmpty.unapply(null:String) should equal (None)
Expand Down Expand Up @@ -40,4 +42,4 @@ class NotEmptyTest extends FunSuite with ShouldMatchers {
test("extracts Some(nonBlankString) from Some(nonBlankString)") {
NotEmpty.unapply(Some("foo")) should equal (Some("foo"))
}
}
}
5 changes: 4 additions & 1 deletion core/src/test/scala/org/scalatra/RequestBodyTest.scala
Expand Up @@ -4,6 +4,8 @@ import org.scalatest.FunSuite
import org.scalatest.matchers.ShouldMatchers
import io.Source
import org.mortbay.jetty.testing.{ServletTester, HttpTester}
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

class RequestBodyTestServlet extends ScalatraServlet {
get("/request-body") {
Expand All @@ -15,6 +17,7 @@ class RequestBodyTestServlet extends ScalatraServlet {
}
}

@RunWith(classOf[JUnitRunner])
class RequestBodyTest extends FunSuite with ShouldMatchers {
val tester = new ServletTester
tester.addServlet(classOf[RequestBodyTestServlet], "/")
Expand Down Expand Up @@ -44,4 +47,4 @@ class RequestBodyTest extends FunSuite with ShouldMatchers {
res.parse(tester.getResponses(req.generate))
res.getContent should equal ("My cat's breath smells like fish!")
}
}
}
3 changes: 3 additions & 0 deletions core/src/test/scala/org/scalatra/ScalatraSuite.scala
Expand Up @@ -2,5 +2,8 @@ package org.scalatra

import org.scalatest.FunSuite
import test.ScalatraTests
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith

@RunWith(classOf[JUnitRunner])
class ScalatraSuite extends FunSuite with ScalatraTests
3 changes: 3 additions & 0 deletions core/src/test/scala/org/scalatra/UrlSupportTest.scala
Expand Up @@ -8,7 +8,10 @@ import org.mockito.Mockito._
import org.mockito.Matchers._
import org.mockito.stubbing.Answer
import org.mockito.invocation.InvocationOnMock
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
class UrlSupportTest extends FunSuite with ShouldMatchers {
private val urlSupport = new UrlSupport {
def contextPath = "/context"
Expand Down
36 changes: 29 additions & 7 deletions example/pom.xml
Expand Up @@ -13,6 +13,12 @@
<name>scalatra-example</name>
<description>An example Scalatra application</description>
<dependencies>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-servlet-tester</artifactId>
<version>6.1.22</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
Expand All @@ -26,9 +32,9 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest</artifactId>
<version>1.2-for-scala-2.8.0.RC7-SNAPSHOT</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -38,10 +44,10 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-servlet-tester</artifactId>
<version>6.1.22</version>
<scope>provided</scope>
<groupId>org.scalatest</groupId>
<artifactId>scalatest</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
Expand Down Expand Up @@ -74,4 +80,20 @@
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.22</version>
</plugin>
</plugins>
</build>
</project>
47 changes: 32 additions & 15 deletions fileupload/pom.xml
Expand Up @@ -13,23 +13,17 @@
<name>scalatra-fileupload</name>
<description>Supplies the optional Scalatra file upload support</description>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest</artifactId>
<version>1.2-for-scala-2.8.0.RC7-SNAPSHOT</version>
<version>1.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
<scope>compile</scope>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5-20081211</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
Expand All @@ -38,10 +32,22 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5-20081211</version>
<scope>provided</scope>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatra</groupId>
Expand All @@ -56,4 +62,15 @@
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Expand Up @@ -5,6 +5,8 @@ import org.scalatest.FunSuite
import org.mortbay.jetty.testing.{ServletTester, HttpTester}
import org.apache.commons.io.IOUtils
import org.scalatra.ScalatraServlet
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith

class FileUploadSupportTestServlet extends ScalatraServlet with FileUploadSupport {
post("/multipart") {
Expand All @@ -19,6 +21,7 @@ class FileUploadSupportTestServlet extends ScalatraServlet with FileUploadSuppor
}
}

@RunWith(classOf[JUnitRunner])
class FileUploadSupportTest extends FunSuite with ShouldMatchers {
val tester = new ServletTester

Expand Down

0 comments on commit e08f005

Please sign in to comment.