commit
2de345b900
|
@ -64,7 +64,7 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<version>${cobertura.plugin.version}</version>
|
||||
<configuration>
|
||||
<instrumentation>
|
||||
<ignores>
|
||||
|
@ -85,6 +85,7 @@
|
|||
<commons-codec.version>1.11</commons-codec.version>
|
||||
<guava.version>27.0.1-jre</guava.version>
|
||||
<combinatoricslib3.version>3.3.0</combinatoricslib3.version>
|
||||
<cobertura.plugin.version>2.7</cobertura.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -46,13 +46,13 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>${commons.lang3.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>pl.pragmatists</groupId>
|
||||
<artifactId>JUnitParams</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>${JUnitParams.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -91,6 +91,8 @@
|
|||
<retrofit.version>2.6.0</retrofit.version>
|
||||
<jmh-core.version>1.19</jmh-core.version>
|
||||
<jmh-generator.version>1.19</jmh-generator.version>
|
||||
<commons.lang3.version>3.8.1</commons.lang3.version>
|
||||
<JUnitParams.version>1.1.0</JUnitParams.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -37,7 +37,7 @@
|
|||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>28.1-jre</version>
|
||||
<version>${guava.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -65,6 +65,7 @@
|
|||
<org.assertj.core.version>3.9.0</org.assertj.core.version>
|
||||
<commons-codec.version>1.11</commons-codec.version>
|
||||
<commons-math3.version>3.6.1</commons-math3.version>
|
||||
<guava.version>28.1-jre</guava.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -18,19 +18,19 @@
|
|||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>javax.ws.rs-api</artifactId>
|
||||
<version>2.1</version>
|
||||
<version>${rs-api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.enterprise</groupId>
|
||||
<artifactId>cdi-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>${cdi-api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.json.bind</groupId>
|
||||
<artifactId>javax.json.bind-api</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${bind-api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -80,6 +80,9 @@
|
|||
<liberty-maven-plugin.version>2.4.2</liberty-maven-plugin.version>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<openliberty-version>18.0.0.2</openliberty-version>
|
||||
<rs-api.version>2.1</rs-api.version>
|
||||
<cdi-api.version>2.0</cdi-api.version>
|
||||
<bind-api.version>1.0</bind-api.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -17,11 +17,12 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<version>${rocketmq.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<geode.core>1.6.0</geode.core>
|
||||
<rocketmq.version>2.0.4</rocketmq.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
|
|
@ -81,10 +81,10 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
<optimize>true</optimize>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -92,7 +92,7 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.7.2</version>
|
||||
<version>${compiler.surefire.version}</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<tapestry.execution-mode>Qa</tapestry.execution-mode>
|
||||
|
@ -104,7 +104,7 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's
|
|||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.16</version>
|
||||
<version>${compiler.jetty.version}</version>
|
||||
<configuration>
|
||||
<!-- Log to the console. -->
|
||||
<requestLog implementation="org.mortbay.jetty.NCSARequestLog">
|
||||
|
@ -140,6 +140,11 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's
|
|||
</repositories>
|
||||
|
||||
<properties>
|
||||
<compiler.jetty.version>6.1.16</compiler.jetty.version>
|
||||
<compiler.surefire.version>2.7.2</compiler.surefire.version>
|
||||
<compiler.plugin.version>2.3.2</compiler.plugin.version>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
<tapestry-release-version>5.4.5</tapestry-release-version>
|
||||
<servlet-api-release-version>2.5</servlet-api-release-version>
|
||||
<testng-release-version>6.8.21</testng-release-version>
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<spring.version>2.2.1.RELEASE</spring.version>
|
||||
<awssdk.version>2.10.27</awssdk.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -26,7 +28,7 @@
|
|||
<!-- Import dependency management from Spring Boot -->
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.2.1.RELEASE</version>
|
||||
<version>${spring.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -34,7 +36,7 @@
|
|||
<dependency>
|
||||
<groupId>software.amazon.awssdk</groupId>
|
||||
<artifactId>bom</artifactId>
|
||||
<version>2.10.27</version>
|
||||
<version>${awssdk.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>${assembly.plugin.version}</version>
|
||||
<configuration>
|
||||
<finalName>${project.build.finalName}</finalName>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
|
@ -161,6 +161,7 @@
|
|||
<assertj-core.version>3.11.1</assertj-core.version>
|
||||
<maven-failsafe-plugin.version>3.0.0-M3</maven-failsafe-plugin.version>
|
||||
<process-exec-maven-plugin.version>0.7</process-exec-maven-plugin.version>
|
||||
<assembly.plugin.version>3.1.0</assembly.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -62,12 +62,12 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-eclipse-compiler</artifactId>
|
||||
<version>3.3.0-01</version>
|
||||
<version>${groovy.compiler.version}</version>
|
||||
<extensions>true</extensions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<compilerId>groovy-eclipse-compiler</compilerId>
|
||||
<source>${java.version}</source>
|
||||
|
@ -113,7 +113,7 @@
|
|||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<version>${surefire.plugin.version}</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
|
@ -126,7 +126,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>${assembly.plugin.version}</version>
|
||||
<configuration>
|
||||
<!-- get all project dependencies -->
|
||||
<descriptorRefs>
|
||||
|
@ -183,6 +183,10 @@
|
|||
<groovy-wslite.version>1.1.3</groovy-wslite.version>
|
||||
<logback.version>1.2.3</logback.version>
|
||||
<groovy.version>2.5.7</groovy.version>
|
||||
<assembly.plugin.version>3.1.0</assembly.plugin.version>
|
||||
<surefire.plugin.version>2.20.1</surefire.plugin.version>
|
||||
<compiler.plugin.version>3.8.0</compiler.plugin.version>
|
||||
<groovy.compiler.version>3.3.0-01</groovy.compiler.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<version>${surefire.plugin.version}</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
|
@ -126,6 +126,7 @@
|
|||
<hsqldb.version>2.4.0</hsqldb.version>
|
||||
<spock-core.version>1.1-groovy-2.4</spock-core.version>
|
||||
<gmavenplus-plugin.version>1.6</gmavenplus-plugin.version>
|
||||
<surefire.plugin.version>2.20.1</surefire.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -42,12 +42,12 @@
|
|||
<dependency>
|
||||
<groupId>org.eclipse.collections</groupId>
|
||||
<artifactId>eclipse-collections</artifactId>
|
||||
<version>10.0.0</version>
|
||||
<version>${eclipse.collections.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.collections</groupId>
|
||||
<artifactId>eclipse-collections-api</artifactId>
|
||||
<version>10.0.0</version>
|
||||
<version>${eclipse.collections.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -108,6 +108,7 @@
|
|||
<assertj.version>3.11.1</assertj.version>
|
||||
<uberjar.name>benchmarks</uberjar.name>
|
||||
<jmh.version>1.22</jmh.version>
|
||||
<eclipse.collections.version>10.0.0</eclipse.collections.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M3</version>
|
||||
<version>${surefire.plugin.version}</version>
|
||||
<configuration>
|
||||
<argLine>--enable-preview</argLine>
|
||||
</configuration>
|
||||
|
@ -53,6 +53,7 @@
|
|||
<maven.compiler.source.version>13</maven.compiler.source.version>
|
||||
<maven.compiler.target.version>13</maven.compiler.target.version>
|
||||
<assertj.version>3.6.1</assertj.version>
|
||||
<surefire.plugin.version>3.0.0-M3</surefire.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,27 @@
|
|||
package com.baeldung.newfeatures;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class SwitchExpressionsWithYieldUnitTest {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("preview")
|
||||
public void whenSwitchingOnOperationSquareMe_thenWillReturnSquare() {
|
||||
var me = 4;
|
||||
var operation = "squareMe";
|
||||
var result = switch (operation) {
|
||||
case "doubleMe" -> {
|
||||
yield me * 2;
|
||||
}
|
||||
case "squareMe" -> {
|
||||
yield me * me;
|
||||
}
|
||||
default -> me;
|
||||
};
|
||||
|
||||
assertEquals(16, result);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.baeldung.newfeatures;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class TextBlocksUnitTest {
|
||||
|
||||
private static final String JSON_STRING = "{\r\n" + "\"name\" : \"Baeldung\",\r\n" + "\"website\" : \"https://www.%s.com/\"\r\n" + "}";
|
||||
|
||||
@SuppressWarnings("preview")
|
||||
private static final String TEXT_BLOCK_JSON = """
|
||||
{
|
||||
"name" : "Baeldung",
|
||||
"website" : "https://www.%s.com/"
|
||||
}
|
||||
""";
|
||||
|
||||
@Test
|
||||
public void whenTextBlocks_thenStringOperationsWork() {
|
||||
|
||||
assertThat(TEXT_BLOCK_JSON.contains("Baeldung")).isTrue();
|
||||
assertThat(TEXT_BLOCK_JSON.indexOf("www")).isGreaterThan(0);
|
||||
assertThat(TEXT_BLOCK_JSON.length()).isGreaterThan(0);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
@Test
|
||||
public void whenTextBlocks_thenFormattedWorksAsFormat() {
|
||||
assertThat(TEXT_BLOCK_JSON.formatted("baeldung")
|
||||
.contains("www.baeldung.com")).isTrue();
|
||||
|
||||
assertThat(String.format(JSON_STRING, "baeldung")
|
||||
.contains("www.baeldung.com")).isTrue();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -36,7 +36,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M3</version>
|
||||
<version>${surefire.plugin.version}</version>
|
||||
<configuration>
|
||||
<argLine>--enable-preview</argLine>
|
||||
</configuration>
|
||||
|
@ -47,6 +47,7 @@
|
|||
<properties>
|
||||
<maven.compiler.source.version>14</maven.compiler.source.version>
|
||||
<maven.compiler.target.version>14</maven.compiler.target.version>
|
||||
<surefire.plugin.version>3.0.0-M3</surefire.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -51,7 +51,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<version>${shade.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
|
@ -79,6 +79,7 @@
|
|||
<commons-lang3.version>3.9</commons-lang3.version>
|
||||
<!-- testing -->
|
||||
<assertj-core.version>3.10.0</assertj-core.version>
|
||||
<shade.plugin.version>3.2.0</shade.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -183,8 +183,8 @@
|
|||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>${maven-javadoc-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -373,6 +373,8 @@
|
|||
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
|
||||
<spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version>
|
||||
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -207,8 +207,8 @@
|
|||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>${maven-javadoc-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -397,6 +397,8 @@
|
|||
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
|
||||
<spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version>
|
||||
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -19,34 +19,34 @@
|
|||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.5.1</version>
|
||||
<version>${jupiter.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>5.0.9.RELEASE</version>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>5.0.9.RELEASE</version>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>5.0.9.RELEASE</version>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>5.0.9.RELEASE</version>
|
||||
<version>${spring.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.199</version>
|
||||
<version>${h2.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -56,11 +56,19 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<spring.version>5.0.9.RELEASE</spring.version>
|
||||
<h2.version>1.4.199</h2.version>
|
||||
<jupiter.version>5.5.1</jupiter.version>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<dependency>
|
||||
<groupId>com.baeldung.servicemodule</groupId>
|
||||
<artifactId>servicemodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${servicemodule.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -29,4 +29,8 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<servicemodule.version>1.0</servicemodule.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -31,6 +31,9 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<compiler.plugin.version>3.8.0</compiler.plugin.version>
|
||||
<source.version>11</source.version>
|
||||
<target.version>11</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -17,12 +17,12 @@
|
|||
<dependency>
|
||||
<groupId>com.baeldung.servicemodule</groupId>
|
||||
<artifactId>servicemodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${servicemodule.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.providermodule</groupId>
|
||||
<artifactId>providermodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${providermodule.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -34,5 +34,10 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<servicemodule.version>1.0</servicemodule.version>
|
||||
<providermodule.version>1.0</providermodule.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -20,14 +20,20 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<compiler.plugin.version>3.8.0</compiler.plugin.version>
|
||||
<source.version>11</source.version>
|
||||
<target.version>11</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -17,7 +17,7 @@
|
|||
<dependency>
|
||||
<groupId>com.baeldung.servicemodule</groupId>
|
||||
<artifactId>servicemodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${servicemodule.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -30,4 +30,9 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<servicemodule.version>1.0</servicemodule.version>
|
||||
</properties>
|
||||
|
||||
|
||||
</project>
|
|
@ -18,7 +18,7 @@
|
|||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.4</version>
|
||||
<version>${commons.beanutils.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjdk.jmh</groupId>
|
||||
|
@ -57,6 +57,7 @@
|
|||
<jmh-core.version>1.19</jmh-core.version>
|
||||
<jmh-generator.version>1.19</jmh-generator.version>
|
||||
<assertj.version>3.12.2</assertj.version>
|
||||
<commons.beanutils.version>1.9.4</commons.beanutils.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
<compilerArgument>-parameters</compilerArgument>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -48,5 +48,7 @@
|
|||
<properties>
|
||||
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
|
||||
<assertj-core.version>3.10.0</assertj-core.version>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
</properties>
|
||||
</project>
|
|
@ -25,7 +25,7 @@
|
|||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>28.1-jre</version>
|
||||
<version>${guava.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<properties>
|
||||
<commons-lang3.version>3.8.1</commons-lang3.version>
|
||||
<assertj.version>3.6.1</assertj.version>
|
||||
<guava.version>27.0.1-jre</guava.version>
|
||||
<guava.version>28.1-jre</guava.version>
|
||||
<junit-jupiter-api.version>5.3.1</junit-jupiter-api.version>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.baeldung.regex.matcher;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class MatcherUnitTest {
|
||||
|
||||
@Test
|
||||
public void whenFindFourDigitWorks_thenCorrect() {
|
||||
Pattern stringPattern = Pattern.compile("\\d\\d\\d\\d");
|
||||
Matcher m = stringPattern.matcher("goodbye 2019 and welcome 2020");
|
||||
|
||||
assertTrue(m.find());
|
||||
assertEquals(8, m.start());
|
||||
assertEquals("2019", m.group());
|
||||
assertEquals(12, m.end());
|
||||
|
||||
assertTrue(m.find());
|
||||
assertEquals(25, m.start());
|
||||
assertEquals("2020", m.group());
|
||||
assertEquals(29, m.end());
|
||||
|
||||
assertFalse(m.find());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenStartIndex_whenFindFourDigitWorks_thenCorrect() {
|
||||
Pattern stringPattern = Pattern.compile("\\d\\d\\d\\d");
|
||||
Matcher m = stringPattern.matcher("goodbye 2019 and welcome 2020");
|
||||
|
||||
assertTrue(m.find(20));
|
||||
assertEquals(25, m.start());
|
||||
assertEquals("2020", m.group());
|
||||
assertEquals(29, m.end());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenMatchFourDigitWorks_thenFail() {
|
||||
Pattern stringPattern = Pattern.compile("\\d\\d\\d\\d");
|
||||
Matcher m = stringPattern.matcher("goodbye 2019 and welcome 2020");
|
||||
assertFalse(m.matches());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenMatchFourDigitWorks_thenCorrect() {
|
||||
Pattern stringPattern = Pattern.compile("\\d\\d\\d\\d");
|
||||
Matcher m = stringPattern.matcher("2019");
|
||||
|
||||
assertTrue(m.matches());
|
||||
assertEquals(0, m.start());
|
||||
assertEquals("2019", m.group());
|
||||
assertEquals(4, m.end());
|
||||
|
||||
assertTrue(m.matches());// matches will always return the same return
|
||||
}
|
||||
|
||||
}
|
|
@ -207,8 +207,8 @@
|
|||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>${maven-javadoc-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -397,6 +397,8 @@
|
|||
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
|
||||
<spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version>
|
||||
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -17,17 +17,17 @@
|
|||
<dependency>
|
||||
<groupId>com.baeldung.entitymodule</groupId>
|
||||
<artifactId>entitymodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${entitymodule.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.daomodule</groupId>
|
||||
<artifactId>daomodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${daomodule.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.userdaomodule</groupId>
|
||||
<artifactId>userdaomodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${userdaomodule.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -43,6 +43,9 @@
|
|||
<properties>
|
||||
<maven.compiler.source>9</maven.compiler.source>
|
||||
<maven.compiler.target>9</maven.compiler.target>
|
||||
<entitymodule.version>1.0</entitymodule.version>
|
||||
<daomodule.version>1.0</daomodule.version>
|
||||
<userdaomodule.version>1.0</userdaomodule.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -45,10 +45,10 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.9</source>
|
||||
<target>1.9</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -56,6 +56,9 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<compiler.plugin.version>3.8.0</compiler.plugin.version>
|
||||
<source.version>1.9</source.version>
|
||||
<target.version>1.9</target.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<assertj-core.version>3.12.2</assertj-core.version>
|
||||
</properties>
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
<dependency>
|
||||
<groupId>com.baeldung.entitymodule</groupId>
|
||||
<artifactId>entitymodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${entitymodule.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.daomodule</groupId>
|
||||
<artifactId>daomodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${daomodule.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -38,6 +38,8 @@
|
|||
<properties>
|
||||
<maven.compiler.source>9</maven.compiler.source>
|
||||
<maven.compiler.target>9</maven.compiler.target>
|
||||
<entitymodule.version>1.0</entitymodule.version>
|
||||
<daomodule.version>1.0</daomodule.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -29,16 +29,16 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>${dependency.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
|
@ -69,5 +69,12 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<dependency.plugin.version>3.1.1</dependency.plugin.version>
|
||||
<compiler.plugin.version>3.8.0</compiler.plugin.version>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package com.baeldung.sequeces
|
||||
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertEquals
|
||||
import java.time.Instant
|
||||
|
||||
class SequencesTest {
|
||||
|
||||
@Test
|
||||
fun shouldBuildSequenceWhenUsingFromElements() {
|
||||
val seqOfElements = sequenceOf("first" ,"second", "third")
|
||||
.toList()
|
||||
assertEquals(3, seqOfElements.count())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldBuildSequenceWhenUsingFromFunction() {
|
||||
val seqFromFunction = generateSequence(Instant.now()) {it.plusSeconds(1)}
|
||||
.take(3)
|
||||
.toList()
|
||||
assertEquals(3, seqFromFunction.count())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldBuildSequenceWhenUsingFromChunks() {
|
||||
val seqFromChunks = sequence {
|
||||
yield(1)
|
||||
yieldAll((2..5).toList())
|
||||
}.toList()
|
||||
assertEquals(5, seqFromChunks.count())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldBuildSequenceWhenUsingFromCollection() {
|
||||
val seqFromIterable = (1..10)
|
||||
.asSequence()
|
||||
.toList()
|
||||
assertEquals(10, seqFromIterable.count())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldShowNoCountDiffWhenUsingWithAndWithoutSequence() {
|
||||
val withSequence = (1..10).asSequence()
|
||||
.filter{it % 2 == 1}
|
||||
.map { it * 2 }
|
||||
.toList()
|
||||
val withoutSequence = (1..10)
|
||||
.filter{it % 2 == 1}
|
||||
.map { it * 2 }
|
||||
.toList()
|
||||
assertEquals(withSequence.count(), withoutSequence.count())
|
||||
}
|
||||
|
||||
}
|
|
@ -28,7 +28,7 @@
|
|||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<version>${scala.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
@ -49,6 +49,7 @@
|
|||
|
||||
<properties>
|
||||
<scala.version>2.12.7</scala.version>
|
||||
<scala.plugin.version>3.3.2</scala.plugin.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
|
|
|
@ -44,12 +44,13 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.3.5</version>
|
||||
<version>${httpclient.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<dl4j.version>0.9.1</dl4j.version> <!-- Latest non beta version -->
|
||||
<httpclient.version>4.3.5</httpclient.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -175,10 +175,10 @@
|
|||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -215,5 +215,8 @@
|
|||
<logback.version>1.2.3</logback.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
<spring-boot-maven-plugin.version>2.0.4.RELEASE</spring-boot-maven-plugin.version>
|
||||
<compiler.plugin.version>3.1</compiler.plugin.version>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<plugin>
|
||||
<groupId>net.ltgt.gwt.maven</groupId>
|
||||
<artifactId>gwt-maven-plugin</artifactId>
|
||||
<version>1.0-rc-8</version>
|
||||
<version>${gwt.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
@ -78,7 +78,7 @@
|
|||
<failOnError>true</failOnError>
|
||||
<!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if
|
||||
you use a different source language for java compilation -->
|
||||
<sourceLevel>1.8</sourceLevel>
|
||||
<sourceLevel>${maven.compiler.source}</sourceLevel>
|
||||
<!-- Compiler configuration -->
|
||||
<compilerArgs>
|
||||
<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
|
||||
|
@ -98,7 +98,7 @@
|
|||
<!-- Skip normal test execution, we use gwt:test instead -->
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.17</version>
|
||||
<version>${surefire.plugin.version}</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
|
@ -119,6 +119,8 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<gwt.version>2.8.2</gwt.version>
|
||||
<gwt.plugin.version>1.0-rc-8</gwt.plugin.version>
|
||||
<surefire.plugin.version>2.17</surefire.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -46,19 +46,19 @@
|
|||
<dependency>
|
||||
<groupId>org.jetbrains.spek</groupId>
|
||||
<artifactId>spek-api</artifactId>
|
||||
<version>1.1.5</version>
|
||||
<version>${spek.api.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.spek</groupId>
|
||||
<artifactId>spek-subject-extension</artifactId>
|
||||
<version>1.1.5</version>
|
||||
<version>${spek.subject.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.spek</groupId>
|
||||
<artifactId>spek-junit-platform-engine</artifactId>
|
||||
<version>1.1.5</version>
|
||||
<version>${spek.junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -195,6 +195,9 @@
|
|||
<junit.vintage.version>5.2.0</junit.vintage.version>
|
||||
<assertj.version>3.10.0</assertj.version>
|
||||
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
|
||||
<spek.api.version>1.1.5</spek.api.version>
|
||||
<spek.subject.version>1.1.5</spek.subject.version>
|
||||
<spek.junit.version>1.1.5</spek.junit.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<awaitility.version>3.1.2</awaitility.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -31,7 +32,7 @@
|
|||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<version>${awaitility.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -12,12 +12,16 @@
|
|||
<artifactId>java-ee-8-security-api</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<unboundid.ldapsdk.version>4.0.4</unboundid.ldapsdk.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.unboundid</groupId>
|
||||
<artifactId>unboundid-ldapsdk</artifactId>
|
||||
<version>4.0.4</version>
|
||||
<version>${unboundid.ldapsdk.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
<artifactId>jmh-generator-annprocess</artifactId>
|
||||
<version>${jmh-generator.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>it.unimi.dsi</groupId>
|
||||
<artifactId>dsiutils</artifactId>
|
||||
<version>${dsiutils.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -33,4 +38,8 @@
|
|||
</resources>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<dsiutils.version>2.6.0</dsiutils.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -7,7 +7,7 @@ public class BruteForcePrimeChecker implements PrimeChecker<Integer> {
|
|||
@Override
|
||||
public boolean isPrime(Integer number) {
|
||||
|
||||
return number > 2 ? IntStream.range(2, number)
|
||||
return number > 1 ? IntStream.range(2, number)
|
||||
.noneMatch(n -> (number % n == 0)) : false;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ public class OptimisedPrimeChecker implements PrimeChecker<Integer> {
|
|||
|
||||
@Override
|
||||
public boolean isPrime(Integer number) {
|
||||
return number > 2 ? IntStream.rangeClosed(2, (int) Math.sqrt(number))
|
||||
return number > 1 ? IntStream.rangeClosed(2, (int) Math.sqrt(number))
|
||||
.noneMatch(n -> (number % n == 0)) : false;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,22 +11,24 @@ public class PrimeCheckerUnitTest {
|
|||
|
||||
@Test
|
||||
public void whenCheckIsPrime_thenTrue() {
|
||||
assertTrue(primeChecker.isPrime(13l));
|
||||
assertTrue(primeChecker.isPrime(2L));
|
||||
assertTrue(primeChecker.isPrime(13L));
|
||||
assertTrue(primeChecker.isPrime(1009L));
|
||||
assertTrue(primeChecker.isPrime(74207281L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenCheckIsPrime_thenFalse() {
|
||||
assertTrue(!primeChecker.isPrime(50L));
|
||||
assertTrue(!primeChecker.isPrime(1001L));
|
||||
assertTrue(!primeChecker.isPrime(74207282L));
|
||||
assertFalse(primeChecker.isPrime(50L));
|
||||
assertFalse(primeChecker.isPrime(1001L));
|
||||
assertFalse(primeChecker.isPrime(74207282L));
|
||||
}
|
||||
|
||||
private final BruteForcePrimeChecker bfPrimeChecker = new BruteForcePrimeChecker();
|
||||
|
||||
@Test
|
||||
public void whenBFCheckIsPrime_thenTrue() {
|
||||
assertTrue(bfPrimeChecker.isPrime(2));
|
||||
assertTrue(bfPrimeChecker.isPrime(13));
|
||||
assertTrue(bfPrimeChecker.isPrime(1009));
|
||||
}
|
||||
|
@ -41,6 +43,7 @@ public class PrimeCheckerUnitTest {
|
|||
|
||||
@Test
|
||||
public void whenOptCheckIsPrime_thenTrue() {
|
||||
assertTrue(optimisedPrimeChecker.isPrime(2));
|
||||
assertTrue(optimisedPrimeChecker.isPrime(13));
|
||||
assertTrue(optimisedPrimeChecker.isPrime(1009));
|
||||
}
|
||||
|
@ -55,6 +58,7 @@ public class PrimeCheckerUnitTest {
|
|||
|
||||
@Test
|
||||
public void whenPrimesCheckIsPrime_thenTrue() {
|
||||
assertTrue(primesPrimeChecker.isPrime(2));
|
||||
assertTrue(primesPrimeChecker.isPrime(13));
|
||||
assertTrue(primesPrimeChecker.isPrime(1009));
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
<dependency>
|
||||
<groupId>javax.mvc</groupId>
|
||||
<artifactId>javax.mvc-api</artifactId>
|
||||
<version>20160715</version>
|
||||
<version>${mvc.api.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.ozark</groupId>
|
||||
|
@ -215,7 +215,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>${lifecycle.mapping.version}</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
|
@ -506,6 +506,8 @@
|
|||
</repositories>
|
||||
|
||||
<properties>
|
||||
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
|
||||
<mvc.api.version>20160715</mvc.api.version>
|
||||
<java.min.version>1.8</java.min.version>
|
||||
<maven.min.version>3.0.0</maven.min.version>
|
||||
<javaee_api.version>7.0</javaee_api.version>
|
||||
|
|
|
@ -253,7 +253,7 @@
|
|||
<dependency>
|
||||
<groupId>org.wildfly.arquillian</groupId>
|
||||
<artifactId>wildfly-arquillian-container-remote</artifactId>
|
||||
<version>2.2.0.Final</version>
|
||||
<version>${wildfly.arquillian.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -261,6 +261,7 @@
|
|||
</profiles>
|
||||
|
||||
<properties>
|
||||
<wildfly.arquillian.version>2.2.0.Final</wildfly.arquillian.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<javaee-api.version>8.0</javaee-api.version>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
</prerequisites>
|
||||
|
||||
<properties>
|
||||
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
|
||||
<argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
|
||||
<assertj.version>3.6.2</assertj.version>
|
||||
<awaitility.version>2.0.0</awaitility.version>
|
||||
|
@ -433,7 +434,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>${lifecycle.mapping.version}</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
<undertow.version>1.4.10.Final</undertow.version>
|
||||
<validation-api.version>1.1.0.Final</validation-api.version>
|
||||
<yarn.version>v0.21.3</yarn.version>
|
||||
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -427,7 +428,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>${lifecycle.mapping.version}</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
<undertow.version>1.4.10.Final</undertow.version>
|
||||
<validation-api.version>1.1.0.Final</validation-api.version>
|
||||
<yarn.version>v0.21.3</yarn.version>
|
||||
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -469,7 +470,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>${lifecycle.mapping.version}</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
|
|
|
@ -302,7 +302,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>${lifecycle.mapping.version}</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
|
@ -398,8 +398,8 @@
|
|||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
|
@ -881,6 +881,9 @@
|
|||
</profiles>
|
||||
|
||||
<properties>
|
||||
<source.version>1.8</source.version>
|
||||
<target.version>1.8</target.version>
|
||||
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
|
||||
<argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
|
||||
<assertj.version>3.6.2</assertj.version>
|
||||
<awaitility.version>2.0.0</awaitility.version>
|
||||
|
|
|
@ -236,7 +236,7 @@
|
|||
<dependency>
|
||||
<groupId>org.zalando</groupId>
|
||||
<artifactId>problem-spring-web</artifactId>
|
||||
<version>0.24.0-RC.0</version>
|
||||
<version>${spring.web.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security.oauth</groupId>
|
||||
|
@ -559,7 +559,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>${lifecycle.mapping.version}</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
|
@ -1012,6 +1012,8 @@
|
|||
</profiles>
|
||||
|
||||
<properties>
|
||||
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
|
||||
<spring.web.version>0.24.0-RC.0</spring.web.version>
|
||||
<!-- Build properties -->
|
||||
<maven.version>3.0.0</maven.version>
|
||||
<java.version>1.8</java.version>
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
<dependency>
|
||||
<groupId>org.zalando</groupId>
|
||||
<artifactId>problem-spring-web</artifactId>
|
||||
<version>0.24.0-RC.0</version>
|
||||
<version>${spring.web.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security.oauth</groupId>
|
||||
|
@ -543,7 +543,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>${lifecycle.mapping.version}</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
|
@ -834,6 +834,8 @@
|
|||
</profiles>
|
||||
|
||||
<properties>
|
||||
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
|
||||
<spring.web.version>0.24.0-RC.0</spring.web.version>
|
||||
<!-- Build properties -->
|
||||
<maven.version>3.0.0</maven.version>
|
||||
<java.version>1.8</java.version>
|
||||
|
|
|
@ -33,19 +33,19 @@
|
|||
<dependency>
|
||||
<groupId>org.jetbrains.spek</groupId>
|
||||
<artifactId>spek-api</artifactId>
|
||||
<version>1.1.5</version>
|
||||
<version>${spek.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.spek</groupId>
|
||||
<artifactId>spek-subject-extension</artifactId>
|
||||
<version>1.1.5</version>
|
||||
<version>${spek.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.spek</groupId>
|
||||
<artifactId>spek-junit-platform-engine</artifactId>
|
||||
<version>1.1.5</version>
|
||||
<version>${spek.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -166,6 +166,7 @@
|
|||
<objenesis.version>2.6</objenesis.version>
|
||||
<rxkotlin.version>2.3.0</rxkotlin.version>
|
||||
<arrow-core.version>0.7.3</arrow-core.version>
|
||||
<spek.version>1.1.5</spek.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>${dependency.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>getClasspathFilenames</id>
|
||||
|
@ -116,7 +116,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.1</version>
|
||||
<version>${surefire.plugin.version}</version>
|
||||
<configuration>
|
||||
<argLine>-Dco.paralleluniverse.fibers.verifyInstrumentation=true</argLine>
|
||||
<argLine>-javaagent:${co.paralleluniverse:quasar-core:jar}</argLine>
|
||||
|
@ -125,7 +125,7 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<version>${exec.plugin.version}</version>
|
||||
<configuration>
|
||||
<workingDirectory>target/classes</workingDirectory>
|
||||
<executable>echo</executable>
|
||||
|
@ -145,6 +145,9 @@
|
|||
<kotlin.version>1.3.31</kotlin.version>
|
||||
<org.slf4j.version>1.7.21</org.slf4j.version>
|
||||
<logback.version>1.1.7</logback.version>
|
||||
<dependency.plugin.version>3.1.1</dependency.plugin.version>
|
||||
<surefire.plugin.version>2.22.1</surefire.plugin.version>
|
||||
<exec.plugin.version>1.3.2</exec.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -183,7 +183,7 @@
|
|||
<plugin>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-maven-plugin</artifactId>
|
||||
<version>11.11.2</version>
|
||||
<version>${ebean.plugin.version}</version>
|
||||
<executions>
|
||||
<!-- enhance main classes -->
|
||||
<execution>
|
||||
|
@ -202,6 +202,7 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<ebean.plugin.version>11.11.2</ebean.plugin.version>
|
||||
<reladomo.version>16.5.1</reladomo.version>
|
||||
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
|
||||
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
|
||||
|
|
|
@ -74,19 +74,19 @@
|
|||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
<version>1.2</version>
|
||||
<version>${commons.cli.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.1</version>
|
||||
<version>${commons.io.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>${httpclient.version}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
@ -133,7 +133,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
<version>${assembly.plugin.version}</version>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/resources/assembly/hadoop-job.xml</descriptor>
|
||||
|
@ -158,6 +158,10 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<assembly.plugin.version>2.3</assembly.plugin.version>
|
||||
<commons.cli.version>1.2</commons.cli.version>
|
||||
<commons.io.version>2.1</commons.io.version>
|
||||
<httpclient.version>3.0.1</httpclient.version>
|
||||
<storm.version>1.2.2</storm.version>
|
||||
<kafka.version>1.0.0</kafka.version>
|
||||
<ignite.version>2.4.0</ignite.version>
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.5</version>
|
||||
<version>${gson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -116,6 +116,7 @@
|
|||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<gson.version>2.8.5</gson.version>
|
||||
<httpclient.version>4.5.3</httpclient.version>
|
||||
<jackson.version>2.9.8</jackson.version>
|
||||
<assertj.version>3.6.2</assertj.version>
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
<dependency>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId>
|
||||
<version>1.5.7.1</version>
|
||||
<version>${asciidoctor.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
@ -154,7 +154,8 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<serenity.version>1.9.9</serenity.version>
|
||||
<asciidoctor.version>1.5.7.1</asciidoctor.version>
|
||||
<serenity.version>1.9.9</serenity.version>
|
||||
<serenity.jbehave.version>1.9.0</serenity.jbehave.version>
|
||||
<serenity.jira.version>1.9.0</serenity.jira.version>
|
||||
<serenity.plugin.version>1.9.27</serenity.plugin.version>
|
||||
|
|
|
@ -523,7 +523,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<version>${shade.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
|
@ -556,6 +556,7 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<shade.plugin.version>2.2</shade.plugin.version>
|
||||
<multiverse.version>0.7.0</multiverse.version>
|
||||
<cglib.version>3.2.7</cglib.version>
|
||||
<javatuples.version>1.2</javatuples.version>
|
||||
|
|
|
@ -0,0 +1,208 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Subsection 2.1
|
||||
simple_function() {
|
||||
for ((i=0;i<5;++i)) do
|
||||
echo -n " "$i" ";
|
||||
done
|
||||
}
|
||||
|
||||
function simple_function_no_parantheses {
|
||||
for ((i=0;i<5;++i)) do
|
||||
echo -n " "$i" ";
|
||||
done
|
||||
}
|
||||
|
||||
function simple_for_loop()
|
||||
for ((i=0;i<5;++i)) do
|
||||
echo -n " "$i" ";
|
||||
done
|
||||
|
||||
function simple_comparison()
|
||||
if [[ "$1" -lt 5 ]]; then
|
||||
echo "$1 is smaller than 5"
|
||||
else
|
||||
echo "$1 is greater than 5"
|
||||
fi
|
||||
|
||||
# Subsection 2.2
|
||||
function simple_inputs() {
|
||||
echo "This is the first argument [$1]"
|
||||
echo "This is the second argument [$2]"
|
||||
echo "Calling function with $# aruments"
|
||||
}
|
||||
|
||||
# Subsection 2.3
|
||||
global_sum=0
|
||||
function global_sum_outputs() {
|
||||
global_sum=$(($1+$2))
|
||||
}
|
||||
|
||||
function cs_sum_outputs() {
|
||||
sum=$(($1+$2))
|
||||
echo $sum
|
||||
}
|
||||
|
||||
# Subsection 2.4
|
||||
function arg_ref_sum_outputs() {
|
||||
declare -n sum_ref=$3
|
||||
sum_ref=$(($1+$2))
|
||||
}
|
||||
|
||||
# Subsection 3.1
|
||||
variable="baeldung"
|
||||
function variable_scope2() {
|
||||
echo "Variable inside function variable_scope2: [$variable]"
|
||||
local variable="ipsum"
|
||||
}
|
||||
|
||||
function variable_scope() {
|
||||
local variable="lorem"
|
||||
echo "Variable inside function variable_scope: [$variable]"
|
||||
variable_scope2
|
||||
}
|
||||
|
||||
# Subsection 3.2
|
||||
subshell_sum=0
|
||||
function simple_subshell_sum() (
|
||||
subshell_sum=$(($1+$2))
|
||||
echo "Value of sum in function with global variables: [$subshell_sum]"
|
||||
)
|
||||
|
||||
function simple_subshell_ref_sum() (
|
||||
declare -n sum_ref=$3
|
||||
sum_ref=$(($1+$2))
|
||||
echo "Value of sum in function with ref arguments: [$sum_ref]"
|
||||
)
|
||||
|
||||
# Subsection 3.3
|
||||
function redirection_in() {
|
||||
while read input;
|
||||
do
|
||||
echo "$input"
|
||||
done
|
||||
} < infile
|
||||
|
||||
function redirection_in_ps() {
|
||||
read
|
||||
while read -a input;
|
||||
do
|
||||
echo "User[${input[2]}]->File[${input[8]}]"
|
||||
done
|
||||
} < <(ls -ll /)
|
||||
|
||||
function redirection_out_ps() {
|
||||
declare -a output=("baeldung" "lorem" "ipsum" "caracg")
|
||||
for element in "${output[@]}"
|
||||
do
|
||||
echo "$element"
|
||||
done
|
||||
} > >(grep "g")
|
||||
|
||||
function redirection_out() {
|
||||
declare -a output=("baeldung" "lorem" "ipsum")
|
||||
for element in "${output[@]}"
|
||||
do
|
||||
echo "$element"
|
||||
done
|
||||
} > outfile
|
||||
|
||||
# Subsection 3.4
|
||||
function fibonnaci_recursion() {
|
||||
argument=$1
|
||||
if [[ "$argument" -eq 0 ]] || [[ "$argument" -eq 1 ]]; then
|
||||
echo $argument
|
||||
else
|
||||
first=$(fibonnaci_recursion $(($argument-1)))
|
||||
second=$(fibonnaci_recursion $(($argument-2)))
|
||||
echo $(( $first + $second ))
|
||||
fi
|
||||
}
|
||||
|
||||
# main menu entry point
|
||||
echo "****Functions samples menu*****"
|
||||
PS3="Your choice (1,2,3 etc.):"
|
||||
options=("function_definitions" "function_input_args" "function_outputs" \
|
||||
"function_variables" "function_subshells" "function_redirections" \
|
||||
"function_recursion" "quit")
|
||||
select option in "${options[@]}"
|
||||
do
|
||||
case $option in
|
||||
"function_definitions")
|
||||
echo -e "\n"
|
||||
echo "**Different ways to define a function**"
|
||||
echo -e "No function keyword:"
|
||||
simple_function
|
||||
echo -e "\nNo function parantheses:"
|
||||
simple_function_no_parantheses
|
||||
echo -e "\nOmitting curly braces:"
|
||||
simple_for_loop
|
||||
echo -e "\n"
|
||||
;;
|
||||
"function_input_args")
|
||||
echo -e "\n"
|
||||
echo "**Passing inputs to a function**"
|
||||
simple_inputs lorem ipsum
|
||||
echo -e "\n"
|
||||
;;
|
||||
"function_outputs")
|
||||
echo -e "\n"
|
||||
echo "**Getting outputs from a function**"
|
||||
global_sum_outputs 1 2
|
||||
echo -e ">1+2 using global variables: [$global_sum]"
|
||||
cs_sum=$(cs_sum_outputs 1 2)
|
||||
echo -e ">1+2 using command substitution: [$cs_sum]"
|
||||
arg_ref_sum_outputs 1 2 arg_ref_sum
|
||||
echo -e ">1+2 using argument references: [$arg_ref_sum]"
|
||||
echo -e "\n"
|
||||
;;
|
||||
"function_variables")
|
||||
echo -e "\n"
|
||||
echo "**Overriding variable scopes**"
|
||||
echo "Global value of variable: [$variable]"
|
||||
variable_scope
|
||||
echo -e "\n"
|
||||
;;
|
||||
"function_subshells")
|
||||
echo -e "\n"
|
||||
echo "**Running function in subshell**"
|
||||
echo "Global value of sum: [$subshell_sum]"
|
||||
simple_subshell_sum 1 2
|
||||
echo "Value of sum after subshell function with \
|
||||
global variables: [$subshell_sum]"
|
||||
subshell_sum_arg_ref=0
|
||||
simple_subshell_ref_sum 1 2 subshell_sum_arg_ref
|
||||
echo "Value of sum after subshell function with \
|
||||
ref arguments: [$subshell_sum_arg_ref]"
|
||||
echo -e "\n"
|
||||
;;
|
||||
"function_redirections")
|
||||
echo -e "\n"
|
||||
echo "**Function redirections**"
|
||||
echo -e ">Function input redirection from file:"
|
||||
redirection_in
|
||||
echo -e ">Function input redirection from command:"
|
||||
redirection_in_ps
|
||||
echo -e ">Function output redirection to file:"
|
||||
redirection_out
|
||||
cat outfile
|
||||
echo -e ">Function output redirection to command:"
|
||||
red_ps=$(redirection_out_ps)
|
||||
echo "$red_ps"
|
||||
echo -e "\n"
|
||||
;;
|
||||
"function_recursion")
|
||||
echo -e "\n"
|
||||
echo "**Function recursion**"
|
||||
fibo_res1=$(fibonnaci_recursion 7)
|
||||
echo "The 7th Fibonnaci number: [$fibo_res1]"
|
||||
fibo_res2=$(fibonnaci_recursion 15)
|
||||
echo "The 15th Fibonnaci number: [$fibo_res2]"
|
||||
echo -e "\n"
|
||||
;;
|
||||
"quit")
|
||||
break
|
||||
;;
|
||||
*) echo "Invalid option";;
|
||||
esac
|
||||
done
|
|
@ -0,0 +1,3 @@
|
|||
Honda Insight 2010
|
||||
Honda Element 2006
|
||||
Chevrolet Avalanche 2002
|
|
@ -15,26 +15,26 @@
|
|||
<dependency>
|
||||
<groupId>com.google.flogger</groupId>
|
||||
<artifactId>flogger</artifactId>
|
||||
<version>0.4</version>
|
||||
<version>${flogger.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.flogger</groupId>
|
||||
<artifactId>flogger-system-backend</artifactId>
|
||||
<version>0.4</version>
|
||||
<version>${flogger.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.flogger</groupId>
|
||||
<artifactId>flogger-slf4j-backend</artifactId>
|
||||
<version>0.4</version>
|
||||
<version>${flogger.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.flogger</groupId>
|
||||
<artifactId>flogger-log4j-backend</artifactId>
|
||||
<version>0.4</version>
|
||||
<version>${flogger.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sun.jmx</groupId>
|
||||
|
@ -54,13 +54,18 @@
|
|||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
<version>${log4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>apache-log4j-extras</artifactId>
|
||||
<version>1.2.17</version>
|
||||
<version>${log4j.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<flogger.version>0.4</flogger.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -19,6 +19,15 @@
|
|||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<kotlin.version>1.3.50</kotlin.version>
|
||||
<dl4j.version>0.9.1</dl4j.version>
|
||||
<clean.plugin.version>3.1.0</clean.plugin.version>
|
||||
<resources.plugin.version>3.0.2</resources.plugin.version>
|
||||
<jar.plugin.version>3.0.2</jar.plugin.version>
|
||||
<compiler.plugin.version>3.8.0</compiler.plugin.version>
|
||||
<surefire.plugin.version>2.22.1</surefire.plugin.version>
|
||||
<install.plugin.version>2.5.2</install.plugin.version>
|
||||
<deploy.plugin.version>2.8.2</deploy.plugin.version>
|
||||
<site.plugin.version>3.7.1</site.plugin.version>
|
||||
<report.plugin.version>3.0.0</report.plugin.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -63,41 +72,41 @@
|
|||
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>${clean.plugin.version}</version>
|
||||
</plugin>
|
||||
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<version>${resources.plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.1</version>
|
||||
<version>${surefire.plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<version>${jar.plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
<version>${install.plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<version>${deploy.plugin.version}</version>
|
||||
</plugin>
|
||||
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.7.1</version>
|
||||
<version>${site.plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>${report.plugin.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
|
|
@ -12,13 +12,19 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>9</source>
|
||||
<target>9</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<compiler.plugin.version>3.8.0</compiler.plugin.version>
|
||||
<source.version>9</source.version>
|
||||
<target.version>9</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -8,16 +8,21 @@
|
|||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<commons.lang3.version>3.9</commons.lang3.version>
|
||||
<junit.version>4.12</junit.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
<version>${commons.lang3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<!-- Update maven war plugin to 3.1.0 or higher -->
|
||||
<version>3.1.0</version>
|
||||
<version>${war.plugin.version}</version>
|
||||
<configuration>
|
||||
<!-- Set failOnMissingWebXml configuration for maven war plugin -->
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
|
@ -26,6 +26,7 @@
|
|||
<!-- Set failOnMissingWebXml as false in properties section -->
|
||||
<properties>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<war.plugin.version>3.1.0</war.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -12,19 +12,19 @@
|
|||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.3</version>
|
||||
<version>${commons.io.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>4.0</version>
|
||||
<version>${commons.collections4.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.0</version>
|
||||
<version>${commons.lang3.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>${commons.beanutils.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<version>${versions.plugin.version}</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>org.apache.commons:commons-collections4</exclude>
|
||||
|
@ -71,6 +71,11 @@
|
|||
|
||||
<properties>
|
||||
<commons-compress-version>1.15</commons-compress-version>
|
||||
<commons.io.version>2.3</commons.io.version>
|
||||
<versions.plugin.version>2.7</versions.plugin.version>
|
||||
<commons.beanutils.version>1.9.1</commons.beanutils.version>
|
||||
<commons.lang3.version>3.0</commons.lang3.version>
|
||||
<commons.collections4.version>4.0</commons.collections4.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -14,6 +14,8 @@
|
|||
<liberty-maven-plugin.version>${liberty-plugin-version}</liberty-maven-plugin.version>
|
||||
<defaultHttpPort>9080</defaultHttpPort>
|
||||
<defaultHttpsPort>9443</defaultHttpsPort>
|
||||
<cdi.api.version>2.0</cdi.api.version>
|
||||
<rsapi.api.version>2.1</rsapi.api.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
|
@ -65,14 +67,14 @@
|
|||
<dependency>
|
||||
<groupId>javax.enterprise</groupId>
|
||||
<artifactId>cdi-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>${cdi.api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>javax.ws.rs-api</artifactId>
|
||||
<version>2.1</version>
|
||||
<version>${rsapi.api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
|
|
@ -12,23 +12,26 @@
|
|||
<groupId>com.baeldung.multimodule-maven-project</groupId>
|
||||
<artifactId>multimodule-maven-project</artifactId>
|
||||
<version>1.0</version>
|
||||
<entitymodule.version>1.0</entitymodule.version>
|
||||
<daomodule.version>1.0</daomodule.version>
|
||||
<userdaomodule.version>1.0</userdaomodule.version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.entitymodule</groupId>
|
||||
<artifactId>entitymodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${entitymodule.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.daomodule</groupId>
|
||||
<artifactId>daomodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${daomodule.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.userdaomodule</groupId>
|
||||
<artifactId>userdaomodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${userdaomodule.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.12.2</version>
|
||||
<version>${assertj.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -44,10 +44,10 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<source>${source.version}</source>
|
||||
<target>${target.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -56,6 +56,11 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<junit.version>4.12</junit.version>
|
||||
<assertj.version>3.12.2</assertj.version>
|
||||
<compiler.plugin.version>3.8.0</compiler.plugin.version>
|
||||
<source.version>11</source.version>
|
||||
<target.version>11</target.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -14,16 +14,21 @@
|
|||
<version>1.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<entitymodule.version>1.0</entitymodule.version>
|
||||
<daomodule.version>1.0</daomodule.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.entitymodule</groupId>
|
||||
<artifactId>entitymodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${entitymodule.version}1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baeldung.daomodule</groupId>
|
||||
<artifactId>daomodule</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>${daomodule.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-component-metadata</artifactId>
|
||||
<version>1.7.1</version>
|
||||
<version>${plexus.component.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
@ -48,6 +48,7 @@
|
|||
|
||||
<properties>
|
||||
<maven-core.version>3.5.4</maven-core.version>
|
||||
<plexus.component.version>1.7.1</plexus.component.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -49,7 +49,7 @@
|
|||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<version>${annotation.api.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -60,19 +60,19 @@
|
|||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.3</version>
|
||||
<version>${lombok.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.projectreactor</groupId>
|
||||
<artifactId>reactor-core</artifactId>
|
||||
<version>3.1.6.RELEASE</version>
|
||||
<version>${reactor.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>${shade.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
|
@ -102,7 +102,7 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>${exec.plugin.version}</version>
|
||||
<configuration>
|
||||
<executable>java</executable>
|
||||
<arguments>
|
||||
|
@ -118,7 +118,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<version>${compiler.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${jdk.version}</source>
|
||||
<target>${jdk.version}</target>
|
||||
|
@ -142,6 +142,13 @@
|
|||
<exec.mainClass>com.baeldung.micronaut.helloworld.server.ServerApplication</exec.mainClass>
|
||||
<micronaut.version>1.0.0.RC2</micronaut.version>
|
||||
<jdk.version>1.8</jdk.version>
|
||||
<annotation.api.version>1.3.2</annotation.api.version>
|
||||
<lombok.version>1.2.3</lombok.version>
|
||||
<junit.version>4.12</junit.version>
|
||||
<reactor.version>3.1.6.RELEASE</reactor.version>
|
||||
<compiler.plugin.version>3.7.0</compiler.plugin.version>
|
||||
<exec.plugin.version>1.6.0</exec.plugin.version>
|
||||
<shade.plugin.version>3.1.0</shade.plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
<properties>
|
||||
<ninja.version>6.5.0</ninja.version>
|
||||
<jetty.version>9.4.18.v20190429</jetty.version>
|
||||
<bootstrap.version>3.3.4</bootstrap.version>
|
||||
<jquery.version>2.1.3</jquery.version>
|
||||
<h2.version>1.4.186</h2.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
|
@ -156,17 +159,17 @@
|
|||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>bootstrap</artifactId>
|
||||
<version>3.3.4</version>
|
||||
<version>${bootstrap.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>jquery</artifactId>
|
||||
<version>2.1.3</version>
|
||||
<version>${jquery.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.186</version>
|
||||
<version>${h2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ninjaframework</groupId>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.hibernatelogging;
|
||||
package com.baeldung.hibernate.logging;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
4
pom.xml
4
pom.xml
|
@ -814,7 +814,7 @@
|
|||
<module>spring-rest-shell</module>
|
||||
<module>spring-rest-simple</module>
|
||||
<module>spring-resttemplate</module>
|
||||
<module>spring-roo</module>
|
||||
<!-- <module>spring-roo</module>-->
|
||||
<module>spring-scheduling</module>
|
||||
<module>spring-security-modules/spring-security-acl</module>
|
||||
<module>spring-security-modules/spring-security-angular/server</module>
|
||||
|
@ -1416,7 +1416,7 @@
|
|||
<module>spring-rest-shell</module>
|
||||
<module>spring-rest-simple</module>
|
||||
<module>spring-resttemplate</module>
|
||||
<module>spring-roo</module>
|
||||
<!-- <module>spring-roo</module>-->
|
||||
|
||||
<module>spring-scheduling</module>
|
||||
<module>spring-security-modules/spring-security-acl</module>
|
||||
|
|
|
@ -24,3 +24,5 @@ item.size=21
|
|||
#Additional properties
|
||||
additional.unit=km
|
||||
additional.max=100
|
||||
|
||||
key.something=val
|
|
@ -1 +1,2 @@
|
|||
foo=bar
|
||||
foo=bar
|
||||
key.something=val
|
Loading…
Reference in New Issue