Browse Source

Move `TestCompiler` and related classes to `core.test.tools` package

Closes gh-29175
pull/29184/head
Phillip Webb 2 years ago
parent
commit
52bffbff76
  1. 4
      spring-aop/src/test/java/org/springframework/aop/scope/ScopedProxyBeanRegistrationAotProcessorTests.java
  2. 6
      spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanRegistrationAotContributionTests.java
  3. 8
      spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanDefinitionMethodGeneratorTests.java
  4. 4
      spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanDefinitionPropertiesCodeGeneratorTests.java
  5. 4
      spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanDefinitionPropertyValueCodeGeneratorTests.java
  6. 6
      spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanRegistrationsAotContributionTests.java
  7. 4
      spring-beans/src/test/java/org/springframework/beans/factory/aot/InstanceSupplierCodeGeneratorTests.java
  8. 4
      spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorAotContributionTests.java
  9. 4
      spring-context/src/test/java/org/springframework/context/aot/ApplicationContextAotGeneratorTests.java
  10. 2
      spring-context/src/test/java/org/springframework/context/generator/ApplicationContextAotGeneratorRuntimeHintsTests.java
  11. 9
      spring-core-test/src/main/java/org/springframework/aot/test/generate/file/package-info.java
  12. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/ClassFile.java
  13. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/ClassFiles.java
  14. 7
      spring-core-test/src/main/java/org/springframework/core/test/tools/CompilationException.java
  15. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/CompileWithForkedClassLoader.java
  16. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/CompileWithForkedClassLoaderClassLoader.java
  17. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/CompileWithForkedClassLoaderExtension.java
  18. 6
      spring-core-test/src/main/java/org/springframework/core/test/tools/Compiled.java
  19. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicClassFileObject.java
  20. 6
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicClassLoader.java
  21. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFile.java
  22. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFileAssert.java
  23. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFiles.java
  24. 6
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicJavaFileManager.java
  25. 4
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicJavaFileObject.java
  26. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicResourceFileObject.java
  27. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFile.java
  28. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFileAssert.java
  29. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFiles.java
  30. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFile.java
  31. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFileAssert.java
  32. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFiles.java
  33. 9
      spring-core-test/src/main/java/org/springframework/core/test/tools/TestCompiler.java
  34. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/WritableContent.java
  35. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/package-info.java
  36. 2
      spring-core-test/src/test/java/org/springframework/core/test/tools/ClassFileTests.java
  37. 2
      spring-core-test/src/test/java/org/springframework/core/test/tools/ClassFilesTests.java
  38. 6
      spring-core-test/src/test/java/org/springframework/core/test/tools/CompilationExceptionTests.java
  39. 7
      spring-core-test/src/test/java/org/springframework/core/test/tools/CompiledTests.java
  40. 2
      spring-core-test/src/test/java/org/springframework/core/test/tools/DynamicClassFileObjectTests.java
  41. 6
      spring-core-test/src/test/java/org/springframework/core/test/tools/DynamicJavaFileManagerTests.java
  42. 4
      spring-core-test/src/test/java/org/springframework/core/test/tools/DynamicJavaFileObjectTests.java
  43. 2
      spring-core-test/src/test/java/org/springframework/core/test/tools/DynamicResourceFileObjectTests.java
  44. 2
      spring-core-test/src/test/java/org/springframework/core/test/tools/ResourceFileTests.java
  45. 2
      spring-core-test/src/test/java/org/springframework/core/test/tools/ResourceFilesTests.java
  46. 2
      spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFileAssertTests.java
  47. 10
      spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFileTests.java
  48. 2
      spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFilesTests.java
  49. 8
      spring-core-test/src/test/java/org/springframework/core/test/tools/TestCompilerTests.java
  50. 4
      spring-orm/src/test/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesBeanRegistrationAotProcessorTests.java
  51. 4
      spring-orm/src/test/java/org/springframework/orm/jpa/support/InjectionCodeGeneratorTests.java
  52. 6
      spring-orm/src/test/java/org/springframework/orm/jpa/support/PersistenceAnnotationBeanPostProcessorAotContributionTests.java
  53. 4
      spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java
  54. 4
      spring-test/src/test/java/org/springframework/test/context/aot/TestContextAotGeneratorTests.java

4
spring-aop/src/test/java/org/springframework/aop/scope/ScopedProxyBeanRegistrationAotProcessorTests.java

