From 8b335e793c088769893bc5a7a7b84e19e5e725b0 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 14 Oct 2023 12:41:01 +0200 Subject: [PATCH] Revise endToEndTestsForEntireSpringTestModule() --- .../test/context/aot/AotIntegrationTests.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java b/spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java index 18d87c1d7eb..20588698e2b 100644 --- a/spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java @@ -113,16 +113,21 @@ class AotIntegrationTests extends AbstractAotTests { @Test void endToEndTestsForEntireSpringTestModule() { // AOT BUILD-TIME: CLASSPATH SCANNING - List> testClasses = - // FYI: you can limit execution to a particular set of test classes as follows. - // List.of(DirtiesContextTransactionalTestNGSpringContextTests.class, ...); - createTestClassScanner() + // + // 1) You can limit execution to a particular set of test classes. + // List> testClasses = List.of(DirtiesContextTransactionalTestNGSpringContextTests.class); + // + // 2) Or you can use the TestClassScanner to find test classes. + List> testClasses = createTestClassScanner() + // Scan all packages. .scan() - // FYI: you can limit execution to a particular package and its subpackages as follows. - // .scan("org.springframework.test.context.junit.jupiter") + // Or limit execution to a particular package and its subpackages. + // .scan("org.springframework.test.context.aot.samples.web") + // Only include test classes named *Tests so that we don't pick up + // internal TestCase classes that aren't really tests. + .filter(clazz -> clazz.getSimpleName().endsWith("Tests")) .toList(); - // AOT BUILD-TIME: PROCESSING InMemoryGeneratedFiles generatedFiles = new InMemoryGeneratedFiles(); TestContextAotGenerator generator = new TestContextAotGenerator(generatedFiles);