Commit 68206c90 authored by Steven Pisarski's avatar Steven Pisarski

Renamed method.

parent 8163d639
......@@ -326,7 +326,7 @@ class GeneratorYaml(@JsonProperty("schemaUri") _schemaUri: String,
require(_outputDefUri != null)
private val outputDefFs = FileSystem.get(new URI(_outputDefUri), new Configuration())
val outputDefs = OutputDefinition.outputDefinition(outputDefFs.open(new Path(_outputDefUri)), inputDef)
val outputDefs = OutputDefinition.outputDefinitions(outputDefFs.open(new Path(_outputDefUri)), inputDef)
val appName = if (_appName == null) "EventGenerator" else _appName
......
......@@ -16,9 +16,9 @@ object OutputDefinition {
* Parses the file that defines the outbound data
* @param is - the InputStream to the output definition
* @param inputDef - the input definition
* @return - returns an OutputDefinition
* @return - returns the configured OutputDefinitions
*/
def outputDefinition(is: InputStream, inputDef: InputDefinition): Set[OutputDefinition] = {
def outputDefinitions(is: InputStream, inputDef: InputDefinition): Set[OutputDefinition] = {
val out = scala.collection.mutable.Set[OutputDefinition]()
val mapper = new ObjectMapper(new YAMLFactory())
......
......@@ -16,7 +16,7 @@ class EngineTest extends EngineTester {
val dateFormatter = new SimpleDateFormat(dateFormat)
var inputDef = InputDefinition.inputDefinition(
new FileInput(new File("testData/generator/definition/cm-constant-short.json")))
val outputDefs = OutputDefinition.outputDefinition(
val outputDefs = OutputDefinition.outputDefinitions(
new FileInputStream(new File("testData/cm/definition/cm-out.yaml")), inputDef)
val eventUri = new File("testData/generator/events/cm.txt").toURI.toString
val delim = '|'
......
......@@ -15,7 +15,7 @@ class GeneratorCmConstantTest extends EngineTester {
val dateFormat = "MM-dd-yyyy HH:mm:ss a"
val dateFormatter = new SimpleDateFormat(dateFormat)
val inputDef = InputDefinition.inputDefinition(new FileInput(new File("testData/cm/definition/cm-constant.json")))
val outputDefs = OutputDefinition.outputDefinition(
val outputDefs = OutputDefinition.outputDefinitions(
new FileInputStream(new File("testData/cm/definition/cm-out.yaml")), inputDef)
val eventUri = new File("testData/cm/events/cm_1a.txt").toURI.toString
val delim = '|'
......
......@@ -15,7 +15,7 @@ class GeneratorCmLinearRegressionTest extends EngineTester {
val dateFormat = "MM-dd-yyyy HH:mm:ss a"
val dateFormatter = new SimpleDateFormat(dateFormat)
val inputDef = InputDefinition.inputDefinition(new FileInput(new File("testData/cm/definition/cm-linear-regression.json")))
val outputDefs = OutputDefinition.outputDefinition(
val outputDefs = OutputDefinition.outputDefinitions(
new FileInputStream(new File("testData/cm/definition/cm-out.yaml")), inputDef)
val eventUri = new File("testData/cm/events/cm_1a.txt").toURI.toString
val delim = '|'
......
......@@ -16,7 +16,7 @@ class GeneratorIvrTest extends EngineTester {
val dateFormat = "MM-dd-yyyy HH:mm:ss a"
val dateFormatter = new SimpleDateFormat(dateFormat)
val inputDef = InputDefinition.inputDefinition(new FileInput(new File("testData/ivr/definition/ivr.json")))
val outputDefs = OutputDefinition.outputDefinition(
val outputDefs = OutputDefinition.outputDefinitions(
new FileInputStream(new File("testData/ivr/definition/ivr-out.yaml")), inputDef)
val eventUri = new File("testData/ivr/events").toURI.toString
val delim = ','
......
......@@ -161,7 +161,7 @@ class OutputDefinitionTest extends UnitSpec {
val inputDefStream = this.getClass.getClassLoader.getResourceAsStream("test_def_1.json")
val inputDef = InputDefinition.inputDefinition(new StreamInput(inputDefStream))
val outputDefStream = this.getClass.getClassLoader.getResourceAsStream("output_def_1.yaml")
val outputDefs = OutputDefinition.outputDefinition(outputDefStream, inputDef)
val outputDefs = OutputDefinition.outputDefinitions(outputDefStream, inputDef)
assert(outputDefs != null)
assert(2 == outputDefs.size)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment