BAEL-602 create JOOL module, one test case

This commit is contained in:
Tomasz Lelek 2017-02-17 18:26:23 +01:00
parent 5f0f26e374
commit 00d83f9070
3 changed files with 76 additions and 0 deletions

46
jooq/pom.xml Normal file
View File

@ -0,0 +1,46 @@
<?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">
<parent>
<artifactId>parent-modules</artifactId>
<groupId>com.baeldung</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jooq</artifactId>
<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>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jool</artifactId>
<version>${jool.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<jool.version>0.9.12</jool.version>
<junit.version>4.12</junit.version>
</properties>
</project>

View File

@ -0,0 +1,29 @@
package com.baeldung;
import org.jooq.lambda.Seq;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import static junit.framework.Assert.assertTrue;
import static junit.framework.TestCase.assertEquals;
public class JOOLTest {
@Test
public void givenSeq_whenCheckContains_shouldReturnTrue() {
List<Integer> concat = Seq.of(1, 2, 3).concat(Seq.of(4, 5, 6)).toList();
assertEquals(concat, Arrays.asList(1, 2, 3, 4, 5, 6));
assertTrue(Seq.of(1, 2, 3, 4).contains(2));
assertTrue(Seq.of(1, 2, 3, 4).containsAll(2, 3));
assertTrue(Seq.of(1, 2, 3, 4).containsAny(2, 5));
}
}

View File

@ -193,6 +193,7 @@
<module>struts2</module>
<module>apache-velocity</module>
<module>jooq</module>
</modules>