Skip to content

Commit

Permalink
replace dynatest with junit5
Browse files Browse the repository at this point in the history
  • Loading branch information
mvysny committed Oct 28, 2024
1 parent e943cfb commit 0b69033
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 90 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
package com.github.mvysny.kaributesting.v10

import com.github.mvysny.dynatest.DynaNodeGroup
import com.github.mvysny.dynatest.DynaTestDsl
import org.junit.jupiter.api.Nested

/**
* @param isModuleTest if true then this test run simulates a jar reusable component.
*/
@DynaTestDsl
fun DynaNodeGroup.allTests19(isModuleTest: Boolean) {
}

abstract class AbstractAllTests19(val isModuleTest: Boolean) {
@Nested inner class AllTests10 : AbstractAllTests10(isModuleTest)
@Nested inner class GridVaadin19Tests : AbstractGrid19Tests()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.github.mvysny.dynatest.DynaTest
import com.github.mvysny.dynatest.jvmVersion
import com.github.mvysny.kaributesting.v10.*
import com.github.mvysny.kaributools.VaadinVersion
import org.junit.jupiter.api.AfterEach
Expand All @@ -9,25 +7,7 @@ import org.junit.jupiter.api.Test
import java.net.URL
import kotlin.test.expect

class AllTests : DynaTest({
test("flow-build-info.json doesn't exist") {
val res: URL? = Thread.currentThread().contextClassLoader.getResource("META-INF/VAADIN/config/flow-build-info.json")
expect(null, "flow-build-info.json exists on the classpath!") { res }
}

group("Vaadin env") {
beforeEach { MockVaadin.setup() }
afterEach { MockVaadin.tearDown() }

test("Vaadin version") {
expect(24) { VaadinVersion.get.major }
expect(false) { VaadinMeta.isCompatibilityMode }
}
}
allTests19(isModuleTest = true)
})

class AllTests24 {
class AllTests {
@Test fun `flow-build-info-json doesn't exist`() {
val res: URL? = Thread.currentThread().contextClassLoader.getResource("META-INF/VAADIN/config/flow-build-info.json")
expect(null, "flow-build-info.json exists on the classpath!") { res }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.github.mvysny.dynatest.DynaTest
import com.github.mvysny.dynatest.jvmVersion
import com.github.mvysny.kaributesting.v10.*
import com.github.mvysny.kaributools.VaadinVersion
import org.junit.jupiter.api.AfterEach
Expand All @@ -9,25 +7,7 @@ import org.junit.jupiter.api.Test
import java.net.URL
import kotlin.test.expect

class AllTests : DynaTest({
test("flow-build-info.json exists") {
val res: URL? = Thread.currentThread().contextClassLoader.getResource("META-INF/VAADIN/config/flow-build-info.json")
expect(true, "flow-build-info.json is not on the classpath!") { res != null }
}

group("Vaadin env") {
beforeEach { MockVaadin.setup() }
afterEach { MockVaadin.tearDown() }

test("Vaadin version") {
expect(24) { VaadinVersion.get.major }
expect(false) { VaadinMeta.isCompatibilityMode }
}
}
allTests19(isModuleTest = false)
})

class AllTests24 {
class AllTests {
@Test fun `flow-build-info-json exists`() {
val res: URL? = Thread.currentThread().contextClassLoader.getResource("META-INF/VAADIN/config/flow-build-info.json")
expect(true, "flow-build-info.json is not on the classpath!") { res != null }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.github.mvysny.dynatest.DynaTest
import com.github.mvysny.dynatest.jvmVersion
import com.github.mvysny.kaributesting.v10.*
import com.github.mvysny.kaributools.VaadinVersion
import org.junit.jupiter.api.AfterEach
Expand All @@ -9,25 +7,7 @@ import org.junit.jupiter.api.Test
import java.net.URL
import kotlin.test.expect

class AllTests : DynaTest({
test("flow-build-info.json doesn't exist") {
val res: URL? = Thread.currentThread().contextClassLoader.getResource("META-INF/VAADIN/config/flow-build-info.json")
expect(null, "flow-build-info.json exists on the classpath!") { res }
}

group("Vaadin env") {
beforeEach { MockVaadin.setup() }
afterEach { MockVaadin.tearDown() }

test("Vaadin version") {
expect(24) { VaadinVersion.get.major }
expect(false) { VaadinMeta.isCompatibilityMode }
}
}
allTests19(isModuleTest = true)
})

class AllTests24 {
class AllTests {
@Test fun `flow-build-info-json doesn't exist`() {
val res: URL? = Thread.currentThread().contextClassLoader.getResource("META-INF/VAADIN/config/flow-build-info.json")
expect(null, "flow-build-info.json exists on the classpath!") { res }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.github.mvysny.dynatest.DynaTest
import com.github.mvysny.dynatest.jvmVersion
import com.github.mvysny.kaributesting.v10.*
import com.github.mvysny.kaributools.VaadinVersion
import org.junit.jupiter.api.AfterEach
Expand All @@ -9,25 +7,7 @@ import org.junit.jupiter.api.Test
import java.net.URL
import kotlin.test.expect

class AllTests : DynaTest({
test("flow-build-info.json exists") {
val res: URL? = Thread.currentThread().contextClassLoader.getResource("META-INF/VAADIN/config/flow-build-info.json")
expect(true, "flow-build-info.json is not on the classpath!") { res != null }
}

group("Vaadin env") {
beforeEach { MockVaadin.setup() }
afterEach { MockVaadin.tearDown() }

test("Vaadin version") {
expect(24) { VaadinVersion.get.major }
expect(false) { VaadinMeta.isCompatibilityMode }
}
}
allTests19(isModuleTest = false)
})

class AllTests24 {
class AllTests {
@Test fun `flow-build-info-json exists`() {
val res: URL? = Thread.currentThread().contextClassLoader.getResource("META-INF/VAADIN/config/flow-build-info.json")
expect(true, "flow-build-info.json is not on the classpath!") { res != null }
Expand Down

0 comments on commit 0b69033

Please sign in to comment.