mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
Merge branch 'master' of https://github.com/marty30/spring-petclinic
This commit is contained in:
commit
a5c39a50cf
10 changed files with 487 additions and 249 deletions
18
.travis.yml
18
.travis.yml
|
@ -2,16 +2,30 @@ language: java
|
|||
sudo: false
|
||||
install: true
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
addons:
|
||||
sonarcloud:
|
||||
organization: "bpsdproject"
|
||||
token:
|
||||
secure: "GBSEwXoZaohdFQyW5yJ3h6t8+HIztd+sEMS8jt10zo5tnenrGNv59YTl7B5VwxR2X/mJcdLsouR4z81TZfP4FX93NZAKwAdkj1d3yAyvEDYSlLywI7Xp3BGcO7Zc4mnHAU+yMhVI98Ww6C45OjirUgBT8STmjLTXk2yuA9T6IttwAmGdLzzzPjon710/6mIY3MzoqRpyhGhuJJjbJLA9BM5h1X79ikbOMk4e2ig3KaTIANS3oeCiQlNHgdikBZcsxow7qMXA5d8mgrBJnKH52EerLbMgVuKPBxdV+RMZQxOLZR6xzg5EQVUpoXCG8EqMbZw6lEdqfIYasm8EPQPaRM4fT6zIbJoQEFFXCIL1Wht7h0pO5RTavPE9jcpjni/QG+MAcr+v80/8RGOQ5MhQ/vF6T5DDf6J/03zAGX4LpPOb7s/8YuWWz+wB+uFYXsdZLOhFb8uuAyEiBzyXIn3ZgkLHxo57sGVgfSDiLgKGea7fIw+xN72JzTKts19jR1x+Sy6SvIgOJdjdmV+qzpbkn1nFtXo0t73RxwQkLLBx5hin02fEr1jWVXszVGCqKrxwglE0oTucMP6qtujMoqNo+eUUE064IAhRl9EPPcDMezctIKLp4vTUP3X5RCL1KRfE8uzeaY+Nnd+/DCh71Nhr4AHm570ISw6q7mKeStaB1dQ="
|
||||
secure: "FKHLAA1VC6XvrJTDFXwh7IvHAgX+hHkzuGmiOJ9RvguTkP8yQTQqczQA0QFUaCKoOXLQf7n1Xadx60vKDxk1FQS4GxhvB1n9muvhjkLOXstpRjKEBL/t3CgVeIYPdf676lT/vED2yeFmTC0BcC82k2h8dNpBpr2c/iRsHriiyf8NOOM9XO6sbDfPPGYhTzkuBRhplVZ6723z5KaHDvSgjQmT/dlIZkY00fqyVPI20JZqvScbR0/8QjED8jWtnlZpzU02lIrpkcIJF2gS4OGkucE1GBvJtkAejm5V2g++mdj3B+ja4x2rZmLmAhOVV2PzRatMSrEyoSCRpjXMf39WaTlehaii2foWPvj+CTl4iO4ApdVluFufS5EuPknJ3/pOQVAilR0qad3NBokUGCnfGhAqo06AA0aeLb05A3nfhT/CeOPEklwpkWNHNG6B4XWkNUH54WemqvmDvUjPspSbFlU3RBwjVcacj4Dyuh4eo48E/+bYnoIhaAZiyh/SXqrIx9Wh0COxYv1tgcqJ/xbDtJf3CZdjGZfKCpC3OUCliRTHtKQrzxQxai4oTlTtGTWhxm81BIOStRY0IgkTGvMiymv91wcWN6Q937D4CsRGJ7O4ZKWeqPXCmntVVqEiWd5av2Lpnv7W2QnajkcNZ4UyGtH3mzo4OykKGc9EV9fcu64="
|
||||
|
||||
jdk: oraclejdk8
|
||||
|
||||
install:
|
||||
- docker-compose build
|
||||
|
||||
before_script:
|
||||
- docker-compose up -d
|
||||
|
||||
script:
|
||||
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar
|
||||
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Dskip.failsafe.tests sonar:sonar
|
||||
- docker exec springpetclinic_pet-clinic_1 mvn verify -Dskip.surefire.tests -q --batch-mode
|
||||
|
||||
after_script:
|
||||
- docker-compose stop
|
||||
- docker-compose rm -f
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
|
34
Dockerfile
34
Dockerfile
|
@ -1,17 +1,17 @@
|
|||
FROM maven:latest
|
||||
|
||||
# Set the workdir
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the source to the container
|
||||
COPY . .
|
||||
|
||||
# Build the project
|
||||
RUN mvn package
|
||||
|
||||
# Make the jar executable
|
||||
RUN sh -c 'touch target/spring-petclinic-*.jar'
|
||||
|
||||
#Start the project
|
||||
ENV JAVA_OPTS=""
|
||||
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar target/spring-petclinic-*.jar" ]
|
||||
FROM maven:latest
|
||||
|
||||
# Set the workdir
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the source to the container
|
||||
COPY . .
|
||||
|
||||
# Build the project
|
||||
RUN mvn package -Dskip.failsafe.tests -q --batch-mode
|
||||
|
||||
# Make the jar executable
|
||||
RUN sh -c 'touch target/spring-petclinic-*.jar'
|
||||
|
||||
#Start the project
|
||||
ENV JAVA_OPTS=""
|
||||
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar target/spring-petclinic-*.jar" ]
|
||||
|
|
|
@ -5,14 +5,20 @@ services:
|
|||
ports:
|
||||
- "8080:8080"
|
||||
links:
|
||||
- mysql:mysql
|
||||
# - mysql:mysql
|
||||
- selenium
|
||||
command: java -jar ./target/*.jar
|
||||
mysql:
|
||||
image: mysql
|
||||
# mysql:
|
||||
# image: mysql
|
||||
# ports:
|
||||
# - "3306:3306"
|
||||
# environment:
|
||||
# - MYSQL_ROOT_PASSWORD=root
|
||||
# - MYSQL_DATABASE=test
|
||||
# volumes:
|
||||
# - "./conf.d:/etc/mysql/conf.d:ro"
|
||||
selenium:
|
||||
image: selenium/standalone-firefox
|
||||
shm_size: 2g
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=root
|
||||
- MYSQL_DATABASE=test
|
||||
volumes:
|
||||
- "./conf.d:/etc/mysql/conf.d:ro"
|
||||
- "4444:4444"
|
||||
|
|
472
pom.xml
472
pom.xml
|
@ -1,229 +1,265 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.samples.bpsd</groupId>
|
||||
<artifactId>spring-petclinic</artifactId>
|
||||
<version>1.5.1</version>
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.samples.bpsd</groupId>
|
||||
<artifactId>spring-petclinic</artifactId>
|
||||
<version>1.5.1</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.5.1.RELEASE</version>
|
||||
</parent>
|
||||
<name>petclinic</name>
|
||||
|
||||
<properties>
|
||||
|
||||
<!-- Generic properties -->
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<!-- Web dependencies -->
|
||||
<webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
|
||||
<webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
|
||||
<webjars-jquery.version>2.2.4</webjars-jquery.version>
|
||||
<wro4j.version>1.8.0</wro4j.version>
|
||||
|
||||
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
|
||||
|
||||
<cobertura.version>2.7</cobertura.version>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring and Spring Boot dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cache</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>nz.net.ultraq.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf-layout-dialect</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Databases - Uses HSQL by default -->
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- caching -->
|
||||
<dependency>
|
||||
<groupId>javax.cache</groupId>
|
||||
<artifactId>cache-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ehcache</groupId>
|
||||
<artifactId>ehcache</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- webjars -->
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>webjars-locator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>jquery</artifactId>
|
||||
<version>${webjars-jquery.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>jquery-ui</artifactId>
|
||||
<version>${webjars-jquery-ui.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>bootstrap</artifactId>
|
||||
<version>${webjars-bootstrap.version}</version>
|
||||
</dependency>
|
||||
<!-- end of webjars -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- Spring Boot Actuator displays build-related information
|
||||
if a META-INF/build-info.properties file is present -->
|
||||
<goals>
|
||||
<goal>build-info</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalProperties>
|
||||
<encoding.source>${project.build.sourceEncoding}</encoding.source>
|
||||
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
|
||||
<java.source>${maven.compiler.source}</java.source>
|
||||
<java.target>${maven.compiler.target}</java.target>
|
||||
</additionalProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>${cobertura.version}</version>
|
||||
<configuration>
|
||||
<check />
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.5.1.RELEASE</version>
|
||||
</parent>
|
||||
<name>petclinic</name>
|
||||
|
||||
<!-- Spring Boot Actuator displays build-related information if a git.properties
|
||||
file is present at the classpath -->
|
||||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>revision</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<verbose>true</verbose>
|
||||
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
|
||||
<generateGitPropertiesFile>true</generateGitPropertiesFile>
|
||||
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
|
||||
</generateGitPropertiesFilename>
|
||||
<failOnNoGitDirectory>false</failOnNoGitDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<properties>
|
||||
|
||||
<plugin>
|
||||
<groupId>ro.isdc.wro4j</groupId>
|
||||
<artifactId>wro4j-maven-plugin</artifactId>
|
||||
<version>${wro4j.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
|
||||
<cssDestinationFolder>${project.build.directory}/classes/static/resources/css</cssDestinationFolder>
|
||||
<wroFile>${basedir}/src/main/wro/wro.xml</wroFile>
|
||||
<extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
|
||||
<contextFolder>${basedir}/src/main/less</contextFolder>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<!-- Generic properties -->
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<!-- Web dependencies -->
|
||||
<webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
|
||||
<webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
|
||||
<webjars-jquery.version>2.2.4</webjars-jquery.version>
|
||||
<wro4j.version>1.8.0</wro4j.version>
|
||||
|
||||
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
|
||||
|
||||
<cobertura.version>2.7</cobertura.version>
|
||||
|
||||
<selenium-java.version>3.4.0</selenium-java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring and Spring Boot dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cache</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>nz.net.ultraq.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf-layout-dialect</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Databases - Uses HSQL by default -->
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- caching -->
|
||||
<dependency>
|
||||
<groupId>javax.cache</groupId>
|
||||
<artifactId>cache-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ehcache</groupId>
|
||||
<artifactId>ehcache</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- webjars -->
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>webjars-locator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>jquery</artifactId>
|
||||
<version>${webjars-jquery.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>jquery-ui</artifactId>
|
||||
<version>${webjars-jquery-ui.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>bootstrap</artifactId>
|
||||
<version>${webjars-bootstrap.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<reporting>
|
||||
<plugins>
|
||||
<!-- integrate maven-cobertura-plugin to project site -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>${cobertura.version}</version>
|
||||
<configuration>
|
||||
<formats>
|
||||
<format>html</format>
|
||||
</formats>
|
||||
<check />
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</dependency>
|
||||
<!-- end of webjars -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!--Selenium-->
|
||||
<dependency>
|
||||
<groupId>org.seleniumhq.selenium</groupId>
|
||||
<artifactId>selenium-java</artifactId>
|
||||
<version>${selenium-java.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- skips surefire tests without skipping failsafe tests.
|
||||
Property value seems to magically default to false -->
|
||||
<skipTests>${skip.surefire.tests}</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- skips failsafe tests without skipping surefire tests.
|
||||
Property value seems to magically default to false -->
|
||||
<skipTests>${skip.failsafe.tests}</skipTests>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>run-integration-tests</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- Spring Boot Actuator displays build-related information
|
||||
if a META-INF/build-info.properties file is present -->
|
||||
<goals>
|
||||
<goal>build-info</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalProperties>
|
||||
<encoding.source>${project.build.sourceEncoding}</encoding.source>
|
||||
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
|
||||
<java.source>${maven.compiler.source}</java.source>
|
||||
<java.target>${maven.compiler.target}</java.target>
|
||||
</additionalProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>${cobertura.version}</version>
|
||||
<configuration>
|
||||
<check/>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Spring Boot Actuator displays build-related information if a git.properties
|
||||
file is present at the classpath -->
|
||||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>revision</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<verbose>true</verbose>
|
||||
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
|
||||
<generateGitPropertiesFile>true</generateGitPropertiesFile>
|
||||
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
|
||||
</generateGitPropertiesFilename>
|
||||
<failOnNoGitDirectory>false</failOnNoGitDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>ro.isdc.wro4j</groupId>
|
||||
<artifactId>wro4j-maven-plugin</artifactId>
|
||||
<version>${wro4j.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
|
||||
<cssDestinationFolder>${project.build.directory}/classes/static/resources/css</cssDestinationFolder>
|
||||
<wroFile>${basedir}/src/main/wro/wro.xml</wroFile>
|
||||
<extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
|
||||
<contextFolder>${basedir}/src/main/less</contextFolder>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>bootstrap</artifactId>
|
||||
<version>${webjars-bootstrap.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<reporting>
|
||||
<plugins>
|
||||
<!-- integrate maven-cobertura-plugin to project site -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>${cobertura.version}</version>
|
||||
<configuration>
|
||||
<formats>
|
||||
<format>html</format>
|
||||
</formats>
|
||||
<check/>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -11,6 +11,3 @@ sonar.language=java
|
|||
|
||||
# Encoding of the source files
|
||||
sonar.sourceEncoding=UTF-8
|
||||
|
||||
sonar.organization=ihristovut-github
|
||||
sonar.login=CqXf1kvNas7kaHHD3TKCcVrAL//0kdYsg/EjVphwABi7JsKILKGHSPiu4JZNG0fQf9DQZpAMBolTnVEyBC89sCR2NalML0m+MZZzBeihvnhqo8wETWoyGvnkPrLe9WILiZBK591qOVRoyipWMqYacyiV42mDpJjTcMJf1HkDPDxcD7kCQTw6qo3TLXbpphR8Y8LeZMDsty0HxPc02QtKS5kOTCiW7NljKWXdnsNDc2ZrGQDj7zVNRsYZ5ULgH8Psi06I7vC2HS9/o7QJcc42nRcoFzkGjVxWEBYPS9r11GQoUM+FwRCL/CKGv2Xzw2H7h/5zrJ89A0ZxHyHR4fKQTv4MRkCHj5WIMSL9a9K1E6nnP9Rk6OTzbKAr+iPt1IMRvU5lxsEzy5yZwOaGw9t6ebtdo8PB6IxVeNVwsg2rFTjeB+G/ct6eOnCU8Kd9yB5WAeA2ySZf9qBIjHKReq1fS9pI9/ps+85a+irW8Ei6TSD3JFWI6wkWPAG00NErWmeWN1AWWgmR16u8uXMQxQcCHRUs1To5aNV4HsNtCqbZOMe8VtH6MF0Yir2vVLG7Ljes5Il1hp2Qhsqxqv2aWmgbtiM6yobJTUMYpZLVuXml5RDoq72b+wgJduH7gwy0H0FzvRQKn+NTEDcKeEt06nI0U42F8mb6TDYeSQsF038rDs8=
|
||||
|
|
47
src/test/java/nl/utwente/bpsd/selenium/AddOwnerIT.java
Normal file
47
src/test/java/nl/utwente/bpsd/selenium/AddOwnerIT.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
package nl.utwente.bpsd.selenium;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.Select;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
/**
|
||||
* @author Martijn
|
||||
* @since 21-6-2017.
|
||||
*/
|
||||
public class AddOwnerIT extends SeleniumBaseIT {
|
||||
public AddOwnerIT() throws MalformedURLException {
|
||||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category(SeleniumBaseIT.class)
|
||||
public void addOwnerIT() {
|
||||
driver.get(BASE_URL+"/owners/new");
|
||||
|
||||
//Add an owner
|
||||
fillTextField(By.name("firstName"), "Sophie");
|
||||
fillTextField(By.name("lastName"), "Lathouwers");
|
||||
fillTextField(By.name("address"), "Homeroad 12");
|
||||
fillTextField(By.name("city"), "Enschede");
|
||||
fillTextField(By.name("telephone"), "0534890000");
|
||||
driver.findElement(By.name("telephone")).submit();
|
||||
Assert.assertTrue(pageContainsText("Sophie Lathouwers"));
|
||||
|
||||
//Add a pet
|
||||
new WebDriverWait(driver, 3).until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.linkText("Add New Pet")));
|
||||
driver.findElement(By.linkText("Add New Pet")).click();
|
||||
fillTextField(By.name("name"), "Thumper");
|
||||
fillTextField(By.name("birthDate"), "1942/08/09");
|
||||
new Select(driver.findElement(By.name("type"))).selectByValue("hamster");
|
||||
driver.findElement(By.name("name")).submit();
|
||||
|
||||
Assert.assertTrue(pageContainsText("Thumper"));
|
||||
}
|
||||
|
||||
}
|
41
src/test/java/nl/utwente/bpsd/selenium/AddVisitIT.java
Normal file
41
src/test/java/nl/utwente/bpsd/selenium/AddVisitIT.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package nl.utwente.bpsd.selenium;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Martijn
|
||||
* @since 21-6-2017.
|
||||
*/
|
||||
public class AddVisitIT extends SeleniumBaseIT {
|
||||
public AddVisitIT() throws MalformedURLException {
|
||||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category(SeleniumBaseIT.class)
|
||||
public void addOwnerTest() {
|
||||
driver.findElement(By.name("lastName")).submit();
|
||||
|
||||
//Go to first owner
|
||||
WebElement table = driver.findElement(By.tagName("table"));
|
||||
List<WebElement> cells = table.findElements(By.xpath("tr/td"));
|
||||
cells.get(0).findElement(By.xpath("a")).click();
|
||||
|
||||
//Go to edit page of first pet
|
||||
driver.findElement(By.xpath("//table//tr/td/table/tbody//a[text()='Edit Pet']")).click();
|
||||
|
||||
//Edit Name of pet
|
||||
fillTextField(By.name("name"), "foobar");
|
||||
driver.findElement(By.name("name")).submit();
|
||||
|
||||
Assert.assertNotNull(driver.findElement(By.xpath("//table//tr/td/dl/dd/[contains(text(), 'foobar')]")));
|
||||
}
|
||||
|
||||
}
|
26
src/test/java/nl/utwente/bpsd/selenium/FailingIT.java
Normal file
26
src/test/java/nl/utwente/bpsd/selenium/FailingIT.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package nl.utwente.bpsd.selenium;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
/**
|
||||
* @author Martijn
|
||||
* @since 21-6-2017.
|
||||
*/
|
||||
public class FailingIT extends SeleniumBaseIT {
|
||||
public FailingIT() throws MalformedURLException {
|
||||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category(SeleniumBaseIT.class)
|
||||
@Ignore
|
||||
public void failIT() {
|
||||
Assert.fail();
|
||||
}
|
||||
|
||||
}
|
28
src/test/java/nl/utwente/bpsd/selenium/FindOwnerIT.java
Normal file
28
src/test/java/nl/utwente/bpsd/selenium/FindOwnerIT.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package nl.utwente.bpsd.selenium;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Martijn
|
||||
* @since 21-6-2017.
|
||||
*/
|
||||
public class FindOwnerIT extends SeleniumBaseIT {
|
||||
public FindOwnerIT() throws MalformedURLException {
|
||||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category(SeleniumBaseIT.class)
|
||||
public void findOwnerIT() {
|
||||
driver.get(BASE_URL+"/owners/find");
|
||||
fillTextField(By.name("lastName"),"Coleman");
|
||||
driver.findElement(By.name("lastName")).submit();
|
||||
Assert.assertTrue(driver.findElementsByXPath("//*[text()='Jean Coleman']").size() == 1);
|
||||
}
|
||||
}
|
43
src/test/java/nl/utwente/bpsd/selenium/SeleniumBaseIT.java
Normal file
43
src/test/java/nl/utwente/bpsd/selenium/SeleniumBaseIT.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
package nl.utwente.bpsd.selenium;
|
||||
|
||||
import org.junit.After;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||
import org.openqa.selenium.remote.RemoteWebDriver;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Martijn
|
||||
* @since 21-6-2017.
|
||||
*/
|
||||
public class SeleniumBaseIT {
|
||||
protected final RemoteWebDriver driver;
|
||||
public static final String BASE_URL = "http://pet-clinic:8080/";
|
||||
// public static final String BASE_URL = "http://localhost:8080/";
|
||||
|
||||
public SeleniumBaseIT() throws MalformedURLException {
|
||||
// System.setProperty("webdriver.chrome.driver","C:\\Users\\marti\\Downloads\\chromedriver_win32\\chromedriver.exe");
|
||||
// this.driver = new ChromeDriver();
|
||||
this.driver = new RemoteWebDriver(new URL("http://selenium:4444/wd/hub"), DesiredCapabilities.firefox());
|
||||
driver.get(BASE_URL);
|
||||
}
|
||||
|
||||
public void fillTextField(By by, String text){
|
||||
driver.findElement(by).clear();
|
||||
driver.findElement(by).sendKeys(text);
|
||||
}
|
||||
|
||||
@After
|
||||
public void afterTest() {
|
||||
driver.close();
|
||||
}
|
||||
|
||||
|
||||
protected boolean pageContainsText(String text) {
|
||||
return driver.findElementsByXPath("//*[text()='"+text+"']").size() == 1;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue