Skip to content

Commit

Permalink
fix(tests): make test naming more concise
Browse files Browse the repository at this point in the history
Signed-off-by: thelooter <[email protected]>
  • Loading branch information
thelooter committed Nov 19, 2024
1 parent 0bce453 commit aa59c0f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 61 deletions.
33 changes: 0 additions & 33 deletions .run/Test Plugin.run.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class JavaIconProvider : IconProvider() {
* @param psiElement The [PsiClass] to get the visibility icon for.
* @return The visibility icon based on the class's modifier, or null if not applicable.
*/
internal fun getVisibilityIcon(psiElement: PsiClass): Icon? =
private fun getVisibilityIcon(psiElement: PsiClass): Icon? =
when {
psiElement.hasModifierProperty(PsiModifier.PUBLIC) -> AllIcons.Nodes.Public
psiElement.hasModifierProperty(PsiModifier.PRIVATE) -> AllIcons.Nodes.Private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test

/**
* Test class for JavaIconProvider. This class tests various scenarios for icon provision for Java
* elements.
* Tests for [JavaIconProvider]. This tests that the correct icons are returned for Java classes in
* both the files and the structure views.
*/
@Tag("fast")
@Tag("javaIcons")
class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {

override fun getTestDataPath(): String = "src/test/testData"
Expand All @@ -38,7 +35,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a standard Java class")
@DisplayName("Icon for a standard Java class")
fun getIcon_javaClass() {
fixture.addFileToProject(
"SomeClass.java",
Expand All @@ -54,7 +51,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a Java interface")
@DisplayName("Icon for a Java interface")
fun getIcon_javaInterface() {
fixture.addFileToProject(
"SomeInterface.java",
Expand All @@ -70,7 +67,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a Java enum")
@DisplayName("Icon for a Java enum")
fun getIcon_javaEnum() {
fixture.addFileToProject(
"SomeEnum.java",
Expand All @@ -86,7 +83,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a Java annotation")
@DisplayName("Icon for a Java annotation")
fun getIcon_javaAnnotation() {
fixture.addFileToProject(
"SomeAnnotation.java",
Expand All @@ -102,7 +99,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a Java record")
@DisplayName("Icon for a Java record")
fun getIcon_javaRecord() {
fixture.addFileToProject(
"SomeRecord.java",
Expand All @@ -118,7 +115,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a Java exception class")
@DisplayName("Icon for a Java exception class")
fun getIcon_javaException() {
fixture.addFileToProject(
"SomeException.java",
Expand All @@ -134,7 +131,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a Java sealed class")
@DisplayName("Icon for a Java sealed class")
fun getIcon_javaSealedClass() {
fixture.addFileToProject(
"SomeSealedClass.java",
Expand All @@ -150,7 +147,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a Java final class")
@DisplayName("Icon for a Java final class")
fun getIcon_javaFinalClass() {
fixture.addFileToProject(
"SomeFinalClass.java",
Expand All @@ -166,7 +163,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test icon provision for a Java abstract class")
@DisplayName("Icon for a Java abstract class")
fun getIcon_javaAbstractClass() {
fixture.addFileToProject(
"SomeAbstractClass.java",
Expand All @@ -182,7 +179,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test that a static class icon includes a static mark")
@DisplayName("Static class icon includes a static mark")
fun getIcon_staticClass_hasStaticMark() {
fixture.addFileToProject(
"StaticClass.java",
Expand All @@ -203,7 +200,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test that a non-static class icon does not include a static mark")
@DisplayName("Non-static class icon does not include a static mark")
fun getIcon_nonStaticClass_hasNoStaticMark() {
fixture.addFileToProject(
"RegularClass.java",
Expand All @@ -220,7 +217,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test that requesting an icon for a non-PsiClass element returns null")
@DisplayName("Non-PsiClass element returns null")
fun getIcon_notPsiClass_returnsNull() {
fixture.addFileToProject(
"SomeClass.java",
Expand All @@ -238,7 +235,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test that requesting an icon for a non-Java file returns null")
@DisplayName("Non-Java file returns null")
fun getIcon_nonJavaFile_returnsNull() {
fixture.addFileToProject(
"SomeClass.kt",
Expand All @@ -254,7 +251,7 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test that when Java support is disabled, a generic Java icon is returned")
@DisplayName("When Java support disabled, a generic Java icon is returned")
fun getIcon_javaDisabled_returnsJavaIcon() {
fixture.addFileToProject(
"SomeClass.java",
Expand All @@ -273,8 +270,8 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test visibility icon for a public class")
fun getVisibilityIconForTesting_publicClass_returnsPublicIcon() {
@DisplayName("Visibility icon for a public class")
fun getIcon_publicClass_returnsPublicIcon() {
fixture.addFileToProject(
"PublicClass.java",
"""
Expand All @@ -291,8 +288,8 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test visibility icon for a private class")
fun getVisibilityIconForTesting_privateClass_returnsPrivateIcon() {
@DisplayName("Visibility icon for a private class")
fun getIcon_privateClass_returnsPrivateIcon() {
fixture.addFileToProject(
"OuterClass.java",
"""
Expand All @@ -311,8 +308,8 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test visibility icon for a protected class")
fun getVisibilityIconForTesting_protectedClass_returnsProtectedIcon() {
@DisplayName("Visibility icon for a protected class")
fun getIcon_protectedClass_returnsProtectedIcon() {
fixture.addFileToProject(
"OuterClass.java",
"""
Expand All @@ -333,8 +330,8 @@ class JavaIconProviderTest : LightJavaCodeInsightFixtureTestCase5() {
}

@Test
@DisplayName("Test visibility icon for a package-private class")
fun getVisibilityIconForTesting_packagePrivateClass_returnsPackageLocalIcon() {
@DisplayName("Visibility icon for a package-private class")
fun getIcon_packagePrivateClass_returnsPackageLocalIcon() {
fixture.addFileToProject(
"PackagePrivateClass.java",
"""
Expand Down

0 comments on commit aa59c0f

Please sign in to comment.