diff options
author | Olli Virtanen <olli.virtanen@oath.com> | 2018-06-21 16:48:59 +0200 |
---|---|---|
committer | Olli Virtanen <olli.virtanen@oath.com> | 2018-06-21 16:48:59 +0200 |
commit | a9f527be723d026ae21ed9504c55553bd5beadbb (patch) | |
tree | 1323e8bcc5a8f6698618d806f35a70a047cc656e /container-di/src/test/scala/com/yahoo/container/di/DirConfigSource.scala | |
parent | 5258489bf992e8176e136362759ac079494b6f94 (diff) |
Scala code in container-di converted to Java
Diffstat (limited to 'container-di/src/test/scala/com/yahoo/container/di/DirConfigSource.scala')
-rw-r--r-- | container-di/src/test/scala/com/yahoo/container/di/DirConfigSource.scala | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/container-di/src/test/scala/com/yahoo/container/di/DirConfigSource.scala b/container-di/src/test/scala/com/yahoo/container/di/DirConfigSource.scala deleted file mode 100644 index 4f80b25a247..00000000000 --- a/container-di/src/test/scala/com/yahoo/container/di/DirConfigSource.scala +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.di - -import java.io.{FileOutputStream, OutputStream, File} -import DirConfigSource._ -import java.util.Random -import org.junit.rules.TemporaryFolder -import com.yahoo.config.subscription.{ConfigSource, ConfigSourceSet} - -/** - * @author tonytv - * @author gjoranv - */ -class DirConfigSource(val testSourcePrefix: String) { - - private val tempFolder = createTemporaryFolder() - - val configSource : ConfigSource = new ConfigSourceSet(testSourcePrefix + new Random().nextLong) - - def writeConfig(name: String, contents: String) { - val file = new File(tempFolder.getRoot, name + ".cfg") - if (!file.exists()) - file.createNewFile() - - printFile(file, contents + "\n") - } - - def configId = "dir:" + tempFolder.getRoot.getPath - - def cleanup() { - tempFolder.delete() - } - -} - -private object DirConfigSource { - - def printFile(f: File, content: String) { - var out: OutputStream = new FileOutputStream(f) - out.write(content.getBytes("UTF-8")) - out.close() - } - - def createTemporaryFolder() = { - val folder = new TemporaryFolder - folder.create() - folder - } - -} |