[java] naming conventions: update default test name pattern (IDEA-279616)

GitOrigin-RevId: 55c6d0aede394c091693c6b0acec8852498b4581
This commit is contained in:
Anna Kozlova
2022-02-18 10:43:28 +00:00
committed by intellij-monorepo-bot
parent 29e78b0f80
commit 0010825b50
3 changed files with 9 additions and 4 deletions
@@ -34,7 +34,7 @@ public class TestClassNamingConvention extends NamingConvention<PsiClass> {
@Override
public NamingConventionBean createDefaultBean() {
return new NamingConventionBean("[A-Z][A-Za-z\\d]*Test(s|Case)?|Test[A-Z][A-Za-z\\d]*", DEFAULT_MIN_LENGTH, DEFAULT_MAX_LENGTH);
return new NamingConventionBean("[A-Z][A-Za-z\\d]*Test(s|Case)?|Test[A-Z][A-Za-z\\d]*|IT(.*)|(.*)IT(Case)?", DEFAULT_MIN_LENGTH, DEFAULT_MAX_LENGTH);
}
@Override
@@ -2,7 +2,7 @@ package com.siyeh.igtest.naming.abstract_class_naming_convention;
import org.junit.jupiter.api.*;
class <warning descr="Test name 'WithNested' doesn't match regex '[A-Z][A-Za-z\d]*Test(s|Case)?|Test[A-Z][A-Za-z\d]*'">WithNested</warning> {
class <warning descr="Test name 'WithNested' doesn't match regex '[A-Z][A-Za-z\d]*Test(s|Case)?|Test[A-Z][A-Za-z\d]*|IT(.*)|(.*)IT(Case)?'">WithNested</warning> {
@Nested
class WithParent {
@Test
@@ -10,7 +10,12 @@ class <warning descr="Test name 'WithNested' doesn't match regex '[A-Z][A-Za-z\d
}
}
class <warning descr="Test name 'Normal' doesn't match regex '[A-Z][A-Za-z\d]*Test(s|Case)?|Test[A-Z][A-Za-z\d]*'">Normal</warning> {
class <warning descr="Test name 'Normal' doesn't match regex '[A-Z][A-Za-z\d]*Test(s|Case)?|Test[A-Z][A-Za-z\d]*|IT(.*)|(.*)IT(Case)?'">Normal</warning> {
@Test
public void test1() {}
}
class NormalIT {
@Test
public void test1() {}
}
@@ -3,7 +3,7 @@ import junit.framework.TestCase
class SpecialGoodTest extends TestCase {
class MyVeryInner extends SpecialGoodTest {}
}
class <warning descr="Test name 'SpecialBad' doesn't match regex '[A-Z][A-Za-z\d]*Test(s|Case)?|Test[A-Z][A-Za-z\d]*'">SpecialBad</warning> extends TestCase { }
class <warning descr="Test name 'SpecialBad' doesn't match regex '[A-Z][A-Za-z\d]*Test(s|Case)?|Test[A-Z][A-Za-z\d]*|IT(.*)|(.*)IT(Case)?'">SpecialBad</warning> extends TestCase { }
class TestInTheBeginning extends TestCase { }
class WithTests extends TestCase { }
class WithTestCase extends TestCase { }