Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Kevin Gilmore 2016-12-15 17:16:47 -06:00
commit 165c895f5b
210 changed files with 3047 additions and 1798 deletions

View File

@ -15,7 +15,7 @@
<properties> <properties>
<auto-service.version>1.0-rc2</auto-service.version> <auto-service.version>1.0-rc2</auto-service.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -13,6 +13,11 @@
<artifactId>annotation-user</artifactId> <artifactId>annotation-user</artifactId>
<properties>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
@ -24,7 +29,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -37,7 +42,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>

View File

@ -4,15 +4,18 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>cxf-introduction</artifactId> <artifactId>cxf-introduction</artifactId>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>apache-cxf</artifactId> <artifactId>apache-cxf</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>
<cxf.version>3.1.6</cxf.version> <cxf.version>3.1.8</cxf.version>
<surefire.version>2.19.1</surefire.version> <surefire.version>2.19.1</surefire.version>
</properties> </properties>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -24,7 +27,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version> <version>${surefire.version}</version>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*LiveTest.java</exclude> <exclude>**/*LiveTest.java</exclude>
@ -33,6 +36,7 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>

View File

@ -0,0 +1,2 @@
### Relevant Articles:
- [Apache CXF Support for RESTful Web Services](http://www.baeldung.com/apache-cxf-rest-api)

View File

@ -4,17 +4,20 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>cxf-jaxrs-implementation</artifactId> <artifactId>cxf-jaxrs-implementation</artifactId>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>apache-cxf</artifactId> <artifactId>apache-cxf</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cxf.version>3.1.7</cxf.version> <cxf.version>3.1.8</cxf.version>
<httpclient.version>4.5.2</httpclient.version> <httpclient.version>4.5.2</httpclient.version>
<surefire.version>2.19.1</surefire.version> <surefire.version>2.19.1</surefire.version>
</properties> </properties>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -26,7 +29,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version> <version>${surefire.version}</version>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*LiveTest.java</exclude> <exclude>**/*LiveTest.java</exclude>
@ -35,6 +38,7 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>

View File