@ -28,8 +28,6 @@ import org.springframework.aop.framework.AopInfrastructureBean; @@ -28,8 +28,6 @@ import org.springframework.aop.framework.AopInfrastructureBean;
import org.springframework.aot.generate.MethodReference;
import org.springframework.aot.generate.MethodReference.ArgumentCodeGenerator;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.aot.AotServices;
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
@ -43,6 +41,8 @@ import org.springframework.beans.factory.support.RootBeanDefinition; @@ -43,6 +41,8 @@ import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.testfixture.beans.factory.aot.MockBeanFactoryInitializationCode;
import org.springframework.beans.testfixture.beans.factory.generator.factory.NumberHolder;
import org.springframework.core.ResolvableType;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.MethodSpec;
import org.springframework.javapoet.ParameterizedTypeName;

6
spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanRegistrationAotContributionTests.java

@ -27,9 +27,6 @@ import org.springframework.aot.generate.MethodReference; @@ -27,9 +27,6 @@ import org.springframework.aot.generate.MethodReference;
import org.springframework.aot.generate.MethodReference.ArgumentCodeGenerator;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.CompileWithForkedClassLoader;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RegisteredBean;
@ -37,6 +34,9 @@ import org.springframework.beans.factory.support.RootBeanDefinition; @@ -37,6 +34,9 @@ import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.testfixture.beans.factory.aot.MockBeanRegistrationCode;
import org.springframework.core.env.Environment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.test.tools.CompileWithForkedClassLoader;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.MethodSpec;
import org.springframework.javapoet.ParameterizedTypeName;

8
spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanDefinitionMethodGeneratorTests.java

@ -32,10 +32,6 @@ import org.springframework.aot.generate.GenerationContext; @@ -32,10 +32,6 @@ import org.springframework.aot.generate.GenerationContext;
import org.springframework.aot.generate.MethodReference;
import org.springframework.aot.generate.MethodReference.ArgumentCodeGenerator;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.CompileWithForkedClassLoader;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.aot.test.generate.file.SourceFile;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@ -49,6 +45,10 @@ import org.springframework.beans.testfixture.beans.TestBean; @@ -49,6 +45,10 @@ import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.beans.testfixture.beans.factory.aot.MockBeanRegistrationsCode;
import org.springframework.core.ResolvableType;
import org.springframework.core.mock.MockSpringFactoriesLoader;
import org.springframework.core.test.tools.CompileWithForkedClassLoader;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.SourceFile;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.MethodSpec;
import org.springframework.javapoet.ParameterizedTypeName;

4
spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanDefinitionPropertiesCodeGeneratorTests.java

@ -30,8 +30,6 @@ import org.junit.jupiter.api.Test; @@ -30,8 +30,6 @@ import org.junit.jupiter.api.Test;
import org.springframework.aot.generate.GeneratedClass;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanReference;
@ -44,6 +42,8 @@ import org.springframework.beans.factory.support.ManagedMap; @@ -44,6 +42,8 @@ import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.support.ManagedSet;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.testfixture.beans.factory.aot.DeferredTypeBuilder;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.MethodSpec;
import org.springframework.javapoet.ParameterizedTypeName;

4
spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanDefinitionPropertyValueCodeGeneratorTests.java

@ -35,8 +35,6 @@ import org.junit.jupiter.api.Test; @@ -35,8 +35,6 @@ import org.junit.jupiter.api.Test;
import org.springframework.aot.generate.GeneratedClass;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.factory.config.BeanReference;
import org.springframework.beans.factory.config.RuntimeBeanNameReference;
import org.springframework.beans.factory.config.RuntimeBeanReference;
@ -45,6 +43,8 @@ import org.springframework.beans.factory.support.ManagedMap; @@ -45,6 +43,8 @@ import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.support.ManagedSet;
import org.springframework.beans.testfixture.beans.factory.aot.DeferredTypeBuilder;
import org.springframework.core.ResolvableType;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.MethodSpec;
import org.springframework.javapoet.ParameterizedTypeName;

6
spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanRegistrationsAotContributionTests.java

@ -34,15 +34,15 @@ import org.springframework.aot.generate.MethodReference; @@ -34,15 +34,15 @@ import org.springframework.aot.generate.MethodReference;
import org.springframework.aot.generate.MethodReference.ArgumentCodeGenerator;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.TestTarget;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.aot.test.generate.file.SourceFile;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RegisteredBean;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.beans.testfixture.beans.factory.aot.MockBeanFactoryInitializationCode;
import org.springframework.core.mock.MockSpringFactoriesLoader;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.SourceFile;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.MethodSpec;
import org.springframework.javapoet.ParameterizedTypeName;

