further exceptions work

This commit is contained in:
eugenp 2013-08-11 17:00:24 +03:00
parent 8ec7ccd7d3
commit 6c3a03f929
7 changed files with 130 additions and 0 deletions

View File

@ -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;
}

View File

@ -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
}

View File

@ -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();
}
}

View File

@ -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
}

View File

@ -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() {
//
}
}

View File

@ -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() {
//
}
}

View File

@ -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() {
//
}
}