@ -33,7 +33,7 @@
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version> <version>${javax.servlet-api.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -41,7 +41,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>2.6</version> <version>${maven-war-plugin.version}</version>
<configuration> <configuration>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
</configuration> </configuration>
@ -66,7 +66,7 @@
<plugin> <plugin>
<groupId>org.codehaus.cargo</groupId> <groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId> <artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.19</version> <version>${cargo-maven2-plugin.version}</version>
<configuration> <configuration>
<container> <container>
<containerId>tomcat8x</containerId> <containerId>tomcat8x</containerId>
@ -121,9 +121,13 @@
</profiles> </profiles>
<properties> <properties>
<cxf.version>3.1.6</cxf.version> <cxf.version>3.1.8</cxf.version>
<spring.version>4.3.1.RELEASE</spring.version> <spring.version>4.3.4.RELEASE</spring.version>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<surefire.version>2.19.1</surefire.version> <surefire.version>2.19.1</surefire.version>
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -5,19 +5,28 @@
<artifactId>apache-cxf</artifactId> <artifactId>apache-cxf</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>cxf-introduction</module> <module>cxf-introduction</module>
<module>cxf-spring</module> <module>cxf-spring</module>
<module>cxf-jaxrs-implementation</module> <module>cxf-jaxrs-implementation</module>
</modules> </modules>
<properties>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<exec-maven-plugin.version>1.5.0</exec-maven-plugin.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<defaultGoal>install</defaultGoal> <defaultGoal>install</defaultGoal>
<pluginManagement> <pluginManagement>
@ -25,7 +34,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -34,7 +43,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version> <version>${exec-maven-plugin.version}</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>

View File

@ -67,7 +67,7 @@
<dependency> <dependency>
<groupId>org.apache.xmlgraphics</groupId> <groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId> <artifactId>fop</artifactId>
<version>1.1</version> <version>${fop.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.apache.avalon.framework</groupId> <groupId>org.apache.avalon.framework</groupId>
@ -83,18 +83,18 @@
<dependency> <dependency>
<groupId>avalon-framework</groupId> <groupId>avalon-framework</groupId>
<artifactId>avalon-framework-api</artifactId> <artifactId>avalon-framework-api</artifactId>
<version>4.2.0</version> <version>${avalon-framework.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>avalon-framework</groupId> <groupId>avalon-framework</groupId>
<artifactId>avalon-framework-impl</artifactId> <artifactId>avalon-framework-impl</artifactId>
<version>4.2.0</version> <version>${avalon-framework.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.dbdoclet</groupId> <groupId>org.dbdoclet</groupId>
<artifactId>dbdoclet</artifactId> <artifactId>dbdoclet</artifactId>
<version>8.0.2</version> <version>${dbdoclet.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -108,7 +108,7 @@
<dependency> <dependency>
<groupId>net.sf.jtidy</groupId> <groupId>net.sf.jtidy</groupId>
<artifactId>jtidy</artifactId> <artifactId>jtidy</artifactId>
<version>r938</version> <version>${jtidy.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -187,40 +187,22 @@
</profiles> </profiles>
<properties> <properties>
<!-- persistence --> <fop.version>1.1</fop.version>
<hibernate.version>4.3.11.Final</hibernate.version> <avalon-framework.version>4.3</avalon-framework.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version> <dbdoclet.version>8.0.2</dbdoclet.version>
<jtidy.version>r938</jtidy.version>
<!-- marshalling -->
<jackson.version>2.7.2</jackson.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.9</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.2</logback.version> <logback.version>1.1.7</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<!-- util -->
<guava.version>19.0</guava.version>
<commons-lang3.version>3.3.2</commons-lang3.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4</httpcore.version>
<httpclient.version>4.4</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -121,12 +121,11 @@
<properties> <properties>
<source.version>1.8</source.version> <source.version>1.8</source.version>
<aspectj.version>1.6.11</aspectj.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aspectj.version>1.8.9</aspectj.version> <aspectj.version>1.8.9</aspectj.version>
<org.slf4j.version>1.7.21</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.7</logback.version> <logback.version>1.1.7</logback.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
</properties> </properties>

View File

@ -23,13 +23,13 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId> <artifactId>assertj-core</artifactId>
<version>3.5.1</version> <version>${assertj-core.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -40,7 +40,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -51,6 +51,11 @@
<properties> <properties>
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<assertj-guava.version>3.1.0</assertj-guava.version>
<junit.version>4.12</junit.version>
<assertj-core.version>3.6.1</assertj-core.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -5,12 +5,13 @@
<artifactId>autovalue-tutorial</artifactId> <artifactId>autovalue-tutorial</artifactId>
<version>1.0</version> <version>1.0</version>
<name>AutoValue</name> <name>AutoValue</name>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>7</source> <source>7</source>
<target>7</target> <target>7</target>
@ -19,19 +20,25 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.google.auto.value</groupId> <groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId> <artifactId>auto-value</artifactId>
<version>1.2</version> <version>${auto-value.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.3</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<auto-value.version>1.3</auto-value.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -22,18 +22,18 @@
<dependency> <dependency>
<groupId>org.aspectj</groupId> <groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId> <artifactId>aspectjweaver</artifactId>
<version>1.8.9</version> <version>${aspectjweaver.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jboss.weld.se</groupId> <groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId> <artifactId>weld-se-core</artifactId>
<version>2.3.5.Final</version> <version>${weld-se-core.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -97,7 +97,10 @@
</profile> </profile>
</profiles> </profiles>
<properties> <properties>
<spring.version>4.3.1.RELEASE</spring.version> <spring.version>4.3.4.RELEASE</spring.version>
<aspectjweaver.version>1.8.9</aspectjweaver.version>
<weld-se-core.version>2.4.1.Final</weld-se-core.version>
<junit.version>4.12</junit.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>

View File

@ -76,9 +76,7 @@
<properties> <properties>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.0.13</logback.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.6-jigsaw-SNAPSHOT</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6-jigsaw-SNAPSHOT</maven-compiler-plugin.version>

View File

@ -38,3 +38,6 @@
- [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join) - [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join)
- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) - [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java)
- [How to Convert String to different data types in Java](http://www.baeldung.com/java-string-conversions) - [How to Convert String to different data types in Java](http://www.baeldung.com/java-string-conversions)
- [Introduction to Java Generics](http://www.baeldung.com/java-generics)
- [Generate equals() and hashCode() with Eclipse](http://www.baeldung.com/java-eclipse-equals-and-hashcode)
- [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java)

View File

@ -14,7 +14,7 @@
<dependency> <dependency>
<groupId>net.sourceforge.collections</groupId> <groupId>net.sourceforge.collections</groupId>
<artifactId>collections-generic</artifactId> <artifactId>collections-generic</artifactId>
<version>4.01</version> <version>${collections-generic.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
@ -25,13 +25,13 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId> <artifactId>commons-collections4</artifactId>
<version>4.0</version> <version>${commons-collections4.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.4</version> <version>${commons-io.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -43,7 +43,7 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId> <artifactId>commons-math3</artifactId>
<version>3.3</version> <version>${commons-math3.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -122,8 +122,6 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId> <artifactId>mockito-core</artifactId>
@ -321,44 +319,33 @@
</profiles> </profiles>
<properties> <properties>
<!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<!-- marshalling --> <!-- marshalling -->
<jackson.version>2.7.8</jackson.version> <jackson.version>2.8.5</jackson.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<bouncycastle.version>1.55</bouncycastle.version> <bouncycastle.version>1.55</bouncycastle.version>
<commons-codec.version>1.10</commons-codec.version> <commons-codec.version>1.10</commons-codec.version>
<commons-math3.version>3.6.1</commons-math3.version>
<commons-io.version>2.5</commons-io.version>
<commons-collections4.version>4.1</commons-collections4.version>
<collections-generic.version>4.01</collections-generic.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<testng.version>6.8</testng.version> <testng.version>6.10</testng.version>
<assertj.version>3.5.1</assertj.version> <assertj.version>3.6.1</assertj.version>
<httpcore.version>4.4.1</httpcore.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -0,0 +1,2 @@
### Relevant Articles:
- [A Guide To UDP In Java](http://www.baeldung.com/udp-in-java)

View File

@ -0,0 +1,2 @@
###Relevant Articles:
- [Introduction to the Java NIO Selector](http://www.baeldung.com/java-nio-selector)

View File

@ -0,0 +1,2 @@
### Relevant Articles:
- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java)

View File

@ -16,10 +16,10 @@ public class ExitingExecutorServiceExample {
public static void main(String... args) { public static void main(String... args) {
ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(5); final ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(5);
ExecutorService executorService = MoreExecutors.getExitingExecutorService(executor, 100, TimeUnit.MILLISECONDS); final ExecutorService executorService = MoreExecutors.getExitingExecutorService(executor, 100, TimeUnit.MILLISECONDS);
executorService.submit(() -> { executorService.submit((Runnable) () -> {
while (true) { while (true) {
} }
}); });

View File

@ -7,20 +7,21 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URL; import java.net.*;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.joining;
import static org.hamcrest.CoreMatchers.*;
public class EncoderDecoderUnitTest { public class EncoderDecoderUnitTest {
private static final Logger LOGGER = LoggerFactory.getLogger(EncoderDecoderUnitTest.class); private static final Logger LOGGER = LoggerFactory.getLogger(EncoderDecoderUnitTest.class);
private static final String testUrl = "http://www.baeldung.com?key1=value+1&key2=value%40%21%242&key3=value%253"; private static final String testUrl = "http://www.baeldung.com?key1=value+1&key2=value%40%21%242&key3=value%253";
private static final String testUrlWithPath = "http://www.baeldung.com/path+1?key1=value+1&key2=value%40%21%242&key3=value%253";
private String encodeValue(String value) { private String encodeValue(String value) {
String encoded = null; String encoded = null;
@ -46,9 +47,9 @@ public class EncoderDecoderUnitTest {
public void givenURL_whenAnalyze_thenCorrect() throws Exception { public void givenURL_whenAnalyze_thenCorrect() throws Exception {
URL url = new URL(testUrl); URL url = new URL(testUrl);
Assert.assertThat(url.getProtocol(), CoreMatchers.is("http")); Assert.assertThat(url.getProtocol(), is("http"));
Assert.assertThat(url.getHost(), CoreMatchers.is("www.baeldung.com")); Assert.assertThat(url.getHost(), is("www.baeldung.com"));
Assert.assertThat(url.getQuery(), CoreMatchers.is("key1=value+1&key2=value%40%21%242&key3=value%253")); Assert.assertThat(url.getQuery(), is("key1=value+1&key2=value%40%21%242&key3=value%253"));
} }
@Test @Test
@ -58,9 +59,11 @@ public class EncoderDecoderUnitTest {
requestParams.put("key2", "value@!$2"); requestParams.put("key2", "value@!$2");
requestParams.put("key3", "value%3"); requestParams.put("key3", "value%3");
String encodedURL = requestParams.keySet().stream().map(key -> key + "=" + encodeValue(requestParams.get(key))).collect(joining("&", "http://www.baeldung.com?", "")); String encodedURL = requestParams.keySet().stream()
.map(key -> key + "=" + encodeValue(requestParams.get(key)))
.collect(joining("&", "http://www.baeldung.com?", ""));
Assert.assertThat(testUrl, CoreMatchers.is(encodedURL)); Assert.assertThat(testUrl, is(encodedURL));
} }
@Test @Test
@ -74,4 +77,38 @@ public class EncoderDecoderUnitTest {
Assert.assertEquals("http://www.baeldung.com?key1=value 1&key2=value@!$2&key3=value%3", url.getProtocol() + "://" + url.getHost() + "?" + decodedQuery); Assert.assertEquals("http://www.baeldung.com?key1=value 1&key2=value@!$2&key3=value%3", url.getProtocol() + "://" + url.getHost() + "?" + decodedQuery);
} }
private String encodePath(String path) {
try {
path = new URI(null, null, path, null).getPath();
} catch (URISyntaxException e) {
LOGGER.error("Error encoding parameter {}", e.getMessage(), e);
}
return path;
}
@Test
public void givenPath_thenEncodeDecodePath() throws URISyntaxException {
URI uri = new URI(null, null, "/Path 1/Path+2", null);
Assert.assertEquals("/Path 1/Path+2", uri.getPath());
Assert.assertEquals("/Path%201/Path+2", uri.getRawPath());
}
@Test
public void givenPathAndRequestParam_whenUTF8Scheme_thenEncode() throws Exception {
Map<String, String> requestParams = new HashMap<>();
requestParams.put("key1", "value 1");
requestParams.put("key2", "value@!$2");
requestParams.put("key3", "value%3");
String path = "path+1";
String encodedURL = requestParams.keySet().stream()
.map(key -> key + "=" + encodeValue(requestParams.get(key)))
.collect(joining("&", "http://www.baeldung.com/" + encodePath(path) + "?", ""));
Assert.assertThat(testUrlWithPath, is(encodedURL));
}
} }

View File

@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import org.junit.Test; import org.junit.Test;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.hasSize;
@ -16,7 +17,9 @@ public class Java8CollectionCleanupUnitTest {
@Test @Test
public void givenListContainsNulls_whenFilteringParallel_thenCorrect() { public void givenListContainsNulls_whenFilteringParallel_thenCorrect() {
final List<Integer> list = Lists.newArrayList(null, 1, 2, null, 3, null); final List<Integer> list = Lists.newArrayList(null, 1, 2, null, 3, null);
final List<Integer> listWithoutNulls = list.parallelStream().filter(i -> i != null).collect(Collectors.toList()); final List<Integer> listWithoutNulls = list.parallelStream()
.filter(Objects::nonNull)
.collect(Collectors.toList());
assertThat(listWithoutNulls, hasSize(3)); assertThat(listWithoutNulls, hasSize(3));
} }
@ -24,7 +27,9 @@ public class Java8CollectionCleanupUnitTest {
@Test @Test
public void givenListContainsNulls_whenFilteringSerial_thenCorrect() { public void givenListContainsNulls_whenFilteringSerial_thenCorrect() {
final List<Integer> list = Lists.newArrayList(null, 1, 2, null, 3, null); final List<Integer> list = Lists.newArrayList(null, 1, 2, null, 3, null);
final List<Integer> listWithoutNulls = list.stream().filter(i -> i != null).collect(Collectors.toList()); final List<Integer> listWithoutNulls = list.stream()
.filter(Objects::nonNull)
.collect(Collectors.toList());
assertThat(listWithoutNulls, hasSize(3)); assertThat(listWithoutNulls, hasSize(3));
} }
@ -32,7 +37,7 @@ public class Java8CollectionCleanupUnitTest {
@Test @Test
public void givenListContainsNulls_whenRemovingNullsWithRemoveIf_thenCorrect() { public void givenListContainsNulls_whenRemovingNullsWithRemoveIf_thenCorrect() {
final List<Integer> listWithoutNulls = Lists.newArrayList(null, 1, 2, null, 3, null); final List<Integer> listWithoutNulls = Lists.newArrayList(null, 1, 2, null, 3, null);
listWithoutNulls.removeIf(p -> p == null); listWithoutNulls.removeIf(Objects::isNull);
assertThat(listWithoutNulls, hasSize(3)); assertThat(listWithoutNulls, hasSize(3));
} }
@ -40,7 +45,9 @@ public class Java8CollectionCleanupUnitTest {
@Test @Test
public void givenListContainsDuplicates_whenRemovingDuplicatesWithJava8_thenCorrect() { public void givenListContainsDuplicates_whenRemovingDuplicatesWithJava8_thenCorrect() {
final List<Integer> listWithDuplicates = Lists.newArrayList(1, 1, 2, 2, 3, 3); final List<Integer> listWithDuplicates = Lists.newArrayList(1, 1, 2, 2, 3, 3);
final List<Integer> listWithoutDuplicates = listWithDuplicates.parallelStream().distinct().collect(Collectors.toList()); final List<Integer> listWithoutDuplicates = listWithDuplicates.parallelStream()
.distinct()
.collect(Collectors.toList());
assertThat(listWithoutDuplicates, hasSize(3)); assertThat(listWithoutDuplicates, hasSize(3));
} }

View File

@ -8,7 +8,7 @@ import java.io.StringWriter;
import java.util.Date; import java.util.Date;
import java.util.Scanner; import java.util.Scanner;
public class JavaTryWithResourcesUnitTest { public class JavaTryWithResourcesLongRunningUnitTest {
private static final String TEST_STRING_HELLO_WORLD = "Hello World"; private static final String TEST_STRING_HELLO_WORLD = "Hello World";
private Date resource1Date, resource2Date; private Date resource1Date, resource2Date;

View File

@ -99,6 +99,7 @@ public class OptionalTest {
assertFalse(priceIsInRange1(new Modem(9.9))); assertFalse(priceIsInRange1(new Modem(9.9)));
assertFalse(priceIsInRange1(new Modem(null))); assertFalse(priceIsInRange1(new Modem(null)));
assertFalse(priceIsInRange1(new Modem(15.5))); assertFalse(priceIsInRange1(new Modem(15.5)));
assertFalse(priceIsInRange1(null));
} }
@ -108,6 +109,7 @@ public class OptionalTest {
assertFalse(priceIsInRange2(new Modem(9.9))); assertFalse(priceIsInRange2(new Modem(9.9)));
assertFalse(priceIsInRange2(new Modem(null))); assertFalse(priceIsInRange2(new Modem(null)));
assertFalse(priceIsInRange2(new Modem(15.5))); assertFalse(priceIsInRange2(new Modem(15.5)));
assertFalse(priceIsInRange1(null));
} }
public boolean priceIsInRange1(Modem modem) { public boolean priceIsInRange1(Modem modem) {

View File

@ -15,85 +15,99 @@ public class JoinSplitCollectionsUnitTest {
public void whenJoiningTwoArrays_thenJoined() { public void whenJoiningTwoArrays_thenJoined() {
String[] animals1 = new String[] { "Dog", "Cat" }; String[] animals1 = new String[] { "Dog", "Cat" };
String[] animals2 = new String[] { "Bird", "Cow" }; String[] animals2 = new String[] { "Bird", "Cow" };
String[] result = Stream.concat(Arrays.stream(animals1), Arrays.stream(animals2)).toArray(String[]::new); String[] result = Stream.concat(
Arrays.stream(animals1), Arrays.stream(animals2)).toArray(String[]::new);
assertArrayEquals(result, new String[] { "Dog", "Cat", "Bird", "Cow" }); assertArrayEquals(result, new String[] { "Dog", "Cat", "Bird", "Cow" });
} }
@Test @Test
public void whenJoiningTwoCollections_thenJoined() { public void whenJoiningTwoCollections_thenJoined() {
Collection<Integer> collection1 = Arrays.asList(7, 8, 9); Collection<String> collection1 = Arrays.asList("Dog", "Cat");
Collection<Integer> collection2 = Arrays.asList(10, 11, 12); Collection<String> collection2 = Arrays.asList("Bird", "Cow", "Moose");
Collection<Integer> result = Stream.concat(collection1.stream(), collection2.stream()).collect(Collectors.toList()); Collection<String> result = Stream.concat(
collection1.stream(), collection2.stream())
.collect(Collectors.toList());
assertTrue(result.equals(Arrays.asList(7, 8, 9, 10, 11, 12))); assertTrue(result.equals(Arrays.asList("Dog", "Cat", "Bird", "Cow", "Moose")));
} }
@Test @Test
public void whenJoiningTwoCollectionsWithFilter_thenJoined() { public void whenJoiningTwoCollectionsWithFilter_thenJoined() {
Collection<Integer> collection1 = Arrays.asList(7, 8, 11); Collection<String> collection1 = Arrays.asList("Dog", "Cat");
Collection<Integer> collection2 = Arrays.asList(9, 12, 10); Collection<String> collection2 = Arrays.asList("Bird", "Cow", "Moose");
Collection<Integer> result = Stream.concat(collection1.stream(), collection2.stream()).filter(next -> next <= 10).collect(Collectors.toList()); Collection<String> result = Stream.concat(
collection1.stream(), collection2.stream())
.filter(e -> e.length() == 3)
.collect(Collectors.toList());
assertTrue(result.equals(Arrays.asList(7, 8, 9, 10))); assertTrue(result.equals(Arrays.asList("Dog", "Cat", "Cow")));
} }
@Test @Test
public void whenConvertArrayToString_thenConverted() { public void whenConvertArrayToString_thenConverted() {
String[] colors = new String[] { "Red", "Blue", "Green", "Yellow" }; String[] animals = new String[] { "Dog", "Cat", "Bird", "Cow" };
String result = Arrays.stream(colors).collect(Collectors.joining(", ")); String result = Arrays.stream(animals).collect(Collectors.joining(", "));
assertEquals(result, "Red, Blue, Green, Yellow"); assertEquals(result, "Dog, Cat, Bird, Cow");
} }
@Test @Test
public void whenConvertCollectionToString_thenConverted() { public void whenConvertCollectionToString_thenConverted() {
Collection<String> directions = Arrays.asList("Left", "Right", "Top", "Bottom"); Collection<String> animals = Arrays.asList("Dog", "Cat", "Bird", "Cow");
String result = directions.stream().collect(Collectors.joining(", ")); String result = animals.stream().collect(Collectors.joining(", "));
assertEquals(result, "Left, Right, Top, Bottom"); assertEquals(result, "Dog, Cat, Bird, Cow");
} }
@Test @Test
public void whenConvertMapToString_thenConverted() { public void whenConvertMapToString_thenConverted() {
Map<Integer, String> users = new HashMap<>(); Map<Integer, String> animals = new HashMap<>();
users.put(1, "John Doe"); animals.put(1, "Dog");
users.put(2, "Paul Smith"); animals.put(2, "Cat");
users.put(3, "Susan Anderson"); animals.put(3, "Cow");
String result = users.entrySet().stream().map(entry -> entry.getKey() + " = " + entry.getValue()).collect(Collectors.joining(", ")); String result = animals.entrySet().stream()
.map(entry -> entry.getKey() + " = " + entry.getValue())
.collect(Collectors.joining(", "));
assertEquals(result, "1 = John Doe, 2 = Paul Smith, 3 = Susan Anderson"); assertEquals(result, "1 = Dog, 2 = Cat, 3 = Cow");
} }
@Test @Test
public void whenConvertNestedCollectionToString_thenConverted() { public void whenConvertNestedCollectionToString_thenConverted() {
Collection<List<String>> nested = new ArrayList<>(); Collection<List<String>> nested = new ArrayList<>();
nested.add(Arrays.asList("Left", "Right", "Top", "Bottom")); nested.add(Arrays.asList("Dog", "Cat"));
nested.add(Arrays.asList("Red", "Blue", "Green", "Yellow")); nested.add(Arrays.asList("Cow", "Pig"));
String result = nested.stream().map(nextList -> nextList.stream().collect(Collectors.joining("-"))).collect(Collectors.joining("; ")); String result = nested.stream().map(
nextList -> nextList.stream()
.collect(Collectors.joining("-")))
.collect(Collectors.joining("; "));
assertEquals(result, "Left-Right-Top-Bottom; Red-Blue-Green-Yellow"); assertEquals(result, "Dog-Cat; Cow-Pig");
} }
@Test @Test
public void whenConvertCollectionToStringAndSkipNull_thenConverted() { public void whenConvertCollectionToStringAndSkipNull_thenConverted() {
Collection<String> fruits = Arrays.asList("Apple", "Orange", null, "Grape"); Collection<String> animals = Arrays.asList("Dog", "Cat", null, "Moose");
String result = fruits.stream().filter(Objects::nonNull).collect(Collectors.joining(", ")); String result = animals.stream()
.filter(Objects::nonNull)
.collect(Collectors.joining(", "));
assertEquals(result, "Apple, Orange, Grape"); assertEquals(result, "Dog, Cat, Moose");
} }
@Test @Test
public void whenSplitCollectionHalf_thenConverted() { public void whenSplitCollectionHalf_thenConverted() {
Collection<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); Collection<String> animals = Arrays.asList(
Collection<Integer> result1 = new ArrayList<>(); "Dog", "Cat", "Cow", "Bird", "Moose", "Pig");
Collection<Integer> result2 = new ArrayList<>(); Collection<String> result1 = new ArrayList<>();
Collection<String> result2 = new ArrayList<>();
AtomicInteger count = new AtomicInteger(); AtomicInteger count = new AtomicInteger();
int midpoint = Math.round(numbers.size() / 2); int midpoint = Math.round(animals.size() / 2);
numbers.forEach(next -> { animals.forEach(next -> {
int index = count.getAndIncrement(); int index = count.getAndIncrement();
if (index < midpoint) { if (index < midpoint) {
result1.add(next); result1.add(next);
@ -102,53 +116,59 @@ public class JoinSplitCollectionsUnitTest {
} }
}); });
assertTrue(result1.equals(Arrays.asList(1, 2, 3, 4, 5))); assertTrue(result1.equals(Arrays.asList("Dog", "Cat", "Cow")));
assertTrue(result2.equals(Arrays.asList(6, 7, 8, 9, 10))); assertTrue(result2.equals(Arrays.asList("Bird", "Moose", "Pig")));
} }
@Test @Test
public void whenSplitArrayByWordLength_thenConverted() { public void whenSplitArrayByWordLength_thenConverted() {
String[] words = new String[] { "bye", "cold", "it", "and", "my", "word" }; String[] animals = new String[] { "Dog", "Cat", "Bird", "Cow", "Pig", "Moose"};
Map<Integer, List<String>> result = Arrays.stream(words).collect(Collectors.groupingBy(String::length)); Map<Integer, List<String>> result = Arrays.stream(animals)
.collect(Collectors.groupingBy(String::length));
assertTrue(result.get(2).equals(Arrays.asList("it", "my"))); assertTrue(result.get(3).equals(Arrays.asList("Dog", "Cat", "Cow", "Pig")));
assertTrue(result.get(3).equals(Arrays.asList("bye", "and"))); assertTrue(result.get(4).equals(Arrays.asList("Bird")));
assertTrue(result.get(4).equals(Arrays.asList("cold", "word"))); assertTrue(result.get(5).equals(Arrays.asList("Moose")));
} }
@Test @Test
public void whenConvertStringToArray_thenConverted() { public void whenConvertStringToArray_thenConverted() {
String colors = "Red, Blue, Green, Yellow"; String animals = "Dog, Cat, Bird, Cow";
String[] result = colors.split(", "); String[] result = animals.split(", ");
assertArrayEquals(result, new String[] { "Red", "Blue", "Green", "Yellow" }); assertArrayEquals(result, new String[] { "Dog", "Cat", "Bird", "Cow" });
} }
@Test @Test
public void whenConvertStringToCollection_thenConverted() { public void whenConvertStringToCollection_thenConverted() {
String colors = "Left, Right, Top, Bottom"; String animals = "Dog, Cat, Bird, Cow";
Collection<String> result = Arrays.asList(colors.split(", ")); Collection<String> result = Arrays.asList(animals.split(", "));
assertTrue(result.equals(Arrays.asList("Left", "Right", "Top", "Bottom"))); assertTrue(result.equals(Arrays.asList("Dog", "Cat", "Bird", "Cow")));
} }
@Test @Test
public void whenConvertStringToMap_thenConverted() { public void whenConvertStringToMap_thenConverted() {
String users = "1 = John Doe, 2 = Paul Smith, 3 = Susan Anderson"; String animals = "1 = Dog, 2 = Cat, 3 = Bird";
Map<Integer, String> result = Arrays.stream(users.split(", ")).map(next -> next.split(" = ")).collect(Collectors.toMap(entry -> Integer.parseInt(entry[0]), entry -> entry[1])); Map<Integer, String> result = Arrays.stream(
animals.split(", ")).map(next -> next.split(" = "))
.collect(Collectors.toMap(entry -> Integer.parseInt(entry[0]), entry -> entry[1]));
assertEquals(result.get(1), "John Doe"); assertEquals(result.get(1), "Dog");
assertEquals(result.get(2), "Paul Smith"); assertEquals(result.get(2), "Cat");
assertEquals(result.get(3), "Susan Anderson"); assertEquals(result.get(3), "Bird");
} }
@Test @Test
public void whenConvertCollectionToStringMultipleSeparators_thenConverted() { public void whenConvertCollectionToStringMultipleSeparators_thenConverted() {
String fruits = "Apple. , Orange, Grape. Lemon"; String animals = "Dog. , Cat, Bird. Cow";
Collection<String> result = Arrays.stream(fruits.split("[,|.]")).map(String::trim).filter(next -> !next.isEmpty()).collect(Collectors.toList()); Collection<String> result = Arrays.stream(animals.split("[,|.]"))
.map(String::trim)
.filter(next -> !next.isEmpty())
.collect(Collectors.toList());
assertTrue(result.equals(Arrays.asList("Apple", "Orange", "Grape", "Lemon"))); assertTrue(result.equals(Arrays.asList("Dog", "Cat", "Bird", "Cow")));
} }
} }

View File

@ -79,10 +79,10 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.7</source> <source>${java.version}</source>
<target>1.7</target> <target>${java.version}</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -100,14 +100,15 @@
</build> </build>
<properties> <properties>
<java.version>1.7</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<couchbase.client.version>2.2.6</couchbase.client.version> <couchbase.client.version>2.3.6</couchbase.client.version>
<spring-framework.version>4.2.4.RELEASE</spring-framework.version> <spring-framework.version>4.3.4.RELEASE</spring-framework.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<org.slf4j.version>1.7.12</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<junit.version>4.11</junit.version> <junit.version>4.12</junit.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>

View File

@ -25,17 +25,22 @@
resources, i.e. build is platform dependent! --> resources, i.e. build is platform dependent! -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.7.21</slf4j.version>
<querydsl.version>3.7.4</querydsl.version>
<deltaspike.version>1.7.2</deltaspike.version>
<!-- JBoss dependency versions --> <!-- JBoss dependency versions -->
<version.wildfly.maven.plugin>1.0.2.Final</version.wildfly.maven.plugin> <wildfly.maven.plugin.version>1.0.2.Final</wildfly.maven.plugin.version>
<!-- Define the version of the JBoss BOMs we want to import to specify <!-- Define the version of the JBoss BOMs we want to import to specify
tested stacks. --> tested stacks. -->
<version.jboss.bom>8.2.1.Final</version.jboss.bom> <jboss.bom.version>8.2.2.Final</jboss.bom.version>
<!-- other plugin versions --> <!-- other plugin versions -->
<version.compiler.plugin>3.1</version.compiler.plugin> <version.compiler.plugin>3.6.0</version.compiler.plugin>
<version.surefire.plugin>2.16</version.surefire.plugin> <surefire.plugin.version>2.19.1</surefire.plugin.version>
<version.war.plugin>2.5</version.war.plugin> <war.plugin.version>2.6</war.plugin.version>
<apt-maven-plugin.version>1.1.3</apt-maven-plugin.version>
<!-- maven-compiler-plugin --> <!-- maven-compiler-plugin -->
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
@ -56,14 +61,14 @@
<dependency> <dependency>
<groupId>org.wildfly.bom</groupId> <groupId>org.wildfly.bom</groupId>
<artifactId>jboss-javaee-7.0-with-tools</artifactId> <artifactId>jboss-javaee-7.0-with-tools</artifactId>
<version>${version.jboss.bom}</version> <version>${jboss.bom.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wildfly.bom</groupId> <groupId>org.wildfly.bom</groupId>
<artifactId>jboss-javaee-7.0-with-hibernate</artifactId> <artifactId>jboss-javaee-7.0-with-hibernate</artifactId>
<version>${version.jboss.bom}</version> <version>${jboss.bom.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -187,14 +192,14 @@
<dependency> <dependency>
<groupId>org.apache.deltaspike.modules</groupId> <groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-data-module-api</artifactId> <artifactId>deltaspike-data-module-api</artifactId>
<version>1.7.1</version> <version>${deltaspike.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.deltaspike.modules</groupId> <groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-data-module-impl</artifactId> <artifactId>deltaspike-data-module-impl</artifactId>
<version>1.7.1</version> <version>${deltaspike.version}</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
@ -202,20 +207,20 @@
<dependency> <dependency>
<groupId>com.mysema.querydsl</groupId> <groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId> <artifactId>querydsl-apt</artifactId>
<version>3.7.4</version> <version>${querydsl.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.mysema.querydsl</groupId> <groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId> <artifactId>querydsl-jpa</artifactId>
<version>3.7.4</version> <version>${querydsl.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version> <version>${slf4j.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -226,7 +231,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>${version.war.plugin}</version> <version>${war.plugin.version}</version>
<configuration> <configuration>
<!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! --> <!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! -->
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
@ -235,7 +240,7 @@
<plugin> <plugin>
<groupId>com.mysema.maven</groupId> <groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId> <artifactId>apt-maven-plugin</artifactId>
<version>1.0.9</version> <version>${apt-maven-plugin.version}</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -253,7 +258,7 @@
<plugin> <plugin>
<groupId>org.wildfly.plugins</groupId> <groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId> <artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version> <version>${wildfly.maven.plugin.version}</version>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
@ -272,7 +277,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version> <version>${surefire.plugin.version}</version>
<configuration> <configuration>
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>

View File

@ -13,7 +13,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>7</source> <source>7</source>
<target>7</target> <target>7</target>
@ -26,33 +26,41 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.5</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId> <artifactId>jcl-over-slf4j</artifactId>
<version>1.7.5</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.2.1</version> <version>${commons-lang3.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sf.dozer</groupId> <groupId>net.sf.dozer</groupId>
<artifactId>dozer</artifactId> <artifactId>dozer</artifactId>
<version>5.5.1</version> <version>${dozer.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.3</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<slf4j.version>1.7.21</slf4j.version>
<commons-lang3.version>3.5</commons-lang3.version>
<dozer.version>5.5.1</dozer.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -44,4 +44,10 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<junit.version>4.12</junit.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties>
</project> </project>

View File

@ -15,7 +15,7 @@
<dependency> <dependency>
<groupId>javax</groupId> <groupId>javax</groupId>
<artifactId>javaee-api</artifactId> <artifactId>javaee-api</artifactId>
<version>7.0</version> <version>${javaee-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -25,7 +25,7 @@
<plugin> <plugin>
<groupId>org.wildfly.plugins</groupId> <groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId> <artifactId>wildfly-maven-plugin</artifactId>
<version>1.1.0.Alpha5</version> <version>${wildfly-maven-plugin.version}</version>
<configuration> <configuration>
<hostname>127.0.0.1</hostname> <hostname>127.0.0.1</hostname>
<port>9990</port> <port>9990</port>
@ -37,4 +37,9 @@
</plugins> </plugins>
<!-- <finalName>ejb-remote</finalName> --> <!-- <finalName>ejb-remote</finalName> -->
</build> </build>
<properties>
<javaee-api.version>7.0</javaee-api.version>
<wildfly-maven-plugin.version>1.1.0.Beta1</wildfly-maven-plugin.version>
</properties>
</project> </project>

View File

@ -38,14 +38,14 @@
<dependency> <dependency>
<groupId>javax</groupId> <groupId>javax</groupId>
<artifactId>javaee-api</artifactId> <artifactId>javaee-api</artifactId>
<version>7.0</version> <version>${javaee-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId> <artifactId>wildfly-ejb-client-bom</artifactId>
<version>10.1.0.Final</version> <version>${wildfly.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -57,7 +57,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -66,7 +66,7 @@
<plugin> <plugin>
<artifactId>maven-ejb-plugin</artifactId> <artifactId>maven-ejb-plugin</artifactId>
<version>2.4</version> <version>${maven-ejb-plugin.version}</version>
<configuration> <configuration>
<ejbVersion>3.2</ejbVersion> <ejbVersion>3.2</ejbVersion>
</configuration> </configuration>
@ -79,4 +79,11 @@
<module>ejb-remote</module> <module>ejb-remote</module>
<module>ejb-client</module> <module>ejb-client</module>
</modules> </modules>
<properties>
<javaee-api.version>7.0</javaee-api.version>
<wildfly.version>10.1.0.Final</wildfly.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-ejb-plugin.version>2.5.1</maven-ejb-plugin.version>
</properties>
</project> </project>

View File

@ -23,7 +23,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -32,4 +32,8 @@
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </build>
<properties>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -16,54 +16,62 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<feign.version>9.4.0</feign.version>
<slf4j.version>1.7.21</slf4j.version>
<log4j.version>2.7</log4j.version>
<lombok.version>1.16.12</lombok.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<spring-boot-maven-plugin.version>1.4.2.RELEASE</spring-boot-maven-plugin.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>io.github.openfeign</groupId> <groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId> <artifactId>feign-core</artifactId>
<version>9.3.1</version> <version>${feign.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.github.openfeign</groupId> <groupId>io.github.openfeign</groupId>
<artifactId>feign-okhttp</artifactId> <artifactId>feign-okhttp</artifactId>
<version>9.3.1</version> <version>${feign.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.github.openfeign</groupId> <groupId>io.github.openfeign</groupId>
<artifactId>feign-gson</artifactId> <artifactId>feign-gson</artifactId>
<version>9.3.1</version> <version>${feign.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.github.openfeign</groupId> <groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId> <artifactId>feign-slf4j</artifactId>
<version>9.3.1</version> <version>${feign.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.21</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.6.2</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId> <artifactId>log4j-slf4j-impl</artifactId>
<version>2.6.2</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.16.10</version> <version>${lombok.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -74,7 +82,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -83,7 +91,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version> <version>${maven-surefire-plugin.version}</version>
<configuration> <configuration>
<skipTests>true</skipTests> <skipTests>true</skipTests>
</configuration> </configuration>
@ -91,9 +99,10 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.0.RELEASE</version> <version>${spring-boot-maven-plugin.version}</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </build>
</project> </project>

View File

@ -10,7 +10,7 @@
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>6.0.3</version> <version>${mysql.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
@ -18,12 +18,12 @@
<plugin> <plugin>
<groupId>org.flywaydb</groupId> <groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId> <artifactId>flyway-maven-plugin</artifactId>
<version>4.0.3</version> <version>${flyway-maven-plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -31,4 +31,9 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<mysql.version>6.0.5</mysql.version>
<flyway-maven-plugin.version>4.0.3</flyway-maven-plugin.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -13,7 +13,7 @@
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>2.4</version> <version>${joda-time.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -24,13 +24,13 @@
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.4</version> <version>${commons-io.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId> <artifactId>commons-collections4</artifactId>
<version>4.0</version> <version>${commons-collections4.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -39,8 +39,6 @@
<version>${commons-lang3.version}</version> <version>${commons-lang3.version}</version>
</dependency> </dependency>
<!-- web -->
<!-- marshalling --> <!-- marshalling -->
<dependency> <dependency>
@ -112,40 +110,24 @@
</build> </build>
<properties> <properties>
<!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<!-- marshalling --> <!-- marshalling -->
<gson.version>2.3</gson.version> <gson.version>2.8.0</gson.version>
<!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version>
<logback.version>1.1.3</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<commons-collections4.version>4.1</commons-collections4.version>
<commons-io.version>2.5</commons-io.version>
<joda-time.version>2.9.6</joda-time.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -19,7 +19,7 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId> <artifactId>commons-collections4</artifactId>
<version>4.0</version> <version>${commons-collections4.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -28,8 +28,6 @@
<version>${commons-lang3.version}</version> <version>${commons-lang3.version}</version>
</dependency> </dependency>
<!-- web -->
<!-- test scoped --> <!-- test scoped -->
<dependency> <dependency>
@ -93,37 +91,19 @@
</build> </build>
<properties> <properties>
<!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version>
<logback.version>1.1.3</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<commons-collections4.version>4.1</commons-collections4.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -11,13 +11,13 @@
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>18.0</version> <version>${guava.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -26,7 +26,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<debug>true</debug> <debug>true</debug>
<optimize>true</optimize> <optimize>true</optimize>
@ -39,5 +39,10 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -17,13 +17,13 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hamcrest</groupId> <groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId> <artifactId>hamcrest-all</artifactId>
<version>1.3</version> <version>${hamcrest.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -32,7 +32,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<debug>true</debug> <debug>true</debug>
<optimize>true</optimize> <optimize>true</optimize>
@ -48,6 +48,9 @@
<properties> <properties>
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<junit.version>4.12</junit.version>
<hamcrest.version>1.3</hamcrest.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -91,14 +91,14 @@
<dependency> <dependency>
<groupId>javax.inject</groupId> <groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId> <artifactId>javax.inject</artifactId>
<version>1</version> <version>${inject.version}</version>
</dependency> </dependency>
<!-- Servlet --> <!-- Servlet -->
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version> <version>${javax.servlet-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet.jsp</groupId> <groupId>javax.servlet.jsp</groupId>
@ -108,7 +108,7 @@
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId> <artifactId>jstl</artifactId>
<version>1.2</version> <version>${jstl.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
@ -126,14 +126,14 @@
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>2.6</version> <version>${joda-time.version}</version>
</dependency> </dependency>
<!-- Handlebars.java --> <!-- Handlebars.java -->
<dependency> <dependency>
<groupId>com.github.jknack</groupId> <groupId>com.github.jknack</groupId>
<artifactId>handlebars</artifactId> <artifactId>handlebars</artifactId>
<version>1.3.2</version> <version>${handlebars.version}</version>
</dependency> </dependency>
<!-- logging --> <!-- logging -->
@ -175,7 +175,7 @@
<plugin> <plugin>
<groupId>net.alchim31.maven</groupId> <groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId> <artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version> <version>${yuicompressor-maven-plugin.version}</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -210,46 +210,29 @@
<java-version>1.8</java-version> <java-version>1.8</java-version>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.springframework.security.version>4.0.4.RELEASE</org.springframework.security.version> <org.springframework.security.version>4.2.0.RELEASE</org.springframework.security.version>
<org.aspectj-version>1.8.1</org.aspectj-version> <org.aspectj-version>1.8.9</org.aspectj-version>
<javax.servlet.jsp-api.version>2.3.2-b01</javax.servlet.jsp-api.version> <javax.servlet.jsp-api.version>2.3.2-b02</javax.servlet.jsp-api.version>
<!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<spring-data-jpa.version>1.9.2.RELEASE</spring-data-jpa.version>
<!-- marshalling --> <!-- marshalling -->
<jackson.version>2.7.8</jackson.version> <jackson.version>2.8.5</jackson.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various --> <!-- various 1.3.2-->
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version> <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<handlebars.version>4.0.6</handlebars.version>
<!-- util --> <joda-time.version>2.9.6</joda-time.version>
<guava.version>19.0</guava.version> <jstl.version>1.2</jstl.version>
<commons-lang3.version>3.4</commons-lang3.version> <javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<inject.version>1</inject.version>
<!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- Maven plugins --> <!-- Maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <yuicompressor-maven-plugin.version>1.5.1</yuicompressor-maven-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -2,10 +2,10 @@
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation=" xsi:schemaLocation="
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd" http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd"
> >
<http use-expressions="true"> <http use-expressions="true">
<intercept-url pattern="/login*" access="permitAll"/> <intercept-url pattern="/login*" access="permitAll"/>

2
hazelcast/README.md Normal file
View File

@ -0,0 +1,2 @@
### Relevant Articles:
- [Guide to Hazelcast with Java](http://www.baeldung.com/java-hazelcast)

View File

@ -64,14 +64,14 @@
<properties> <properties>
<!-- hazelcast --> <!-- hazelcast -->
<hazelcast.version>3.7.2</hazelcast.version> <hazelcast.version>3.7.4</hazelcast.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.21</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.7</logback.version> <logback.version>1.1.7</logback.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -51,13 +51,13 @@
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
<version>1.9</version> <version>${commons-codec.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId> <artifactId>httpasyncclient</artifactId>
<version>4.1-beta1</version> <!-- 4.0.2 --> <!-- 4.1-beta1 --> <version>${httpasyncclient.version}</version> <!-- 4.0.2 --> <!-- 4.1-beta1 -->
</dependency> </dependency>
<!-- logging --> <!-- logging -->
@ -188,37 +188,28 @@
</profiles> </profiles>
<properties> <properties>
<!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<commons-codec.version>1.10</commons-codec.version>
<httpasyncclient.version>4.1.2</httpasyncclient.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version> <httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5</httpclient.version> <!-- 4.3.6 --> <!-- 4.4-beta1 --> <httpclient.version>4.5.2</httpclient.version> <!-- 4.3.6 --> <!-- 4.4-beta1 -->
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -37,7 +37,7 @@ public class HttpAsyncClientLiveTest {
private static final String HOST = "http://www.google.com"; private static final String HOST = "http://www.google.com";
private static final String HOST_WITH_SSL = "https://mms.nw.ru/"; private static final String HOST_WITH_SSL = "https://mms.nw.ru/";
private static final String HOST_WITH_PROXY = "https://issues.apache.org/"; private static final String HOST_WITH_PROXY = "http://httpbin.org/";
private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://browserspy.dk/password-ok.php";// "http://localhost:8080/spring-security-rest-basic-auth/api/foos/1"; private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://browserspy.dk/password-ok.php";// "http://localhost:8080/spring-security-rest-basic-auth/api/foos/1";
private static final String DEFAULT_USER = "test";// "user1"; private static final String DEFAULT_USER = "test";// "user1";
private static final String DEFAULT_PASS = "test";// "user1Pass"; private static final String DEFAULT_PASS = "test";// "user1Pass";
@ -89,7 +89,7 @@ public class HttpAsyncClientLiveTest {
public void whenUseProxyWithHttpClient_thenCorrect() throws Exception { public void whenUseProxyWithHttpClient_thenCorrect() throws Exception {
final CloseableHttpAsyncClient client = HttpAsyncClients.createDefault(); final CloseableHttpAsyncClient client = HttpAsyncClients.createDefault();
client.start(); client.start();
final HttpHost proxy = new HttpHost("74.50.126.248", 3127); final HttpHost proxy = new HttpHost("127.0.0.1", 8080);
final RequestConfig config = RequestConfig.custom().setProxy(proxy).build(); final RequestConfig config = RequestConfig.custom().setProxy(proxy).build();
final HttpGet request = new HttpGet(HOST_WITH_PROXY); final HttpGet request = new HttpGet(HOST_WITH_PROXY);
request.setConfig(config); request.setConfig(config);

View File

@ -218,7 +218,7 @@ public class HttpClientConnectionManagementLiveTest {
final HeaderElement he = it.nextElement(); final HeaderElement he = it.nextElement();
final String param = he.getName(); final String param = he.getName();
final String value = he.getValue(); final String value = he.getValue();
if (value != null && param.equalsIgnoreCase("timeout")) { if ((value != null) && param.equalsIgnoreCase("timeout")) {
return Long.parseLong(value) * 1000; return Long.parseLong(value) * 1000;
} }
} }
@ -251,9 +251,9 @@ public class HttpClientConnectionManagementLiveTest {
basicConnManager.connect(conn, route, 1000, context); basicConnManager.connect(conn, route, 1000, context);
basicConnManager.routeComplete(conn, route, context); basicConnManager.routeComplete(conn, route, context);
final HttpRequestExecutor exeRequest = new HttpRequestExecutor(); final HttpRequestExecutor exeRequest = new HttpRequestExecutor();
context.setTargetHost((new HttpHost("www.baeldung.com", 80))); context.setTargetHost((new HttpHost("http://httpbin.org", 80)));
final HttpGet get = new HttpGet("http://www.baeldung.com"); final HttpGet get = new HttpGet("http://httpbin.org");
exeRequest.execute(get, conn, context); exeRequest.execute(get, conn, context);
conn.isResponseAvailable(1000); conn.isResponseAvailable(1000);
basicConnManager.releaseConnection(conn, null, 1, TimeUnit.SECONDS); basicConnManager.releaseConnection(conn, null, 1, TimeUnit.SECONDS);
@ -282,8 +282,9 @@ public class HttpClientConnectionManagementLiveTest {
for (final MultiHttpClientConnThread thread : threads) { for (final MultiHttpClientConnThread thread : threads) {
thread.join(10000); thread.join(10000);
countConnMade++; countConnMade++;
if (countConnMade == 0) if (countConnMade == 0) {
assertTrue(thread.getLeasedConn() == 5); assertTrue(thread.getLeasedConn() == 5);
}
} }
} }
@ -356,7 +357,7 @@ public class HttpClientConnectionManagementLiveTest {
// @Ignore // @Ignore
// 8.2 ARTICLE VERSION // 8.2 ARTICLE VERSION
public final void whenCustomizedIdleConnMonitor_thenNoExceptions() throws InterruptedException, IOException { public final void whenCustomizedIdleConnMonitor_thenNoExceptions() throws InterruptedException, IOException {
final HttpGet get = new HttpGet("http://google.com"); new HttpGet("http://google.com");
poolingConnManager = new PoolingHttpClientConnectionManager(); poolingConnManager = new PoolingHttpClientConnectionManager();
client = HttpClients.custom().setConnectionManager(poolingConnManager).build(); client = HttpClients.custom().setConnectionManager(poolingConnManager).build();
final IdleConnectionMonitorThread staleMonitor = new IdleConnectionMonitorThread(poolingConnManager); final IdleConnectionMonitorThread staleMonitor = new IdleConnectionMonitorThread(poolingConnManager);

View File

@ -11,7 +11,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <version>1.4.2.RELEASE</version>
</parent> </parent>
@ -21,7 +21,7 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<!-- Hystrix --> <!-- Hystrix -->
<hystrix-core.version>1.5.4</hystrix-core.version> <hystrix-core.version>1.5.8</hystrix-core.version>
<rxjava-core.version>0.20.7</rxjava-core.version> <rxjava-core.version>0.20.7</rxjava-core.version>
<!-- Testing --> <!-- Testing -->
@ -29,13 +29,13 @@
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version> <maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version> <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<hystrix-metrics-event-stream.version>1.3.16</hystrix-metrics-event-stream.version> <hystrix-metrics-event-stream.version>1.5.8</hystrix-metrics-event-stream.version>
<hystrix-dashboard.version>1.4.3</hystrix-dashboard.version> <hystrix-dashboard.version>1.5.8</hystrix-dashboard.version>
<spring-boot-starter-test.version>1.4.0.RELEASE</spring-boot-starter-test.version> <spring-boot-starter-test.version>1.4.2.RELEASE</spring-boot-starter-test.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -10,7 +10,7 @@ import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
public class HystrixTimeoutTest { public class HystrixTimeoutIntegrationTest {
@Test @Test
public void givenInputBobAndDefaultSettings_whenCommandExecuted_thenReturnHelloBob(){ public void givenInputBobAndDefaultSettings_whenCommandExecuted_thenReturnHelloBob(){

View File

@ -12,24 +12,24 @@
<dependency> <dependency>
<groupId>org.immutables</groupId> <groupId>org.immutables</groupId>
<artifactId>value</artifactId> <artifactId>value</artifactId>
<version>2.2.10</version> <version>${immutables.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId> <artifactId>assertj-core</artifactId>
<version>3.5.2</version> <version>${assertj.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mutabilitydetector</groupId> <groupId>org.mutabilitydetector</groupId>
<artifactId>MutabilityDetector</artifactId> <artifactId>MutabilityDetector</artifactId>
<version>0.9.5</version> <version>${mutabilitydetector.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -39,7 +39,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -47,4 +47,13 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<immutables.version>2.3.10</immutables.version>
<junit.version>4.12</junit.version>
<assertj.version>3.6.1</assertj.version>
<mutabilitydetector.version>0.9.6</mutabilitydetector.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -88,28 +88,28 @@
<dependency> <dependency>
<groupId>io.rest-assured</groupId> <groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId> <artifactId>rest-assured</artifactId>
<version>3.0.1</version> <version>${rest-assured.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.rest-assured</groupId> <groupId>io.rest-assured</groupId>
<artifactId>json-schema-validator</artifactId> <artifactId>json-schema-validator</artifactId>
<version>3.0.0</version> <version>${rest-assured.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.rest-assured</groupId> <groupId>io.rest-assured</groupId>
<artifactId>json-path</artifactId> <artifactId>json-path</artifactId>
<version>3.0.1</version> <version>${rest-assured.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.fge</groupId> <groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId> <artifactId>json-schema-validator</artifactId>
<version>2.2.6</version> <version>${json-schema-validator.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -123,7 +123,7 @@
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId> <artifactId>assertj-core</artifactId>
<version>3.6.1</version> <version>${assertj.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -187,11 +187,6 @@
</build> </build>
<properties> <properties>
<!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<!-- marshalling --> <!-- marshalling -->
<jackson.version>2.8.5</jackson.version> <jackson.version>2.8.5</jackson.version>
@ -200,7 +195,6 @@
<logback.version>1.1.7</logback.version> <logback.version>1.1.7</logback.version>
<!-- various --> <!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<joda-time.version>2.9.6</joda-time.version> <joda-time.version>2.9.6</joda-time.version>
<gson.version>2.8.0</gson.version> <gson.version>2.8.0</gson.version>
<commons-collections4.version>4.1</commons-collections4.version> <commons-collections4.version>4.1</commons-collections4.version>
@ -211,21 +205,14 @@
<commons-io.version>2.5</commons-io.version> <commons-io.version>2.5</commons-io.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>2.2.26</mockito.version> <rest-assured.version>3.0.1</rest-assured.version>
<json-schema-validator.version>2.2.6</json-schema-validator.version>
<httpcore.version>4.4.1</httpcore.version> <assertj.version>3.6.1</assertj.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-compiler-plugin.source>1.8</maven-compiler-plugin.source> <maven-compiler-plugin.source>1.8</maven-compiler-plugin.source>

View File

@ -20,19 +20,19 @@
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.4</version> <version>${commons-io.version}</version>
</dependency> </dependency>
<!--jackson for xml--> <!--jackson for xml-->
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId> <artifactId>jackson-dataformat-xml</artifactId>
<version>2.7.4</version> <version>${jackson.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId> <artifactId>commons-collections4</artifactId>
<version>4.0</version> <version>${commons-collections4.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -41,8 +41,6 @@
<version>${commons-lang3.version}</version> <version>${commons-lang3.version}</version>
</dependency> </dependency>
<!-- web -->
<!-- marshalling --> <!-- marshalling -->
<dependency> <dependency>
@ -66,19 +64,19 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.module</groupId> <groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jsonSchema</artifactId> <artifactId>jackson-module-jsonSchema</artifactId>
<version>2.7.2</version> <version>${jackson.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>2.9.2</version> <version>${joda-time.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>2.6.2</version> <version>${gson.version}</version>
</dependency> </dependency>
<!-- test scoped --> <!-- test scoped -->
@ -169,40 +167,30 @@
</build> </build>
<properties> <properties>
<!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<!-- marshalling --> <!-- marshalling -->
<jackson.version>2.7.8</jackson.version> <jackson.version>2.8.5</jackson.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<commons-io.version>2.5</commons-io.version>
<joda-time.version>2.9.6</joda-time.version>
<gson.version>2.8.0</gson.version>
<commons-collections4.version>4.1</commons-collections4.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version> <rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

2
java-cassandra/README.md Normal file
View File

@ -0,0 +1,2 @@
### Relevant Articles:
- [A Guide to Cassandra with Java](http://www.baeldung.com/cassandra-with-java)

View File

@ -20,7 +20,7 @@
<dependency> <dependency>
<groupId>org.cassandraunit</groupId> <groupId>org.cassandraunit</groupId>
<artifactId>cassandra-unit</artifactId> <artifactId>cassandra-unit</artifactId>
<version>3.0.0.1</version> <version>${cassandra-unit.version}</version>
</dependency> </dependency>
<!-- This guava version is required for cassandra-unit 3.0.0.1 --> <!-- This guava version is required for cassandra-unit 3.0.0.1 -->
@ -135,18 +135,15 @@
<logback.version>1.1.7</logback.version> <logback.version>1.1.7</logback.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>
<testng.version>6.8</testng.version>
<assertj.version>3.5.1</assertj.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<!-- Cassandra --> <!-- Cassandra -->
<cassandra-driver-core.version>3.1.0</cassandra-driver-core.version> <cassandra-driver-core.version>3.1.2</cassandra-driver-core.version>
<cassandra-unit.version>3.1.1.0</cassandra-unit.version>
</properties> </properties>
</project> </project>

View File

@ -2,4 +2,5 @@
.idea .idea
classes classes
target target
*.iml *.iml
out

View File

@ -7,6 +7,28 @@
<groupId>com.root</groupId> <groupId>com.root</groupId>
<artifactId>ServletmavenExample</artifactId> <artifactId>ServletmavenExample</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<dependencies> <dependencies>
@ -33,7 +55,7 @@
<properties> <properties>
<javax.servlet.version>3.1.0</javax.servlet.version> <javax.servlet.version>3.1.0</javax.servlet.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<org.apache.httpcomponents.version>4.5</org.apache.httpcomponents.version> <org.apache.httpcomponents.version>4.5.2</org.apache.httpcomponents.version>
</properties> </properties>
</project> </project>

View File

@ -1,4 +1,4 @@
package com.root; package com.baeldung.servlets;
import javax.servlet.RequestDispatcher; import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException; import javax.servlet.ServletException;

View File

@ -1,4 +1,4 @@
package com.root; package com.baeldung.servlets;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient; import org.apache.http.client.HttpClient;
@ -13,7 +13,7 @@ import java.util.List;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
public class FormServletTest { public class FormServletLiveTest {
@Test @Test
public void whenPostRequestUsingHttpClient_thenCorrect() throws Exception { public void whenPostRequestUsingHttpClient_thenCorrect() throws Exception {
@ -21,10 +21,11 @@ public class FormServletTest {
HttpClient client = new DefaultHttpClient(); HttpClient client = new DefaultHttpClient();
HttpPost method = new HttpPost("http://localhost:8080/calculateServlet"); HttpPost method = new HttpPost("http://localhost:8080/calculateServlet");
List<BasicNameValuePair> nvps = new ArrayList<BasicNameValuePair>(); List<BasicNameValuePair> nvps = new ArrayList<>();
nvps.add(new BasicNameValuePair("height", String.valueOf(2))); nvps.add(new BasicNameValuePair("height", String.valueOf(2)));
nvps.add(new BasicNameValuePair("weight", String.valueOf(80))); nvps.add(new BasicNameValuePair("weight", String.valueOf(80)));
method.setEntity(new UrlEncodedFormEntity(nvps)); method.setEntity(new UrlEncodedFormEntity(nvps));
HttpResponse httpResponse = client.execute(method); HttpResponse httpResponse = client.execute(method);

View File

@ -4,42 +4,50 @@
<artifactId>javaxval</artifactId> <artifactId>javaxval</artifactId>
<version>0.1-SNAPSHOT</version> <version>0.1-SNAPSHOT</version>
<properties>
<junit.version>4.12</junit.version>
<validation-api.version>1.1.0.Final</validation-api.version>
<hibernate-validator.version>5.3.4.Final</hibernate-validator.version>
<javax.el-api.version>3.0.0</javax.el-api.version>
<javax.el.version>2.2.6</javax.el.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.validation</groupId> <groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId> <artifactId>validation-api</artifactId>
<version>1.1.0.Final</version> <version>${validation-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
<version>5.2.1.Final</version> <version>${hibernate-validator.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId> <artifactId>hibernate-validator-annotation-processor</artifactId>
<version>5.2.1.Final</version> <version>${hibernate-validator.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.el</groupId> <groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId> <artifactId>javax.el-api</artifactId>
<version>2.2.4</version> <version>${javax.el-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.glassfish.web</groupId> <groupId>org.glassfish.web</groupId>
<artifactId>javax.el</artifactId> <artifactId>javax.el</artifactId>
<version>2.2.4</version> <version>${javax.el.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -23,7 +23,7 @@
<dependency> <dependency>
<groupId>com.sun.istack</groupId> <groupId>com.sun.istack</groupId>
<artifactId>istack-commons-runtime</artifactId> <artifactId>istack-commons-runtime</artifactId>
<version>3.0.2</version> <version>${istack.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -60,7 +60,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle-mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>
@ -158,12 +158,15 @@
<!-- jaxb --> <!-- jaxb -->
<jaxb.version>2.2.11</jaxb.version> <jaxb.version>2.2.11</jaxb.version>
<istack.version>3.0.2</istack.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.21</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.7</logback.version> <logback.version>1.1.7</logback.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<jaxb2-maven-plugin.version>2.3</jaxb2-maven-plugin.version> <jaxb2-maven-plugin.version>2.3</jaxb2-maven-plugin.version>
</properties> </properties>

View File

@ -1,311 +1,335 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<modelVersion>4.0.0</modelVersion> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>jee7schedule</artifactId> <artifactId>jee7schedule</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<description>JavaEE 7 Arquillian Archetype Sample</description> <description>JavaEE 7 Arquillian Archetype Sample</description>
<packaging>war</packaging> <packaging>war</packaging>
<properties> <properties>
<java.min.version>1.7</java.min.version> <java.min.version>1.7</java.min.version>
<maven.min.version>3.0.0</maven.min.version> <maven.min.version>3.0.0</maven.min.version>
<version.junit>4.11</version.junit> <junit.version>4.12</junit.version>
<version.javaee_api>7.0</version.javaee_api> <javaee_api.version>7.0</javaee_api.version>
<arquillian_core.version>1.1.11.Final</arquillian_core.version>
<wildfly.version>8.2.1.Final</wildfly.version>
<awaitility.version>1.7.0</awaitility.version>
<undertow-websockets-jsr.version>1.4.6.Final</undertow-websockets-jsr.version>
<resteasy.version>3.0.19.Final</resteasy.version>
<glassfish-embedded-all.version>4.1.1</glassfish-embedded-all.version>
<javax.json.version>1.0.4</javax.json.version>
<tyrus.version>1.13</tyrus.version>
<jersey.version>2.25</jersey.version>
<arquillian-glassfish.version>1.0.0.Final</arquillian-glassfish.version>
<version.arquillian_core>1.1.4.Final</version.arquillian_core> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
</properties>
<version.wildfly>8.0.0.Final</version.wildfly> <prerequisites>
</properties> <maven>${maven.min.version}</maven>
</prerequisites>
<prerequisites> <dependencyManagement>
<maven>${maven.min.version}</maven> <dependencies>
</prerequisites>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${version.arquillian_core}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${version.javaee_api}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>1.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.min.version}</source>
<target>${java.min.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>wildfly-managed-arquillian</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<serverProfile>standalone-full.xml</serverProfile>
<serverRoot>${project.build.directory}/wildfly-${version.wildfly}</serverRoot>
</properties>
<dependencies>
<dependency> <dependency>
<groupId>io.undertow</groupId> <groupId>org.jboss.arquillian</groupId>
<artifactId>undertow-websockets-jsr</artifactId> <artifactId>arquillian-bom</artifactId>
<version>1.0.0.Beta25</version> <version>${arquillian_core.version}</version>
<scope>test</scope> <scope>import</scope>
<type>pom</type>
</dependency> </dependency>
<dependency> </dependencies>
<groupId>org.jboss.resteasy</groupId> </dependencyManagement>
<artifactId>resteasy-client</artifactId>
<version>3.0.5.Final</version> <dependencies>
<scope>test</scope> <dependency>
</dependency> <groupId>javax</groupId>
<dependency> <artifactId>javaee-api</artifactId>
<groupId>org.jboss.resteasy</groupId> <version>${javaee_api.version}</version>
<artifactId>resteasy-jaxb-provider</artifactId> <scope>provided</scope>
<version>3.0.5.Final</version> </dependency>
<scope>test</scope>
</dependency> <dependency>
<dependency> <groupId>junit</groupId>
<groupId>org.jboss.resteasy</groupId> <artifactId>junit</artifactId>
<artifactId>resteasy-json-p-provider</artifactId> <version>${junit.version}</version>
<version>3.0.5.Final</version> <scope>test</scope>
<scope>test</scope> </dependency>
</dependency> <dependency>
<dependency> <groupId>org.jboss.arquillian.junit</groupId>
<groupId>org.wildfly</groupId> <artifactId>arquillian-junit-container</artifactId>
<artifactId>wildfly-arquillian-container-managed</artifactId> <scope>test</scope>
<version>${version.wildfly}</version> </dependency>
<scope>test</scope> <dependency>
</dependency> <groupId>com.jayway.awaitility</groupId>
</dependencies> <artifactId>awaitility</artifactId>
<build> <version>${awaitility.version}</version>
<plugins> <scope>test</scope>
<plugin> </dependency>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version> <dependency>
<configuration> <groupId>org.jboss.shrinkwrap.resolver</groupId>
<skip>${maven.test.skip}</skip> <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
</configuration> <scope>test</scope>
<executions> <type>jar</type>
<execution> </dependency>
<id>unpack</id>
<phase>process-test-classes</phase> <dependency>
<goals> <groupId>org.jboss.shrinkwrap.resolver</groupId>
<goal>unpack</goal> <artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
</goals> <scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.min.version}</source>
<target>${java.min.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LongRunningUnitTest.java</exclude>
<exclude>**/*ManualTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>wildfly-managed-arquillian</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<serverProfile>standalone-full.xml</serverProfile>
<serverRoot>${project.build.directory}/wildfly-${version.wildfly}</serverRoot>
</properties>
<dependencies>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-websockets-jsr</artifactId>
<version>${undertow-websockets-jsr.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>${resteasy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>${resteasy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-p-provider</artifactId>
<version>${resteasy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${wildfly.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<configuration> <configuration>
<artifactItems> <skip>${maven.test.skip}</skip>
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>${version.wildfly}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration> </configuration>
</execution> <executions>
</executions> <execution>
</plugin> <id>unpack</id>
<plugin> <phase>process-test-classes</phase>
<artifactId>maven-surefire-plugin</artifactId> <goals>
<version>2.17</version> <goal>unpack</goal>
<configuration> </goals>
<environmentVariables> <configuration>
<JBOSS_HOME>${project.build.directory}/wildfly-${version.wildfly}</JBOSS_HOME> <artifactItems>
</environmentVariables> <artifactItem>
</configuration> <groupId>org.wildfly</groupId>
</plugin> <artifactId>wildfly-dist</artifactId>
</plugins> <version>${wildfly.version}</version>
</build> <type>zip</type>
</profile> <overWrite>false</overWrite>
<profile> <outputDirectory>${project.build.directory}</outputDirectory>
<id>wildfly-remote-arquillian</id> </artifactItem>
<dependencies> </artifactItems>
<dependency> </configuration>
<groupId>io.undertow</groupId> </execution>
<artifactId>undertow-websockets-jsr</artifactId> </executions>
<version>1.0.0.Beta25</version> </plugin>
<scope>test</scope> <plugin>
</dependency> <artifactId>maven-surefire-plugin</artifactId>
<dependency> <version>2.17</version>
<groupId>org.jboss.resteasy</groupId> <configuration>
<artifactId>resteasy-client</artifactId> <environmentVariables>
<version>3.0.5.Final</version> <JBOSS_HOME>${project.build.directory}/wildfly-${wildfly.version}</JBOSS_HOME>
<scope>test</scope> </environmentVariables>
</dependency> </configuration>
<dependency> </plugin>
<groupId>org.jboss.resteasy</groupId> </plugins>
<artifactId>resteasy-jaxb-provider</artifactId> </build>
<version>3.0.5.Final</version> </profile>
<scope>test</scope> <profile>
</dependency> <id>wildfly-remote-arquillian</id>
<dependency> <dependencies>
<groupId>org.jboss.resteasy</groupId> <dependency>
<artifactId>resteasy-json-p-provider</artifactId> <groupId>io.undertow</groupId>
<version>3.0.5.Final</version> <artifactId>undertow-websockets-jsr</artifactId>
<scope>test</scope> <version>${undertow-websockets-jsr.version}</version>
</dependency> <scope>test</scope>
<dependency> </dependency>
<groupId>org.wildfly</groupId> <dependency>
<artifactId>wildfly-arquillian-container-remote</artifactId> <groupId>org.jboss.resteasy</groupId>
<version>${version.wildfly}</version> <artifactId>resteasy-client</artifactId>
<scope>test</scope> <version>${resteasy.version}</version>
</dependency> <scope>test</scope>
</dependencies> </dependency>
</profile> <dependency>
<profile> <groupId>org.jboss.resteasy</groupId>
<id>glassfish-embedded-arquillian</id> <artifactId>resteasy-jaxb-provider</artifactId>
<dependencies> <version>${resteasy.version}</version>
<dependency> <scope>test</scope>
<groupId>org.glassfish.main.extras</groupId> </dependency>
<artifactId>glassfish-embedded-all</artifactId> <dependency>
<version>4.0</version> <groupId>org.jboss.resteasy</groupId>
<scope>test</scope> <artifactId>resteasy-json-p-provider</artifactId>
</dependency> <version>${resteasy.version}</version>
<dependency> <scope>test</scope>
<groupId>org.glassfish</groupId> </dependency>
<artifactId>javax.json</artifactId> <dependency>
<version>1.0.4</version> <groupId>org.wildfly</groupId>
<scope>test</scope> <artifactId>wildfly-arquillian-container-remote</artifactId>
</dependency> <version>${wildfly.version}</version>
<dependency> <scope>test</scope>
<groupId>org.glassfish.tyrus</groupId> </dependency>
<artifactId>tyrus-client</artifactId> </dependencies>
<version>1.3</version> </profile>
<scope>test</scope> <profile>
</dependency> <id>glassfish-embedded-arquillian</id>
<dependency> <dependencies>
<groupId>org.glassfish.tyrus</groupId> <dependency>
<artifactId>tyrus-container-grizzly-client</artifactId> <groupId>org.glassfish.main.extras</groupId>
<version>1.3</version> <artifactId>glassfish-embedded-all</artifactId>
<scope>test</scope> <version>${glassfish-embedded-all.version}</version>
</dependency> <scope>test</scope>
<dependency> </dependency>
<groupId>org.glassfish.jersey.core</groupId> <dependency>
<artifactId>jersey-client</artifactId> <groupId>org.glassfish</groupId>
<version>2.4</version> <artifactId>javax.json</artifactId>
<scope>test</scope> <version>${javax.json.version}</version>
</dependency> <scope>test</scope>
<dependency> </dependency>
<groupId>org.jboss.arquillian.container</groupId> <dependency>
<artifactId>arquillian-glassfish-embedded-3.1</artifactId> <groupId>org.glassfish.tyrus</groupId>
<version>1.0.0.CR4</version> <artifactId>tyrus-client</artifactId>
<scope>test</scope> <version>${tyrus.version}</version>
</dependency> <scope>test</scope>
</dependencies> </dependency>
</profile> <dependency>
<profile> <groupId>org.glassfish.tyrus</groupId>
<id>glassfish-remote-arquillian</id> <artifactId>tyrus-container-grizzly-client</artifactId>
<dependencies> <version>${tyrus.version}</version>
<dependency> <scope>test</scope>
<groupId>org.glassfish</groupId> </dependency>
<artifactId>javax.json</artifactId> <dependency>
<version>1.0.4</version> <groupId>org.glassfish.jersey.core</groupId>
<scope>test</scope> <artifactId>jersey-client</artifactId>
</dependency> <version>${jersey.version}</version>
<dependency> <scope>test</scope>
<groupId>org.glassfish.tyrus</groupId> </dependency>
<artifactId>tyrus-client</artifactId> <dependency>
<version>1.3</version> <groupId>org.jboss.arquillian.container</groupId>
<scope>test</scope> <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
</dependency> <version>${arquillian-glassfish.version}</version>
<dependency> <scope>test</scope>
<groupId>org.glassfish.tyrus</groupId> </dependency>
<artifactId>tyrus-container-grizzly-client</artifactId> </dependencies>
<version>1.3</version> </profile>
<scope>test</scope> <profile>
</dependency> <id>glassfish-remote-arquillian</id>
<dependency> <dependencies>
<groupId>org.glassfish.jersey.core</groupId> <dependency>
<artifactId>jersey-client</artifactId> <groupId>org.glassfish</groupId>
<version>2.4</version> <artifactId>javax.json</artifactId>
<scope>test</scope> <version>${javax.json.version}</version>
</dependency> <scope>test</scope>
<dependency> </dependency>
<groupId>org.glassfish.jersey.media</groupId> <dependency>
<artifactId>jersey-media-json-jackson</artifactId> <groupId>org.glassfish.tyrus</groupId>
<version>2.4</version> <artifactId>tyrus-client</artifactId>
<scope>test</scope> <version>${tyrus.version}</version>
</dependency> <scope>test</scope>
<dependency> </dependency>
<groupId>org.glassfish.jersey.media</groupId> <dependency>
<artifactId>jersey-media-json-processing</artifactId> <groupId>org.glassfish.tyrus</groupId>
<version>2.4</version> <artifactId>tyrus-container-grizzly-client</artifactId>
<scope>test</scope> <version>${tyrus.version}</version>
</dependency> <scope>test</scope>
<dependency> </dependency>
<groupId>org.jboss.arquillian.container</groupId> <dependency>
<artifactId>arquillian-glassfish-remote-3.1</artifactId> <groupId>org.glassfish.jersey.core</groupId>
<version>1.0.0.CR4</version> <artifactId>jersey-client</artifactId>
<scope>test</scope> <version>${jersey.version}</version>
</dependency> <scope>test</scope>
</dependencies> </dependency>
</profile> <dependency>
</profiles> <groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-processing</artifactId>
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-remote-3.1</artifactId>
<version>${arquillian-glassfish.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project> </project>

View File

@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.equalTo;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
public class AutomaticTimerBeanTest { public class AutomaticTimerBeanIntegrationTest {
//the @AutomaticTimerBean has a method called every 10 seconds //the @AutomaticTimerBean has a method called every 10 seconds
//testing the difference ==> 100000 //testing the difference ==> 100000

View File

@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.is;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
public class ProgrammaticAtFixedRateTimerBeanTest { public class ProgrammaticAtFixedRateTimerBeanIntegrationTest {
final static long TIMEOUT = 1000; final static long TIMEOUT = 1000;
final static long TOLERANCE = 500l; final static long TOLERANCE = 500l;

View File

@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.is;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
public class ProgrammaticTimerBeanTest { public class ProgrammaticTimerBeanIntegrationTest {
final static long TIMEOUT = 5000l; final static long TIMEOUT = 5000l;
final static long TOLERANCE = 1000l; final static long TOLERANCE = 1000l;

View File

@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.is;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
public class ProgrammaticWithFixedDelayTimerBeanTest { public class ProgrammaticWithFixedDelayTimerBeanIntegrationTest {
final static long TIMEOUT = 15000l; final static long TIMEOUT = 15000l;
final static long TOLERANCE = 1000l; final static long TOLERANCE = 1000l;

View File

@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.equalTo;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
public class ScheduleTimerBeanTest { public class ScheduleTimerBeanIntegrationTest {
final static long TIMEOUT = 5000l; final static long TIMEOUT = 5000l;
final static long TOLERANCE = 1000l; final static long TOLERANCE = 1000l;

View File

@ -14,13 +14,14 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<jjwt.version>0.7.0</jjwt.version>
</properties> </properties>
<dependencies> <dependencies>
@ -48,7 +49,7 @@
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId> <artifactId>jjwt</artifactId>
<version>0.6.0</version> <version>${jjwt.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -9,8 +9,10 @@
<properties> <properties>
<jee.version>7.0</jee.version> <jee.version>7.0</jee.version>
<hibernate.version>5.1.0.Final</hibernate.version> <hibernate.version>5.2.5.Final</hibernate.version>
<mysql.version>5.1.38</mysql.version> <mysql.version>6.0.5</mysql.version>
<junit.version>4.12</junit.version>
<commons-io.version>2.5</commons-io.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
@ -69,7 +71,7 @@
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version> <version>${mysql.version}</version>
</dependency> </dependency>
<!-- Junit Library --> <!-- Junit Library -->
@ -77,13 +79,13 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.4</version> <version>${junit.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.4</version> <version>${commons-io.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -36,7 +36,7 @@
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId> <artifactId>jstl</artifactId>
<version>1.2</version> <version>${jstl.version}</version>
</dependency> </dependency>
<!-- Spring --> <!-- Spring -->
@ -123,21 +123,23 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<!-- JSF --> <!-- JSF -->
<com.sun.faces.version>2.2.13</com.sun.faces.version> <com.sun.faces.version>2.2.14</com.sun.faces.version>
<javax.el.version>3.0.0</javax.el.version> <javax.el.version>3.0.0</javax.el.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!--Tomcat--> <!--Tomcat-->
<javax.servlet.version>3.1.0</javax.servlet.version> <javax.servlet.version>3.1.0</javax.servlet.version>
<jstl.version>1.2</jstl.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version> <maven-war-plugin.version>2.6</maven-war-plugin.version>
</properties> </properties>

View File

@ -42,7 +42,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -53,13 +53,15 @@
<properties> <properties>
<!-- json-path --> <!-- json-path -->
<json-path.version>2.1.0</json-path.version> <json-path.version>2.2.0</json-path.version>
<!-- Testing --> <!-- Testing -->
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<!-- Logging --> <!-- Logging -->
<slf4j.version>1.7.14</slf4j.version> <slf4j.version>1.7.21</slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -10,22 +10,27 @@
<dependency> <dependency>
<groupId>org.everit.json</groupId> <groupId>org.everit.json</groupId>
<artifactId>org.everit.json.schema</artifactId> <artifactId>org.everit.json.schema</artifactId>
<version>1.3.0</version> <version>${everit.json.schema.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.13</version> <version>${fastjson.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<everit.json.schema.version>1.4.1</everit.json.schema.version>
<fastjson.version>1.2.21</fastjson.version>
<junit.version>4.12</junit.version>
</properties>
</project> </project>

View File

@ -13,15 +13,18 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<junit.jupiter.version>5.0.0-M2</junit.jupiter.version> <junit.jupiter.version>5.0.0-M3</junit.jupiter.version>
<junit.platform.version>1.0.0-M2</junit.platform.version> <junit.platform.version>1.0.0-M3</junit.platform.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>${java.version}</source> <source>${java.version}</source>
<target>${java.version}</target> <target>${java.version}</target>
@ -29,7 +32,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version> <version>${maven-surefire-plugin.version}</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.junit.platform</groupId> <groupId>org.junit.platform</groupId>

View File

@ -12,19 +12,19 @@
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>4.3.3.RELEASE</version> <version>${springframework.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>4.3.3.RELEASE</version> <version>${springframework.version}</version>
</dependency> </dependency>
<!--log4j dependencies --> <!--log4j dependencies -->
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>1.2.17</version> <version>${log4j.version}</version>
</dependency> </dependency>
<!--log4j2 dependencies --> <!--log4j2 dependencies -->
@ -36,31 +36,38 @@
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.7</version> <version>${log4j-api.version}</version>
</dependency> </dependency>
<!--disruptor for log4j2 async logging --> <!--disruptor for log4j2 async logging -->
<dependency> <dependency>
<groupId>com.lmax</groupId> <groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId> <artifactId>disruptor</artifactId>
<version>3.3.4</version> <version>${disruptor.version}</version>
</dependency> </dependency>
<!--logback dependencies --> <!--logback dependencies -->
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>1.1.7</version> <version>${logback.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<springframework.version>4.3.4.RELEASE</springframework.version>
<log4j.version>1.2.17</log4j.version>
<log4j-api.version>2.7</log4j-api.version>
<disruptor.version>3.3.6</disruptor.version>
<logback.version>1.1.7</logback.version>
<junit.version>4.12</junit.version>
</properties>
</project> </project>

View File

@ -1,2 +1,6 @@
### Relevant Articles: ### Relevant Articles:
- [Introduction to Java Logging](http://www.baeldung.com/java-logging-intro) - [Introduction to Java Logging](http://www.baeldung.com/java-logging-intro)
- [Introduction to SLF4J](http://www.baeldung.com/slf4j-with-log4j2-logback)
- [Generate equals() and hashCode() with Eclipse](http://www.baeldung.com/java-eclipse-equals-and-hashcode)
- [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java)
- [Introduction to SLF4J](http://www.baeldung.com/slf4j-with-log4j2-logback)

View File

@ -13,39 +13,39 @@
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>1.2.17</version> <version>${log4j.version}</version>
</dependency> </dependency>
<!--log4j2 dependencies--> <!--log4j2 dependencies-->
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId> <artifactId>log4j-api</artifactId>
<version>2.7</version> <version>${log4j-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.7</version> <version>${log4j-core.version}</version>
</dependency> </dependency>
<!--disruptor for log4j2 async logging--> <!--disruptor for log4j2 async logging-->
<dependency> <dependency>
<groupId>com.lmax</groupId> <groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId> <artifactId>disruptor</artifactId>
<version>3.3.4</version> <version>${disruptor.version}</version>
</dependency> </dependency>
<!--logback dependencies--> <!--logback dependencies-->
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>1.1.7</version> <version>${logback.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<debug>true</debug> <debug>true</debug>
<optimize>true</optimize> <optimize>true</optimize>
@ -58,5 +58,15 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<log4j.version>1.2.17</log4j.version>
<log4j-api.version>2.7</log4j-api.version>
<log4j-core.version>2.7</log4j-core.version>
<disruptor.version>3.3.6</disruptor.version>
<logback.version>1.1.7</logback.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -18,47 +18,47 @@
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.7</version> <version>${log4j-core.version}</version>
</dependency> </dependency>
<!-- This is used by JSONLayout. --> <!-- This is used by JSONLayout. -->
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.8.4</version> <version>${jackson.version}</version>
</dependency> </dependency>
<!-- This is used by XMLLayout. --> <!-- This is used by XMLLayout. -->
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId> <artifactId>jackson-dataformat-xml</artifactId>
<version>2.8.4</version> <version>${jackson.version}</version>
</dependency> </dependency>
<!-- This is used by JDBC Appender. --> <!-- This is used by JDBC Appender. -->
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>1.4.192</version> <version>${h2.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId> <artifactId>commons-dbcp2</artifactId>
<version>2.1.1</version> <version>${commons-dbcp2.version}</version>
</dependency> </dependency>
<!-- This is used for testing only. --> <!-- This is used for testing only. -->
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.7</version> <version>${log4j-core.version}</version>
<type>test-jar</type> <type>test-jar</type>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -68,7 +68,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -76,4 +76,13 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<jackson.version>2.8.5</jackson.version>
<h2.version>1.4.193</h2.version>
<commons-dbcp2.version>2.1.1</commons-dbcp2.version>
<log4j-core.version>2.7</log4j-core.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -128,24 +128,24 @@
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<!-- lombok: https://projectlombok.org/changelog.html --> <!-- lombok: https://projectlombok.org/changelog.html -->
<lombok.version>1.16.8</lombok.version> <lombok.version>1.16.12</lombok.version>
<!-- various --> <!-- various -->
<hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version> <hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- testing --> <!-- testing -->
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<!-- delombok maven plugin --> <!-- delombok maven plugin -->
<delombok-maven-plugin.version>${lombok.version}.0</delombok-maven-plugin.version> <delombok-maven-plugin.version>1.16.10.0</delombok-maven-plugin.version>
</properties> </properties>
</project> </project>

2
mapstruct/README.md Normal file
View File

@ -0,0 +1,2 @@
###Relevant Articles:
- [Quick Guide to MapStruct](http://www.baeldung.com/mapstruct)

View File

@ -10,7 +10,11 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<org.mapstruct.version>1.0.0.Final</org.mapstruct.version> <org.mapstruct.version>1.1.0.Final</org.mapstruct.version>
<junit.version>4.12</junit.version>
<springframework.version>4.3.4.RELEASE</springframework.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
@ -21,18 +25,18 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>4.3.2.RELEASE</version> <version>${springframework.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<version>4.3.2.RELEASE</version> <version>${springframework.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -42,7 +46,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -56,10 +60,10 @@
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version> <version>${maven-surefire-plugin.version}</version>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*IntegrationTest.java</exclude> <exclude>**/*IntegrationTest.java</exclude>

View File

@ -101,42 +101,19 @@
</build> </build>
<properties> <properties>
<!-- Spring -->
<org.springframework.version>4.1.5.RELEASE</org.springframework.version>
<org.springframework.security.version>3.2.5.RELEASE</org.springframework.security.version>
<!-- persistence -->
<hibernate.version>4.3.10.Final</hibernate.version>
<mysql-connector-java.version>5.1.35</mysql-connector-java.version>
<!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version>
<logback.version>1.1.3</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<powermock.version>1.6.4</powermock.version> <powermock.version>1.6.6</powermock.version>
<httpcore.version>4.4.1</httpcore.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.4.1</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.14</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -17,8 +17,8 @@
<jmockit.version>1.24</jmockit.version> <jmockit.version>1.24</jmockit.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -16,13 +16,13 @@
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<easymock.version>3.4</easymock.version> <easymock.version>3.4</easymock.version>
<jmockit.version>1.24</jmockit.version> <jmockit.version>1.29</jmockit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -6,13 +6,15 @@
<version>1.0</version> <version>1.0</version>
<properties> <properties>
<slf4j-api.version>1.7.5</slf4j-api.version> <slf4j-api.version>1.7.21</slf4j-api.version>
<jcl-over-slf4j.version>1.7.5</jcl-over-slf4j.version> <jcl-over-slf4j.version>1.7.21</jcl-over-slf4j.version>
<orika-core.version>1.4.6</orika-core.version> <orika-core.version>1.5.0</orika-core.version>
<junit.version>4.3</junit.version> <junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
<name>Orika</name> <name>orika</name>
<dependencies> <dependencies>
@ -48,7 +50,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>7</source> <source>7</source>
<target>7</target> <target>7</target>

View File

@ -4,31 +4,31 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import ma.glasnost.orika.BoundMapperFacade; import ma.glasnost.orika.BoundMapperFacade;
import ma.glasnost.orika.CustomMapper; import ma.glasnost.orika.CustomMapper;
import ma.glasnost.orika.MapperFacade; import ma.glasnost.orika.MapperFacade;
import ma.glasnost.orika.MapperFactory; import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.MappingContext;
import ma.glasnost.orika.impl.DefaultMapperFactory; import ma.glasnost.orika.impl.DefaultMapperFactory;
import org.junit.Before;
import org.junit.Test;
public class OrikaTest { public class OrikaTest {
MapperFactory mapperFactory; MapperFactory mapperFactory;
CustomMapper<Personne3, Person3> customMapper; CustomMapper<Personne3, Person3> customMapper;
// constant to help us cover time zone differences // constant to help us cover time zone differences
private final long GMT_DIFFERENCE = 46800000; private final long GMT_DIFFERENCE = 46800000;
//
@Before @Before
public void before() { public void before() {
mapperFactory = new DefaultMapperFactory.Builder().build(); mapperFactory = new DefaultMapperFactory.Builder().build();
@ -68,8 +68,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcAndDest_whenMapsUsingBoundMapper_thenCorrect() { public void givenSrcAndDest_whenMapsUsingBoundMapper_thenCorrect() {
BoundMapperFacade<Source, Dest> boundMapper = mapperFactory BoundMapperFacade<Source, Dest> boundMapper = mapperFactory.getMapperFacade(Source.class, Dest.class);
.getMapperFacade(Source.class, Dest.class);
Source src = new Source("baeldung", 10); Source src = new Source("baeldung", 10);
Dest dest = boundMapper.map(src); Dest dest = boundMapper.map(src);
assertEquals(dest.getAge(), src.getAge()); assertEquals(dest.getAge(), src.getAge());
@ -78,8 +77,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcAndDest_whenMapsUsingBoundMapperInReverse_thenCorrect() { public void givenSrcAndDest_whenMapsUsingBoundMapperInReverse_thenCorrect() {
BoundMapperFacade<Source, Dest> boundMapper = mapperFactory BoundMapperFacade<Source, Dest> boundMapper = mapperFactory.getMapperFacade(Source.class, Dest.class);
.getMapperFacade(Source.class, Dest.class);
Dest src = new Dest("baeldung", 10); Dest src = new Dest("baeldung", 10);
Source dest = boundMapper.mapReverse(src); Source dest = boundMapper.mapReverse(src);
assertEquals(dest.getAge(), src.getAge()); assertEquals(dest.getAge(), src.getAge());
@ -88,8 +86,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcAndDest_whenMapsUsingBoundMapperByObject_thenCorrect() { public void givenSrcAndDest_whenMapsUsingBoundMapperByObject_thenCorrect() {
BoundMapperFacade<Source, Dest> boundMapper = mapperFactory BoundMapperFacade<Source, Dest> boundMapper = mapperFactory.getMapperFacade(Source.class, Dest.class);
.getMapperFacade(Source.class, Dest.class);
Source src = new Source("baeldung", 10); Source src = new Source("baeldung", 10);
Dest dest = new Dest(); Dest dest = new Dest();
boundMapper.map(src, dest); boundMapper.map(src, dest);
@ -99,8 +96,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcAndDest_whenMapsUsingBoundMapperByObjectInReverse_thenCorrect() { public void givenSrcAndDest_whenMapsUsingBoundMapperByObjectInReverse_thenCorrect() {
BoundMapperFacade<Source, Dest> boundMapper = mapperFactory BoundMapperFacade<Source, Dest> boundMapper = mapperFactory.getMapperFacade(Source.class, Dest.class);
.getMapperFacade(Source.class, Dest.class);
Dest src = new Dest("baeldung", 10); Dest src = new Dest("baeldung", 10);
Source dest = new Source(); Source dest = new Source();
boundMapper.mapReverse(src, dest); boundMapper.mapReverse(src, dest);
@ -110,9 +106,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcAndDestWithDifferentFieldNames_whenMaps_thenCorrect() { public void givenSrcAndDestWithDifferentFieldNames_whenMaps_thenCorrect() {
mapperFactory.classMap(Personne.class, Person.class) mapperFactory.classMap(Personne.class, Person.class).field("nom", "name").field("surnom", "nickname").field("age", "age").register();
.field("nom", "name").field("surnom", "nickname")
.field("age", "age").register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
@ -127,8 +121,7 @@ public class OrikaTest {
@Test @Test
public void givenBothDifferentAndSameFieldNames_whenFailsToMapSameNameFieldAutomatically_thenCorrect() { public void givenBothDifferentAndSameFieldNames_whenFailsToMapSameNameFieldAutomatically_thenCorrect() {
mapperFactory.classMap(Personne.class, Person.class) mapperFactory.classMap(Personne.class, Person.class).field("nom", "name").field("surnom", "nickname").register();
.field("nom", "name").field("surnom", "nickname").register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Personne frenchPerson = new Personne("Claire", "cla", 25); Personne frenchPerson = new Personne("Claire", "cla", 25);
@ -139,9 +132,7 @@ public class OrikaTest {
@Test @Test
public void givenBothDifferentAndSameFieldNames_whenMapsSameNameFieldByDefault_thenCorrect() { public void givenBothDifferentAndSameFieldNames_whenMapsSameNameFieldByDefault_thenCorrect() {
mapperFactory.classMap(Personne.class, Person.class) mapperFactory.classMap(Personne.class, Person.class).field("nom", "name").field("surnom", "nickname").byDefault().register();
.field("nom", "name").field("surnom", "nickname").byDefault()
.register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Personne frenchPerson = new Personne("Claire", "cla", 25); Personne frenchPerson = new Personne("Claire", "cla", 25);
@ -155,9 +146,7 @@ public class OrikaTest {
@Test @Test
public void givenUnidirectionalMappingSetup_whenMapsUnidirectionally_thenCorrect() { public void givenUnidirectionalMappingSetup_whenMapsUnidirectionally_thenCorrect() {
mapperFactory.classMap(Personne.class, Person.class) mapperFactory.classMap(Personne.class, Person.class).fieldAToB("nom", "name").fieldAToB("surnom", "nickname").fieldAToB("age", "age").register();
.fieldAToB("nom", "name").fieldAToB("surnom", "nickname")
.fieldAToB("age", "age").register();
; ;
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Personne frenchPerson = new Personne("Claire", "cla", 25); Personne frenchPerson = new Personne("Claire", "cla", 25);
@ -169,11 +158,9 @@ public class OrikaTest {
} }
@Test @Test
public void givenSrcAndDest_whenCanExcludeField_thenCorrect() { public void givenSrcAndDest_whenCanExcludeField_thenCorrect() {
mapperFactory.classMap(Personne.class, Person.class).exclude("nom") mapperFactory.classMap(Personne.class, Person.class).exclude("nom").field("surnom", "nickname").field("age", "age").register();
.field("surnom", "nickname").field("age", "age").register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Personne frenchPerson = new Personne("Claire", "cla", 25); Personne frenchPerson = new Personne("Claire", "cla", 25);
@ -186,9 +173,7 @@ public class OrikaTest {
@Test @Test
public void givenSpecificConstructorToUse_whenMaps_thenCorrect() { public void givenSpecificConstructorToUse_whenMaps_thenCorrect() {
mapperFactory.classMap(Personne.class, Person.class).constructorB() mapperFactory.classMap(Personne.class, Person.class).constructorB().field("nom", "name").field("surnom", "nickname").field("age", "age").register();
.field("nom", "name").field("surnom", "nickname")
.field("age", "age").register();
; ;
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Personne frenchPerson = new Personne("Claire", "cla", 25); Personne frenchPerson = new Personne("Claire", "cla", 25);
@ -202,12 +187,9 @@ public class OrikaTest {
@Test @Test
public void givenSrcWithListAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() { public void givenSrcWithListAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() {
mapperFactory.classMap(PersonNameList.class, PersonNameParts.class) mapperFactory.classMap(PersonNameList.class, PersonNameParts.class).field("nameList[0]", "firstName").field("nameList[1]", "lastName").register();
.field("nameList[0]", "firstName")
.field("nameList[1]", "lastName").register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
List<String> nameList = Arrays.asList(new String[]{"Sylvester", List<String> nameList = Arrays.asList(new String[] { "Sylvester", "Stallone" });
"Stallone"});
PersonNameList src = new PersonNameList(nameList); PersonNameList src = new PersonNameList(nameList);
PersonNameParts dest = mapper.map(src, PersonNameParts.class); PersonNameParts dest = mapper.map(src, PersonNameParts.class);
assertEquals(dest.getFirstName(), "Sylvester"); assertEquals(dest.getFirstName(), "Sylvester");
@ -216,11 +198,9 @@ public class OrikaTest {
@Test @Test
public void givenSrcWithArrayAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() { public void givenSrcWithArrayAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() {
mapperFactory.classMap(PersonNameArray.class, PersonNameParts.class) mapperFactory.classMap(PersonNameArray.class, PersonNameParts.class).field("nameArray[0]", "firstName").field("nameArray[1]", "lastName").register();
.field("nameArray[0]", "firstName")
.field("nameArray[1]", "lastName").register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
String[] nameArray = new String[]{"Vin", "Diesel"}; String[] nameArray = new String[] { "Vin", "Diesel" };
PersonNameArray src = new PersonNameArray(nameArray); PersonNameArray src = new PersonNameArray(nameArray);
PersonNameParts dest = mapper.map(src, PersonNameParts.class); PersonNameParts dest = mapper.map(src, PersonNameParts.class);
assertEquals(dest.getFirstName(), "Vin"); assertEquals(dest.getFirstName(), "Vin");
@ -229,9 +209,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcWithMapAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() { public void givenSrcWithMapAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() {
mapperFactory.classMap(PersonNameMap.class, PersonNameParts.class) mapperFactory.classMap(PersonNameMap.class, PersonNameParts.class).field("nameMap['first']", "firstName").field("nameMap[\"last\"]", "lastName").register();
.field("nameMap['first']", "firstName")
.field("nameMap[\"last\"]", "lastName").register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Map<String, String> nameMap = new HashMap<>(); Map<String, String> nameMap = new HashMap<>();
nameMap.put("first", "Leornado"); nameMap.put("first", "Leornado");
@ -244,9 +222,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcWithNestedFields_whenMaps_thenCorrect() { public void givenSrcWithNestedFields_whenMaps_thenCorrect() {
mapperFactory.classMap(PersonContainer.class, PersonNameParts.class) mapperFactory.classMap(PersonContainer.class, PersonNameParts.class).field("name.firstName", "firstName").field("name.lastName", "lastName").register();
.field("name.firstName", "firstName")
.field("name.lastName", "lastName").register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
PersonContainer src = new PersonContainer(new Name("Nick", "Canon")); PersonContainer src = new PersonContainer(new Name("Nick", "Canon"));
PersonNameParts dest = mapper.map(src, PersonNameParts.class); PersonNameParts dest = mapper.map(src, PersonNameParts.class);
@ -266,8 +242,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcWithNullAndGlobalConfigForNoNull_whenFailsToMap_ThenCorrect() { public void givenSrcWithNullAndGlobalConfigForNoNull_whenFailsToMap_ThenCorrect() {
MapperFactory mapperFactory = new DefaultMapperFactory.Builder() MapperFactory mapperFactory = new DefaultMapperFactory.Builder().mapNulls(false).build();
.mapNulls(false).build();
mapperFactory.classMap(Source.class, Dest.class); mapperFactory.classMap(Source.class, Dest.class);
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Source src = new Source(null, 10); Source src = new Source(null, 10);
@ -279,8 +254,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcWithNullAndLocalConfigForNoNull_whenFailsToMap_ThenCorrect() { public void givenSrcWithNullAndLocalConfigForNoNull_whenFailsToMap_ThenCorrect() {
mapperFactory.classMap(Source.class, Dest.class).field("age", "age") mapperFactory.classMap(Source.class, Dest.class).field("age", "age").mapNulls(false).field("name", "name").byDefault().register();
.mapNulls(false).field("name", "name").byDefault().register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Source src = new Source(null, 10); Source src = new Source(null, 10);
Dest dest = new Dest("Clinton", 55); Dest dest = new Dest("Clinton", 55);
@ -302,9 +276,7 @@ public class OrikaTest {
@Test @Test
public void givenDestWithNullReverseMappedToSourceAndLocalConfigForNoNull_whenFailsToMap_thenCorrect() { public void givenDestWithNullReverseMappedToSourceAndLocalConfigForNoNull_whenFailsToMap_thenCorrect() {
mapperFactory.classMap(Source.class, Dest.class).field("age", "age") mapperFactory.classMap(Source.class, Dest.class).field("age", "age").mapNullsInReverse(false).field("name", "name").byDefault().register();
.mapNullsInReverse(false).field("name", "name").byDefault()
.register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Dest src = new Dest(null, 10); Dest src = new Dest(null, 10);
Source dest = new Source("Vin", 44); Source dest = new Source("Vin", 44);
@ -315,9 +287,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcWithNullAndFieldLevelConfigForNoNull_whenFailsToMap_ThenCorrect() { public void givenSrcWithNullAndFieldLevelConfigForNoNull_whenFailsToMap_ThenCorrect() {
mapperFactory.classMap(Source.class, Dest.class).field("age", "age") mapperFactory.classMap(Source.class, Dest.class).field("age", "age").fieldMap("name", "name").mapNulls(false).add().byDefault().register();
.fieldMap("name", "name").mapNulls(false).add().byDefault()
.register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
Source src = new Source(null, 10); Source src = new Source(null, 10);
Dest dest = new Dest("Clinton", 55); Dest dest = new Dest("Clinton", 55);
@ -328,8 +298,7 @@ public class OrikaTest {
@Test @Test
public void givenSrcAndDest_whenCustomMapperWorks_thenCorrect() { public void givenSrcAndDest_whenCustomMapperWorks_thenCorrect() {
mapperFactory.classMap(Personne3.class, Person3.class) mapperFactory.classMap(Personne3.class, Person3.class).customize(customMapper).register();
.customize(customMapper).register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
long timestamp = new Long("1182882159000"); long timestamp = new Long("1182882159000");
Personne3 personne3 = new Personne3("Leornardo", timestamp); Personne3 personne3 = new Personne3("Leornardo", timestamp);
@ -339,14 +308,12 @@ public class OrikaTest {
// since different timezones will resolve the timestamp to a different // since different timezones will resolve the timestamp to a different
// datetime string, it suffices to check only for format rather than // datetime string, it suffices to check only for format rather than
// specific date // specific date
assertTrue(timestampTest.charAt(10) == 'T' assertTrue(timestampTest.charAt(10) == 'T' && timestampTest.charAt(19) == 'Z');
&& timestampTest.charAt(19) == 'Z');
} }
@Test @Test
public void givenSrcAndDest_whenCustomMapperWorksBidirectionally_thenCorrect() { public void givenSrcAndDest_whenCustomMapperWorksBidirectionally_thenCorrect() {
mapperFactory.classMap(Personne3.class, Person3.class) mapperFactory.classMap(Personne3.class, Person3.class).customize(customMapper).register();
.customize(customMapper).register();
MapperFacade mapper = mapperFactory.getMapperFacade(); MapperFacade mapper = mapperFactory.getMapperFacade();
String dateTime = "2007-06-26T21:22:39Z"; String dateTime = "2007-06-26T21:22:39Z";
@ -355,12 +322,10 @@ public class OrikaTest {
Personne3 personne3 = mapper.map(person3, Personne3.class); Personne3 personne3 = mapper.map(person3, Personne3.class);
long timestampToTest = personne3.getDtob(); long timestampToTest = personne3.getDtob();
/* /*
* since different timezones will resolve the datetime to a different * since different timezones will resolve the datetime to a different
* unix timestamp, we must provide a range of tolerance * unix timestamp, we must provide a range of tolerance
*/ */
assertTrue(timestampToTest == timestamp assertTrue(timestampToTest == timestamp || timestampToTest >= timestamp - GMT_DIFFERENCE || timestampToTest <= timestamp + GMT_DIFFERENCE);
|| timestampToTest >= timestamp - GMT_DIFFERENCE
|| timestampToTest <= timestamp + GMT_DIFFERENCE);
} }

2
patterns/README.md Normal file
View File

@ -0,0 +1,2 @@
###Relevant Articles:
- [A Guide to the Front Controller Pattern in Java](http://www.baeldung.com/java-front-controller-pattern)

View File

@ -22,7 +22,7 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.21</version> <version>${slf4j.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -51,4 +51,8 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<slf4j.version>1.7.21</slf4j.version>
</properties>
</project> </project>

View File

@ -24,7 +24,7 @@
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version> <version>${javax.servlet-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -36,7 +36,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -45,14 +45,22 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version> <version>${maven-war-plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId> <artifactId>jetty-maven-plugin</artifactId>
<version>9.3.12.v20160915</version> <version>${jetty-maven-plugin.version}</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </build>
<properties>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>3.0.0</maven-war-plugin.version>
<jetty-maven-plugin.version>9.4.0.v20161208</jetty-maven-plugin.version>
</properties>
</project> </project>

View File

@ -14,6 +14,15 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.12</junit.version>
<pdfbox-tools.version>2.0.3</pdfbox-tools.version>
<pdf2dom.version>1.6</pdf2dom.version>
<itextpdf.version>5.5.10</itextpdf.version>
<xmlworker.version>5.5.10</xmlworker.version>
<poi-scratchpad.version>3.15</poi-scratchpad.version>
<batik-transcoder.version>1.8</batik-transcoder.version>
<poi-ooxml.version>3.15</poi-ooxml.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
</properties> </properties>
@ -21,43 +30,43 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>3.8.1</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.pdfbox</groupId> <groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-tools</artifactId> <artifactId>pdfbox-tools</artifactId>
<version>2.0.3</version> <version>${pdfbox-tools.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sf.cssbox</groupId> <groupId>net.sf.cssbox</groupId>
<artifactId>pdf2dom</artifactId> <artifactId>pdf2dom</artifactId>
<version>1.6</version> <version>${pdf2dom.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.itextpdf</groupId> <groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId> <artifactId>itextpdf</artifactId>
<version>5.5.10</version> <version>${itextpdf.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.itextpdf.tool</groupId> <groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId> <artifactId>xmlworker</artifactId>
<version>5.5.10</version> <version>${xmlworker.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId> <artifactId>poi-scratchpad</artifactId>
<version>3.15</version> <version>${poi-scratchpad.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.xmlgraphics</groupId> <groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-transcoder</artifactId> <artifactId>batik-transcoder</artifactId>
<version>1.8</version> <version>${batik-transcoder.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
<version>3.15</version> <version>${poi-ooxml.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

4
play-framework/README.md Normal file
View File

@ -0,0 +1,4 @@
###Relevant Articles:
- [REST API with Play Framework in Java](http://www.baeldung.com/rest-api-with-play)
- [Routing In Play Applications in Java](http://www.baeldung.com/routing-in-play)
- [Introduction To Play In Java](http://www.baeldung.com/java-intro-to-the-play-framework)

View File

@ -16,10 +16,19 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<spring.version>4.3.1.RELEASE</spring.version> <spring.version>4.3.4.RELEASE</spring.version>
<hibernate.version>5.2.1.Final</hibernate.version> <hibernate.version>5.2.5.Final</hibernate.version>
<querydsl.version>4.1.3</querydsl.version> <hibernate-jpa.version>1.0.0.Final</hibernate-jpa.version>
<querydsl.version>4.1.4</querydsl.version>
<hsqldb.version>2.3.4</hsqldb.version>
<commons-pool.version>1.6</commons-pool.version>
<commons-dbcp.version>1.4</commons-dbcp.version>
<slf4j.version>1.7.21</slf4j.version> <slf4j.version>1.7.21</slf4j.version>
<logback.version>1.1.7</logback.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<apt-maven-plugin.version>1.1.3</apt-maven-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
@ -50,14 +59,14 @@
<dependency> <dependency>
<groupId>org.hibernate.javax.persistence</groupId> <groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId> <artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version> <version>${hibernate-jpa.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-dbcp</groupId> <groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId> <artifactId>commons-dbcp</artifactId>
<version>1.4</version> <version>${commons-dbcp.version}</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@ -65,7 +74,7 @@
<dependency> <dependency>
<groupId>commons-pool</groupId> <groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId> <artifactId>commons-pool</artifactId>
<version>1.6</version> <version>${commons-pool.version}</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@ -74,7 +83,7 @@
<dependency> <dependency>
<groupId>org.hsqldb</groupId> <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId> <artifactId>hsqldb</artifactId>
<version>2.3.4</version> <version>${hsqldb.version}</version>
</dependency> </dependency>
<!-- Spring Dependencies --> <!-- Spring Dependencies -->
@ -116,7 +125,7 @@
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>1.1.7</version> <version>${logback.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
@ -142,7 +151,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>${java.version}</source> <source>${java.version}</source>
<target>${java.version}</target> <target>${java.version}</target>
@ -154,7 +163,7 @@
<plugin> <plugin>
<groupId>com.mysema.maven</groupId> <groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId> <artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version> <version>${apt-maven-plugin.version}</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>

View File

@ -15,13 +15,13 @@
<dependency> <dependency>
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>2.8.1</version> <version>${jedis.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.kstyrc</groupId> <groupId>com.github.kstyrc</groupId>
<artifactId>embedded-redis</artifactId> <artifactId>embedded-redis</artifactId>
<version>0.6</version> <version>${embedded-redis.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -38,7 +38,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -50,7 +50,13 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jedis.version>2.9.0</jedis.version>
<embedded-redis.version>0.6</embedded-redis.version>
<!-- testing --> <!-- testing -->
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -10,106 +10,106 @@
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>3.1-b06</version> <version>${javax.servlet-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>
<version>2.5</version> <version>${servlet-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId> <artifactId>jetty-security</artifactId>
<version>9.2.0.M1</version> <version>${jetty.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId> <artifactId>jetty-servlet</artifactId>
<version>9.2.0.M1</version> <version>${jetty.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId> <artifactId>jetty-servlets</artifactId>
<version>9.2.0.M1</version> <version>${jetty.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId> <artifactId>jetty-io</artifactId>
<version>9.2.0.M1</version> <version>${jetty.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId> <artifactId>jetty-http</artifactId>
<version>9.2.0.M1</version> <version>${jetty.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId> <artifactId>jetty-server</artifactId>
<version>9.2.0.M1</version> <version>${jetty.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId> <artifactId>jetty-util</artifactId>
<version>9.2.0.M1</version> <version>${jetty.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.21</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>1.2.17</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId> <artifactId>commons-logging</artifactId>
<version>1.2</version> <version>${commons-logging.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId> <artifactId>httpcore</artifactId>
<version>4.4.5</version> <version>${httpcore.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.4</version> <version>${commons-lang3.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.fge</groupId> <groupId>com.github.fge</groupId>
<artifactId>uri-template</artifactId> <artifactId>uri-template</artifactId>
<version>0.9</version> <version>${uri-template.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.googlecode.libphonenumber</groupId> <groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId> <artifactId>libphonenumber</artifactId>
<version>7.4.5</version> <version>${libphonenumber.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<version>1.4.7</version> <version>${javax.mail.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>2.9.4</version> <version>${joda-time.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -126,13 +126,13 @@
<dependency> <dependency>
<groupId>com.github.fge</groupId> <groupId>com.github.fge</groupId>
<artifactId>msg-simple</artifactId> <artifactId>msg-simple</artifactId>
<version>1.1</version> <version>${msg-simple.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.fge</groupId> <groupId>com.github.fge</groupId>
<artifactId>jackson-coreutils</artifactId> <artifactId>jackson-coreutils</artifactId>
<version>1.8</version> <version>${jackson-coreutils.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -143,63 +143,63 @@
<dependency> <dependency>
<groupId>com.github.fge</groupId> <groupId>com.github.fge</groupId>
<artifactId>btf</artifactId> <artifactId>btf</artifactId>
<version>1.2</version> <version>${btf.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.5.2</version> <version>${httpclient.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.codehaus.groovy</groupId> <groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId> <artifactId>groovy-all</artifactId>
<version>2.4.7</version> <version>${groovy.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.tomakehurst</groupId> <groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId> <artifactId>wiremock</artifactId>
<version>2.1.7</version> <version>${wiremock.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.rest-assured</groupId> <groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId> <artifactId>rest-assured</artifactId>
<version>3.0.0</version> <version>${rest-assured.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.rest-assured</groupId> <groupId>io.rest-assured</groupId>
<artifactId>json-schema-validator</artifactId> <artifactId>json-schema-validator</artifactId>
<version>3.0.0</version> <version>${rest-assured-json-schema-validator.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.fge</groupId> <groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId> <artifactId>json-schema-validator</artifactId>
<version>2.2.6</version> <version>${github-json-schema-validator.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.fge</groupId> <groupId>com.github.fge</groupId>
<artifactId>json-schema-core</artifactId> <artifactId>json-schema-core</artifactId>
<version>1.2.5</version> <version>${json-schema-core.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.3</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hamcrest</groupId> <groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId> <artifactId>hamcrest-all</artifactId>
<version>1.3</version> <version>${hamcrest.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-collections</groupId> <groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId> <artifactId>commons-collections</artifactId>
<version>3.2.2</version> <version>${commons-collections.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -209,7 +209,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>8</source> <source>8</source>
<target>8</target> <target>8</target>
@ -219,8 +219,42 @@
</build> </build>
<properties> <properties>
<jackson.version>2.8.3</jackson.version> <jackson.version>2.8.5</jackson.version>
<jackson-coreutils.version>1.8</jackson-coreutils.version>
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<servlet-api.version>2.5</servlet-api.version>
<javax.mail.version>1.4.7</javax.mail.version>
<jetty.version>9.4.0.v20161208</jetty.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.21</slf4j.version>
<commons-lang3.version>3.5</commons-lang3.version>
<commons-logging.version>1.2</commons-logging.version>
<commons-collections.version>3.2.2</commons-collections.version>
<httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5.2</httpclient.version>
<uri-template.version>0.9</uri-template.version>
<libphonenumber.version>8.0.0</libphonenumber.version>
<joda-time.version>2.9.6</joda-time.version>
<msg-simple.version>1.1</msg-simple.version>
<btf.version>1.2</btf.version>
<groovy.version>2.4.7</groovy.version>
<wiremock.version>2.4.1</wiremock.version>
<github-json-schema-validator.version>2.2.6</github-json-schema-validator.version>
<json-schema-core.version>1.2.5</json-schema-core.version>
<hamcrest.version>1.3</hamcrest.version>
<rest-assured.version>3.0.1</rest-assured.version>
<rest-assured-json-schema-validator.version>3.0.1</rest-assured-json-schema-validator.version>
<junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -20,7 +20,7 @@
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.4</version> <version>${commons-io.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -106,20 +106,20 @@
<dependency> <dependency>
<groupId>com.github.tomakehurst</groupId> <groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId> <artifactId>wiremock</artifactId>
<version>1.58</version> <version>${wiremock.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>info.cukes</groupId> <groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId> <artifactId>cucumber-java</artifactId>
<version>1.2.4</version> <version>${cucumber.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>info.cukes</groupId> <groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId> <artifactId>cucumber-junit</artifactId>
<version>1.2.4</version> <version>${cucumber.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -198,35 +198,33 @@
<properties> <properties>
<!-- marshalling --> <!-- marshalling -->
<jackson.version>2.7.8</jackson.version> <jackson.version>2.8.5</jackson.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<commons-io.version>2.5</commons-io.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<rest-assured.version>2.9.0</rest-assured.version>
<cucumber.version>1.2.5</cucumber.version>
<wiremock.version>2.4.1</wiremock.version>
<httpcore.version>4.4.1</httpcore.version> <httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5</httpclient.version> <httpclient.version>4.5.2</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version> <maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -9,9 +9,11 @@
<packaging>war</packaging> <packaging>war</packaging>
<properties> <properties>
<resteasy.version>3.0.14.Final</resteasy.version> <resteasy.version>3.0.19.Final</resteasy.version>
<junit.version>4.12</junit.version>
<commons-io.version>2.5</commons-io.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
</properties> </properties>
<build> <build>
@ -93,13 +95,13 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.4</version> <version>${junit.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.4</version> <version>${commons-io.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -9,7 +9,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -18,7 +18,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version> <version>${maven-surefire-plugin.version}</version>
<configuration> <configuration>
<testFailureIgnore>true</testFailureIgnore> <testFailureIgnore>true</testFailureIgnore>
<includes> <includes>
@ -38,7 +38,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version> <version>${maven-surefire-plugin.version}</version>
<configuration> <configuration>
<includes> <includes>
<include>**/*LiveTest.java</include> <include>**/*LiveTest.java</include>
@ -55,17 +55,26 @@
<dependency> <dependency>
<groupId>org.seleniumhq.selenium</groupId> <groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId> <artifactId>selenium-java</artifactId>
<version>3.0.1</version> <version>${selenium-java.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>org.testng</groupId>
<artifactId>testng</artifactId> <artifactId>testng</artifactId>
<version>6.9.13.6</version> <version>${testng.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<junit.version>4.12</junit.version>
<testng.version>6.10</testng.version>
<selenium-java.version>3.0.1</selenium-java.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
</project> </project>

View File

@ -115,11 +115,11 @@
</profiles> </profiles>
<properties> <properties>
<spring.version>4.3.2.RELEASE</spring.version> <spring.version>4.3.4.RELEASE</spring.version>
<akka.version>2.4.8</akka.version> <akka.version>2.4.14</akka.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>

View File

@ -11,7 +11,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.6.RELEASE</version> <version>1.4.2.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>
@ -134,7 +134,7 @@
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId> <artifactId>assertj-core</artifactId>
<version>3.5.1</version> <version>${assertj.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -158,13 +158,13 @@
<dependency> <dependency>
<groupId>org.easymock</groupId> <groupId>org.easymock</groupId>
<artifactId>easymock</artifactId> <artifactId>easymock</artifactId>
<version>3.4</version> <version>${easymock.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.ehcache</groupId> <groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId> <artifactId>ehcache</artifactId>
<version>3.1.3</version> <version>${ehcache.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -273,42 +273,17 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.3.1.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.springframework.security.version>4.0.4.RELEASE</org.springframework.security.version> <org.springframework.security.version>4.2.0.RELEASE</org.springframework.security.version>
<javassist.version>3.20.0-GA</javassist.version>
<jstl.version>1.2</jstl.version>
<!-- persistence --> <!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version> <hibernate.version>5.2.5.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version>
<logback.version>1.1.3</logback.version>
<!-- various -->
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <ehcache.version>3.1.3</ehcache.version>
<easymock.version>3.4</easymock.version>
<!-- testing --> <assertj.version>3.6.1</assertj.version>
<org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -10,9 +10,9 @@
<properties> <properties>
<env.camel.version>2.16.1</env.camel.version> <env.camel.version>2.16.1</env.camel.version>
<env.spring.version>4.2.4.RELEASE</env.spring.version> <env.spring.version>4.3.4.RELEASE</env.spring.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<java.version>1.7</java.version> <java.version>1.8</java.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
</properties> </properties>
@ -48,7 +48,11 @@
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>${env.spring.version}</version> <version>${env.spring.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -0,0 +1,16 @@
package com.baeldung.camel.file;
import org.apache.camel.builder.RouteBuilder;
public class ContentBasedFileRouter extends RouteBuilder {
private static final String SOURCE_FOLDER = "src/test/source-folder";
private static final String DESTINATION_FOLDER_TXT = "src/test/destination-folder-txt";
private static final String DESTINATION_FOLDER_OTHER = "src/test/destination-folder-other";
@Override
public void configure() throws Exception {
from("file://" + SOURCE_FOLDER + "?delete=true").choice().when(simple("${file:ext} == 'txt'")).to("file://" + DESTINATION_FOLDER_TXT).otherwise().to("file://" + DESTINATION_FOLDER_OTHER);
}
}

View File

@ -0,0 +1,18 @@
package com.baeldung.camel.file;
import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.RouteBuilder;
public class DeadLetterChannelFileRouter extends RouteBuilder {
private static final String SOURCE_FOLDER = "src/test/source-folder";
@Override
public void configure() throws Exception {
errorHandler(deadLetterChannel("log:dead?level=ERROR").maximumRedeliveries(3)
.redeliveryDelay(1000).retryAttemptedLogLevel(LoggingLevel.ERROR));
from("file://" + SOURCE_FOLDER + "?delete=true").process((exchange) -> {
throw new IllegalArgumentException("Exception thrown!");
});
}
}

View File

@ -0,0 +1,14 @@
package com.baeldung.camel.file;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
public class MessageTranslatorFileRouter extends RouteBuilder {
private static final String SOURCE_FOLDER = "src/test/source-folder";
private static final String DESTINATION_FOLDER = "src/test/destination-folder";
@Override
public void configure() throws Exception {
from("file://" + SOURCE_FOLDER + "?delete=true").transform(body().append(header(Exchange.FILE_NAME))).to("file://" + DESTINATION_FOLDER);
}
}

View File

@ -0,0 +1,18 @@
package com.baeldung.camel.file;
import org.apache.camel.builder.RouteBuilder;
public class MulticastFileRouter extends RouteBuilder {
private static final String SOURCE_FOLDER = "src/test/source-folder";
private static final String DESTINATION_FOLDER_WORLD = "src/test/destination-folder-world";
private static final String DESTINATION_FOLDER_HELLO = "src/test/destination-folder-hello";
@Override
public void configure() throws Exception {
from("file://" + SOURCE_FOLDER + "?delete=true").multicast().to("direct:append", "direct:prepend").end();
from("direct:append").transform(body().append("World")).to("file://" + DESTINATION_FOLDER_WORLD);
from("direct:prepend").transform(body().prepend("Hello")).to("file://" + DESTINATION_FOLDER_HELLO);
}
}

View File

@ -0,0 +1,15 @@
package com.baeldung.camel.file;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
public class SplitterFileRouter extends RouteBuilder {
private static final String SOURCE_FOLDER = "src/test/source-folder";
private static final String DESTINATION_FOLDER = "src/test/destination-folder";
@Override
public void configure() throws Exception {
from("file://" + SOURCE_FOLDER + "?delete=true").split(body().convertToString().tokenize("\n")).setHeader(Exchange.FILE_NAME, body()).to("file://" + DESTINATION_FOLDER);
}
}

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