example.profilescan.ProfileAnnotatedComponent Java Examples
The following examples show how to use
example.profilescan.ProfileAnnotatedComponent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClassPathScanningCandidateComponentProviderTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_noProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(false)); }
Example #2
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_invalidProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.getEnvironment().setActiveProfiles("other"); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(false)); }
Example #3
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_validProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.getEnvironment().setActiveProfiles(ProfileAnnotatedComponent.PROFILE_NAME); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(true)); }
Example #4
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_noProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(false)); }
Example #5
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testWithActiveProfile() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); ConfigurableEnvironment env = new StandardEnvironment(); env.setActiveProfiles(ProfileAnnotatedComponent.PROFILE_NAME); provider.setEnvironment(env); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(true)); }
Example #6
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testWithInactiveProfile() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); ConfigurableEnvironment env = new StandardEnvironment(); env.setActiveProfiles("other"); provider.setEnvironment(env); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(false)); }
Example #7
Source File: ClassPathScanningCandidateComponentProviderTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_invalidProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.getEnvironment().setActiveProfiles("other"); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(false)); }
Example #8
Source File: ClassPathScanningCandidateComponentProviderTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_validProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.getEnvironment().setActiveProfiles(ProfileAnnotatedComponent.PROFILE_NAME); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(true)); }
Example #9
Source File: ClassPathScanningCandidateComponentProviderTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testWithActiveProfile() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); ConfigurableEnvironment env = new StandardEnvironment(); env.setActiveProfiles(ProfileAnnotatedComponent.PROFILE_NAME); provider.setEnvironment(env); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(true)); }
Example #10
Source File: ClassPathScanningCandidateComponentProviderTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testWithInactiveProfile() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); ConfigurableEnvironment env = new StandardEnvironment(); env.setActiveProfiles("other"); provider.setEnvironment(env); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(false)); }
Example #11
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_invalidProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.getEnvironment().setActiveProfiles("other"); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(false)); }
Example #12
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_validProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.getEnvironment().setActiveProfiles(ProfileAnnotatedComponent.PROFILE_NAME); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(true)); }
Example #13
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void testIntegrationWithAnnotationConfigApplicationContext_noProfile() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(ProfileAnnotatedComponent.class); ctx.refresh(); assertThat(ctx.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(false)); }
Example #14
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void testWithActiveProfile() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); ConfigurableEnvironment env = new StandardEnvironment(); env.setActiveProfiles(ProfileAnnotatedComponent.PROFILE_NAME); provider.setEnvironment(env); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(true)); }
Example #15
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void testWithInactiveProfile() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); ConfigurableEnvironment env = new StandardEnvironment(); env.setActiveProfiles("other"); provider.setEnvironment(env); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(false)); }
Example #16
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring-analysis-note with MIT License | 4 votes |
@Test public void testWithNullEnvironment() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(false)); }
Example #17
Source File: ClassPathScanningCandidateComponentProviderTests.java From java-technology-stack with MIT License | 4 votes |
@Test public void testWithNullEnvironment() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(false)); }
Example #18
Source File: ClassPathScanningCandidateComponentProviderTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@Test public void testWithNullEnvironment() { ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_PROFILE_PACKAGE); assertThat(containsBeanClass(candidates, ProfileAnnotatedComponent.class), is(false)); }