From 43d7c3a32ee966f1f7301c23e0d77c0e99147622 Mon Sep 17 00:00:00 2001 From: lintool Date: Thu, 26 Apr 2018 10:45:32 -0400 Subject: [PATCH] Code refformatting. --- .../scala/io/archivesunleashed/ArcTest.scala | 5 +- .../archivesunleashed/ArchiveRecordTest.scala | 2 +- .../archivesunleashed/CountableRDDTest.scala | 4 +- .../archivesunleashed/RecordLoaderTest.scala | 92 +++++++++---------- .../io/archivesunleashed/RecordRDDTest.scala | 9 +- .../scala/io/archivesunleashed/WarcTest.scala | 1 + .../matchbox/ComputeImageSizeTest.scala | 8 +- .../matchbox/ExtractAtMentionsTest.scala | 1 + .../matchbox/ExtractBoilerPipeTextTest.scala | 38 ++++---- .../matchbox/ExtractDateTest.scala | 13 +-- .../matchbox/ExtractDomainTest.scala | 3 +- .../matchbox/ExtractHashtagsTest.scala | 3 +- .../matchbox/ExtractImageLinksTest.scala | 8 +- .../matchbox/ExtractLinksTest.scala | 6 +- .../matchbox/ExtractTextFromPDFsTest.scala | 26 +++--- .../matchbox/ExtractUrlsTest.scala | 4 +- .../matchbox/RemoveHTMLTest.scala | 10 +- .../matchbox/RemoveHttpHeaderTest.scala | 1 + .../matchbox/StringUtilsTest.scala | 2 + .../matchbox/TupleFormatterTest.scala | 1 + .../util/JsonUtilsTest.scala | 41 ++++----- .../util/TweetUtilsTest.scala | 1 + 22 files changed, 150 insertions(+), 129 deletions(-) diff --git a/src/test/scala/io/archivesunleashed/ArcTest.scala b/src/test/scala/io/archivesunleashed/ArcTest.scala index b36a4cee..f8c82b35 100644 --- a/src/test/scala/io/archivesunleashed/ArcTest.scala +++ b/src/test/scala/io/archivesunleashed/ArcTest.scala @@ -14,15 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed import com.google.common.io.Resources +import io.archivesunleashed.matchbox.ExtractDate.DateComponent +import io.archivesunleashed.matchbox._ import org.apache.spark.{SparkConf, SparkContext} import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest.{BeforeAndAfter, FunSuite} -import matchbox.ExtractDate.DateComponent -import matchbox._ @RunWith(classOf[JUnitRunner]) class ArcTest extends FunSuite with BeforeAndAfter { diff --git a/src/test/scala/io/archivesunleashed/ArchiveRecordTest.scala b/src/test/scala/io/archivesunleashed/ArchiveRecordTest.scala index 1d86a562..a405b8a1 100644 --- a/src/test/scala/io/archivesunleashed/ArchiveRecordTest.scala +++ b/src/test/scala/io/archivesunleashed/ArchiveRecordTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed import com.google.common.io.Resources @@ -22,7 +23,6 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest.{BeforeAndAfter, FunSuite} - @RunWith(classOf[JUnitRunner]) class ArchiveRecordTest extends FunSuite with BeforeAndAfter { private val arcPath = Resources.getResource("arc/example.arc.gz").getPath diff --git a/src/test/scala/io/archivesunleashed/CountableRDDTest.scala b/src/test/scala/io/archivesunleashed/CountableRDDTest.scala index d39f76cb..2097e4cf 100644 --- a/src/test/scala/io/archivesunleashed/CountableRDDTest.scala +++ b/src/test/scala/io/archivesunleashed/CountableRDDTest.scala @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.archivesunleashed -import matchbox._ +package io.archivesunleashed import com.google.common.io.Resources +import io.archivesunleashed.matchbox._ import org.apache.spark.{SparkConf, SparkContext} import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner diff --git a/src/test/scala/io/archivesunleashed/RecordLoaderTest.scala b/src/test/scala/io/archivesunleashed/RecordLoaderTest.scala index 503fb365..48fa255c 100644 --- a/src/test/scala/io/archivesunleashed/RecordLoaderTest.scala +++ b/src/test/scala/io/archivesunleashed/RecordLoaderTest.scala @@ -15,57 +15,55 @@ * limitations under the License. */ - package io.archivesunleashed +package io.archivesunleashed - import com.google.common.io.Resources - import org.apache.spark.{SparkConf, SparkContext} - import org.junit.runner.RunWith - import org.scalatest.junit.JUnitRunner - import org.scalatest.{BeforeAndAfter, FunSuite} - import java.nio.file.{Files, Paths} +import com.google.common.io.Resources +import io.archivesunleashed.util.TweetUtils._ +import org.apache.spark.{SparkConf, SparkContext} +import org.junit.runner.RunWith +import org.scalatest.junit.JUnitRunner +import org.scalatest.{BeforeAndAfter, FunSuite} - import io.archivesunleashed.util.TweetUtils._ +@RunWith(classOf[JUnitRunner]) +class RecordLoaderTest extends FunSuite with BeforeAndAfter { + private val warcPath = Resources.getResource("warc/example.warc.gz").getPath + private val tweetPath = Resources.getResource("arc/tweetsTest.json").getPath + private val delTweetPath = Resources.getResource("arc/delTweetsTest.json").getPath + private val master = "local[4]" + private val appName = "example-spark" + private var sc: SparkContext = _ - @RunWith(classOf[JUnitRunner]) - class RecordLoaderTest extends FunSuite with BeforeAndAfter { - private val warcPath = Resources.getResource("warc/example.warc.gz").getPath - private val tweetPath = Resources.getResource("arc/tweetsTest.json").getPath - private val delTweetPath = Resources.getResource("arc/delTweetsTest.json").getPath - private val master = "local[4]" - private val appName = "example-spark" - private var sc: SparkContext = _ + before { + val conf = new SparkConf() + .setMaster(master) + .setAppName(appName) + sc = new SparkContext(conf) + } - before { - val conf = new SparkConf() - .setMaster(master) - .setAppName(appName) - sc = new SparkContext(conf) - } + test("loads Warc") { + val base = RecordLoader.loadArchives(warcPath, sc) + .keepValidPages() + .map(x => x.getUrl) + .take(1) + assert(base(0) == "http://www.archive.org/") + } - test("loads Warc") { - val base = RecordLoader.loadArchives(warcPath, sc) - .keepValidPages() - .map(x => x.getUrl) - .take(1) - assert (base(0) == "http://www.archive.org/") - } + test("loads Tweets") { + val base = RecordLoader.loadTweets(tweetPath, sc) + .map(x => x.text()) + .collect() + assert(base(0) == "some text") + assert(base(1) == "some more text") + } - test("loads Tweets") { - val base = RecordLoader.loadTweets(tweetPath, sc) - .map(x => x.text()) - .collect() - assert (base(0) == "some text") - assert (base(1) == "some more text") - } + test("does not load deleted") { + val base = RecordLoader.loadTweets(delTweetPath, sc).collect() + assert(base.deep == Array().deep) + } - test("does not load deleted") { - val base = RecordLoader.loadTweets(delTweetPath, sc).collect() - assert (base.deep == Array().deep) - } - - after { - if (sc != null) { - sc.stop() - } - } - } + after { + if (sc != null) { + sc.stop() + } + } +} diff --git a/src/test/scala/io/archivesunleashed/RecordRDDTest.scala b/src/test/scala/io/archivesunleashed/RecordRDDTest.scala index c6e03092..28802e8c 100644 --- a/src/test/scala/io/archivesunleashed/RecordRDDTest.scala +++ b/src/test/scala/io/archivesunleashed/RecordRDDTest.scala @@ -14,18 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.archivesunleashed -import matchbox._ -import matchbox.ExtractDate.DateComponent -import matchbox.ExtractDate.DateComponent.DateComponent +package io.archivesunleashed import com.google.common.io.Resources +import io.archivesunleashed.matchbox.ExtractDate.DateComponent +import io.archivesunleashed.matchbox._ import org.apache.spark.{SparkConf, SparkContext} import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest.{BeforeAndAfter, FunSuite} -import scala.util.matching.Regex @RunWith(classOf[JUnitRunner]) class RecordRDDTest extends FunSuite with BeforeAndAfter { @@ -35,7 +33,6 @@ class RecordRDDTest extends FunSuite with BeforeAndAfter { private val appName = "example-spark" private var sc: SparkContext = _ - before { val conf = new SparkConf() .setMaster(master) diff --git a/src/test/scala/io/archivesunleashed/WarcTest.scala b/src/test/scala/io/archivesunleashed/WarcTest.scala index 330f4ef3..acef2849 100644 --- a/src/test/scala/io/archivesunleashed/WarcTest.scala +++ b/src/test/scala/io/archivesunleashed/WarcTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed import com.google.common.io.Resources diff --git a/src/test/scala/io/archivesunleashed/matchbox/ComputeImageSizeTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ComputeImageSizeTest.scala index 503fda31..72646f78 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ComputeImageSizeTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ComputeImageSizeTest.scala @@ -14,14 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox +import java.awt.image.BufferedImage +import java.io.ByteArrayOutputStream +import javax.imageio.ImageIO + import org.junit.runner.RunWith import org.scalatest.FunSuite import org.scalatest.junit.JUnitRunner -import java.io.ByteArrayOutputStream -import java.awt.image.BufferedImage -import javax.imageio.ImageIO @RunWith(classOf[JUnitRunner]) class ComputeImageSizeTest extends FunSuite { diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractAtMentionsTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractAtMentionsTest.scala index 6b665831..73fb6572 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractAtMentionsTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractAtMentionsTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox import org.junit.runner.RunWith diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractBoilerPipeTextTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractBoilerPipeTextTest.scala index 2a495c1c..d0f170e9 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractBoilerPipeTextTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractBoilerPipeTextTest.scala @@ -15,23 +15,27 @@ * limitations under the License. */ - package io.archivesunleashed.matchbox +package io.archivesunleashed.matchbox - import org.junit.runner.RunWith - import org.scalatest.FunSuite - import org.scalatest.junit.JUnitRunner - import java.io.IOException +import java.io.IOException - @RunWith(classOf[JUnitRunner]) - class ExtractBoilerpipeTextTest extends FunSuite { - var text = """

Text with a boiler plate.

+import org.junit.runner.RunWith +import org.scalatest.FunSuite +import org.scalatest.junit.JUnitRunner + +@RunWith(classOf[JUnitRunner]) +class ExtractBoilerPipeTextTest extends FunSuite { + var text = """

Text with a boiler plate.

""" - var boiler = """Copyright 2017""" - test ("Collects boilerpip") { - assert (ExtractBoilerpipeText (text) == boiler) - assert (ExtractBoilerpipeText ("") == Nil) - assert (ExtractBoilerpipeText ("All Rights Reserved.") == Nil) - val caught = intercept[IOException] {ExtractBoilerpipeText (null)} - assert (caught.getMessage == "Caught exception processing input row java.lang.NullPointerException") - } - } + var boiler = """Copyright 2017""" + + test("Collects boilerpip") { + assert(ExtractBoilerpipeText(text) == boiler) + assert(ExtractBoilerpipeText("") == Nil) + assert(ExtractBoilerpipeText("All Rights Reserved.") == Nil) + val caught = intercept[IOException] { + ExtractBoilerpipeText(null) + } + assert(caught.getMessage == "Caught exception processing input row java.lang.NullPointerException") + } +} diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractDateTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractDateTest.scala index 8bf2325e..3576c81f 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractDateTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractDateTest.scala @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox +import io.archivesunleashed.matchbox.ExtractDate.DateComponent._ import org.junit.runner.RunWith import org.scalatest.FunSuite import org.scalatest.junit.JUnitRunner -import io.archivesunleashed.matchbox.ExtractDate.DateComponent._ @RunWith(classOf[JUnitRunner]) class ExtractDateTest extends FunSuite { @@ -34,10 +35,10 @@ class ExtractDateTest extends FunSuite { } test("more perfect") { - assert(ExtractDate("20151204", YYYY) == "20151204".substring(0,4)) - assert(ExtractDate("20151204", MM) == "20151204".substring(4,6)) - assert(ExtractDate("20151204", DD) == "20151204".substring(6,8)) - assert(ExtractDate("20151204", YYYYMM) == "20151204".substring(0,6)) - assert(ExtractDate("20151204", YYYYMMDD) == "20151204".substring(0,8)) + assert(ExtractDate("20151204", YYYY) == "20151204".substring(0, 4)) + assert(ExtractDate("20151204", MM) == "20151204".substring(4, 6)) + assert(ExtractDate("20151204", DD) == "20151204".substring(6, 8)) + assert(ExtractDate("20151204", YYYYMM) == "20151204".substring(0, 6)) + assert(ExtractDate("20151204", YYYYMMDD) == "20151204".substring(0, 8)) } } diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractDomainTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractDomainTest.scala index b1f80eff..ca1192fa 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractDomainTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractDomainTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox import org.junit.runner.RunWith @@ -38,6 +39,7 @@ class ExtractDomainTest extends FunSuite { case (link, domain) => assert(ExtractDomain(link) == domain) } } + test("withBase") { data2.foreach { case (link, base, domain) => assert(ExtractDomain(link, base) == domain) @@ -48,5 +50,4 @@ class ExtractDomainTest extends FunSuite { assert(ExtractDomain(null) == null) assert(ExtractDomain("index.html", null) == null) } - } diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractHashtagsTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractHashtagsTest.scala index 03736738..dcaa9ceb 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractHashtagsTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractHashtagsTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox import org.junit.runner.RunWith @@ -21,7 +22,7 @@ import org.scalatest.FunSuite import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -class ExtractHashtagTest extends FunSuite { +class ExtractHashtagsTest extends FunSuite { test("simple") { val tweet = "Here are #some #hashtags #TeSTing" val extracted = ExtractHashtags(tweet).toList diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractImageLinksTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractImageLinksTest.scala index 5d395d79..ef197302 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractImageLinksTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractImageLinksTest.scala @@ -14,12 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox +import java.io.IOException + import org.junit.runner.RunWith import org.scalatest.FunSuite import org.scalatest.junit.JUnitRunner -import java.io.IOException @RunWith(classOf[JUnitRunner]) class ExtractImageLinksTest extends FunSuite { @@ -48,6 +50,8 @@ class ExtractImageLinksTest extends FunSuite { assert(ExtractImageLinks("", "") == Nil) // Need way of creating an exception here val invalid = null - intercept[IOException] { ExtractImageLinks (invalid, fragment)} + intercept[IOException] { + ExtractImageLinks(invalid, fragment) + } } } diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractLinksTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractLinksTest.scala index 79bcb26f..ed9a494a 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractLinksTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractLinksTest.scala @@ -14,13 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox +import java.io.IOException + import org.junit.runner.RunWith import org.scalatest.FunSuite import org.scalatest.junit.JUnitRunner + import scala.collection.mutable -import java.io.IOException @RunWith(classOf[JUnitRunner]) class ExtractLinksTest extends FunSuite { @@ -51,6 +54,5 @@ class ExtractLinksTest extends FunSuite { assert(ExtractLinks("", "", "http://www.foobar.org/index.html") == mutable.MutableList[(String, String, String)]()) // invalid url should throw exception - need more information here intercept[IOException] { ExtractLinks("", null, "FROTSTEDwww.foobar.org/index.html") } - } } diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractTextFromPDFsTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractTextFromPDFsTest.scala index 1777ccc5..2a20db34 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractTextFromPDFsTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractTextFromPDFsTest.scala @@ -15,19 +15,17 @@ * limitations under the License. */ - package io.archivesunleashed.matchbox +package io.archivesunleashed.matchbox - import org.junit.runner.RunWith - import org.scalatest.FunSuite - import org.scalatest.junit.JUnitRunner - import io.archivesunleashed.matchbox._ - import org.scalatest.Matchers._ - import org.apache.tika.parser.pdf.PDFParser; +import org.apache.tika.parser.pdf.PDFParser +import org.junit.runner.RunWith +import org.scalatest.FunSuite +import org.scalatest.Matchers._ +import org.scalatest.junit.JUnitRunner - @RunWith(classOf[JUnitRunner]) - class ExtractTextFromPDFsTest extends FunSuite { - test ("get parser") { - ExtractTextFromPDFs.pdfParser shouldBe a [PDFParser] - } - - } +@RunWith(classOf[JUnitRunner]) +class ExtractTextFromPDFsTest extends FunSuite { + test("get parser") { + ExtractTextFromPDFs.pdfParser shouldBe a[PDFParser] + } +} diff --git a/src/test/scala/io/archivesunleashed/matchbox/ExtractUrlsTest.scala b/src/test/scala/io/archivesunleashed/matchbox/ExtractUrlsTest.scala index 77cc37fc..ec8d6e37 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/ExtractUrlsTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/ExtractUrlsTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox import org.junit.runner.RunWith @@ -24,7 +25,8 @@ import org.scalatest.junit.JUnitRunner class ExtractUrlsTest extends FunSuite { test("simple") { val tweet = "Tweet with http://t.co/sgeexaad and http://twitter.com/ and https://twitter.com/lintool/" - val extracted = ExtractUrls(tweet).toList + val extracted = ExtractUrls(tweet) + assert(extracted.size == 3) assert("http://t.co/sgeexaad" == extracted(0)) assert("http://twitter.com/" == extracted(1)) diff --git a/src/test/scala/io/archivesunleashed/matchbox/RemoveHTMLTest.scala b/src/test/scala/io/archivesunleashed/matchbox/RemoveHTMLTest.scala index ad712653..fe437013 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/RemoveHTMLTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/RemoveHTMLTest.scala @@ -17,10 +17,11 @@ package io.archivesunleashed.matchbox +import java.io.IOException + import org.junit.runner.RunWith import org.scalatest.FunSuite import org.scalatest.junit.JUnitRunner -import java.io.IOException @RunWith(classOf[JUnitRunner]) class RemoveHTMLTest extends FunSuite { @@ -34,9 +35,12 @@ class RemoveHTMLTest extends FunSuite { """ + val removed = RemoveHTML(html) assert(removed == "Here is some... HTML") - val caught = intercept[IOException] {RemoveHTML (null)} - assert (caught.getMessage == "Caught exception processing input row ") + val caught = intercept[IOException] { + RemoveHTML(null) + } + assert(caught.getMessage == "Caught exception processing input row ") } } diff --git a/src/test/scala/io/archivesunleashed/matchbox/RemoveHttpHeaderTest.scala b/src/test/scala/io/archivesunleashed/matchbox/RemoveHttpHeaderTest.scala index a90eeed6..3751967c 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/RemoveHttpHeaderTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/RemoveHttpHeaderTest.scala @@ -29,6 +29,7 @@ class RemoveHttpHeaderTest extends FunSuite { val removed = RemoveHttpHeader(header) val unchanged = RemoveHttpHeader(nohttp) val error = RemoveHttpHeader(null) + assert(removed == "Hello content") assert(unchanged == nohttp) assert( error == null ) diff --git a/src/test/scala/io/archivesunleashed/matchbox/StringUtilsTest.scala b/src/test/scala/io/archivesunleashed/matchbox/StringUtilsTest.scala index 609ffdcc..66b94c8a 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/StringUtilsTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/StringUtilsTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox import java.io.IOException @@ -38,6 +39,7 @@ class StringUtilsTest extends FunSuite { val caught = intercept[IOException] {except.escapeInvalidXML()} assert (caught.getMessage == "Caught exception processing input row "); } + test ("md5 hash") { val s: String = "unesco.org"; assert(s.computeHash() == "8e8decc8e8107bcf9d3896f3222b77d8"); diff --git a/src/test/scala/io/archivesunleashed/matchbox/TupleFormatterTest.scala b/src/test/scala/io/archivesunleashed/matchbox/TupleFormatterTest.scala index 6b7271c3..31caff51 100644 --- a/src/test/scala/io/archivesunleashed/matchbox/TupleFormatterTest.scala +++ b/src/test/scala/io/archivesunleashed/matchbox/TupleFormatterTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.matchbox import org.junit.runner.RunWith diff --git a/src/test/scala/io/archivesunleashed/util/JsonUtilsTest.scala b/src/test/scala/io/archivesunleashed/util/JsonUtilsTest.scala index 3d054c6c..20bfd337 100644 --- a/src/test/scala/io/archivesunleashed/util/JsonUtilsTest.scala +++ b/src/test/scala/io/archivesunleashed/util/JsonUtilsTest.scala @@ -15,28 +15,27 @@ * limitations under the License. */ - package io.archivesunleashed.matchbox +package io.archivesunleashed.matchbox - import org.junit.runner.RunWith - import org.scalatest.FunSuite - import org.scalatest.junit.JUnitRunner - import io.archivesunleashed.util.JsonUtils +import io.archivesunleashed.util.JsonUtils +import org.junit.runner.RunWith +import org.scalatest.FunSuite +import org.scalatest.junit.JUnitRunner - @RunWith(classOf[JUnitRunner]) - class JsonUtilsTest extends FunSuite { - test("proper Map") { - val map: Map[Symbol, Any] = Map('a -> 1, 'b -> 2, 'c -> 3) - assert(JsonUtils.toJson(map) == """{"a":1,"b":2,"c":3}""") - } +@RunWith(classOf[JUnitRunner]) +class JsonUtilsTest extends FunSuite { + test("proper Map") { + val map: Map[Symbol, Any] = Map('a -> 1, 'b -> 2, 'c -> 3) + assert(JsonUtils.toJson(map) == """{"a":1,"b":2,"c":3}""") + } - test("any value") { - val value = 12345 - assert(JsonUtils.toJson(12345) == "12345") - } + test("any value") { + val value = 12345 + assert(JsonUtils.toJson(12345) == "12345") + } - test("json string") { - val jsonString = """{"a":1,"b":2,"c":3}""" - assert(JsonUtils.fromJson(jsonString) == Map("a" -> 1, "b" -> 2, "c" -> 3 )) - - } - } + test("json string") { + val jsonString = """{"a":1,"b":2,"c":3}""" + assert(JsonUtils.fromJson(jsonString) == Map("a" -> 1, "b" -> 2, "c" -> 3)) + } +} diff --git a/src/test/scala/io/archivesunleashed/util/TweetUtilsTest.scala b/src/test/scala/io/archivesunleashed/util/TweetUtilsTest.scala index 3883e1af..ddc8421a 100644 --- a/src/test/scala/io/archivesunleashed/util/TweetUtilsTest.scala +++ b/src/test/scala/io/archivesunleashed/util/TweetUtilsTest.scala @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.archivesunleashed.util import io.archivesunleashed.util.TweetUtils._