4
spring-beans/src/test/java/org/springframework/beans/factory/aot/InstanceSupplierCodeGeneratorTests.java

@ -31,8 +31,6 @@ import org.springframework.aot.hint.ExecutableMode; @@ -31,8 +31,6 @@ import org.springframework.aot.hint.ExecutableMode;
import org.springframework.aot.hint.ReflectionHints;
import org.springframework.aot.hint.TypeHint;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@ -51,6 +49,8 @@ import org.springframework.beans.testfixture.beans.factory.generator.factory.Num @@ -51,6 +49,8 @@ import org.springframework.beans.testfixture.beans.factory.generator.factory.Num
import org.springframework.beans.testfixture.beans.factory.generator.factory.SampleFactory;
import org.springframework.beans.testfixture.beans.factory.generator.injection.InjectionComponent;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.MethodSpec;
import org.springframework.javapoet.ParameterizedTypeName;

4
spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorAotContributionTests.java

@ -31,8 +31,6 @@ import org.springframework.aot.generate.MethodReference; @@ -31,8 +31,6 @@ import org.springframework.aot.generate.MethodReference;
import org.springframework.aot.generate.MethodReference.ArgumentCodeGenerator;
import org.springframework.aot.hint.ResourcePatternHint;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
@ -49,6 +47,8 @@ import org.springframework.context.testfixture.context.generator.annotation.Impo @@ -49,6 +47,8 @@ import org.springframework.context.testfixture.context.generator.annotation.Impo
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.MethodSpec;

4
spring-context/src/test/java/org/springframework/context/aot/ApplicationContextAotGeneratorTests.java

@ -32,8 +32,6 @@ import org.springframework.aot.hint.RuntimeHints; @@ -32,8 +32,6 @@ import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.TypeReference;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
@ -66,6 +64,8 @@ import org.springframework.core.env.ConfigurableEnvironment; @@ -66,6 +64,8 @@ import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import static org.assertj.core.api.Assertions.assertThat;

2
spring-context/src/test/java/org/springframework/context/generator/ApplicationContextAotGeneratorRuntimeHintsTests.java

@ -25,7 +25,6 @@ import org.springframework.aot.test.agent.EnabledIfRuntimeHintsAgent; @@ -25,7 +25,6 @@ import org.springframework.aot.test.agent.EnabledIfRuntimeHintsAgent;
import org.springframework.aot.test.agent.RuntimeHintsInvocations;
import org.springframework.aot.test.agent.RuntimeHintsRecorder;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.ApplicationContextInitializer;
@ -35,6 +34,7 @@ import org.springframework.context.support.GenericApplicationContext; @@ -35,6 +34,7 @@ import org.springframework.context.support.GenericApplicationContext;
import org.springframework.context.testfixture.context.generator.SimpleComponent;
import org.springframework.context.testfixture.context.generator.annotation.AutowiredComponent;
import org.springframework.context.testfixture.context.generator.annotation.InitDestroyComponent;
import org.springframework.core.test.tools.TestCompiler;
import static org.assertj.core.api.Assertions.assertThat;

9
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/package-info.java

@ -1,9 +0,0 @@ @@ -1,9 +0,0 @@
/**
* Support classes for running assertions on generated files.
*/
@NonNullApi
@NonNullFields
package org.springframework.aot.test.generate.file;
import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/ClassFile.java → spring-core-test/src/main/java/org/springframework/core/test/tools/ClassFile.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.io.IOException;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/ClassFiles.java → spring-core-test/src/main/java/org/springframework/core/test/tools/ClassFiles.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.util.Arrays;
import java.util.Collections;

7
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/CompilationException.java → spring-core-test/src/main/java/org/springframework/core/test/tools/CompilationException.java

