Skip to content

Commit

Permalink
Upgrades dependencies and adds support for Scala 2.13.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-schlichtherle committed Jun 12, 2019
1 parent 794bdd2 commit 177883c
Show file tree
Hide file tree
Showing 21 changed files with 146 additions and 83 deletions.
16 changes: 8 additions & 8 deletions api/src/test/scala/global/namespace/fun/io/api/FilterSpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2017 Schlichtherle IT Services
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,12 +17,12 @@ package global.namespace.fun.io.api

import java.io.{InputStream, OutputStream}

import Filter._
import global.namespace.fun.io.api.Filter._
import org.mockito.ArgumentMatchers.any
import org.mockito.Mockito.{inOrder, when}
import org.mockito.Mockito.when
import org.scalatest.Matchers.{inOrder => _, _}
import org.scalatest.WordSpec
import org.scalatest.mockito.MockitoSugar.mock
import org.scalatestplus.mockito.MockitoSugar.mock

/**
* @author Christian Schlichtherle
Expand Down Expand Up @@ -59,20 +59,20 @@ class FilterSpec extends WordSpec {
val oss1 = mock[Socket[OutputStream]]
val oss2 = mock[Socket[OutputStream]]

when(s output ()) thenReturn oss1
when(s.output()) thenReturn oss1
when(f output oss1) thenReturn oss2

fs output () shouldBe oss2
fs.output() shouldBe oss2
}

"apply to the input" in {
val iss1 = mock[Socket[InputStream]]
val iss2 = mock[Socket[InputStream]]

when(s input ()) thenReturn iss1
when(s.input()) thenReturn iss1
when(f input iss1) thenReturn iss2

fs input () shouldBe iss2
fs.input() shouldBe iss2
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2017 Schlichtherle IT Services
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ import org.mockito.ArgumentMatchers._
import org.mockito.Mockito._
import org.scalatest.Matchers.{inOrder => _, _}
import org.scalatest.WordSpec
import org.scalatest.mockito.MockitoSugar.mock
import org.scalatestplus.mockito.MockitoSugar.mock

class InternalSpec extends WordSpec {

Expand All @@ -36,15 +36,15 @@ class InternalSpec extends WordSpec {
val io = inOrder(a, b)
io verify a output any[Socket[OutputStream]]
io verify b output any[Socket[OutputStream]]
io verifyNoMoreInteractions ()
io.verifyNoMoreInteractions()
}

"being unapplied" in {
c input mock[Socket[InputStream]] shouldBe null
val io = inOrder(a, b)
io verify a input any[Socket[InputStream]]
io verify b input any[Socket[InputStream]]
io verifyNoMoreInteractions ()
io.verifyNoMoreInteractions()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2017 Schlichtherle IT Services
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,8 +19,8 @@ import com.amazonaws.services.s3.AmazonS3
import global.namespace.fun.io.aws.sdk1.AWS.s3
import org.scalatest.Matchers._
import org.scalatest.WordSpec
import org.scalatest.mockito.MockitoSugar._
import org.scalatest.prop.PropertyChecks._
import org.scalatestplus.mockito.MockitoSugar._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks._

class AWSSpec extends WordSpec {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2017 Schlichtherle IT Services
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,8 +18,8 @@ package global.namespace.fun.io.aws.sdk2
import global.namespace.fun.io.aws.sdk2.AWS.s3
import org.scalatest.Matchers._
import org.scalatest.WordSpec
import org.scalatest.mockito.MockitoSugar._
import org.scalatest.prop.PropertyChecks._
import org.scalatestplus.mockito.MockitoSugar._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks._
import software.amazon.awssdk.services.s3.S3Client

class AWSSpec extends WordSpec {
Expand Down
12 changes: 6 additions & 6 deletions bios/src/test/scala/global/namespace/fun/io/bios/BIOSSpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2017 Schlichtherle IT Services
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@ import global.namespace.fun.io.bios.BIOS._
import org.mockito.Mockito._
import org.scalatest.Matchers._
import org.scalatest.WordSpec
import org.scalatest.mockito.MockitoSugar.mock
import org.scalatestplus.mockito.MockitoSugar.mock

class BIOSSpec extends WordSpec {

Expand All @@ -32,17 +32,17 @@ class BIOSSpec extends WordSpec {
val in = mock[InputStream]
val source = stream(in)
source acceptReader (_.read)
verify(in) read ()
verify(in, never) close ()
verify(in).read()
verify(in, never).close()
}

"given an output stream" in {
val out = mock[OutputStream]
val sink = stream(out)
sink acceptWriter ((_: OutputStream) write 0)
verify(out) write 0
verify(out) flush ()
verify(out, never) close ()
verify(out).flush()
verify(out, never).close()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
/*
* Copyright (C) 2013-2018 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package global.namespace.fun.io.bios

import java.nio.file.Paths

import org.scalatest.Matchers._
import org.scalatest.WordSpec
import org.scalatest.prop.PropertyChecks._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks._

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/** @author Christian Schlichtherle */
class DirectoryStoreSpec extends WordSpec {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
/*
* Copyright (C) 2013-2018 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package global.namespace.fun.io.delta

import java.nio.charset.Charset
import java.security.MessageDigest

import global.namespace.fun.io.api.Store
import global.namespace.fun.io.bios.BIOS.memory
import global.namespace.fun.io.delta.Delta._
import global.namespace.fun.io.delta.DeltaModelCodecSpec._
import global.namespace.fun.io.delta.model.{DeltaModel, EntryNameAndDigestValue, EntryNameAndTwoDigestValues}
import global.namespace.fun.io.api.Store
import global.namespace.fun.io.bios.BIOS.memory
import org.scalatest.Matchers._
import org.scalatest.WordSpec
import org.scalatest.prop.PropertyChecks._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks._

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/** @author Christian Schlichtherle */
class DeltaModelCodecSpec extends WordSpec {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
/*
* Copyright (C) 2013-2018 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package global.namespace.fun.io.delta

import global.namespace.fun.io.delta.MessageDigests._
import org.scalatest.Matchers._
import org.scalatest.WordSpec
import org.scalatest.prop.PropertyChecks._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks._

/** @author Christian Schlichtherle */
class MessageDigestsSpec extends WordSpec {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2017 Schlichtherle IT Services
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,7 +41,7 @@ trait ArchiveSpecContext {

def withTempArchiveFile(factory: ArchiveStoreFactory)(test: ArchiveStore => Any): Unit = {
val file = File.createTempFile("tmp", null)
file delete ()
file.delete()
try {
test(factory(file))
} finally {
Expand All @@ -50,7 +50,7 @@ trait ArchiveSpecContext {
}

private def deleteAll(file: File): Unit = {
Option(file listFiles ()) foreach (_ foreach deleteAll)
file delete ()
Option(file.listFiles()) foreach (_ foreach deleteAll)
file.delete()
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2017 Schlichtherle IT Services
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,9 +20,9 @@ import global.namespace.fun.io.delta.Delta.diff
import global.namespace.fun.io.spi.Copy.copy
import org.scalatest.Matchers._
import org.scalatest.WordSpec
import org.scalatest.prop.PropertyChecks._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks._

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/** @author Christian Schlichtherle */
abstract class ArchiveSpecSuite extends WordSpec with ArchiveSpecContext {
Expand Down
14 changes: 7 additions & 7 deletions it/src/test/scala/global/namespace/fun/io/it/ContentSpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2017 Schlichtherle IT Services
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,7 @@ import global.namespace.fun.io.bios.BIOS._
import global.namespace.fun.io.scala.api._
import org.scalatest.Matchers._
import org.scalatest.WordSpec
import org.scalatest.prop.PropertyChecks._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks._

class ContentSpec extends WordSpec {

Expand All @@ -35,7 +35,7 @@ class ContentSpec extends WordSpec {
() => memory,
() => file {
val file = File.createTempFile("tmp", null)
file delete ()
file.delete()
file
},
() => path {
Expand Down Expand Up @@ -63,7 +63,7 @@ class ContentSpec extends WordSpec {
new String(store content 3) shouldBe "123"
intercept[ContentTooLargeException](store content 2)

store delete()
store.delete()
store.exists shouldBe false
intercept[IOException](store.content)

Expand All @@ -72,7 +72,7 @@ class ContentSpec extends WordSpec {
new String(store content 2) shouldBe "23"
intercept[ContentTooLargeException](store content 1)

store delete()
store.delete()
store.exists shouldBe false
intercept[IOException](store.content)

Expand All @@ -81,7 +81,7 @@ class ContentSpec extends WordSpec {
new String(store content 1) shouldBe "3"
intercept[ContentTooLargeException](store content 0)

store delete()
store.delete()
store.exists shouldBe false
intercept[IOException](store.content)

Expand All @@ -90,7 +90,7 @@ class ContentSpec extends WordSpec {
new String(store content 0) shouldBe ""
intercept[IllegalArgumentException](store content -1)

store delete()
store.delete()
store.exists shouldBe false
intercept[IOException](store.content)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
/*
* Copyright (C) 2013-2018 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
* Copyright © 2017 - 2019 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package global.namespace.fun.io.it

Expand All @@ -13,7 +24,7 @@ import global.namespace.fun.io.it.DiffAndPatchSpecSuite._
import org.scalatest.Matchers._
import org.scalatest.WordSpec

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/** @author Christian Schlichtherle */
abstract class DiffAndPatchSpecSuite extends WordSpec with ArchiveSpecContext {
Expand Down
Loading

0 comments on commit 177883c

Please sign in to comment.