further exceptions work
This commit is contained in:
parent
8ec7ccd7d3
commit
6c3a03f929
|
@ -0,0 +1,12 @@
|
||||||
|
package org.baeldung.ex.beandefinitionstoreexception.cause2;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class BeanA {
|
||||||
|
|
||||||
|
@Value("${some.property2}")
|
||||||
|
private String someProperty2;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package org.baeldung.ex.beandefinitionstoreexception.spring;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.ImportResource;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan("org.baeldung.ex.beandefinitionstoreexception.cause1")
|
||||||
|
@ImportResource("beans.xml")
|
||||||
|
public class Cause1ContextWithJavaConfig {
|
||||||
|
|
||||||
|
public Cause1ContextWithJavaConfig() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
// beans
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package org.baeldung.ex.beandefinitionstoreexception.spring;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan("org.baeldung.ex.beandefinitionstoreexception.cause2")
|
||||||
|
public class Cause2ContextWithJavaConfig {
|
||||||
|
|
||||||
|
@Value("${some.property}")
|
||||||
|
private String someProperty;
|
||||||
|
|
||||||
|
public Cause2ContextWithJavaConfig() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
// beans
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||||
|
return new PropertySourcesPlaceholderConfigurer();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.baeldung.ex.beandefinitionstoreexception.spring;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan("org.baeldung.ex.beandefinitionstoreexception.cause3")
|
||||||
|
public class Cause3ContextWithJavaConfig {
|
||||||
|
|
||||||
|
public Cause3ContextWithJavaConfig() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
// beans
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.baeldung.ex.beandefinitionstoreexception;
|
||||||
|
|
||||||
|
import org.baeldung.ex.beandefinitionstoreexception.spring.Cause1ContextWithJavaConfig;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
|
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||||
|
|
||||||
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
|
@ContextConfiguration(classes = { Cause1ContextWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||||
|
public class Cause1BeanDefinitionStoreExceptionIntegrationTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public final void givenContextIsInitialized_thenNoException() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.baeldung.ex.beandefinitionstoreexception;
|
||||||
|
|
||||||
|
import org.baeldung.ex.beandefinitionstoreexception.spring.Cause2ContextWithJavaConfig;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
|
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||||
|
|
||||||
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
|
@ContextConfiguration(classes = { Cause2ContextWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||||
|
public class Cause2BeanDefinitionStoreExceptionIntegrationTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public final void givenContextIsInitialized_thenNoException() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.baeldung.ex.beandefinitionstoreexception;
|
||||||
|
|
||||||
|
import org.baeldung.ex.beandefinitionstoreexception.spring.Cause3ContextWithJavaConfig;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
|
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||||
|
|
||||||
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
|
@ContextConfiguration(classes = { Cause3ContextWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||||
|
public class Cause3BeanDefinitionStoreExceptionIntegrationTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public final void givenContextIsInitialized_thenNoException() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue