From 8674b0c8963782535b8a779783455e9699b5644d Mon Sep 17 00:00:00 2001 From: Bjørn Christian Seime Date: Tue, 11 Jul 2017 14:48:36 +0200 Subject: ShouldMatchersForJUnit is removed from scala-test v3 --- .../scala/com/yahoo/container/plugin/bundle/AnalyzeBundle.scala | 8 ++++---- .../com/yahoo/container/plugin/bundle/AnalyzeBundleTest.scala | 6 ++++-- .../yahoo/container/plugin/classanalysis/AnalyzeClassTest.scala | 7 +++++-- .../container/plugin/classanalysis/AnalyzeMethodBodyTest.scala | 6 ++++-- .../yahoo/container/plugin/osgi/ExportPackageParserTest.scala | 8 ++++---- .../com/yahoo/container/plugin/osgi/ImportPackageTest.scala | 8 ++++---- .../src/test/scala/com/yahoo/container/plugin/util/IOTest.scala | 9 +++++---- 7 files changed, 30 insertions(+), 22 deletions(-) (limited to 'bundle-plugin') diff --git a/bundle-plugin/src/main/scala/com/yahoo/container/plugin/bundle/AnalyzeBundle.scala b/bundle-plugin/src/main/scala/com/yahoo/container/plugin/bundle/AnalyzeBundle.scala index f1bbf644ac6..1b3979476bd 100644 --- a/bundle-plugin/src/main/scala/com/yahoo/container/plugin/bundle/AnalyzeBundle.scala +++ b/bundle-plugin/src/main/scala/com/yahoo/container/plugin/bundle/AnalyzeBundle.scala @@ -1,11 +1,11 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.plugin.bundle -import java.util.jar.{Manifest => JarManifest} import java.io.File -import com.yahoo.container.plugin.osgi.{ExportPackages, ExportPackageParser} -import ExportPackages.Export -import collection.immutable.LinearSeq +import java.util.jar.{Manifest => JarManifest} + +import com.yahoo.container.plugin.osgi.ExportPackageParser +import com.yahoo.container.plugin.osgi.ExportPackages.Export import com.yahoo.container.plugin.util.JarFiles diff --git a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.scala b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.scala index cf6ae3ccf9c..3ef1b1fea87 100644 --- a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.scala +++ b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/bundle/AnalyzeBundleTest.scala @@ -1,16 +1,18 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.plugin.bundle -import org.scalatest.junit.{JUnitSuite, ShouldMatchersForJUnit} +import org.scalatest.junit.{AssertionsForJUnit, JUnitSuite} import org.junit.Test import com.yahoo.container.plugin.bundle.AnalyzeBundle.PublicPackages import com.yahoo.container.plugin.osgi.ExportPackages import java.io.File +import org.scalatest.Matchers + /** * @author tonytv */ -class AnalyzeBundleTest extends JUnitSuite with ShouldMatchersForJUnit { +class AnalyzeBundleTest extends JUnitSuite with AssertionsForJUnit with Matchers { val jarDir = new File("src/test/resources/jar") val PublicPackages(exports, globals) = AnalyzeBundle.publicPackagesAggregated( diff --git a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.scala b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.scala index 3377315e3d8..e2d0e3c6f10 100644 --- a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.scala +++ b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.scala @@ -2,19 +2,22 @@ package com.yahoo.container.plugin.classanalysis import org.junit.Test -import org.scalatest.junit.{ShouldMatchersForJUnit, JUnitSuite} +import org.scalatest.junit.{AssertionsForJUnit, JUnitSuite} import java.awt.Image import java.awt.image.{ImagingOpException, Kernel} + import sampleclasses._ import TestUtilities._ import com.yahoo.osgi.annotation.{ExportPackage, Version} import javax.security.auth.login.LoginException +import org.scalatest.Matchers + /** * Tests that analysis of class files works. * @author tonytv */ -class AnalyzeClassTest extends JUnitSuite with ShouldMatchersForJUnit { +class AnalyzeClassTest extends JUnitSuite with AssertionsForJUnit with Matchers { @Test def require_that_full_class_name_is_returned() { analyzeClass[Base].name should be(name[Base]) } diff --git a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/AnalyzeMethodBodyTest.scala b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/AnalyzeMethodBodyTest.scala index 231aba36325..43f52884f39 100644 --- a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/AnalyzeMethodBodyTest.scala +++ b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/AnalyzeMethodBodyTest.scala @@ -1,17 +1,19 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.plugin.classanalysis -import org.scalatest.junit.{JUnitSuite, ShouldMatchersForJUnit} +import org.scalatest.junit.{AssertionsForJUnit, JUnitSuite} import sampleclasses._ import TestUtilities._ import org.junit.Test import java.io.PrintStream +import org.scalatest.Matchers + /** * Tests that classes used in method bodies are included in the imports list. * @author tonytv */ -class AnalyzeMethodBodyTest extends JUnitSuite with ShouldMatchersForJUnit { +class AnalyzeMethodBodyTest extends JUnitSuite with AssertionsForJUnit with Matchers { @Test def require_that_class_of_locals_are_included() { analyzeClass[Methods].referencedClasses should contain(name[Base]) } diff --git a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/osgi/ExportPackageParserTest.scala b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/osgi/ExportPackageParserTest.scala index 37399ec8c00..5ddc7fef16d 100644 --- a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/osgi/ExportPackageParserTest.scala +++ b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/osgi/ExportPackageParserTest.scala @@ -1,15 +1,15 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.plugin.osgi -import org.scalatest.junit.{JUnitSuite, ShouldMatchersForJUnit} +import org.scalatest.junit.{AssertionsForJUnit, JUnitSuite} import org.junit.Test - -import ExportPackages.{Parameter, Export} +import ExportPackages.{Export, Parameter} +import org.scalatest.Matchers /** * @author tonytv */ -class ExportPackageParserTest extends JUnitSuite with ShouldMatchersForJUnit { +class ExportPackageParserTest extends JUnitSuite with AssertionsForJUnit with Matchers { val versionParameter = Parameter("version", "1.2.3.sample") @Test diff --git a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/osgi/ImportPackageTest.scala b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/osgi/ImportPackageTest.scala index b39c8da7df6..4011f170da9 100644 --- a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/osgi/ImportPackageTest.scala +++ b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/osgi/ImportPackageTest.scala @@ -1,16 +1,16 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.plugin.osgi -import org.scalatest.junit.{JUnitSuite, ShouldMatchersForJUnit} +import org.scalatest.junit.{AssertionsForJUnit, JUnitSuite} import org.junit.Test - import ImportPackages.Import -import ExportPackages.{Parameter, Export} +import ExportPackages.{Export, Parameter} +import org.scalatest.Matchers /** * @author tonytv */ -class ImportPackageTest extends JUnitSuite with ShouldMatchersForJUnit { +class ImportPackageTest extends JUnitSuite with AssertionsForJUnit with Matchers { val referencedPackages = Set("com.yahoo.exported") val exports = exportByPackageName(Export(List("com.yahoo.exported"), List())) val exportsWithVersion = exportByPackageName(exports.head._2.copy(parameters = List(Parameter("version", "1.3")))) diff --git a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/util/IOTest.scala b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/util/IOTest.scala index d96273d81e1..7efb0392f5e 100644 --- a/bundle-plugin/src/test/scala/com/yahoo/container/plugin/util/IOTest.scala +++ b/bundle-plugin/src/test/scala/com/yahoo/container/plugin/util/IOTest.scala @@ -1,22 +1,23 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.plugin.util -import org.scalatest.junit.{JUnitSuite, ShouldMatchersForJUnit} +import org.scalatest.junit.{AssertionsForJUnit, JUnitSuite} import org.junit.Test - import IO.using import java.io.Closeable +import org.scalatest.Matchers + /** * @author tonytv */ -class IOTest extends JUnitSuite with ShouldMatchersForJUnit { +class IOTest extends JUnitSuite with AssertionsForJUnit with Matchers { class ClosingException extends RuntimeException class FunctionException extends RuntimeException object throwWhenClosingResource extends Closeable { def close() { - throw new ClosingException(); + throw new ClosingException() } } -- cgit v1.2.3