@ -14,12 +14,7 @@ @@ -14,12 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
import org.springframework.aot.test.generate.file.ResourceFile;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.aot.test.generate.file.SourceFile;
import org.springframework.aot.test.generate.file.SourceFiles;
package org.springframework.core.test.tools;
/**
* Exception thrown when code cannot compile.

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/CompileWithForkedClassLoader.java → spring-core-test/src/main/java/org/springframework/core/test/tools/CompileWithForkedClassLoader.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/CompileWithForkedClassLoaderClassLoader.java → spring-core-test/src/main/java/org/springframework/core/test/tools/CompileWithForkedClassLoaderClassLoader.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.IOException;
import java.io.InputStream;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/CompileWithForkedClassLoaderExtension.java → spring-core-test/src/main/java/org/springframework/core/test/tools/CompileWithForkedClassLoaderExtension.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.lang.reflect.Method;

6
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/Compiled.java → spring-core-test/src/main/java/org/springframework/core/test/tools/Compiled.java

@ -14,17 +14,13 @@ @@ -14,17 +14,13 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.springframework.aot.test.generate.file.ResourceFile;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.aot.test.generate.file.SourceFile;
import org.springframework.aot.test.generate.file.SourceFiles;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/DynamicClassFileObject.java → spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicClassFileObject.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

6
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/DynamicClassLoader.java → spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicClassLoader.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@ -29,10 +29,6 @@ import java.util.Map; @@ -29,10 +29,6 @@ import java.util.Map;
import java.util.function.Function;
import java.util.function.Supplier;
import org.springframework.aot.test.generate.file.ClassFile;
import org.springframework.aot.test.generate.file.ClassFiles;
import org.springframework.aot.test.generate.file.ResourceFile;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.lang.Nullable;
import org.springframework.util.ReflectionUtils;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/DynamicFile.java → spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFile.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/DynamicFileAssert.java → spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFileAssert.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import org.assertj.core.api.AbstractAssert;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/DynamicFiles.java → spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFiles.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.util.Arrays;
import java.util.Collections;

6
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/DynamicJavaFileManager.java → spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicJavaFileManager.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.IOException;
import java.util.ArrayList;
@ -30,10 +30,6 @@ import javax.tools.JavaFileManager; @@ -30,10 +30,6 @@ import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import javax.tools.JavaFileObject.Kind;
import org.springframework.aot.test.generate.file.ClassFile;
import org.springframework.aot.test.generate.file.ClassFiles;
import org.springframework.aot.test.generate.file.ResourceFile;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.util.ClassUtils;
/**

4
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/DynamicJavaFileObject.java → spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicJavaFileObject.java

@ -14,15 +14,13 @@ @@ -14,15 +14,13 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.net.URI;
import javax.tools.JavaFileObject;
import javax.tools.SimpleJavaFileObject;
import org.springframework.aot.test.generate.file.SourceFile;
/**
* Adapts a {@link SourceFile} instance to a {@link JavaFileObject}.
*

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/DynamicResourceFileObject.java → spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicResourceFileObject.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/ResourceFile.java → spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFile.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/ResourceFileAssert.java → spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFileAssert.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
/**
* Assertion methods for {@code ResourceFile} instances.

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/ResourceFiles.java → spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFiles.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.util.Iterator;
import java.util.stream.Stream;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/SourceFile.java → spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFile.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.io.File;
import java.io.FileInputStream;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/SourceFileAssert.java → spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFileAssert.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
/**
* Assertion methods for {@code SourceFile} instances.

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/SourceFiles.java → spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFiles.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.util.Iterator;
import java.util.Objects;

9
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/TestCompiler.java → spring-core-test/src/main/java/org/springframework/core/test/tools/TestCompiler.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.PrintStream;
import java.util.ArrayList;
@ -35,13 +35,6 @@ import javax.tools.ToolProvider; @@ -35,13 +35,6 @@ import javax.tools.ToolProvider;
import org.springframework.aot.generate.GeneratedFiles.Kind;
import org.springframework.aot.generate.InMemoryGeneratedFiles;
import org.springframework.aot.test.generate.file.ClassFile;
import org.springframework.aot.test.generate.file.ClassFiles;
import org.springframework.aot.test.generate.file.ResourceFile;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.aot.test.generate.file.SourceFile;
import org.springframework.aot.test.generate.file.SourceFiles;
import org.springframework.aot.test.generate.file.WritableContent;
import org.springframework.lang.Nullable;
/**

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/file/WritableContent.java → spring-core-test/src/main/java/org/springframework/core/test/tools/WritableContent.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.io.IOException;

2
spring-core-test/src/main/java/org/springframework/aot/test/generate/compile/package-info.java → spring-core-test/src/main/java/org/springframework/core/test/tools/package-info.java

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
*/
@NonNullApi
@NonNullFields
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;

2
spring-core-test/src/test/java/org/springframework/aot/test/generate/file/ClassFileTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/ClassFileTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import org.junit.jupiter.api.Test;

