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

com.bybutter.sisyphus.test.descriptor.SisyphusTestDescriptor.kt Maven / Gradle / Ivy

There is a newer version: 2.1.22
Show newest version
package com.bybutter.sisyphus.test.descriptor

import com.bybutter.sisyphus.test.SisyphusTestEngineContext
import com.bybutter.sisyphus.test.extension.AfterTest
import com.bybutter.sisyphus.test.extension.BeforeTest
import com.bybutter.sisyphus.test.extensions
import org.junit.platform.engine.UniqueId
import org.junit.platform.engine.support.descriptor.EngineDescriptor
import org.junit.platform.engine.support.hierarchical.Node

class SisyphusTestDescriptor(id: UniqueId) : EngineDescriptor(id, "Sisyphus Test"), Node {
    override fun shouldBeSkipped(context: SisyphusTestEngineContext): Node.SkipResult {
        return if (children.isEmpty()) Node.SkipResult.skip("No test cases found.") else Node.SkipResult.doNotSkip()
    }

    override fun before(context: SisyphusTestEngineContext): SisyphusTestEngineContext {
        context.extensions { beforeTest(context, this@SisyphusTestDescriptor) }
        return context
    }

    override fun after(context: SisyphusTestEngineContext) {
        context.extensions { afterTest(context, this@SisyphusTestDescriptor) }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy