Browse Source
This commit moves the test implementation for GenerationContext in spring-core-test. This also removes the copy we had in testfixtures See gh-28877pull/29085/head
24 changed files with 42 additions and 90 deletions
@ -1,56 +0,0 @@ |
|||||||
/* |
|
||||||
* Copyright 2002-2022 the original author or authors. |
|
||||||
* |
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
||||||
* you may not use this file except in compliance with the License. |
|
||||||
* You may obtain a copy of the License at |
|
||||||
* |
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, software |
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, |
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
||||||
* See the License for the specific language governing permissions and |
|
||||||
* limitations under the License. |
|
||||||
*/ |
|
||||||
|
|
||||||
package org.springframework.core.testfixture.aot.generate; |
|
||||||
|
|
||||||
import org.springframework.aot.generate.ClassNameGenerator; |
|
||||||
import org.springframework.aot.generate.DefaultGenerationContext; |
|
||||||
import org.springframework.aot.generate.GenerationContext; |
|
||||||
import org.springframework.aot.generate.InMemoryGeneratedFiles; |
|
||||||
|
|
||||||
/** |
|
||||||
* {@link GenerationContext} test implementation that uses |
|
||||||
* {@link InMemoryGeneratedFiles} and provides a convenient |
|
||||||
* {@link TestTarget} by default. |
|
||||||
* |
|
||||||
* @author Stephane Nicoll |
|
||||||
* @author Sam Brannen |
|
||||||
* @since 6.0 |
|
||||||
*/ |
|
||||||
public class TestGenerationContext extends DefaultGenerationContext { |
|
||||||
|
|
||||||
/** |
|
||||||
* Create an instance using {@link TestTarget} as the default target class. |
|
||||||
*/ |
|
||||||
public TestGenerationContext() { |
|
||||||
this(new ClassNameGenerator(TestTarget.class)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Create an instance using the specified {@link ClassNameGenerator}. |
|
||||||
* @param classNameGenerator the class name generator to use |
|
||||||
*/ |
|
||||||
public TestGenerationContext(ClassNameGenerator classNameGenerator) { |
|
||||||
super(classNameGenerator, new InMemoryGeneratedFiles()); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
@Override |
|
||||||
public InMemoryGeneratedFiles getGeneratedFiles() { |
|
||||||
return (InMemoryGeneratedFiles) super.getGeneratedFiles(); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
Loading…
Reference in new issue