2
spring-core-test/src/test/java/org/springframework/aot/test/generate/file/ClassFilesTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/ClassFilesTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.util.Iterator;

6
spring-core-test/src/test/java/org/springframework/aot/test/generate/compile/CompilationExceptionTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/CompilationExceptionTests.java

@ -14,16 +14,12 @@ @@ -14,16 +14,12 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import org.junit.jupiter.api.Test;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.aot.test.generate.file.SourceFiles;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link CompilationException}.
*

7
spring-core-test/src/test/java/org/springframework/aot/test/generate/compile/CompiledTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/CompiledTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.util.List;
import java.util.concurrent.Callable;
@ -22,11 +22,6 @@ import java.util.function.Supplier; @@ -22,11 +22,6 @@ import java.util.function.Supplier;
import org.junit.jupiter.api.Test;
import org.springframework.aot.test.generate.file.ResourceFile;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.aot.test.generate.file.SourceFile;
import org.springframework.aot.test.generate.file.SourceFiles;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;

2
spring-core-test/src/test/java/org/springframework/aot/test/generate/compile/DynamicClassFileObjectTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/DynamicClassFileObjectTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.ByteArrayInputStream;
import java.io.OutputStream;

6
spring-core-test/src/test/java/org/springframework/aot/test/generate/compile/DynamicJavaFileManagerTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/DynamicJavaFileManagerTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.IOException;
import java.io.OutputStream;
@ -31,10 +31,6 @@ import org.junit.jupiter.api.Test; @@ -31,10 +31,6 @@ import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.aot.test.generate.file.ClassFile;
import org.springframework.aot.test.generate.file.ClassFiles;
import org.springframework.aot.test.generate.file.ResourceFile;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.util.StreamUtils;
import static org.assertj.core.api.Assertions.assertThat;

4
spring-core-test/src/test/java/org/springframework/aot/test/generate/compile/DynamicJavaFileObjectTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/DynamicJavaFileObjectTests.java

