Merge remote-tracking branch 'origin/master'

This commit is contained in:
slavisa-baeldung 2017-04-01 08:26:15 +01:00
commit 44865cd630
13 changed files with 68 additions and 40 deletions

View File

@ -1 +1,3 @@
*.docx *.docx
temp.xls
temp.xlsx

View File

@ -33,6 +33,7 @@
<groupId>org.apache.hbase</groupId> <groupId>org.apache.hbase</groupId>
<artifactId>hbase</artifactId> <artifactId>hbase</artifactId>
<version>${hbase.version}</version> <version>${hbase.version}</version>
<type>pom</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>jee7schedule</artifactId> <artifactId>jee7</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>

View File

@ -19,25 +19,27 @@ import static com.jayway.awaitility.Awaitility.to;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
public class ScheduleTimerBeanIntegrationTest { public class ScheduleTimerBeanIntegrationTest {
final static long TIMEOUT = 5000l; private final static long TIMEOUT = 5000l;
final static long TOLERANCE = 1000l; private final static long TOLERANCE = 1000l;
@Inject @Inject TimerEventListener timerEventListener;
TimerEventListener timerEventListener;
@Deployment @Deployment
public static WebArchive deploy() { public static WebArchive deploy() {
File[] jars = Maven.resolver().loadPomFromFile("pom.xml") File[] jars = Maven
.resolve("com.jayway.awaitility:awaitility") .resolver()
.withTransitivity().asFile(); .loadPomFromFile("pom.xml")
.resolve("com.jayway.awaitility:awaitility")
.withTransitivity()
.asFile();
return ShrinkWrap.create(WebArchive.class) return ShrinkWrap
.addAsLibraries(jars) .create(WebArchive.class)
.addClasses(WithinWindowMatcher.class, TimerEvent.class, TimerEventListener.class, ScheduleTimerBean.class); .addAsLibraries(jars)
.addClasses(WithinWindowMatcher.class, TimerEvent.class, TimerEventListener.class, ScheduleTimerBean.class);
} }
@Test @Test
@ -46,9 +48,15 @@ public class ScheduleTimerBeanIntegrationTest {
Awaitility.setDefaultTimeout(30, TimeUnit.SECONDS); Awaitility.setDefaultTimeout(30, TimeUnit.SECONDS);
await().untilCall(to(timerEventListener.getEvents()).size(), equalTo(3)); await().untilCall(to(timerEventListener.getEvents()).size(), equalTo(3));
TimerEvent firstEvent = timerEventListener.getEvents().get(0); TimerEvent firstEvent = timerEventListener
TimerEvent secondEvent = timerEventListener.getEvents().get(1); .getEvents()
TimerEvent thirdEvent = timerEventListener.getEvents().get(2); .get(0);
TimerEvent secondEvent = timerEventListener
.getEvents()
.get(1);
TimerEvent thirdEvent = timerEventListener
.getEvents()
.get(2);
long delay = secondEvent.getTime() - firstEvent.getTime(); long delay = secondEvent.getTime() - firstEvent.getTime();
assertThat(delay, Matchers.is(WithinWindowMatcher.withinWindow(TIMEOUT, TOLERANCE))); assertThat(delay, Matchers.is(WithinWindowMatcher.withinWindow(TIMEOUT, TOLERANCE)));

View File

@ -1,12 +1,9 @@
package com.baeldung; package com.baeldung;
import junit.framework.Assert;
import org.jooq.lambda.Seq; import org.jooq.lambda.Seq;
import org.jooq.lambda.Unchecked; import org.jooq.lambda.Unchecked;
import org.jooq.lambda.function.Function1; import org.jooq.lambda.function.Function1;
import org.jooq.lambda.function.Function2; import org.jooq.lambda.function.Function2;
import org.jooq.lambda.tuple.Tuple;
import org.jooq.lambda.tuple.Tuple2; import org.jooq.lambda.tuple.Tuple2;
import org.jooq.lambda.tuple.Tuple3; import org.jooq.lambda.tuple.Tuple3;
import org.jooq.lambda.tuple.Tuple4; import org.jooq.lambda.tuple.Tuple4;

15
pom.xml
View File

@ -52,7 +52,7 @@
<module>handling-spring-static-resources</module> <module>handling-spring-static-resources</module>
<module>hazelcast</module> <module>hazelcast</module>
<!--<module>hbase</module> TODO: CI problems--> <module>hbase</module>
<module>httpclient</module> <module>httpclient</module>
<module>hystrix</module> <module>hystrix</module>
@ -214,6 +214,7 @@
<module>vertx</module> <module>vertx</module>
<module>spring-data-gemfire</module> <module>spring-data-gemfire</module>
</modules> </modules>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -226,6 +227,18 @@
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LongRunningUnitTest.java</exclude>
<exclude>**/*ManualTest.java</exclude>
</excludes>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins> </plugins>
<extensions> <extensions>
<!--<extension> <!--<extension>

View File

@ -180,7 +180,6 @@
<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>${maven-surefire-plugin.version}</version>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*IntegrationTest.java</exclude> <exclude>**/*IntegrationTest.java</exclude>

View File

@ -3,25 +3,25 @@
*/ */
package org.baeldung.querydsl.intro; package org.baeldung.querydsl.intro;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.baeldung.querydsl.intro.entities.BlogPost;
import org.baeldung.querydsl.intro.entities.QBlogPost;
import org.baeldung.querydsl.intro.entities.QUser;
import org.baeldung.querydsl.intro.entities.User;
import com.querydsl.core.Tuple; import com.querydsl.core.Tuple;
import com.querydsl.core.types.dsl.Expressions; import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.core.types.dsl.NumberPath; import com.querydsl.core.types.dsl.NumberPath;
import com.querydsl.jpa.JPAExpressions; import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
import org.baeldung.querydsl.intro.entities.BlogPost;
import org.baeldung.querydsl.intro.entities.QBlogPost;
import org.baeldung.querydsl.intro.entities.QUser;
import org.baeldung.querydsl.intro.entities.User;
import org.junit.*; import org.junit.*;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import java.util.List;
import static org.junit.Assert.*; import static org.junit.Assert.*;
public class QueryDSLTest { public class QueryDSLIntegrationTest {
private static EntityManagerFactory emf; private static EntityManagerFactory emf;

View File

@ -17,6 +17,18 @@
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LongRunningUnitTest.java</exclude>
<exclude>**/*ManualTest.java</exclude>
</excludes>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
@ -47,4 +59,5 @@
<hamcrest.version>1.3</hamcrest.version> <hamcrest.version>1.3</hamcrest.version>
</properties> </properties>
</project> </project>

View File

@ -14,7 +14,7 @@ import java.util.stream.IntStream;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
public class RxJavaBackpressureTest { public class RxJavaBackpressureLongRunningUnitTest {
@Test @Test
public void givenColdObservable_shouldNotThrowException() { public void givenColdObservable_shouldNotThrowException() {

View File

@ -15,11 +15,12 @@ import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@ActiveProfiles("test") @ActiveProfiles("test")
@SpringBootTest(webEnvironment=SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = RANDOM_PORT)
public class MessageControllerTest { public class MessageControllerIntegrationTest {
@Autowired @Autowired
private TestRestTemplate restTemplate; private TestRestTemplate restTemplate;

View File

@ -15,11 +15,6 @@
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
@ -28,7 +23,6 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 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> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>jooq-spring</artifactId> <artifactId>sprin-jooq</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<dependencyManagement> <dependencyManagement>