diff --git a/project/Build.scala b/project/Build.scala index e171c4a..7f3d49b 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -22,12 +22,10 @@ object MyBuild extends Build { import BuildSettings._ - val scalatest = "org.scalatest" %% "scalatest" % "1.6.1" - val junit = "junit" % "junit" % "4.8" - val junit_interface = "com.novocode" % "junit-interface" % "0.7" + val scalatest = "org.scalatest" % "scalatest_2.10" % "1.9.1" % "test" private val dependencies = Seq ( - scalatest, junit, junit_interface + scalatest ) private val test_argument = diff --git a/src/test/scala/Adler32Test.scala b/src/test/scala/Adler32Test.scala index 796296b..026ebe6 100644 --- a/src/test/scala/Adler32Test.scala +++ b/src/test/scala/Adler32Test.scala @@ -1,24 +1,24 @@ -/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* -*-mode:scala; c-basic-offset:2; indent-tabs-mode:nil -*- */ package com.jcraft.jzlib -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 -import org.junit.{Test, Before} -import org.junit.Assert._ -import org.hamcrest.CoreMatchers._ +import org.scalatest._ +import org.scalatest.matchers.ShouldMatchers + import java.util.zip.{Adler32 => juzAdler32} -@RunWith(classOf[JUnit4]) -class Adler32Test { +class Adler32Test extends FlatSpec with BeforeAndAfter with ShouldMatchers { private var adler: Adler32 = _ - @Before - def setUp = { + before { adler = new Adler32 } - @Test - def comat = { + after { + } + + behavior of "Adler32" + + it must "be compatible with java.util.zip.Adler32." in { val buf1 = randombuf(1024) val juza = new juzAdler32 val expected = { @@ -27,11 +27,10 @@ class Adler32Test { } val actual = getValue(List(buf1)); - assertThat(actual, is(expected)) + actual should equal (expected) } - @Test - def copy = { + it can "copy itself." in { val buf1 = randombuf(1024) val buf2 = randombuf(1024) @@ -47,11 +46,10 @@ class Adler32Test { val expected = adler1.getValue val actual = adler2.getValue - assertThat(actual, is(expected)) + actual should equal (expected) } - @Test - def combine = { + it can "combine adler values." in { val buf1 = randombuf(1024) val buf2 = randombuf(1024) @@ -62,7 +60,7 @@ class Adler32Test { val actual = Adler32.combine(adler1, adler2, buf2.length) - assertThat(actual, is(expected)) + actual should equal (expected) } private def getValue(buf:Seq[Array[Byte]]) = synchronized { diff --git a/src/test/scala/DeflateInflateTest.scala b/src/test/scala/DeflateInflateTest.scala index 2ff1557..3229a6e 100644 --- a/src/test/scala/DeflateInflateTest.scala +++ b/src/test/scala/DeflateInflateTest.scala @@ -1,16 +1,12 @@ -/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* -*-mode:scala; c-basic-offset:2; indent-tabs-mode:nil -*- */ package com.jcraft.jzlib -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 -import org.junit.{Test, Before} -import org.junit.Assert._ -import org.hamcrest.CoreMatchers._ +import org.scalatest._ +import org.scalatest.matchers.ShouldMatchers import JZlib._ -@RunWith(classOf[JUnit4]) -class DeflateInflateTest { +class DeflateInflateTest extends FlatSpec with BeforeAndAfter with ShouldMatchers { val comprLen = 40000 val uncomprLen = comprLen var compr:Array[Byte] = _ @@ -19,8 +15,8 @@ class DeflateInflateTest { var deflater: Deflater = _ var inflater: Inflater = _ var err: Int = _ - @Before - def setUp = { + + before { compr = new Array[Byte](comprLen) uncompr = new Array[Byte](uncomprLen) @@ -30,68 +26,71 @@ class DeflateInflateTest { err = Z_OK } - @Test - def large = { + after { + } + + behavior of "Deflter and Inflater" + + it can "deflate and infate data in the large buffer." in { val data = "hello, hello!".getBytes err = deflater.init(Z_BEST_SPEED) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) deflater.setInput(uncompr) deflater.setOutput(compr) err = deflater.deflate(Z_NO_FLUSH) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) - assertThat(deflater.avail_in, is(0)) + deflater.avail_in should equal (0) deflater.params(Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY) deflater.setInput(compr) deflater.avail_in = comprLen/2 err = deflater.deflate(Z_NO_FLUSH) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) deflater.params(Z_BEST_COMPRESSION, Z_FILTERED) deflater.setInput(uncompr) deflater.avail_in = uncomprLen err = deflater.deflate(Z_NO_FLUSH) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) err = deflater.deflate(JZlib.Z_FINISH); - assertThat(err, is(Z_STREAM_END)) + err should equal (Z_STREAM_END) err = deflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(compr) err = inflater.init - assertThat(err, is(Z_OK)) + err should equal (Z_OK) var loop = true while(loop) { inflater.setOutput(uncompr) err = inflater.inflate(Z_NO_FLUSH) if(err == Z_STREAM_END) loop = false - else assertThat(err, is(Z_OK)) + else err should equal (Z_OK) } err = inflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) val total_out = inflater.total_out.asInstanceOf[Int] - assertThat(total_out, is(2*uncomprLen + comprLen/2)) + total_out should equal (2*uncomprLen + comprLen/2) } - @Test - def small_buffers = { + it can "deflate and infate data in the small buffer." in { val data = "hello, hello!".getBytes err = deflater.init(Z_DEFAULT_COMPRESSION) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) deflater.setInput(data) deflater.setOutput(compr) @@ -101,7 +100,7 @@ class DeflateInflateTest { deflater.avail_in = 1 deflater.avail_out = 1 err = deflater.deflate(Z_NO_FLUSH) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) } do { @@ -111,13 +110,13 @@ class DeflateInflateTest { while(err != Z_STREAM_END); err = deflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(compr) inflater.setOutput(uncompr) err = inflater.init - assertThat(err, is(Z_OK)) + err should equal (Z_OK) var loop = true while(inflater.total_out loop = false case Z_NEED_DICT => - assertThat(dictID, is(inflater.getAdler)) + dictID should equal (inflater.getAdler) err = inflater.setDictionary(dictionary, dictionary.length); - assertThat(err, is(Z_OK)) + err should equal (Z_OK) case _ => - assertThat(err, is(Z_OK)) + err should equal (Z_OK) } } while(loop) err = inflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) val total_out = inflater.total_out.asInstanceOf[Int] val actual = new Array[Byte](total_out) System.arraycopy(uncompr, 0, actual, 0, total_out) - assertThat(actual, is(hello)) + actual should equal (hello) } - @Test - def sync = { + it should "support the sync." in { val hello = "hello".getBytes err = deflater.init(Z_DEFAULT_COMPRESSION) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) deflater.setInput(hello) deflater.avail_in = 3; deflater.setOutput(compr) err = deflater.deflate(Z_FULL_FLUSH) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) compr(3) = (compr(3) + 1).asInstanceOf[Byte] deflater.avail_in = hello.length - 3; err = deflater.deflate(Z_FINISH) - assertThat(err, is(Z_STREAM_END)) + err should equal (Z_STREAM_END) val comprLen= deflater.total_out.asInstanceOf[Int] err = deflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) err = inflater.init - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(compr) inflater.avail_in = 2 @@ -227,26 +224,27 @@ class DeflateInflateTest { inflater.setOutput(uncompr) err = inflater.inflate(JZlib.Z_NO_FLUSH) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.avail_in = comprLen-2 err = inflater.sync err = inflater.inflate(Z_FINISH) - assertThat(err, is(Z_DATA_ERROR)) + err should equal (Z_DATA_ERROR) err = inflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) val total_out = inflater.total_out.asInstanceOf[Int] val actual = new Array[Byte](total_out) System.arraycopy(uncompr, 0, actual, 0, total_out) - assertThat("hel"+new String(actual), is(new String(hello))) + "hel"+new String(actual) should equal (new String(hello)) } - @Test - def gzip_inflater = { + behavior of "Inflater" + + it can "inflate gzip data." in { val hello = "foo".getBytes val data = List(0x1f, 0x8b, 0x08, 0x18, 0x08, 0xeb, 0x7a, 0x0b, 0x00, 0x0b, 0x58, 0x00, 0x59, 0x00, 0x4b, 0xcb, 0xcf, 0x07, 0x00, 0x21, @@ -255,7 +253,7 @@ class DeflateInflateTest { toArray err = inflater.init(15 + 32) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(data) inflater.setOutput(uncompr) @@ -268,25 +266,26 @@ class DeflateInflateTest { loop) { err = inflater.inflate(Z_NO_FLUSH) if(err == Z_STREAM_END) loop = false - else assertThat(err, is(Z_OK)) + else err should equal (Z_OK) } err = inflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) val total_out = inflater.total_out.asInstanceOf[Int] val actual = new Array[Byte](total_out) System.arraycopy(uncompr, 0, actual, 0, total_out) - assertThat(actual, is(hello)) + actual should equal (hello) } - @Test - def gzip_deflate_inflate = { + behavior of "Inflater and Deflater" + + it can "support gzip data." in { val data = "hello, hello!".getBytes err = deflater.init(Z_DEFAULT_COMPRESSION, 15+16) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) deflater.setInput(data) deflater.setOutput(compr) @@ -296,7 +295,7 @@ class DeflateInflateTest { deflater.avail_in = 1 deflater.avail_out = 1 err = deflater.deflate(Z_NO_FLUSH) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) } do { @@ -306,13 +305,13 @@ class DeflateInflateTest { while(err != Z_STREAM_END); err = deflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(compr) inflater.setOutput(uncompr) err = inflater.init(15 + 32) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) var loop = true while(inflater.total_out BAOS, ByteArrayInputStream => BAIS} import JZlib._ -@RunWith(classOf[JUnit4]) -class DeflaterInflaterStreamTest { +class DeflaterInflaterStreamTest extends FlatSpec with BeforeAndAfter with ShouldMatchers { - @Before - def setUp = { + before { } - @Test - def one_by_one = { + after { + } + + behavior of "Deflter and Inflater" + + it can "deflate and infate data one by one." in { val data1 = randombuf(1024) implicit val buf = new Array[Byte](1) @@ -32,12 +31,13 @@ class DeflaterInflaterStreamTest { new InflaterInputStream(new BAIS(baos.toByteArray)) -> baos2 val data2 = baos2.toByteArray - assertThat(data2.length, is(data1.length)) - assertThat(data2, is(data1)) + data2.length should equal (data1.length) + data2 should equal (data1) } - @Test - def read_write_with_buf = { + behavior of "DeflterOutputStream and InflaterInputStream" + + it can "deflate and infate." in { (1 to 100 by 3).foreach { i => @@ -54,13 +54,14 @@ class DeflaterInflaterStreamTest { new InflaterInputStream(new BAIS(baos.toByteArray)) -> baos2 val data2 = baos2.toByteArray - assertThat(data2.length, is(data1.length)) - assertThat(data2, is(data1)) + data2.length should equal (data1.length) + data2 should equal (data1) } } - @Test - def read_write_with_buf_nowrap = { + behavior of "Deflter and Inflater" + + it can "deflate and infate nowrap data." in { (1 to 100 by 3).foreach { i => @@ -81,13 +82,12 @@ class DeflaterInflaterStreamTest { new InflaterInputStream(new BAIS(baos.toByteArray), inflater) -> baos2 val data2 = baos2.toByteArray - assertThat(data2.length, is(data1.length)) - assertThat(data2, is(data1)) + data2.length should equal (data1.length) + data2 should equal (data1) } } - @Test - def read_write_with_nowrap = { + it can "deflate and infate nowrap data with MAX_WBITS." in { implicit val buf = new Array[Byte](100) List(randombuf(10240), @@ -108,8 +108,8 @@ class DeflaterInflaterStreamTest { new InflaterInputStream(new BAIS(baos.toByteArray), inflater) -> baos2 val data2 = baos2.toByteArray - assertThat(data2.length, is(data1.length)) - assertThat(data2, is(data1)) + data2.length should equal (data1.length) + data2 should equal (data1) } } } diff --git a/src/test/scala/GZIPIOStreamTest.scala b/src/test/scala/GZIPIOStreamTest.scala index 59d1d5a..3cd97b8 100644 --- a/src/test/scala/GZIPIOStreamTest.scala +++ b/src/test/scala/GZIPIOStreamTest.scala @@ -1,25 +1,24 @@ -/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* -*-mode:scala; c-basic-offset:2; indent-tabs-mode:nil -*- */ package com.jcraft.jzlib -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 -import org.junit.{Test, Before} -import org.junit.Assert._ -import org.hamcrest.CoreMatchers._ +import org.scalatest._ +import org.scalatest.matchers.ShouldMatchers import java.io._ import JZlib._ -@RunWith(classOf[JUnit4]) -class GZIPIOStreamTest { +class GZIPIOStreamTest extends FlatSpec with BeforeAndAfter with ShouldMatchers { - @Before - def setUp = { + before { } - @Test - def outstream = { + after { + } + + behavior of "GZipOutputStream and GZipInputStream" + + it can "deflate and infate data." in { val comment = "hi" val name = "/tmp/foo" @@ -41,17 +40,17 @@ class GZIPIOStreamTest { val buf = new Array[Byte](1024) val i = gis.read(buf) - assertThat(content.length, is(i)) + content.length should equal(i) (0 until i) foreach { i => - assertThat(content(i).asInstanceOf[Byte], is(buf(i).asInstanceOf[Byte])) + content(i).asInstanceOf[Byte] should equal(buf(i).asInstanceOf[Byte]) } - assertThat(comment, is(gis.getComment)) - assertThat(name, is(gis.getName)) + comment should equal(gis.getComment) + name should equal(gis.getName) val crc32 = new CRC32 crc32.update(content, 0, content.length) - assertThat(crc32.getValue, is(gis.getCRC.asInstanceOf[Long])) + crc32.getValue should equal(gis.getCRC.asInstanceOf[Long]) } } diff --git a/src/test/scala/WrapperTypeTest.scala b/src/test/scala/WrapperTypeTest.scala index a2458ac..949df3a 100644 --- a/src/test/scala/WrapperTypeTest.scala +++ b/src/test/scala/WrapperTypeTest.scala @@ -1,17 +1,14 @@ -/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* -*-mode:scala; c-basic-offset:2; indent-tabs-mode:nil -*- */ package com.jcraft.jzlib -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 -import org.junit.{Test, Before} -import org.junit.Assert._ -import org.hamcrest.CoreMatchers._ +import org.scalatest._ +import org.scalatest.matchers.ShouldMatchers + import java.io.{ByteArrayOutputStream => BAOS, ByteArrayInputStream => BAIS} import JZlib._ -@RunWith(classOf[JUnit4]) -class WrapperTypeTest { +class WrapperTypeTest extends FlatSpec with BeforeAndAfter with ShouldMatchers { val data = "hello, hello!".getBytes val comprLen = 40000 @@ -25,16 +22,19 @@ class WrapperTypeTest { (W_GZIP, (List(W_GZIP, W_ANY), List(W_ZLIB, W_NONE))), (W_NONE, (List(W_NONE, W_ANY), List(W_ZLIB, W_GZIP)))) - @Before - def setUp = { + before { compr = new Array[Byte](comprLen) uncompr = new Array[Byte](uncomprLen) err = Z_OK } - @Test - def DeflterInflaterStream = { + after { + } + + behavior of "Deflater" + + it can "detect data type of input." in { implicit val buf = compr cases foreach { case (iflag, (good, bad)) => @@ -51,11 +51,11 @@ class WrapperTypeTest { val inflater = new Inflater(w) new InflaterInputStream(new BAIS(deflated), inflater) -> baos2 val data1 = baos2.toByteArray - assertThat(data1.length, is(data.length)) - assertThat(data1, is(data)) + data1.length should equal (data.length) + data1 should equal (data) import inflater._ (avail_in, avail_out, total_in, total_out) - } reduceLeft { (x, y) => assertThat(x, is(y)); x } + } reduceLeft { (x, y) => x should equal (y); x } bad foreach { w => val baos2 = new BAOS @@ -71,20 +71,21 @@ class WrapperTypeTest { } } - @Test - def ZStream = { + behavior of "ZStream" + + it can "detect data type of input." in { cases foreach { case (iflag, (good, bad)) => val deflater = new ZStream err = deflater.deflateInit(Z_BEST_SPEED, DEF_WBITS, 9, iflag) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) deflate(deflater, data, compr) good foreach { w => val inflater = inflate(compr, uncompr, w) val total_out = inflater.total_out.asInstanceOf[Int] - assertThat(new String(uncompr, 0, total_out), is(new String(data))) + new String(uncompr, 0, total_out) should equal (new String(data)) } bad foreach { w => @@ -93,18 +94,19 @@ class WrapperTypeTest { } } - @Test - def wbits_plus_32 = { + behavior of "Deflater" + + it should "support wbits+32." in { var deflater = new Deflater err = deflater.init(Z_BEST_SPEED, DEF_WBITS, 9) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) deflate(deflater, data, compr) var inflater = new Inflater err = inflater.init(DEF_WBITS + 32) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(compr) @@ -113,23 +115,23 @@ class WrapperTypeTest { inflater.setOutput(uncompr) err = inflater.inflate(Z_NO_FLUSH) if(err == Z_STREAM_END) loop = false - else assertThat(err, is(Z_OK)) + else err should equal (Z_OK) } err = inflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) var total_out = inflater.total_out.asInstanceOf[Int] - assertThat(new String(uncompr, 0, total_out), is(new String(data))) + new String(uncompr, 0, total_out) should equal (new String(data)) deflater = new Deflater err = deflater.init(Z_BEST_SPEED, DEF_WBITS + 16, 9) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) deflate(deflater, data, compr) inflater = new Inflater err = inflater.init(DEF_WBITS + 32) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(compr) @@ -138,13 +140,13 @@ class WrapperTypeTest { inflater.setOutput(uncompr) err = inflater.inflate(Z_NO_FLUSH) if(err == Z_STREAM_END) loop = false - else assertThat(err, is(Z_OK)) + else err should equal (Z_OK) } err = inflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) total_out = inflater.total_out.asInstanceOf[Int] - assertThat(new String(uncompr, 0, total_out), is(new String(data))) + new String(uncompr, 0, total_out) should equal (new String(data)) } private def deflate(deflater: ZStream, @@ -153,10 +155,10 @@ class WrapperTypeTest { deflater.setOutput(compr) err = deflater.deflate(JZlib.Z_FINISH) - assertThat(err, is(Z_STREAM_END)) + err should equal (Z_STREAM_END) err = deflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) } private def inflate(compr: Array[Byte], @@ -164,7 +166,7 @@ class WrapperTypeTest { w: WrapperType) = { val inflater = new ZStream err = inflater.inflateInit(w) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(compr) @@ -173,10 +175,10 @@ class WrapperTypeTest { inflater.setOutput(uncompr) err = inflater.inflate(Z_NO_FLUSH) if(err == Z_STREAM_END) loop = false - else assertThat(err, is(Z_OK)) + else err should equal (Z_OK) } err = inflater.end - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater } @@ -187,7 +189,7 @@ class WrapperTypeTest { val inflater = new ZStream err = inflater.inflateInit(w) - assertThat(err, is(Z_OK)) + err should equal (Z_OK) inflater.setInput(compr) @@ -197,7 +199,7 @@ class WrapperTypeTest { err = inflater.inflate(Z_NO_FLUSH) if(err == Z_STREAM_END) loop = false else { - assertThat(err, is(Z_DATA_ERROR)) + err should equal (Z_DATA_ERROR) loop = false } } diff --git a/src/test/scala/ZIOStreamTest.scala b/src/test/scala/ZIOStreamTest.scala index bfe17f8..183c3f5 100644 --- a/src/test/scala/ZIOStreamTest.scala +++ b/src/test/scala/ZIOStreamTest.scala @@ -1,11 +1,8 @@ -/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* -*-mode:scala; c-basic-offset:2; indent-tabs-mode:nil -*- */ package com.jcraft.jzlib -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 -import org.junit.{Test, Before} -import org.junit.Assert._ -import org.hamcrest.CoreMatchers._ +import org.scalatest._ +import org.scalatest.matchers.ShouldMatchers import java.io.{ByteArrayOutputStream => BAOS, ByteArrayInputStream => BAIS} import java.io.{ObjectOutputStream => OOS, ObjectInputStream => OIS} @@ -13,15 +10,17 @@ import java.io._ import JZlib._ -@RunWith(classOf[JUnit4]) -class ZIOStreamTest { +class ZIOStreamTest extends FlatSpec with BeforeAndAfter with ShouldMatchers { - @Before - def setUp = { + before { } - @Test - def deflate_inflate = { + after { + } + + behavior of "ZOutputStream and ZInputStream" + + it can "deflate and inflate data." in { val hello = "Hello World!" val out = new BAOS() @@ -34,11 +33,12 @@ class ZIOStreamTest { val zIn = new ZInputStream(in) val objIn = new OIS(zIn) - assertThat(objIn.readObject.toString, is(hello)) + objIn.readObject.toString should equal (hello) } - @Test - def nowrap = { + behavior of "ZOutputStream and ZInputStream" + + it can "support nowrap data." in { implicit val buf = new Array[Byte](100) @@ -54,7 +54,7 @@ class ZIOStreamTest { zis -> baos2 val data2 = baos2.toByteArray - assertThat(data2.length, is(hello.length)) - assertThat(data2, is(hello)) + data2.length should equal (hello.length) + data2 should equal (hello) } } diff --git a/src/test/scala/package.scala b/src/test/scala/package.scala index 72c7add..35d1e5e 100644 --- a/src/test/scala/package.scala +++ b/src/test/scala/package.scala @@ -1,4 +1,4 @@ -/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* -*-mode:scala; c-basic-offset:2; indent-tabs-mode:nil -*- */ package com.jcraft import java.io._