Skip to content

Commit

Permalink
change deprecated classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard van Heest committed Apr 28, 2020
1 parent f3ad2ac commit e4380ab
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ package nl.knaw.dans.easy.stage.command

import java.io.{ ByteArrayOutputStream, File }

import nl.knaw.dans.easy.stage.CustomMatchers._
import nl.knaw.dans.easy.stage.command.CustomMatchers._
import org.apache.commons.configuration.PropertiesConfiguration
import org.rogach.scallop.ScallopConf
import org.scalatest.{ FlatSpec, Matchers }
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

import scala.collection.JavaConverters._

abstract class AbstractConfSpec extends FlatSpec with Matchers {
abstract class AbstractConfSpec extends AnyFlatSpec with Matchers {

def getCommandLineOptions: ScallopConf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package nl.knaw.dans.easy.stage.command
import java.io.File
import java.nio.file.Paths

import nl.knaw.dans.easy.stage.CustomMatchers._
import nl.knaw.dans.easy.stage.command.CustomMatchers._
import org.apache.commons.configuration.PropertiesConfiguration
import org.rogach.scallop.ScallopConf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.knaw.dans.easy.stage
package nl.knaw.dans.easy.stage.command

import java.io.File
import java.nio.charset.StandardCharsets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ package nl.knaw.dans.easy.stage.command
import java.nio.file.{ Files, Paths }

import org.apache.commons.configuration.PropertiesConfiguration
import org.scalatest.{ FlatSpec, Matchers }
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import resource._

import scala.collection.JavaConverters._

class DebugConfigSpec extends FlatSpec with Matchers {
class DebugConfigSpec extends AnyFlatSpec with Matchers {

"debug-config" should "contain the same files as src/main/assembly/dist/cfg" in {
val filesInDebugConfig = managed(Files.list(Paths.get("src/test/resources/debug-config")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ import nl.knaw.dans.easy.stage.fileitem.{ EasyFilesAndFolders, EasyStageFileItem
import nl.knaw.dans.easy.stage.lib.Fedora
import org.apache.commons.configuration.PropertiesConfiguration
import org.apache.commons.io.FileUtils.{ deleteQuietly, readFileToString, write }
import org.scalatest._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.{ BeforeAndAfterEach, Inside }

import scala.collection.immutable.HashMap
import scala.util.{ Success, Try }

class EasyStageFileItemCommandSpec extends FlatSpec with Matchers with Inside with BeforeAndAfterEach {
class EasyStageFileItemCommandSpec extends AnyFlatSpec with Matchers with Inside with BeforeAndAfterEach {

private val testDir = Paths.get("target/test", getClass.getSimpleName)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package nl.knaw.dans.easy.stage.command.fileitem
import java.io.File
import java.nio.file.Paths

import nl.knaw.dans.easy.stage.CustomMatchers._
import nl.knaw.dans.easy.stage.command.CustomMatchers._
import nl.knaw.dans.easy.stage.command.{ AbstractConfSpec, Configuration }
import org.apache.commons.configuration.PropertiesConfiguration
import org.rogach.scallop.ScallopConf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ import nl.knaw.dans.easy.stage.command.Configuration
import nl.knaw.dans.easy.stage.command.fileitem.FileItemCommandLineOptions
import nl.knaw.dans.easy.stage.lib.CSV
import org.apache.commons.configuration.PropertiesConfiguration
import org.scalatest.{FlatSpec, Inside, Matchers}
import org.scalatest.Inside
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

import scala.util.Failure

class CsvSpec extends FlatSpec with Matchers with Inside {
class CsvSpec extends AnyFlatSpec with Matchers with Inside {
private val resourceDirString: String = Paths.get(getClass.getResource("/").toURI).toAbsolutePath.toString

private val mockedConfiguration = new Configuration("version x.y.z", new PropertiesConfiguration() {
Expand Down
7 changes: 3 additions & 4 deletions lib/src/test/scala/nl.knaw.dans.easy.stage/RunSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ package nl.knaw.dans.easy.stage
import java.io.File
import java.nio.file.{ Files, Path, Paths }

import nl.knaw.dans.easy.stage.lib.Constants
import nl.knaw.dans.easy.stage.lib.Constants.DATASET_SDO
import org.apache.commons.configuration.PropertiesConfiguration
import org.apache.commons.io.FileUtils
import resource._
import Constants.DATASET_SDO
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import resource._

import scala.collection.JavaConverters._
import scala.util.Success
Expand Down Expand Up @@ -54,7 +53,7 @@ class RunSpec extends AnyFlatSpec with Matchers with CanConnectFixture {

for (bag <- testBags) {
val sdoSetDir = puddingsDir.resolve(bag.getFileName)
implicit val settings = createSettings(bag.toFile, sdoSetDir.toFile)
implicit val settings: Settings = createSettings(bag.toFile, sdoSetDir.toFile)

val res = EasyStageDataset.run(settings)
res.recover { case e => e.printStackTrace() }
Expand Down

0 comments on commit e4380ab

Please sign in to comment.