From 00d83f90709108e88c16ade58dbeb9899f7067dc Mon Sep 17 00:00:00 2001 From: Tomasz Lelek Date: Fri, 17 Feb 2017 18:26:23 +0100 Subject: [PATCH] BAEL-602 create JOOL module, one test case --- jooq/pom.xml | 46 +++++++++++++++++++ jooq/src/test/java/com/baeldung/JOOLTest.java | 29 ++++++++++++ pom.xml | 1 + 3 files changed, 76 insertions(+) create mode 100644 jooq/pom.xml create mode 100644 jooq/src/test/java/com/baeldung/JOOLTest.java diff --git a/jooq/pom.xml b/jooq/pom.xml new file mode 100644 index 0000000000..ef287d0292 --- /dev/null +++ b/jooq/pom.xml @@ -0,0 +1,46 @@ + + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + 4.0.0 + + jooq + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + + + + + org.jooq + jool + ${jool.version} + + + junit + junit + ${junit.version} + test + + + + + 0.9.12 + 4.12 + + + + \ No newline at end of file diff --git a/jooq/src/test/java/com/baeldung/JOOLTest.java b/jooq/src/test/java/com/baeldung/JOOLTest.java new file mode 100644 index 0000000000..aa729a3edf --- /dev/null +++ b/jooq/src/test/java/com/baeldung/JOOLTest.java @@ -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 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)); + } +} diff --git a/pom.xml b/pom.xml index ecb07e987b..42ded9de0d 100644 --- a/pom.xml +++ b/pom.xml @@ -193,6 +193,7 @@ struts2 apache-velocity + jooq