BAEL-20262: Migrate spring-core-2 module to the com.baeldung package

This commit is contained in:
Krzysztof Woyke 2019-12-20 12:56:36 +01:00
parent c69b2a5ca3
commit fd92e64815
111 changed files with 145 additions and 146 deletions

View File

@ -201,7 +201,7 @@
</profiles>
<properties>
<start-class>org.baeldung.sample.App</start-class>
<start-class>com.baeldung.sample.App</start-class>
<!-- Spring -->
<org.springframework.version>5.0.6.RELEASE</org.springframework.version>
<annotation-api.version>1.3.2</annotation-api.version>

View File

@ -1,4 +1,4 @@
package org.baeldung.autowire.sample;
package com.baeldung.autowire.sample;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

View File

@ -1,10 +1,10 @@
package org.baeldung.autowire.sample;
package com.baeldung.autowire.sample;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("org.baeldung.autowire.sample")
@ComponentScan("com.baeldung.autowire.sample")
public class AppConfig {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.autowire.sample;
package com.baeldung.autowire.sample;
import org.springframework.stereotype.Component;

View File

@ -0,0 +1,5 @@
package com.baeldung.autowire.sample;
public class FooDAO {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.autowire.sample;
package com.baeldung.autowire.sample;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.autowire.sample;
package com.baeldung.autowire.sample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.autowire.sample;
package com.baeldung.autowire.sample;
public interface Formatter {

View File

@ -1,4 +1,4 @@
package org.baeldung.autowire.sample;
package com.baeldung.autowire.sample;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

View File

@ -1,7 +1,7 @@
package org.baeldung.bean.config;
package com.baeldung.bean.config;
import org.baeldung.bean.injection.Helm;
import org.baeldung.bean.injection.Ship;
import com.baeldung.bean.injection.Helm;
import com.baeldung.bean.injection.Ship;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,7 +1,7 @@
package org.baeldung.bean.config;
package com.baeldung.bean.config;
import org.baeldung.bean.injection.Helm;
import org.baeldung.bean.injection.Ship;
import com.baeldung.bean.injection.Helm;
import com.baeldung.bean.injection.Ship;
import org.springframework.context.annotation.Bean;
public class SetterBasedShipConfig {

View File

@ -1,4 +1,4 @@
package org.baeldung.bean.injection;
package com.baeldung.bean.injection;
public class Helm {

View File

@ -1,4 +1,4 @@
package org.baeldung.bean.injection;
package com.baeldung.bean.injection;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,9 +1,9 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("org.baeldung.customannotation")
@ComponentScan("com.baeldung.customannotation")
public class CustomAnnotationConfiguration {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import java.util.Collections;
import java.util.List;

View File

@ -1,4 +1,4 @@
package org.baeldung.customscope;
package com.baeldung.customscope;
public class TenantBean {

View File

@ -1,4 +1,4 @@
package org.baeldung.customscope;
package com.baeldung.customscope;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;

View File

@ -1,4 +1,4 @@
package org.baeldung.customscope;
package com.baeldung.customscope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package org.baeldung.customscope;
package com.baeldung.customscope;
import java.util.Collections;
import java.util.HashMap;

View File

@ -1,4 +1,4 @@
package org.baeldung.customscope;
package com.baeldung.customscope;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.context.annotation.Bean;

View File

@ -1,4 +1,4 @@
package org.baeldung.nullibility;
package com.baeldung.nullibility;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;

View File

@ -1,6 +1,6 @@
@NonNullApi
@NonNullFields
package org.baeldung.nullibility;
package com.baeldung.nullibility;
import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;

View File

@ -1,4 +1,4 @@
package org.baeldung.order;
package com.baeldung.order;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

View File

@ -1,4 +1,4 @@
package org.baeldung.order;
package com.baeldung.order;
import org.springframework.stereotype.Component;
import org.springframework.core.annotation.Order;

View File

@ -1,4 +1,4 @@
package org.baeldung.order;
package com.baeldung.order;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.order;
package com.baeldung.order;
public interface Rating {

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence;
package com.baeldung.persistence;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

View File

@ -1,4 +1,4 @@
package org.baeldung.primary;
package com.baeldung.primary;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -6,7 +6,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@Configuration
@ComponentScan(basePackages="org.baeldung.primary")
@ComponentScan(basePackages="com.baeldung.primary")
public class Config {
@Bean

View File

@ -1,4 +1,4 @@
package org.baeldung.primary;
package com.baeldung.primary;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.primary;
package com.baeldung.primary;
/**
* Created by Gebruiker on 7/17/2018.

View File

@ -1,4 +1,4 @@
package org.baeldung.primary;
package com.baeldung.primary;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.primary;
package com.baeldung.primary;
/**
* Created by Gebruiker on 7/19/2018.

View File

@ -1,4 +1,4 @@
package org.baeldung.primary;
package com.baeldung.primary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

View File

@ -1,4 +1,4 @@
package org.baeldung.primary;
package com.baeldung.primary;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

View File

@ -1,4 +1,4 @@
package org.baeldung.profiles;
package com.baeldung.profiles;
public interface DatasourceConfig {
void setup();

View File

@ -1,4 +1,4 @@
package org.baeldung.profiles;
package com.baeldung.profiles;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.profiles;
package com.baeldung.profiles;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.profiles;
package com.baeldung.profiles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;

View File

@ -1,11 +1,11 @@
package org.baeldung.profiles;
package com.baeldung.profiles;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@Configuration
@ComponentScan("org.baeldung.profiles")
@ComponentScan("com.baeldung.profiles")
@PropertySource(value = "classpath:application.properties")
public class SpringProfilesConfig {

View File

@ -0,0 +1,5 @@
package com.baeldung.sample;
public class Bar {
}

View File

@ -0,0 +1,5 @@
package com.baeldung.sample;
public class Foo {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.sampleabstract;
package com.baeldung.sampleabstract;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,4 +1,4 @@
package org.baeldung.sampleabstract;
package com.baeldung.sampleabstract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.sampleabstract;
package com.baeldung.sampleabstract;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@ -6,7 +6,7 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan(basePackages = "org.baeldung.sampleabstract")
@ComponentScan(basePackages = "com.baeldung.sampleabstract")
public class DemoApp {

View File

@ -1,4 +1,4 @@
package org.baeldung.sampleabstract;
package com.baeldung.sampleabstract;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.sampleabstract;
package com.baeldung.sampleabstract;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.scopes;
package com.baeldung.scopes;
public class HelloMessageGenerator {

View File

@ -1,4 +1,4 @@
package org.baeldung.scopes;
package com.baeldung.scopes;
public class Person {
private String name;

View File

@ -1,4 +1,4 @@
package org.baeldung.scopes;
package com.baeldung.scopes;
import javax.annotation.Resource;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.config;
package com.baeldung.spring.config;
import java.util.concurrent.ExecutorService;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.config;
package com.baeldung.spring.config;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@ComponentScan("org.baeldung.core")
@ComponentScan("com.baeldung.core")
public class CoreConfig implements WebMvcConfigurer {
public CoreConfig() {

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.config;
package com.baeldung.spring.config;
import java.util.Set;
@ -26,7 +26,7 @@ public class MainWebAppInitializer implements WebApplicationInitializer
// Create the 'root' Spring application context
final AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext();
root.scan("org.baeldung.spring.config");
root.scan("com.baeldung.spring.config");
// root.getEnvironment().setDefaultProfiles("embedded");
sc.addListener(new ContextLoaderListener(root));

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.config;
package com.baeldung.spring.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.config;
package com.baeldung.spring.config;
import java.util.Properties;
@ -20,7 +20,7 @@ import com.google.common.base.Preconditions;
// @Configuration
@EnableTransactionManagement
@PropertySource({ "classpath:persistence-mysql.properties" })
@ComponentScan({ "org.baeldung.persistence" })
@ComponentScan({ "com.baeldung.persistence" })
public class PersistenceConfig {
@Autowired
@ -34,7 +34,7 @@ public class PersistenceConfig {
public LocalSessionFactoryBean sessionFactory() {
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
sessionFactory.setDataSource(restDataSource());
sessionFactory.setPackagesToScan(new String[] { "org.baeldung.spring.persistence.model" });
sessionFactory.setPackagesToScan(new String[] { "com.baeldung.spring.persistence.model" });
sessionFactory.setHibernateProperties(hibernateProperties());
return sessionFactory;

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.asynchronous;
package com.baeldung.springevents.asynchronous;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -8,7 +8,7 @@ import org.springframework.context.event.SimpleApplicationEventMulticaster;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
@Configuration
@ComponentScan("org.baeldung.springevents.synchronous")
@ComponentScan("com.baeldung.springevents.synchronous")
public class AsynchronousSpringEventsConfig {
@Bean(name = "applicationEventMulticaster")

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.EventListener;

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
import org.springframework.context.ApplicationEvent;

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
import org.springframework.context.ApplicationEvent;

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
public class GenericSpringEvent<T> {

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
import org.springframework.context.ApplicationListener;
import org.springframework.lang.NonNull;

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
class GenericStringSpringAppEvent extends GenericSpringAppEvent<String> {

View File

@ -1,4 +1,4 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
public class GenericStringSpringEvent extends GenericSpringEvent<String> {

View File

@ -1,10 +1,10 @@
package org.baeldung.springevents.synchronous;
package com.baeldung.springevents.synchronous;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("org.baeldung.springevents.synchronous")
@ComponentScan("com.baeldung.springevents.synchronous")
public class SynchronousSpringEventsConfig {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.startup;
package com.baeldung.startup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,4 +1,4 @@
package org.baeldung.startup;
package com.baeldung.startup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,4 +1,4 @@
package org.baeldung.startup;
package com.baeldung.startup;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package org.baeldung.startup;
package com.baeldung.startup;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package org.baeldung.startup;
package com.baeldung.startup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;

View File

@ -1,4 +1,4 @@
package org.baeldung.startup;
package com.baeldung.startup;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package org.baeldung.startup;
package com.baeldung.startup;
import java.util.Arrays;

View File

@ -1,9 +1,9 @@
package org.baeldung.startup;
package com.baeldung.startup;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("org.baeldung.startup")
@ComponentScan("com.baeldung.startup")
public class SpringStartupConfig {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.startup;
package com.baeldung.startup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,5 +0,0 @@
package org.baeldung.autowire.sample;
public class FooDAO {
}

View File

@ -1,5 +0,0 @@
package org.baeldung.sample;
public class Bar {
}

View File

@ -1,5 +0,0 @@
package org.baeldung.sample;
public class Foo {
}

View File

@ -4,12 +4,12 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="ship" class="org.baeldung.bean.injection.Ship">
<bean id="ship" class="com.baeldung.bean.injection.Ship">
<constructor-arg>
<ref bean="helm"/>
</constructor-arg>
</bean>
<bean id="helm" class="org.baeldung.bean.injection.Helm"/>
<bean id="helm" class="com.baeldung.bean.injection.Helm"/>
</beans>

View File

@ -4,11 +4,11 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="ship" class="org.baeldung.bean.injection.Ship">
<bean id="ship" class="com.baeldung.bean.injection.Ship">
<property name="helm">
<ref bean="helm"/>
</property>
</bean>
<bean id="helm" class="org.baeldung.bean.injection.Helm"/>
<bean id="helm" class="com.baeldung.bean.injection.Helm"/>
</beans>

View File

@ -4,7 +4,7 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"
>
<bean id="employeeDao" class="org.baeldung.jdbc.EmployeeDAO">
<bean id="employeeDao" class="com.baeldung.jdbc.EmployeeDAO">
<property name="dataSource" ref="dataSource"/>
</bean>

View File

@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="personSingleton" class="org.baeldung.scopes.Person" scope="singleton"/>
<bean id="personSingleton" class="com.baeldung.scopes.Person" scope="singleton"/>
<bean id="personPrototype" class="org.baeldung.scopes.Person" scope="prototype"/>
<bean id="personPrototype" class="com.baeldung.scopes.Person" scope="prototype"/>
</beans>

View File

@ -6,10 +6,10 @@
>
<beans profile="dev">
<bean id="devDatasourceConfig" class="org.baeldung.profiles.DevDatasourceConfig"/>
<bean id="devDatasourceConfig" class="com.baeldung.profiles.DevDatasourceConfig"/>
</beans>
<beans profile="production">
<bean id="productionDatasourceConfig" class="org.baeldung.profiles.ProductionDatasourceConfig"/>
<bean id="productionDatasourceConfig" class="com.baeldung.profiles.ProductionDatasourceConfig"/>
</beans>
</beans>

View File

@ -4,13 +4,13 @@
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="initMethodExampleBean"
class="org.baeldung.startup.InitMethodExampleBean"
class="com.baeldung.startup.InitMethodExampleBean"
scope="prototype"
init-method="init">
</bean>
<bean id="allStrategiesExampleBean"
class="org.baeldung.startup.AllStrategiesExampleBean"
class="com.baeldung.startup.AllStrategiesExampleBean"
init-method="init">
</bean>
</beans>

View File

@ -1,4 +1,4 @@
package org.baeldung.autowire.sample;
package com.baeldung.autowire.sample;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,6 +1,6 @@
package org.baeldung.bean.injection;
package com.baeldung.bean.injection;
import org.baeldung.bean.config.ConstructorBasedShipConfig;
import com.baeldung.bean.config.ConstructorBasedShipConfig;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

View File

@ -1,6 +1,6 @@
package org.baeldung.bean.injection;
package com.baeldung.bean.injection;
import org.baeldung.bean.config.SetterBasedShipConfig;
import com.baeldung.bean.config.SetterBasedShipConfig;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import org.springframework.stereotype.Repository;

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;

View File

@ -1,4 +1,4 @@
package org.baeldung.customannotation;
package com.baeldung.customannotation;
import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package org.baeldung.customscope;
package com.baeldung.customscope;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
@ -46,7 +46,7 @@ public class TenantScopeIntegrationTest {
public final void whenComponentScan_thenContextContainsFooAndBar() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
try {
ctx.scan("org.baeldung.customscope");
ctx.scan("com.baeldung.customscope");
ctx.refresh();
TenantBean foo = (TenantBean) ctx.getBean("foo", TenantBean.class);

View File

@ -1,4 +1,4 @@
package org.baeldung.order;
package com.baeldung.order;
import static org.hamcrest.CoreMatchers.equalTo;
@ -21,7 +21,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
public class RatingRetrieverUnitTest {
@Configuration
@ComponentScan(basePackages = {"org.baeldung.order"})
@ComponentScan(basePackages = {"com.baeldung.order"})
static class ContextConfiguration {}
@Autowired

Some files were not shown because too many files have changed in this diff Show More