parent
96f80af447
commit
b2ca1903b8
@ -1,22 +1,33 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> |
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> |
||||||
|
|
||||||
|
|
||||||
|
<wb-module deploy-name="vaadin-clubhelper-0.0.2-SNAPSHOT"> |
||||||
|
|
||||||
|
|
||||||
<wb-module deploy-name="vaadin-clubhelper-0.0.1-SNAPSHOT"> |
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/WebContent"/> |
<wb-resource deploy-path="/" source-path="/WebContent"/> |
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> |
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> |
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> |
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> |
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> |
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> |
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> |
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> |
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-resources/gwt"/> |
|
||||||
|
|
||||||
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-resources/gwt"/> |
||||||
|
|
||||||
|
|
||||||
<property name="context-root" value="vaadin-clubhelper"/> |
<property name="context-root" value="vaadin-clubhelper"/> |
||||||
|
|
||||||
|
|
||||||
<property name="java-output-path" value="/vaadin-clubhelper/target/classes"/> |
<property name="java-output-path" value="/vaadin-clubhelper/target/classes"/> |
||||||
|
|
||||||
</wb-module> |
|
||||||
|
|
||||||
|
</wb-module> |
||||||
|
|
||||||
|
|
||||||
</project-modules> |
</project-modules> |
||||||
|
|||||||
@ -1,11 +0,0 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper; |
|
||||||
|
|
||||||
//@RunWith(SpringRunner.class)
|
|
||||||
//@SpringBootTest
|
|
||||||
public class VaadinClubhelperApplicationTests { |
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void contextLoads() { |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -0,0 +1,57 @@ |
|||||||
|
package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.tests; |
||||||
|
|
||||||
|
import javax.persistence.EntityManager; |
||||||
|
|
||||||
|
import org.hibernate.SessionFactory; |
||||||
|
import org.springframework.context.annotation.Bean; |
||||||
|
import org.springframework.context.annotation.Configuration; |
||||||
|
|
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Adress; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Attendance; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Contact; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.DeletedEntry; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.GroupDef; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Persongroup; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Relative; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Startpaesse; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.StartpassStartrechte; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Version; |
||||||
|
|
||||||
|
@Configuration |
||||||
|
public class TestConfiguration { |
||||||
|
|
||||||
|
@Bean |
||||||
|
public EntityManager getEntityManager() throws Exception { |
||||||
|
|
||||||
|
// setup the session factory
|
||||||
|
org.hibernate.cfg.Configuration configuration = createConfig(); |
||||||
|
|
||||||
|
SessionFactory sessionFactory = configuration.buildSessionFactory(); |
||||||
|
return sessionFactory.openSession(); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public org.hibernate.cfg.Configuration createConfig() { |
||||||
|
org.hibernate.cfg.Configuration configuration = new org.hibernate.cfg.Configuration(); |
||||||
|
configuration.addAnnotatedClass(Adress.class); |
||||||
|
configuration.addAnnotatedClass(Attendance.class); |
||||||
|
configuration.addAnnotatedClass(Contact.class); |
||||||
|
configuration.addAnnotatedClass(DeletedEntry.class); |
||||||
|
configuration.addAnnotatedClass(GroupDef.class); |
||||||
|
configuration.addAnnotatedClass(Person.class); |
||||||
|
configuration.addAnnotatedClass(Persongroup.class); |
||||||
|
configuration.addAnnotatedClass(Relative.class); |
||||||
|
configuration.addAnnotatedClass(Startpaesse.class); |
||||||
|
configuration.addAnnotatedClass(StartpassStartrechte.class); |
||||||
|
configuration.addAnnotatedClass(Version.class); |
||||||
|
configuration.addInputStream(getClass().getResourceAsStream("/schema/ClubEvent.hbm.xml")); |
||||||
|
|
||||||
|
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect"); |
||||||
|
configuration.setProperty("hibernate.connection.driver_class", "org.h2.Driver"); |
||||||
|
configuration.setProperty("hibernate.connection.url", "jdbc:h2:mem:test"); |
||||||
|
configuration.setProperty("hibernate.hbm2ddl.auto", "create"); |
||||||
|
return configuration; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,25 @@ |
|||||||
|
package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.tests; |
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; |
||||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||||
|
import org.springframework.test.web.reactive.server.WebTestClient; |
||||||
|
|
||||||
|
//@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
||||||
|
@AutoConfigureWebTestClient |
||||||
|
//@SpringApplicationConfiguration(classes = VaadinClubhelperApplication.class)
|
||||||
|
//@WebAppConfiguration
|
||||||
|
public class VaadinClubhelperApplicationTests { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private WebTestClient webClient; |
||||||
|
|
||||||
|
@Test |
||||||
|
public void contextLoads() { |
||||||
|
|
||||||
|
webClient.get().uri("/").exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("Hello World"); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue