File tree Expand file tree Collapse file tree 5 files changed +92
-38
lines changed
src/test/java/org/springframework/core/env Expand file tree Collapse file tree 5 files changed +92
-38
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2002-2019 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package org .springframework .core .env .scan1 ;
18
+
19
+ import org .springframework .context .annotation .Configuration ;
20
+ import org .springframework .context .annotation .Import ;
21
+
22
+ @ Configuration
23
+ @ Import ({ DevConfig .class , ProdConfig .class })
24
+ class Config {
25
+
26
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2002-2019 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package org .springframework .core .env .scan1 ;
18
+
19
+ import org .springframework .context .annotation .Bean ;
20
+ import org .springframework .context .annotation .Configuration ;
21
+ import org .springframework .context .annotation .Profile ;
22
+
23
+ @ Profile (org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .DEV_ENV_NAME )
24
+ @ Configuration
25
+ class DevConfig {
26
+
27
+ @ Bean
28
+ public Object devBean () {
29
+ return new Object ();
30
+ }
31
+
32
+ }
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- /**
18
- * Mirrors the structure of beans and environment-specific config files
19
- * in EnvironmentIntegrationTests-context.xml
20
- */
21
- package org .springframework .core .env .scan1 ;
22
17
23
- import static org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .DEV_ENV_NAME ;
24
- import static org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .PROD_ENV_NAME ;
18
+ package org .springframework .core .env .scan1 ;
25
19
26
20
import org .springframework .context .annotation .Bean ;
27
21
import org .springframework .context .annotation .Configuration ;
28
- import org .springframework .context .annotation .Import ;
29
22
import org .springframework .context .annotation .Profile ;
30
23
31
- @ Configuration
32
- @ Import ({DevConfig .class , ProdConfig .class })
33
- class Config {
34
- }
35
-
36
- @ Profile (DEV_ENV_NAME )
37
- @ Configuration
38
- class DevConfig {
39
- @ Bean
40
- public Object devBean () {
41
- return new Object ();
42
- }
43
- }
44
-
45
- @ Profile (PROD_ENV_NAME )
24
+ @ Profile (org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .PROD_ENV_NAME )
46
25
@ Configuration
47
26
class ProdConfig {
27
+
48
28
@ Bean
49
29
public Object prodBean () {
50
30
return new Object ();
51
31
}
32
+
52
33
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2002-2019 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package org .springframework .core .env .scan2 ;
18
+
19
+ import org .springframework .context .annotation .Profile ;
20
+ import org .springframework .stereotype .Component ;
21
+
22
+ @ Profile (org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .DEV_ENV_NAME )
23
+ @ Component (org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .DEV_BEAN_NAME )
24
+ class DevBean {
25
+ }
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- /**
18
- * Mirrors the structure of beans and environment-specific config files
19
- * in EnvironmentIntegrationTests-context.xml
20
- */
21
- package org .springframework .core .env .scan2 ;
22
17
23
- import static org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .DEV_BEAN_NAME ;
24
- import static org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .DEV_ENV_NAME ;
25
- import static org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .PROD_BEAN_NAME ;
26
- import static org .springframework .core .env .EnvironmentSystemIntegrationTests .Constants .PROD_ENV_NAME ;
18
+ package org .springframework .core .env .scan2 ;
27
19
28
20
import org .springframework .context .annotation .Profile ;
29
21
import org .springframework .stereotype .Component ;
30
22
31
- @ Profile (DEV_ENV_NAME )
32
- @ Component (DEV_BEAN_NAME )
33
- class DevBean { }
23
+ @ Profile (org . springframework . core . env . EnvironmentSystemIntegrationTests . Constants . PROD_ENV_NAME )
24
+ @ Component (org . springframework . core . env . EnvironmentSystemIntegrationTests . Constants . PROD_BEAN_NAME )
25
+ class ProdBean {
34
26
35
- @ Profile (PROD_ENV_NAME )
36
- @ Component (PROD_BEAN_NAME )
37
- class ProdBean { }
27
+ }
You can’t perform that action at this time.
0 commit comments