Search in sources :

Example 1 with TestFile

use of com.sequenceiq.cloudbreak.blueprint.testrepeater.TestFile in project cloudbreak by hortonworks.

the class ReadTestData method getInputOutputData.

public static List<BlueprintDataProvider> getInputOutputData(Map<String, BlueprintPreparationObject> models) throws IOException {
    final List<BlueprintDataProvider> testFiles = new LinkedList<>();
    for (Map.Entry<String, BlueprintPreparationObject> entry : models.entrySet()) {
        try {
            TestFile inputFile = getTestFile(getFileName(BLUEPRINT_UPDATER_TEST_INPUTS, entry.getKey()));
            TestFile outputFile = getTestFile(getFileName(BLUEPRINT_UPDATER_TEST_OUTPUTS, entry.getKey()));
            testFiles.add(new BlueprintDataProvider(inputFile, outputFile, entry.getValue()));
        } catch (Exception ex) {
            throw new IOException(String.format("Unable to locate the desired folder/file in the classpath <%s>, message: %s", entry.getKey(), ex.getMessage()));
        }
    }
    return testFiles;
}
Also used : TestFile(com.sequenceiq.cloudbreak.blueprint.testrepeater.TestFile) BlueprintPreparationObject(com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject) IOException(java.io.IOException) Map(java.util.Map) LinkedList(java.util.LinkedList) IOException(java.io.IOException)

Aggregations

BlueprintPreparationObject (com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject)1 TestFile (com.sequenceiq.cloudbreak.blueprint.testrepeater.TestFile)1 IOException (java.io.IOException)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1