반응형

2021.05.12

 어제는 요가를 했더니 몸이 찌뿌둥하다. 특히나 어제 밤에는 등쪽 근육이 아파서 잠을 못잤다. 잠자다가 한번씩 깨게되었다. 첫날이라서 별로 심하게 하지도 않았는데 왜이러는지... 아파서 파스를 사와서 붙였더니 훨씬 나아졌다. 이제 좀더 조심조심 해야겠자.

 

반응형
반응형

모든 내용을 번역하기는 좀 시간이 부족해서 어노테이션 설명의 첫문단만 번역함.

원문.

docs.spring.io/spring-framework/docs/current/reference/html/testing.html#integration-testing

 

Testing

The classes in this example show the use of named hierarchy levels in order to merge the configuration for specific levels in a context hierarchy. BaseTests defines two levels in the hierarchy, parent and child. ExtendedTests extends BaseTests and instruct

docs.spring.io

 

3.4.1. Spring Testing Annotations

The Spring Framework provides the following set of Spring-specific annotations that you can use in your unit and integration tests in conjunction with the TestContext framework. See the corresponding javadoc for further information, including default attribute values, attribute aliases, and other details.

스프링 프레임워크는 다음와 같은 스프링 특화 어노테이션을 제공한다. 이 어노테이션들은 유닛테스트 혹은 통합테스트를 할때 테스트 프레임워크(TestContext framework)와의 연결을 위해서 사용된다. 디폴트값, 속성, 등 더많은 정보를 위해서는 대응되는 javadoc을 보도록 하라.

 

Spring’s testing annotations include the following:

스프링의 테스팅 어노테이션은 아래를 포함한다.

 

@BootstrapWith

@BootstrapWith is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped. Specifically, you can use @BootstrapWith to specify a custom TestContextBootstrapper. See the section on bootstrapping the TestContext framework for further details.

@BootstrapWith는 클래스 레벨 어노테이션이다. 어떻게 스프링 테스트 프레이워크가 부트스트랩 되는지를 정의한다. 특히, @BootstrapWith를 사용하면 커스텀 테스트 컨텍스트 부트스트랩퍼를 지정할 수 있다. 더 많은 정보를 위해서 bootstrapping the TestContext framework  를 참조하도록 하라.

 

@ContextConfiguration

@ContextConfiguration defines class-level metadata that is used to determine how to load and configure an ApplicationContext for integration tests. Specifically, @ContextConfiguration declares the application context resource locations or the component classes used to load the context.

@ContextConfiguration은 클래스 레벨 메타데이터를 정의한다. 메타데이터는 통합 테스트를 위한 어플리케이션 컨텍스트를 어떻게 구성 하고, 로드 하는지를 정의한다. 특히, @ContextConfiguration은 어플리케이션 컨텍스트 리소스의 위치(location) 혹은 컨텍스트를 로드할때 사용되는 클래스의 컴포넌트를 선언한다.

 

@WebAppConfiguration

@WebAppConfiguration is a class-level annotation that you can use to declare that the ApplicationContext loaded for an integration test should be a WebApplicationContext. The mere presence of @WebAppConfiguration on a test class ensures that a WebApplicationContext is loaded for the test, using the default value of "file:src/main/webapp" for the path to the root of the web application (that is, the resource base path). The resource base path is used behind the scenes to create a MockServletContext, which serves as the ServletContext for the test’s WebApplicationContext.

@WebAppConfiguration은 클래스 레벨 어노테이션이다. @WebAppConfiguration은 통합 테스트를 위한 어플리케이션 컨텍스트가 WebApplicationContext여야 하는 경우 사용된다. @WebAppConfiguration가 사용되는 유일한 이유는 테스트를 할때WebApplicationContext가 로드되었다는것을 보장해주고, 웹 어플리케이션의 루트 패스인 "file:src/main/webapp"를 디폴트 값으로 사용하는것을 보장하는 것이다. 리소스의 베이스 패스는 Mock서블렛 컨텍스트를 생성하기위해서 사용되며 Mock서블렛 컨텍스트는 WebApplicationContext의 테스트에 사용되는 서블렛 컨텍스트 역할을 수행한다.

 

@ContextHierarchy

@ContextHierarchy is a class-level annotation that is used to define a hierarchy of ApplicationContext instances for integration tests. @ContextHierarchy should be declared with a list of one or more @ContextConfiguration instances, each of which defines a level in the context hierarchy. 

@ContextHierachy는 클래스레벨 어노테이션이다. @ContextHierarchy는 통합 테스트시 어플리케이션 컨텍스트의 인스턴스의 계층을 정의하기위해 사용된다. @ContextHierachy는 하나 이상의 @ContextConfiguration인스턴스와 함께 정의 되어야한다. 이때 사용되는 각 @ContextConfiguration가 컨텍스트 계층 레벨을 정의한다. 

 

@ActiveProfiles

@ActiveProfiles is a class-level annotation that is used to declare which bean definition profiles should be active when loading an ApplicationContext for an integration test.

@ActiveProfiles는 클래스 레벨 어노테이션이다. @ActiveProfiles는 통합 테스트시 어플리케이션 컨텍스를 로딩할때 어떤 빈 정의 프로파일이 활성화 되어야하는지를 정의한다. 

 

@TestPropertySource

@TestPropertySource is a class-level annotation that you can use to configure the locations of properties files and inlined properties to be added to the set of PropertySources in the Environment for an ApplicationContext loaded for an integration test.

 

 

 

반응형
반응형

2021.05.11

 오늘은 아침부터 빡세게 동영상 편집을 했다. 적절히 잘 편집을해서 유투브 업로드를 할 수 있었다.

 저녘엔 안랙술과 요가를 시작했다. 20분정도 아쉬탕가 요가의 맨 앞부분만했다. 하고나서 누워있는데 등과 허리가 아프다. 뼈쪽이 삐끗한건 아니고 담이 온거같다. 와... 별로 힘든걸하지도 안았는데 이정도라니. 충격적이다.

반응형

+ Recent posts