diff --git a/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/DisabledJUnit5ClassTest.kt b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/DisabledJUnit5ClassTest.kt new file mode 100644 index 000000000000..9b3dbdc7b055 --- /dev/null +++ b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/DisabledJUnit5ClassTest.kt @@ -0,0 +1,21 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.testFramework.extensions.ignore + +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + + +/** + * Tests to ensure [Disabled] annotation works for JUnit 5 test class. + */ +@Disabled("IJI-1434") +class DisabledJUnit5ClassTest { + /** + * A test which should never be executed. + * If executed, the test will immediately fail. + */ + @Test + fun testShouldNotBeExecuted() { + error("Test should not be executed") + } +} diff --git a/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/DisabledJUnit5MethodTest.kt b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/DisabledJUnit5MethodTest.kt new file mode 100644 index 000000000000..85adeb389157 --- /dev/null +++ b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/DisabledJUnit5MethodTest.kt @@ -0,0 +1,26 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.testFramework.extensions.ignore + +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + + +/** + * Tests to ensure [Disabled] annotation works for JUnit 5 methods. + */ +class DisabledJUnit5MethodTest { + @Test + fun testShouldBeExecuted() { + + } + + /** + * A test which should never be executed. + * If executed, the test will immediately fail. + */ + @Disabled("IJI-1434") + @Test + fun testShouldNotBeExecuted() { + error("Test should not be executed") + } +} diff --git a/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit3ClassTest.kt b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit3ClassTest.kt new file mode 100644 index 000000000000..65d7853cb7e0 --- /dev/null +++ b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit3ClassTest.kt @@ -0,0 +1,23 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.testFramework.extensions.ignore + +import com.intellij.idea.IgnoreJUnit3 +import com.intellij.testFramework.UsefulTestCase.IS_UNDER_TEAMCITY +import junit.framework.TestCase + + +/** + * Tests to ensure [IgnoreJUnit3] annotation works for JUnit 3 test class. + */ +@IgnoreJUnit3(reason = "IJI-1434") +class IgnoreJUnit3ClassTest : TestCase() { + /** + * A test which should never be executed under TeamCity. + * If executed, the test will immediately fail. + */ + fun testShouldNotBeExecuted() { + if (IS_UNDER_TEAMCITY) { + error("Test should not be executed under TeamCity") + } + } +} diff --git a/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit3MethodTest.kt b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit3MethodTest.kt new file mode 100644 index 000000000000..baf1b1cb2710 --- /dev/null +++ b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit3MethodTest.kt @@ -0,0 +1,27 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.testFramework.extensions.ignore + +import com.intellij.idea.IgnoreJUnit3 +import com.intellij.testFramework.UsefulTestCase.IS_UNDER_TEAMCITY +import junit.framework.TestCase + + +/** + * Tests to ensure [IgnoreJUnit3] annotation works for JUnit 3 methods. + */ +class IgnoreJUnit3MethodTest : TestCase() { + fun testShouldBeExecuted() { + + } + + /** + * A test which should never be executed under TeamCity. + * If executed, the test will immediately fail. + */ + @IgnoreJUnit3(reason = "IJI-1434") + fun testShouldNotBeExecuted() { + if (IS_UNDER_TEAMCITY) { + error("Test should not be executed under TeamCity") + } + } +} diff --git a/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit4ClassTest.kt b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit4ClassTest.kt new file mode 100644 index 000000000000..739afbb9d2ac --- /dev/null +++ b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit4ClassTest.kt @@ -0,0 +1,24 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.testFramework.extensions.ignore + +import com.intellij.testFramework.UsefulTestCase.IS_UNDER_TEAMCITY +import org.junit.Ignore +import org.junit.Test + + +/** + * Tests to ensure [Ignore] annotation works for JUnit 4 test class. + */ +@Ignore(value = "IJI-1434") +class IgnoreJUnit4ClassTest { + /** + * A test which should never be executed under TeamCity. + * If executed, the test will immediately fail. + */ + @Test + fun testShouldNotBeExecuted() { + if (IS_UNDER_TEAMCITY) { + error("Test should not be executed under TeamCity") + } + } +} diff --git a/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit4MethodTest.kt b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit4MethodTest.kt new file mode 100644 index 000000000000..5575a6132ed1 --- /dev/null +++ b/platform/testFramework/testSrc/com/intellij/testFramework/extensions/ignore/IgnoreJUnit4MethodTest.kt @@ -0,0 +1,29 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.testFramework.extensions.ignore + +import com.intellij.testFramework.UsefulTestCase.IS_UNDER_TEAMCITY +import org.junit.Ignore +import org.junit.Test + + +/** + * Tests to ensure [Ignore] annotation works for JUnit 4 methods. + */ +class IgnoreJUnit4MethodTest { + @Test + fun testShouldBeExecuted() { + + } + + /** + * A test which should never be executed under TeamCity. + * If executed, the test will immediately fail. + */ + @Ignore(value = "IJI-1434") + @Test + fun testShouldNotBeExecuted() { + if (IS_UNDER_TEAMCITY) { + error("Test should not be executed under TeamCity") + } + } +}