Skip to content

Commit

Permalink
test(scanner): Rename the abstract storage test classes
Browse files Browse the repository at this point in the history
Rename the abstract storage test classes to better match the names of
the related storage interfaces.

Signed-off-by: Martin Nonnenmacher <[email protected]>
  • Loading branch information
mnonnenmacher committed Mar 18, 2024
1 parent c5ddcbb commit df3054d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import org.semver4j.Semver

private val DUMMY_TEXT_LOCATION = TextLocation("fakepath", 13, 21)

abstract class AbstractStorageFunTest(vararg listeners: TestListener) : WordSpec() {
abstract class AbstractPackageBasedScanStorageFunTest(vararg listeners: TestListener) : WordSpec() {
private val id = Identifier("type", "namespace", "name1", "version")

private val sourceArtifact = RemoteArtifact("url1", Hash.create("0123456789abcdef0123456789abcdef01234567"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import org.ossreviewtoolkit.scanner.ProvenanceBasedScanStorage
import org.ossreviewtoolkit.scanner.ScanStorageException
import org.ossreviewtoolkit.scanner.ScannerMatcher

abstract class AbstractProvenanceBasedStorageFunTest(vararg listeners: TestListener) : WordSpec() {
abstract class AbstractProvenanceBasedScanStorageFunTest(vararg listeners: TestListener) : WordSpec() {
private lateinit var storage: ProvenanceBasedScanStorage

protected abstract fun createStorage(): ProvenanceBasedScanStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ import io.kotest.engine.spec.tempdir

import org.ossreviewtoolkit.utils.ort.storage.LocalFileStorage

class FileBasedStorageFunTest : AbstractStorageFunTest() {
class FileBasedStorageFunTest : AbstractPackageBasedScanStorageFunTest() {
override fun createStorage() = FileBasedStorage(LocalFileStorage(tempdir()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ import org.ossreviewtoolkit.utils.test.PostgresListener

private val postgresListener = PostgresListener()

class PostgresStorageFunTest : AbstractStorageFunTest(postgresListener) {
class PostgresStorageFunTest : AbstractPackageBasedScanStorageFunTest(postgresListener) {
override fun createStorage() = PostgresStorage(dataSource = postgresListener.dataSource)
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ import io.kotest.engine.spec.tempdir

import org.ossreviewtoolkit.utils.ort.storage.LocalFileStorage

class ProvenanceBasedFileStorageFunTest : AbstractProvenanceBasedStorageFunTest() {
class ProvenanceBasedFileStorageFunTest : AbstractProvenanceBasedScanStorageFunTest() {
override fun createStorage() = ProvenanceBasedFileStorage(LocalFileStorage(tempdir()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ import org.ossreviewtoolkit.utils.test.PostgresListener

private val postgresListener = PostgresListener()

class ProvenanceBasedPostgresStorageFunTest : AbstractProvenanceBasedStorageFunTest(postgresListener) {
class ProvenanceBasedPostgresStorageFunTest : AbstractProvenanceBasedScanStorageFunTest(postgresListener) {
override fun createStorage() = ProvenanceBasedPostgresStorage(postgresListener.dataSource)
}

0 comments on commit df3054d

Please sign in to comment.