|
|
|
|
@ -3,20 +3,18 @@ package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.tests; |
|
|
|
|
import javax.persistence.EntityManager; |
|
|
|
|
|
|
|
|
|
import org.hibernate.SessionFactory; |
|
|
|
|
import org.springframework.boot.SpringBootConfiguration; |
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
|
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
|
import org.springframework.context.annotation.ComponentScan; |
|
|
|
|
import org.springframework.orm.hibernate5.LocalSessionFactoryBean; |
|
|
|
|
|
|
|
|
|
import de.kreth.vaadin.clubhelper.HibernateHolder; |
|
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.business.EventBusiness; |
|
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.AltersgruppeDao; |
|
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.AltersgruppeDaoImpl; |
|
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.ClubEventDao; |
|
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.ClubEventDaoImpl; |
|
|
|
|
|
|
|
|
|
@Configuration |
|
|
|
|
//@SpringBootConfiguration
|
|
|
|
|
//@EnableAutoConfiguration
|
|
|
|
|
|
|
|
|
|
//@Configuration
|
|
|
|
|
@SpringBootConfiguration |
|
|
|
|
@ComponentScan(basePackages = { "de.kreth" }) |
|
|
|
|
@EnableAutoConfiguration |
|
|
|
|
public class TestConfiguration { |
|
|
|
|
|
|
|
|
|
private SessionFactory sessionFactory; |
|
|
|
|
@ -35,23 +33,8 @@ public class TestConfiguration { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public EntityManager getEntityManager() { |
|
|
|
|
public EntityManager entityManager() { |
|
|
|
|
return sessionFactory.openSession(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public ClubEventDao getClubEventDao() { |
|
|
|
|
return new ClubEventDaoImpl(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public AltersgruppeDao getAltersgruppeDao() { |
|
|
|
|
return new AltersgruppeDaoImpl(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public EventBusiness getEventBusiness() { |
|
|
|
|
return new EventBusiness(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|