@ -14,12 +14,10 @@ @@ -14,12 +14,10 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import org.junit.jupiter.api.Test;
import org.springframework.aot.test.generate.file.SourceFile;
import static org.assertj.core.api.Assertions.assertThat;
/**

2
spring-core-test/src/test/java/org/springframework/aot/test/generate/compile/DynamicResourceFileObjectTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/DynamicResourceFileObjectTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.io.ByteArrayInputStream;
import java.io.InputStream;

2
spring-core-test/src/test/java/org/springframework/aot/test/generate/file/ResourceFileTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/ResourceFileTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import org.junit.jupiter.api.Test;

2
spring-core-test/src/test/java/org/springframework/aot/test/generate/file/ResourceFilesTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/ResourceFilesTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.util.Iterator;

2
spring-core-test/src/test/java/org/springframework/aot/test/generate/file/SourceFileAssertTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFileAssertTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import org.junit.jupiter.api.Test;

10
spring-core-test/src/test/java/org/springframework/aot/test/generate/file/SourceFileTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFileTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.io.File;
import java.io.IOException;
@ -88,15 +88,15 @@ class SourceFileTests { @@ -88,15 +88,15 @@ class SourceFileTests {
@Test
void forClassWithClassUsesClass() {
SourceFile sourceFile = SourceFile.forClass(new File("src/test/java"), SourceFileTests.class);
assertThat(sourceFile.getPath()).isEqualTo("org/springframework/aot/test/generate/file/SourceFileTests.java");
assertThat(sourceFile.getClassName()).isEqualTo("org.springframework.aot.test.generate.file.SourceFileTests");
assertThat(sourceFile.getPath()).isEqualTo("org/springframework/core/test/tools/SourceFileTests.java");
assertThat(sourceFile.getClassName()).isEqualTo("org.springframework.core.test.tools.SourceFileTests");
}
@Test
void forTestClassWithClassUsesClass() {
SourceFile sourceFile = SourceFile.forTestClass(SourceFileTests.class);
assertThat(sourceFile.getPath()).isEqualTo("org/springframework/aot/test/generate/file/SourceFileTests.java");
assertThat(sourceFile.getClassName()).isEqualTo("org.springframework.aot.test.generate.file.SourceFileTests");
assertThat(sourceFile.getPath()).isEqualTo("org/springframework/core/test/tools/SourceFileTests.java");
assertThat(sourceFile.getClassName()).isEqualTo("org.springframework.core.test.tools.SourceFileTests");
}
@Test

2
spring-core-test/src/test/java/org/springframework/aot/test/generate/file/SourceFilesTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/SourceFilesTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.file;
package org.springframework.core.test.tools;
import java.util.Iterator;

8
spring-core-test/src/test/java/org/springframework/aot/test/generate/compile/TestCompilerTests.java → spring-core-test/src/test/java/org/springframework/core/test/tools/TestCompilerTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.aot.test.generate.compile;
package org.springframework.core.test.tools;
import java.util.ArrayList;
import java.util.List;
@ -30,12 +30,6 @@ import javax.lang.model.element.TypeElement; @@ -30,12 +30,6 @@ import javax.lang.model.element.TypeElement;
import com.example.PublicInterface;
import org.junit.jupiter.api.Test;
import org.springframework.aot.test.generate.file.ClassFile;
import org.springframework.aot.test.generate.file.ResourceFile;
import org.springframework.aot.test.generate.file.ResourceFiles;
import org.springframework.aot.test.generate.file.SourceFile;
import org.springframework.aot.test.generate.file.SourceFiles;
import org.springframework.aot.test.generate.file.WritableContent;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.ClassUtils;

4
spring-orm/src/test/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesBeanRegistrationAotProcessorTests.java

@ -27,8 +27,6 @@ import org.springframework.aot.hint.MemberCategory; @@ -27,8 +27,6 @@ import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
@ -36,6 +34,8 @@ import org.springframework.context.annotation.Configuration; @@ -36,6 +34,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.aot.ApplicationContextAotGenerator;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.domain.DriversLicense;

4
spring-orm/src/test/java/org/springframework/orm/jpa/support/InjectionCodeGeneratorTests.java

@ -27,11 +27,11 @@ import org.junit.jupiter.api.Test; @@ -27,11 +27,11 @@ import org.junit.jupiter.api.Test;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.beans.testfixture.beans.TestBeanWithPrivateMethod;
import org.springframework.beans.testfixture.beans.TestBeanWithPublicField;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.JavaFile;
import org.springframework.javapoet.MethodSpec;

6
spring-orm/src/test/java/org/springframework/orm/jpa/support/PersistenceAnnotationBeanPostProcessorAotContributionTests.java

@ -34,14 +34,14 @@ import org.junit.jupiter.api.Test; @@ -34,14 +34,14 @@ import org.junit.jupiter.api.Test;
import org.springframework.aot.hint.TypeReference;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.aot.test.generate.compile.CompileWithForkedClassLoader;
import org.springframework.aot.test.generate.compile.Compiled;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.beans.factory.aot.BeanRegistrationAotContribution;
import org.springframework.beans.factory.aot.BeanRegistrationCode;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RegisteredBean;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.test.tools.CompileWithForkedClassLoader;
import org.springframework.core.test.tools.Compiled;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.util.ReflectionUtils;
import static org.assertj.core.api.Assertions.assertThat;

4
spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java

@ -37,8 +37,8 @@ import org.opentest4j.MultipleFailuresError; @@ -37,8 +37,8 @@ import org.opentest4j.MultipleFailuresError;
import org.springframework.aot.AotDetector;
import org.springframework.aot.generate.GeneratedFiles.Kind;
import org.springframework.aot.generate.InMemoryGeneratedFiles;
import org.springframework.aot.test.generate.compile.CompileWithForkedClassLoader;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.core.test.tools.CompileWithForkedClassLoader;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.test.context.aot.samples.basic.BasicSpringJupiterSharedConfigTests;
import org.springframework.test.context.aot.samples.basic.BasicSpringJupiterTests;
import org.springframework.test.context.aot.samples.basic.BasicSpringTestNGTests;

4
spring-test/src/test/java/org/springframework/test/context/aot/TestContextAotGeneratorTests.java

@ -33,12 +33,12 @@ import org.springframework.aot.generate.InMemoryGeneratedFiles; @@ -33,12 +33,12 @@ import org.springframework.aot.generate.InMemoryGeneratedFiles;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.TypeReference;
import org.springframework.aot.test.generate.compile.CompileWithForkedClassLoader;
import org.springframework.aot.test.generate.compile.TestCompiler;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Profiles;
import org.springframework.core.test.tools.CompileWithForkedClassLoader;
import org.springframework.core.test.tools.TestCompiler;
import org.springframework.javapoet.ClassName;
import org.springframework.test.context.BootstrapUtils;
import org.springframework.test.context.MergedContextConfiguration;

Loading…
Cancel
Save