All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.deviniti.testflo.testsender.TestResultFileValidator.kt Maven / Gradle / Ivy

There is a newer version: 1.0.11
Show newest version
package com.deviniti.testflo.testsender

import com.google.gson.Gson
import java.io.File

object TestResultFileValidator {
    fun isValid(testResultFile: File, testResultsType: TestResultsType): Boolean {
        return when (testResultsType) {
            TestResultsType.TESTNG -> TestNGValidator.validate(testResultFile)
            TestResultsType.JUNIT -> JUNitValidator.validate(testResultFile)
            TestResultsType.CUCUMBER -> CucumberValidator.validate(testResultFile)
        }
    }
}

private interface Validator {
    fun validate(file: File): Boolean
}

private object JUNitValidator : Validator {
    override fun validate(file: File) = file.readText().contains("




© 2015 - 2024 Weber Informatics LLC | Privacy Policy