From 3718d15004400f35fa2d8802e2c9510b2eb5e5f4 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 25 Jul 2020 23:24:14 +0200 Subject: [PATCH 001/302] Update SHACommonUtils.java Replace StringBuffer with StringBuilder and add initial capacity. StringBuilder is faster because it is not synchronized. --- .../src/main/java/com/baeldung/hashing/SHACommonUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-java-modules/core-java-security-2/src/main/java/com/baeldung/hashing/SHACommonUtils.java b/core-java-modules/core-java-security-2/src/main/java/com/baeldung/hashing/SHACommonUtils.java index 0f28408083..699e9141a4 100644 --- a/core-java-modules/core-java-security-2/src/main/java/com/baeldung/hashing/SHACommonUtils.java +++ b/core-java-modules/core-java-security-2/src/main/java/com/baeldung/hashing/SHACommonUtils.java @@ -3,7 +3,7 @@ package com.baeldung.hashing; class SHACommonUtils { public static String bytesToHex(byte[] hash) { - StringBuffer hexString = new StringBuffer(); + StringBuilder hexString = new StringBuilder(2 * hash.length); for (byte h : hash) { String hex = Integer.toHexString(0xff & h); if (hex.length() == 1) From eed6c93543b18001962ed6c80e62a364d3f97612 Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Sun, 6 Sep 2020 23:29:31 +0200 Subject: [PATCH 002/302] Fix dynamic parameter Wrong Gatling usage: randCustId() was only called once. One needs to pass a function. --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index f9b3837759..d253ecab83 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -20,7 +20,7 @@ class RewardsScenario extends Simulation { .repeat(10){ exec(http("transactions_add") .post("/transactions/add/") - .body(StringBody("""{ "customerRewardsId":null,"customerId":""""+ randCustId() + """","transactionDate":null }""")).asJson + .body(StringBody(_ => s"""{ "customerRewardsId":null,"customerId":"${randCustId()}","transactionDate":null }""")).asJson .check(jsonPath("$.id").saveAs("txnId")) .check(jsonPath("$.transactionDate").saveAs("txtDate")) .check(jsonPath("$.customerId").saveAs("custId"))) From bbdce526c75236aebe0d28a06f8eda6868a1ddf6 Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Sun, 6 Sep 2020 23:32:19 +0200 Subject: [PATCH 003/302] Fix random cust id generation to reduce collisions The current range causes lots of collisions and the application doesn't handle them gracefully, causing lots of exceptions to get logged and hamerring performance. Use 100,000 like the JMeter test, see https://github.com/slandelle/tutorials/blob/master/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test%20Plan.jmx#L203 --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index d253ecab83..70c7d51748 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -7,7 +7,7 @@ import scala.concurrent.duration._ class RewardsScenario extends Simulation { - def randCustId() = Random.nextInt(99) + def randCustId() = Random.nextInt(100000) val httpProtocol = http.baseUrl("http://localhost:8080") .acceptHeader("text/html,application/json;q=0.9,*/*;q=0.8") From b2643fc0dded537af91306146b72de583fd47bd2 Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Sun, 6 Sep 2020 23:33:17 +0200 Subject: [PATCH 004/302] Use ThreadLocalRandom instead of Random which is synchronized --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index 70c7d51748..28314dca08 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -7,7 +7,7 @@ import scala.concurrent.duration._ class RewardsScenario extends Simulation { - def randCustId() = Random.nextInt(100000) + def randCustId() = java.util.concurrent.ThreadLocalRandom.current().nextInt(1, 10000) val httpProtocol = http.baseUrl("http://localhost:8080") .acceptHeader("text/html,application/json;q=0.9,*/*;q=0.8") From a3626ba16c9fbad2f5f8c04390db655cc0ef873c Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Sun, 6 Sep 2020 23:34:37 +0200 Subject: [PATCH 005/302] Add missing optional option on the check that captures the reward This shouldn't be an error, it's an expected situation as described in the article. --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index 28314dca08..bda5e07c28 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -28,7 +28,7 @@ class RewardsScenario extends Simulation { .exec(http("get_reward") .get("/rewards/find/${custId}") - .check(jsonPath("$.id").saveAs("rwdId"))) + .check(jsonPath("$.id").optional.saveAs("rwdId"))) .pause(1) .doIf("${rwdId.isUndefined()}"){ From 7c41e378296080881ec0eabf7b394c3e0b063090 Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Sun, 6 Sep 2020 23:37:51 +0200 Subject: [PATCH 006/302] Remove the unfair 1 second pauses between requests Those pauses don't exist in the JMeter test. They just artificially reduce the Gatling test's throughput. --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 3 --- 1 file changed, 3 deletions(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index bda5e07c28..f17f5f6124 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -24,12 +24,10 @@ class RewardsScenario extends Simulation { .check(jsonPath("$.id").saveAs("txnId")) .check(jsonPath("$.transactionDate").saveAs("txtDate")) .check(jsonPath("$.customerId").saveAs("custId"))) - .pause(1) .exec(http("get_reward") .get("/rewards/find/${custId}") .check(jsonPath("$.id").optional.saveAs("rwdId"))) - .pause(1) .doIf("${rwdId.isUndefined()}"){ exec(http("rewards_add") @@ -41,7 +39,6 @@ class RewardsScenario extends Simulation { .exec(http("transactions_add") .post("/transactions/add/") .body(StringBody("""{ "customerRewardsId":"${rwdId}","customerId":"${custId}","transactionDate":"${txtDate}" }""")).asJson) - .pause(1) .exec(http("get_reward") .get("/transactions/findAll/${rwdId}")) From bf63939b9666a0ec8e122ebc837ed2126d78de57 Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Tue, 8 Sep 2020 17:44:31 +0100 Subject: [PATCH 007/302] Revert "Non-Local Returns (#9934)" This reverts commit 0748a7534ff97866d1418f45eb0783db476439d7. --- .../main/kotlin/com/baeldung/inline/Inline.kt | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/core-kotlin-modules/core-kotlin-lang/src/main/kotlin/com/baeldung/inline/Inline.kt b/core-kotlin-modules/core-kotlin-lang/src/main/kotlin/com/baeldung/inline/Inline.kt index aaa6616ed1..3b179642ba 100644 --- a/core-kotlin-modules/core-kotlin-lang/src/main/kotlin/com/baeldung/inline/Inline.kt +++ b/core-kotlin-modules/core-kotlin-lang/src/main/kotlin/com/baeldung/inline/Inline.kt @@ -22,30 +22,6 @@ fun main() { numbers.each { println(random * it) } // capturing the random variable } -fun namedFunction(): Int { - return 42 -} - -fun anonymous(): () -> Int { - return fun(): Int { - return 42 - } -} - -inline fun List.eachIndexed(f: (Int, T) -> Unit) { - for (i in indices) { - f(i, this[i]) - } -} - -fun List.indexOf(x: T): Int { - eachIndexed { index, value -> - if (value == x) return index - } - - return -1 -} - /** * Generates a random number. */ From 20a6e042f2c90c8de5c1613370cf2862822de9af Mon Sep 17 00:00:00 2001 From: "sahil.singla" Date: Thu, 10 Sep 2020 00:24:37 +0530 Subject: [PATCH 008/302] BAEL-4558: Article for stopping execution after a certain time --- .../com/baeldung/concurrent/stopexecution/StopExecution.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java diff --git a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java new file mode 100644 index 0000000000..618801f57b --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java @@ -0,0 +1,4 @@ +package com.baeldung.concurrent.stopexecution; + +public class StopExecution { +} From 213d5cfe39a9dd4c616d1ba9002de53ddf6d7ea5 Mon Sep 17 00:00:00 2001 From: "sahil.singla" Date: Thu, 10 Sep 2020 00:29:18 +0530 Subject: [PATCH 009/302] BAEL-4558: Article for stopping execution after a certain time --- .../stopexecution/StopExecution.java | 264 ++++++++++++++++++ 1 file changed, 264 insertions(+) diff --git a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java index 618801f57b..2eb807020c 100644 --- a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java +++ b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java @@ -1,4 +1,268 @@ package com.baeldung.concurrent.stopexecution; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.ArrayList; +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + public class StopExecution { + private static final Logger LOG = LoggerFactory.getLogger(StopExecution.class); + + public static void main(String[] args) { + StopExecution stopExecution = new StopExecution(); + //stopExecution.testUsingLoop(); + //stopExecution.testTimer(); + stopExecution.testScheduledExecutor(); + LOG.info("done"); + } + + + public void testUsingLoop(){ + long start = System.currentTimeMillis(); + long end = start + 5000; + List items = new ArrayList<>(); + int counter = 0; + + // Let this loop run only upto 5 seconds + while (System.currentTimeMillis() < end && counter < items.size()) + { + // Fetch the item from the list. + // Some expensive operation on the item. + try { + Thread.sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } + counter++; + } + } + + public static void testThreads(){ + Thread thread = new Thread(new Runnable() { + @Override + public void run() { + LOG.info("inside run"); + + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + LOG.info("exit run"); + } + }); + thread.start(); + while (thread.getState() != Thread.State.TERMINATED){ + LOG.info(thread.getState().name()); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + public static void testExecutor(){ + final ExecutorService service = Executors.newSingleThreadExecutor(); + Future f = null; + try { + f = service.submit(() -> { + // Do you long running calculation here + try { + Thread.sleep(2737); // Simulate some delay + } + catch (InterruptedException e){ + LOG.info("Interrupted"); + return "interrupted"; + } + LOG.info("Sleep finished"); + return "42"; + }); + + LOG.info(f.get(2, TimeUnit.SECONDS)); + } catch (final TimeoutException e) { + f.cancel(true); + LOG.error("Calculation took to long"); + } catch (final Exception e) { + throw new RuntimeException(e); + } finally { + service.shutdown(); + } + } + + + public void testExecutor2(){ + final ExecutorService service = Executors.newSingleThreadExecutor(); + Future f = null; + try { + f = service.submit(new LongRunningTask()); + LOG.info("testExecutor2"); + f.get(1, TimeUnit.SECONDS); + } catch (final TimeoutException e) { + f.cancel(true); + LOG.error("Calculation took to long"); + } catch (final Exception e) { + throw new RuntimeException(e); + } finally { + service.shutdownNow(); + } + } + + public void testScheduledExecutor(){ + LOG.info("testScheduledExecutor"); + ScheduledExecutorService executor = Executors.newScheduledThreadPool(2); + Future future = executor.submit(new LongRunningTask()); + executor.schedule(new Runnable(){ + public void run(){ + future.cancel(true); + } + }, 1000, TimeUnit.MILLISECONDS); + executor.shutdown(); + } + public void testThreadAndInterrupt(){ + + Thread t; + try { + t = new Thread(new LongRunningTask()); + + LOG.info("testExecutor3"); + long end = System.currentTimeMillis() + 2000; + t.start(); + while (t.isAlive() && System.currentTimeMillis() < end){ + Thread.sleep(50); + } + t.interrupt(); + } catch (final Exception e) { + throw new RuntimeException(e); + } + } + public void testTimer(){ + LOG.info("Timer test"); + Thread t = new Thread(new LongRunningTask()); + Timer timeoutTimer = new Timer(); + timeoutTimer.schedule(new TimeOutTask(t, timeoutTimer), 1000); + t.start(); + } + + class MyRunnableTask implements Runnable{ + public void run() + { + try + { + LOG.info("MyRunnable..."); + Thread.sleep(10000); + } + catch (InterruptedException ie) + { + LOG.info("MyRunnable interrupted..."); + } + } + } + + + class TimeOutTask extends TimerTask { + private Thread t; + private Timer timer; + + TimeOutTask(Thread t, Timer timer){ + this.t = t; + this.timer = timer; + } + public void run() { + if (t != null && t.isAlive()) { + t.interrupt(); + timer.cancel(); + } + } + } + + class LongRunningTask implements Runnable{ + @Override + public void run() { + longRunningSort(); + } + + private void longRunningOperation(){ + LOG.info("long Running operation started"); + + try { + //Thread.sleep(500); + longFileRead(); + LOG.info("long running operation finished"); + } + catch (InterruptedException e){ + LOG.info("long Running operation interrupted"); + } + } + + private void longRunningSort(){ + LOG.info("long Running task started"); + // Do you long running calculation here + int len = 100000; + List numbers = new ArrayList<>(); + try { + for (int i = len; i > 0; i--) { + //Thread.sleep(5) + numbers.add(i); + } + + int i = 0; + for (i = 0; i < len; i++) { + int minIndex = i; + for (int j = i + 1; j < len; j++) { + if (numbers.get(minIndex) > numbers.get(j)) + minIndex = j; + } + if (minIndex != i) { + int temp = numbers.get(i); + numbers.set(i, numbers.get(minIndex)); + numbers.set(minIndex, temp); + } + throwExceptionOnThreadInterrupt(); + } + LOG.info("Index position: " + i); + LOG.info("Long running task finished"); + }catch (InterruptedException e){ + LOG.info("long Running operation interrupted"); + } + } + + private void longFileRead() throws InterruptedException{ + String file = "input.txt"; + ClassLoader classloader = getClass().getClassLoader(); + + try (InputStream inputStream = classloader.getResourceAsStream(file)){ + Reader inputStreamReader = new InputStreamReader(inputStream); + + int data = inputStreamReader.read(); + while (data != -1) { + char theChar = (char) data; + data = inputStreamReader.read(); + throwExceptionOnThreadInterrupt(); + } + } catch (IOException e){ + LOG.error("Exception: ", e); + } + } + private void throwExceptionOnThreadInterrupt() throws InterruptedException{ + if (Thread.currentThread().interrupted()){ + throw new InterruptedException(); + } + } + } + } + + From 5d1439378863657b54591ade01ef11e51d0ab313 Mon Sep 17 00:00:00 2001 From: mikr Date: Mon, 14 Sep 2020 12:21:57 +0200 Subject: [PATCH 010/302] Java-2136 Update Jackson version in main pom --- pom.xml | 3 +-- spring-dispatcher-servlet/pom.xml | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index a2e09c0f91..49c9fd9413 100644 --- a/pom.xml +++ b/pom.xml @@ -1389,9 +1389,8 @@ 3.1.0 1.2 2.3.1 - 1.9.13 1.2 - 2.9.8 + 2.11.1 1.3 1.2.0 5.2.0 diff --git a/spring-dispatcher-servlet/pom.xml b/spring-dispatcher-servlet/pom.xml index 46e40722f1..21324e6757 100644 --- a/spring-dispatcher-servlet/pom.xml +++ b/spring-dispatcher-servlet/pom.xml @@ -40,11 +40,6 @@ javax.servlet.jsp-api ${javax.servlet.jsp-api.version} - - org.codehaus.jackson - jackson-mapper-asl - ${jackson-mapper-asl.version} - javax.servlet jstl From 6927cc7237978851c174ea1e3daec27d32ffe254 Mon Sep 17 00:00:00 2001 From: mikr Date: Mon, 14 Sep 2020 13:11:59 +0200 Subject: [PATCH 011/302] Java-2136 Use Jackson version from main pom in all other applicable modules --- json-2/pom.xml | 4 ++-- libraries-data-2/pom.xml | 2 +- libraries-http-2/pom.xml | 2 +- libraries-http/pom.xml | 2 +- metrics/pom.xml | 6 +++--- persistence-modules/hibernate-libraries/pom.xml | 1 - spring-5-mvc/pom.xml | 1 - .../spring-openapi-generator-api-client/pom.xml | 6 +++--- testing-modules/mockito-2/pom.xml | 1 - 9 files changed, 11 insertions(+), 14 deletions(-) diff --git a/json-2/pom.xml b/json-2/pom.xml index f0215a375f..53091d6245 100644 --- a/json-2/pom.xml +++ b/json-2/pom.xml @@ -53,12 +53,12 @@ com.fasterxml.jackson.core jackson-annotations - 2.11.0 + ${jackson.version} com.fasterxml.jackson.core jackson-databind - 2.11.0 + ${jackson.version} com.io-informatics.oss diff --git a/libraries-data-2/pom.xml b/libraries-data-2/pom.xml index 26d8651cdd..0154823cca 100644 --- a/libraries-data-2/pom.xml +++ b/libraries-data-2/pom.xml @@ -168,7 +168,7 @@ 0.1.0 1.0.3 9.1.5.Final - 2.9.8 + 4.3.8.RELEASE 4.0.0 1.1.0 diff --git a/libraries-http-2/pom.xml b/libraries-http-2/pom.xml index 73fe6c66bd..3c0af51131 100644 --- a/libraries-http-2/pom.xml +++ b/libraries-http-2/pom.xml @@ -72,7 +72,7 @@ 3.14.2 2.8.5 3.14.2 - 2.9.8 + 1.0.3 9.4.19.v20190610 2.2.11 diff --git a/libraries-http/pom.xml b/libraries-http/pom.xml index cbc74ce132..74e00a7291 100644 --- a/libraries-http/pom.xml +++ b/libraries-http/pom.xml @@ -118,7 +118,7 @@ 2.8.5 4.5.3 - 2.9.8 + 3.6.2 3.14.2 1.23.0 diff --git a/metrics/pom.xml b/metrics/pom.xml index 92699c3fb8..07adf15936 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -66,12 +66,12 @@ com.fasterxml.jackson.core jackson-databind - ${fasterxml.jackson.version} + ${jackson.version} com.fasterxml.jackson.dataformat jackson-dataformat-smile - ${fasterxml.jackson.version} + ${jackson.version} @@ -93,7 +93,7 @@ 3.1.0 0.12.17 0.12.0.RELEASE - 2.9.1 + 2.0.7.RELEASE 3.11.1 1.1.0 diff --git a/persistence-modules/hibernate-libraries/pom.xml b/persistence-modules/hibernate-libraries/pom.xml index 808c47133c..f67309cf43 100644 --- a/persistence-modules/hibernate-libraries/pom.xml +++ b/persistence-modules/hibernate-libraries/pom.xml @@ -170,7 +170,6 @@ 29.0-jre 2.9.7 5.4.14.Final - 2.10.3 3.27.0-GA 2.3.1 2.0.0 diff --git a/spring-5-mvc/pom.xml b/spring-5-mvc/pom.xml index fd9868ad66..0bb69d8057 100644 --- a/spring-5-mvc/pom.xml +++ b/spring-5-mvc/pom.xml @@ -173,7 +173,6 @@ 2.9.0 - 2.9.9 1.2.71 4.5.8 com.baeldung.Spring5Application diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml b/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml index 7c6de543ae..3074849e4c 100644 --- a/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml +++ b/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml @@ -90,7 +90,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-databind-version} + ${jackson-version} com.fasterxml.jackson.jaxrs @@ -264,8 +264,8 @@ 1.5.22 4.3.9.RELEASE - 2.10.1 - 2.10.1 + 2.11.1 + 0.2.1 2.9.10 1.0.0 diff --git a/testing-modules/mockito-2/pom.xml b/testing-modules/mockito-2/pom.xml index 340af89c82..055debe615 100644 --- a/testing-modules/mockito-2/pom.xml +++ b/testing-modules/mockito-2/pom.xml @@ -30,7 +30,6 @@ 2.21.0 - 2.10.3 From cd89253474a9ab6ba174c5b79ee9d8aeffe107f1 Mon Sep 17 00:00:00 2001 From: Cavero Barca Date: Mon, 14 Sep 2020 23:58:12 +0200 Subject: [PATCH 012/302] Create the layers configuration, modify the pom and Dockerfile --- docker/docker-spring-boot/pom.xml | 1 + docker/docker-spring-boot/src/layers.xml | 27 +++++++++++++++++++ .../src/main/docker/Dockerfile | 1 + 3 files changed, 29 insertions(+) create mode 100644 docker/docker-spring-boot/src/layers.xml diff --git a/docker/docker-spring-boot/pom.xml b/docker/docker-spring-boot/pom.xml index b9c80bc43a..e8f6c134b1 100644 --- a/docker/docker-spring-boot/pom.xml +++ b/docker/docker-spring-boot/pom.xml @@ -45,6 +45,7 @@ true + ${project.basedir}/src/layers.xml diff --git a/docker/docker-spring-boot/src/layers.xml b/docker/docker-spring-boot/src/layers.xml new file mode 100644 index 0000000000..61c9bd9c39 --- /dev/null +++ b/docker/docker-spring-boot/src/layers.xml @@ -0,0 +1,27 @@ + + + + org/springframework/boot/loader/** + + + + + + *:*:*SNAPSHOT + + + com.baeldung.docker:*:* + + + + + dependencies + spring-boot-loader + internal-dependencies + snapshot-dependencies + application + + \ No newline at end of file diff --git a/docker/docker-spring-boot/src/main/docker/Dockerfile b/docker/docker-spring-boot/src/main/docker/Dockerfile index fa147dd69b..663cc94490 100644 --- a/docker/docker-spring-boot/src/main/docker/Dockerfile +++ b/docker/docker-spring-boot/src/main/docker/Dockerfile @@ -10,6 +10,7 @@ RUN java -Djarmode=layertools -jar application.jar extract FROM adoptopenjdk:11-jre-hotspot COPY --from=builder dependencies/ ./ COPY --from=builder snapshot-dependencies/ ./ +COPY --from=builder internal-dependencies/ ./ COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] \ No newline at end of file From 27aa7c4cad3d469a1bfbb96d36e2bd5acdcd2161 Mon Sep 17 00:00:00 2001 From: mikr Date: Tue, 15 Sep 2020 10:16:09 +0200 Subject: [PATCH 013/302] Java-2136 Fix Unit tests + remove unnecessary println --- jackson-modules/jackson-custom-conversions/pom.xml | 7 +++++++ .../deserialization/CustomDeserializationUnitTest.java | 7 ++----- .../serialization/CustomSerializationUnitTest.java | 3 --- .../skipfields/IgnoreFieldsWithFilterUnitTest.java | 2 -- .../baeldung/skipfields/JacksonDynamicIgnoreUnitTest.java | 8 -------- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/jackson-modules/jackson-custom-conversions/pom.xml b/jackson-modules/jackson-custom-conversions/pom.xml index c319891da9..78894bb403 100644 --- a/jackson-modules/jackson-custom-conversions/pom.xml +++ b/jackson-modules/jackson-custom-conversions/pom.xml @@ -23,6 +23,13 @@ jackson-datatype-joda ${jackson.version} + + com.fasterxml.jackson.core + jackson-core + 2.10.1 + + + diff --git a/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/deserialization/CustomDeserializationUnitTest.java b/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/deserialization/CustomDeserializationUnitTest.java index f2a2502c3e..17016149a2 100644 --- a/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/deserialization/CustomDeserializationUnitTest.java +++ b/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/deserialization/CustomDeserializationUnitTest.java @@ -60,8 +60,6 @@ public class CustomDeserializationUnitTest { String converted = objectMapper.writeValueAsString(now); // restore an instance of ZonedDateTime from String ZonedDateTime restored = objectMapper.readValue(converted, ZonedDateTime.class); - System.out.println("serialized: " + now); - System.out.println("restored: " + restored); assertThat(now, is(not(restored))); } @@ -70,15 +68,14 @@ public class CustomDeserializationUnitTest { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.findAndRegisterModules(); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + objectMapper.enable(SerializationFeature.WRITE_DATES_WITH_ZONE_ID); objectMapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); // construct a new instance of ZonedDateTime ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Europe/Berlin")); String converted = objectMapper.writeValueAsString(now); // restore an instance of ZonedDateTime from String ZonedDateTime restored = objectMapper.readValue(converted, ZonedDateTime.class); - System.out.println("serialized: " + now); - System.out.println("restored: " + restored); - assertThat(now, is(restored)); + assertThat(restored, is(now)); } } diff --git a/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/serialization/CustomSerializationUnitTest.java b/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/serialization/CustomSerializationUnitTest.java index 6cb4019fa2..9c46a86fd8 100644 --- a/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/serialization/CustomSerializationUnitTest.java +++ b/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/serialization/CustomSerializationUnitTest.java @@ -24,7 +24,6 @@ public class CustomSerializationUnitTest { public final void whenSerializing_thenNoExceptions() throws JsonGenerationException, JsonMappingException, IOException { final Item myItem = new Item(1, "theItem", new User(2, "theUser")); final String serialized = new ObjectMapper().writeValueAsString(myItem); - System.out.println(serialized); } @Test @@ -38,7 +37,6 @@ public class CustomSerializationUnitTest { mapper.registerModule(simpleModule); final String serialized = mapper.writeValueAsString(myItem); - System.out.println(serialized); } @Test @@ -46,7 +44,6 @@ public class CustomSerializationUnitTest { final ItemWithSerializer myItem = new ItemWithSerializer(1, "theItem", new User(2, "theUser")); final String serialized = new ObjectMapper().writeValueAsString(myItem); - System.out.println(serialized); } } diff --git a/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/IgnoreFieldsWithFilterUnitTest.java b/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/IgnoreFieldsWithFilterUnitTest.java index e71f31bc6a..ec753019b2 100644 --- a/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/IgnoreFieldsWithFilterUnitTest.java +++ b/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/IgnoreFieldsWithFilterUnitTest.java @@ -37,7 +37,6 @@ public class IgnoreFieldsWithFilterUnitTest { assertThat(dtoAsString, not(containsString("intValue"))); assertThat(dtoAsString, containsString("booleanValue")); assertThat(dtoAsString, containsString("stringValue")); - System.out.println(dtoAsString); } @Test @@ -83,7 +82,6 @@ public class IgnoreFieldsWithFilterUnitTest { assertThat(dtoAsString, not(containsString("intValue"))); assertThat(dtoAsString, containsString("booleanValue")); assertThat(dtoAsString, containsString("stringValue")); - System.out.println(dtoAsString); } } diff --git a/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/JacksonDynamicIgnoreUnitTest.java b/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/JacksonDynamicIgnoreUnitTest.java index 6ba14f7476..2fd59e2a82 100644 --- a/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/JacksonDynamicIgnoreUnitTest.java +++ b/jackson-modules/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/JacksonDynamicIgnoreUnitTest.java @@ -51,8 +51,6 @@ public class JacksonDynamicIgnoreUnitTest { assertTrue(result.contains("john")); assertTrue(result.contains("address")); assertTrue(result.contains("usa")); - - System.out.println("Not Hidden = " + result); } @Test @@ -65,8 +63,6 @@ public class JacksonDynamicIgnoreUnitTest { assertTrue(result.contains("john")); assertFalse(result.contains("address")); assertFalse(result.contains("usa")); - - System.out.println("Address Hidden = " + result); } @Test @@ -76,8 +72,6 @@ public class JacksonDynamicIgnoreUnitTest { final String result = mapper.writeValueAsString(person); assertTrue(result.length() == 0); - - System.out.println("All Hidden = " + result); } @Test @@ -90,7 +84,5 @@ public class JacksonDynamicIgnoreUnitTest { final Person p3 = new Person("adam", ad3, false); final String result = mapper.writeValueAsString(Arrays.asList(p1, p2, p3)); - - System.out.println(result); } } From 5121313f65903725a7e883d0ac9cb6f98cd9d16a Mon Sep 17 00:00:00 2001 From: mikr Date: Tue, 15 Sep 2020 11:08:35 +0200 Subject: [PATCH 014/302] Java-2136 Correctly configure netty server --- .../reactive/security/SpringSecurity5Application.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java index 325923f577..d315bf8238 100644 --- a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java @@ -28,9 +28,7 @@ public class SpringSecurity5Application { HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context) .build(); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler); - HttpServer httpServer = HttpServer.create(); - httpServer.host("localhost"); - httpServer.port(8080); + HttpServer httpServer = HttpServer.create().host("localhost").port(8080); return httpServer.handle(adapter).bindNow(); } From c6f067c17f2351f845dab5bb9f83bcb6f1bf039b Mon Sep 17 00:00:00 2001 From: Vishal Date: Sun, 13 Sep 2020 23:05:36 +0530 Subject: [PATCH 015/302] Add examples to demo IndexOutOfBoundsException while using Collectins.copy method and other working demos to copy elements from one list to another list --- .../CopyListUsingAddAllMethodDemo.java | 24 +++++++++++++++++ ...opyListUsingCollectionsCopyMethodDemo.java | 21 +++++++++++++++ .../CopyListUsingConstructorDemo.java | 21 +++++++++++++++ .../com/baeldung/CopyListUsingJava10Demo.java | 18 +++++++++++++ .../CopyListUsingJava8StreamDemo.java | 22 +++++++++++++++ .../exception/IndexOutOfBoundsException.java | 27 +++++++++++++++++++ 6 files changed, 133 insertions(+) create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingAddAllMethodDemo.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingCollectionsCopyMethodDemo.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingConstructorDemo.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingJava10Demo.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingJava8StreamDemo.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exception/IndexOutOfBoundsException.java diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingAddAllMethodDemo.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingAddAllMethodDemo.java new file mode 100644 index 0000000000..a7d24cdec8 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingAddAllMethodDemo.java @@ -0,0 +1,24 @@ +package com.baeldung; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class CopyListUsingAddAllMethodDemo { + + static List copyList(List source) { + List destination = new ArrayList<>(); + + destination.addAll(source); + + return destination; + } + + public static void main(String[] args) { + List source = Arrays.asList(11, 22, 33); + + List destination = copyList(source); + + System.out.println("copy = " + destination); + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingCollectionsCopyMethodDemo.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingCollectionsCopyMethodDemo.java new file mode 100644 index 0000000000..bdf6726924 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingCollectionsCopyMethodDemo.java @@ -0,0 +1,21 @@ +package com.baeldung; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class CopyListUsingCollectionsCopyMethodDemo { + + static void copyList(List source, List destination) { + Collections.copy(destination, source); + } + + public static void main(String[] args) { + List source = Arrays.asList(11, 22, 33); + List destination = Arrays.asList(1, 2, 3, 4, 5); + + copyList(source, destination); + + System.out.println("copy = " + destination); + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingConstructorDemo.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingConstructorDemo.java new file mode 100644 index 0000000000..b76a1448d4 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingConstructorDemo.java @@ -0,0 +1,21 @@ +package com.baeldung; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class CopyListUsingConstructorDemo { + + static List copyList(List source) { + + return new ArrayList<>(source); + } + + public static void main(String[] args) { + List source = Arrays.asList(11, 22, 33); + + List destination = copyList(source); + + System.out.println("copy = " + destination); + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingJava10Demo.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingJava10Demo.java new file mode 100644 index 0000000000..1a32dcec4f --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingJava10Demo.java @@ -0,0 +1,18 @@ +package com.baeldung; + +import java.util.Arrays; +import java.util.List; + +public class CopyListUsingJava10Demo { + static List copyList(List source) { + return List.copyOf(source); + } + + public static void main(String[] args) { + List source = Arrays.asList(11, 22, 33); + + List destination = copyList(source); + + System.out.println("copy = " + destination); + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingJava8StreamDemo.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingJava8StreamDemo.java new file mode 100644 index 0000000000..81ae533505 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/CopyListUsingJava8StreamDemo.java @@ -0,0 +1,22 @@ +package com.baeldung; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public class CopyListUsingJava8StreamDemo { + + static List copyList(List source) { + return source + .stream() + .collect(Collectors.toList()); + } + + public static void main(String[] args) { + List source = Arrays.asList(11, 22, 33); + + List destination = copyList(source); + + System.out.println("copy = " + destination); + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exception/IndexOutOfBoundsException.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exception/IndexOutOfBoundsException.java new file mode 100644 index 0000000000..a1b6bf1151 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exception/IndexOutOfBoundsException.java @@ -0,0 +1,27 @@ +package com.baeldung.exception; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * This example produces an IndexOutOfBoundsException, when we try to copy a list using the Collections.copy method. + * As the destination list doesn't have enough space/size to copy elements from source list. + */ +public class IndexOutOfBoundsException { + + static List copyList(List source) { + List destination = new ArrayList<>(source.size()); + Collections.copy(destination, source); + return destination; + } + + public static void main(String[] args) { + List source = Arrays.asList(1, 2, 3, 4, 5); + List copy = copyList(source); + + System.out.println("copy = " + copy); + } + +} From a47ed70f36934c10bf4161efa5b6bd01e7612246 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 17 Sep 2020 16:41:47 +0530 Subject: [PATCH 016/302] Add maven compiler plugin for java 11 --- core-java-modules/core-java-exceptions-3/pom.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core-java-modules/core-java-exceptions-3/pom.xml b/core-java-modules/core-java-exceptions-3/pom.xml index b909572afe..19996f85af 100644 --- a/core-java-modules/core-java-exceptions-3/pom.xml +++ b/core-java-modules/core-java-exceptions-3/pom.xml @@ -26,6 +26,19 @@ + + + + org.apache.maven.plugins + maven-compiler-plugin + + 11 + 11 + 11 + + + + 3.10.0 From f8d53b4c6015d5646c74320151c1ee235f059967 Mon Sep 17 00:00:00 2001 From: Jonathan Cook Date: Thu, 17 Sep 2020 22:00:57 +0200 Subject: [PATCH 017/302] BAEL-4437 - System Rules --- testing-modules/pom.xml | 3 +- testing-modules/testing-libraries-2/pom.xml | 43 ++++++++++++++++++ ...ClearSystemPropertiesWithRuleUnitTest.java | 19 ++++++++ .../ProvidesSystemPropertyUnitTest.java | 26 +++++++++++ ...rovidesSystemPropertyWithRuleUnitTest.java | 44 +++++++++++++++++++ .../systemrules/SystemErrPrintlnUnitTest.java | 24 ++++++++++ .../SystemErrPrintlnWithRuleUnitTest.java | 25 +++++++++++ .../systemrules/SystemExitUnitTest.java | 23 ++++++++++ .../SystemExitWithRuleUnitTest.java | 22 ++++++++++ .../systemrules/SystemInUnitTest.java | 27 ++++++++++++ .../systemrules/SystemInWithRuleUnitTest.java | 31 +++++++++++++ .../src/test/resources/test.properties | 2 + 12 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 testing-modules/testing-libraries-2/pom.xml create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ClearSystemPropertiesWithRuleUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ProvidesSystemPropertyUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ProvidesSystemPropertyWithRuleUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemErrPrintlnUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemErrPrintlnWithRuleUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemExitUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemExitWithRuleUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemInUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemInWithRuleUnitTest.java create mode 100644 testing-modules/testing-libraries-2/src/test/resources/test.properties diff --git a/testing-modules/pom.xml b/testing-modules/pom.xml index f1d30cd7a1..0416423239 100644 --- a/testing-modules/pom.xml +++ b/testing-modules/pom.xml @@ -41,7 +41,8 @@ junit-5-advanced xmlunit-2 junit-4 - testing-libraries + testing-libraries + testing-libraries-2 powermock diff --git a/testing-modules/testing-libraries-2/pom.xml b/testing-modules/testing-libraries-2/pom.xml new file mode 100644 index 0000000000..282583c882 --- /dev/null +++ b/testing-modules/testing-libraries-2/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + testing-libraries-2 + testing-libraries-2 + + + com.baeldung + testing-modules + 1.0.0-SNAPSHOT + + + + + com.github.stefanbirkner + system-rules + ${system-rules.version} + test + + + com.github.stefanbirkner + system-lambda + ${system-lambda.version} + test + + + + + testing-libraries + + + src/test/resources + true + + + + + + 1.19.0 + 1.0.0 + + diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ClearSystemPropertiesWithRuleUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ClearSystemPropertiesWithRuleUnitTest.java new file mode 100644 index 0000000000..699b40bad9 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ClearSystemPropertiesWithRuleUnitTest.java @@ -0,0 +1,19 @@ +package com.baeldung.systemrules; + +import static org.junit.Assert.assertNull; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.ClearSystemProperties; + +public class ClearSystemPropertiesWithRuleUnitTest { + + @Rule + public final ClearSystemProperties userNameIsClearedRule = new ClearSystemProperties("user.name"); + + @Test + public void givenClearUsernameProperty_whenGetUserName_thenNull() { + assertNull(System.getProperty("user.name")); + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ProvidesSystemPropertyUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ProvidesSystemPropertyUnitTest.java new file mode 100644 index 0000000000..361a338508 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ProvidesSystemPropertyUnitTest.java @@ -0,0 +1,26 @@ +package com.baeldung.systemrules; + +import static com.github.stefanbirkner.systemlambda.SystemLambda.restoreSystemProperties; +import static org.junit.Assert.assertEquals; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ProvidesSystemPropertyUnitTest { + + @BeforeAll + static void setUpBeforeClass() throws Exception { + System.setProperty("log_dir", "/tmp/baeldung/logs"); + } + + @Test + void givenSetSystemProperty_whenGetLogDir_thenLogDirIsProvidedSuccessfully() throws Exception { + restoreSystemProperties(() -> { + System.setProperty("log_dir", "test/resources"); + assertEquals("log_dir should be provided", "test/resources", System.getProperty("log_dir")); + }); + + assertEquals("log_dir should be provided", "/tmp/baeldung/logs", System.getProperty("log_dir")); + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ProvidesSystemPropertyWithRuleUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ProvidesSystemPropertyWithRuleUnitTest.java new file mode 100644 index 0000000000..3a90592a0d --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ProvidesSystemPropertyWithRuleUnitTest.java @@ -0,0 +1,44 @@ +package com.baeldung.systemrules; + +import static org.junit.Assert.assertEquals; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.ProvideSystemProperty; + +public class ProvidesSystemPropertyWithRuleUnitTest { + + @Rule + public final ProvideSystemProperty providesSystemPropertyRule = new ProvideSystemProperty("log_dir", "test/resources").and("another_property", "another_value"); + + @Rule + public final ProvideSystemProperty providesSystemPropertyFromFileRule = ProvideSystemProperty.fromResource("/test.properties"); + + @BeforeClass + public static void setUpBeforeClass() { + setLogs(); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + System.out.println(System.getProperty("log_dir")); + } + + @Test + public void givenProvideSystemProperty_whenGetLogDir_thenLogDirIsProvidedSuccessfully() { + assertEquals("log_dir should be provided", "test/resources", System.getProperty("log_dir")); + } + + @Test + public void givenProvideSystemPropertyFromFile_whenGetName_thenNameIsProvidedSuccessfully() { + assertEquals("name should be provided", "baeldung", System.getProperty("name")); + assertEquals("version should be provided", "1.0", System.getProperty("version")); + } + + private static void setLogs() { + System.setProperty("log_dir", "/tmp/baeldung/logs"); + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemErrPrintlnUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemErrPrintlnUnitTest.java new file mode 100644 index 0000000000..3345ddae8a --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemErrPrintlnUnitTest.java @@ -0,0 +1,24 @@ +package com.baeldung.systemrules; + +import static com.github.stefanbirkner.systemlambda.SystemLambda.tapSystemErr; + +import org.junit.Assert; +import org.junit.jupiter.api.Test; + +class SystemErrPrintlnUnitTest { + + @Test + void givenTapSystemErr_whenInvokePrintln_thenOutputIsReturnedSuccessfully() throws Exception { + + String text = tapSystemErr(() -> { + printError("An error occurred Baeldung Readers!!"); + }); + + Assert.assertEquals("An error occurred Baeldung Readers!!", text.trim()); + } + + private void printError(String output) { + System.err.println(output); + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemErrPrintlnWithRuleUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemErrPrintlnWithRuleUnitTest.java new file mode 100644 index 0000000000..7994f91063 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemErrPrintlnWithRuleUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.systemrules; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.SystemErrRule; + +public class SystemErrPrintlnWithRuleUnitTest { + + @Rule + public final SystemErrRule systemErrRule = new SystemErrRule().enableLog(); + + @Test + public void givenSystemErrRule_whenInvokePrintln_thenLogSuccess() { + printError("An Error occurred Baeldung Readers!!"); + + Assert.assertEquals("An Error occurred Baeldung Readers!!", systemErrRule.getLog() + .trim()); + } + + private void printError(String output) { + System.err.println(output); + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemExitUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemExitUnitTest.java new file mode 100644 index 0000000000..1e2548e714 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemExitUnitTest.java @@ -0,0 +1,23 @@ +package com.baeldung.systemrules; + +import static org.junit.Assert.assertEquals; + +import static com.github.stefanbirkner.systemlambda.SystemLambda.catchSystemExit; + +import org.junit.jupiter.api.Test; + +class SystemExitUnitTest { + + @Test + void givenCatchSystemExit_whenAppCallsSystemExit_thenStatusIsReturnedSuccessfully() throws Exception { + int statusCode = catchSystemExit(() -> { + exit(); + }); + assertEquals("status code should be 1:", 1, statusCode); + } + + private void exit() { + System.exit(1); + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemExitWithRuleUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemExitWithRuleUnitTest.java new file mode 100644 index 0000000000..471aab1989 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemExitWithRuleUnitTest.java @@ -0,0 +1,22 @@ +package com.baeldung.systemrules; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.ExpectedSystemExit; + +public class SystemExitWithRuleUnitTest { + + @Rule + public final ExpectedSystemExit exitRule = ExpectedSystemExit.none(); + + @Test + public void givenSystemExitRule_whenAppCallsSystemExit_thenExitRuleWorkssAsExpected() { + exitRule.expectSystemExitWithStatus(1); + exit(); + } + + private void exit() { + System.exit(1); + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemInUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemInUnitTest.java new file mode 100644 index 0000000000..96badb59d4 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemInUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.systemrules; + +import static com.github.stefanbirkner.systemlambda.SystemLambda.withTextFromSystemIn; +import static org.junit.Assert.assertEquals; + +import java.util.Scanner; + +import org.junit.jupiter.api.Test; + +class SystemInUnitTest { + + @Test + void givenTwoNames_whenSystemInMock_thenNamesJoinedTogether() throws Exception { + withTextFromSystemIn("Jonathan", "Cook").execute(() -> { + assertEquals("Names should be concatenated", "Jonathan Cook", getFullname()); + }); + } + + private String getFullname() { + try (Scanner scanner = new Scanner(System.in)) { + String firstName = scanner.next(); + String surname = scanner.next(); + return String.join(" ", firstName, surname); + } + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemInWithRuleUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemInWithRuleUnitTest.java new file mode 100644 index 0000000000..5730e2f592 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/SystemInWithRuleUnitTest.java @@ -0,0 +1,31 @@ +package com.baeldung.systemrules; + +import static org.junit.Assert.assertEquals; + +import java.util.Scanner; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.TextFromStandardInputStream; +import static org.junit.contrib.java.lang.system.TextFromStandardInputStream.emptyStandardInputStream; + +public class SystemInWithRuleUnitTest { + + @Rule + public final TextFromStandardInputStream systemInMock = emptyStandardInputStream(); + + @Test + public void givenTwoNames_whenSystemInMock_thenNamesJoinedTogether() { + systemInMock.provideLines("Jonathan", "Cook"); + assertEquals("Names should be concatenated", "Jonathan Cook", getFullname()); + } + + private String getFullname() { + try (Scanner scanner = new Scanner(System.in)) { + String firstName = scanner.next(); + String surname = scanner.next(); + return String.join(" ", firstName, surname); + } + } + +} diff --git a/testing-modules/testing-libraries-2/src/test/resources/test.properties b/testing-modules/testing-libraries-2/src/test/resources/test.properties new file mode 100644 index 0000000000..144847cdb0 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/resources/test.properties @@ -0,0 +1,2 @@ +name=baeldung +version=1.0 \ No newline at end of file From 23e39f4244414b15defde5bfc620383101187241 Mon Sep 17 00:00:00 2001 From: mikr Date: Sat, 19 Sep 2020 13:51:05 +0200 Subject: [PATCH 018/302] Java-82 Fix test --- apache-libraries/pom.xml | 5 +++++ jackson-modules/jackson-custom-conversions/pom.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apache-libraries/pom.xml b/apache-libraries/pom.xml index 9f800f1e0b..15404676cc 100644 --- a/apache-libraries/pom.xml +++ b/apache-libraries/pom.xml @@ -129,6 +129,11 @@ zookeeper ${zookeeper.version} + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + com.fasterxml.jackson.core jackson-databind diff --git a/jackson-modules/jackson-custom-conversions/pom.xml b/jackson-modules/jackson-custom-conversions/pom.xml index 78894bb403..f58b25781c 100644 --- a/jackson-modules/jackson-custom-conversions/pom.xml +++ b/jackson-modules/jackson-custom-conversions/pom.xml @@ -26,7 +26,7 @@ com.fasterxml.jackson.core jackson-core - 2.10.1 + ${jackson.version} From 599a6c45fc064011d3ea3ff1b12118a8cad1a81a Mon Sep 17 00:00:00 2001 From: "amit.pandey" Date: Sun, 20 Sep 2020 15:58:04 +0530 Subject: [PATCH 019/302] fixing build issue --- maven-modules/maven-plugins/custom-rule/pom.xml | 13 +++++++++++++ maven-modules/maven-plugins/pom.xml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/maven-modules/maven-plugins/custom-rule/pom.xml b/maven-modules/maven-plugins/custom-rule/pom.xml index 0fb551e71b..075a5c7943 100644 --- a/maven-modules/maven-plugins/custom-rule/pom.xml +++ b/maven-modules/maven-plugins/custom-rule/pom.xml @@ -51,4 +51,17 @@ 1.0-alpha-9 + + + + maven-verifier-plugin + ${maven.verifier.version} + + ../input-resources/verifications.xml + false + + + + + diff --git a/maven-modules/maven-plugins/pom.xml b/maven-modules/maven-plugins/pom.xml index 4877f00a92..9f28871ec0 100644 --- a/maven-modules/maven-plugins/pom.xml +++ b/maven-modules/maven-plugins/pom.xml @@ -15,7 +15,7 @@ - + custom-rule maven-enforcer From 4503d5c3f7eba623a416be58c523ed5f6bd972fa Mon Sep 17 00:00:00 2001 From: Cristian Rosu Date: Sun, 20 Sep 2020 19:57:43 +0300 Subject: [PATCH 020/302] BAEL-4415 get a list of trusted certificates in Java --- .../certificates/CertificatesUnitTest.java | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 core-java-modules/core-java-security-2/src/test/java/certificates/CertificatesUnitTest.java diff --git a/core-java-modules/core-java-security-2/src/test/java/certificates/CertificatesUnitTest.java b/core-java-modules/core-java-security-2/src/test/java/certificates/CertificatesUnitTest.java new file mode 100644 index 0000000000..a631df086b --- /dev/null +++ b/core-java-modules/core-java-security-2/src/test/java/certificates/CertificatesUnitTest.java @@ -0,0 +1,94 @@ +package certificates; + +import org.junit.jupiter.api.Test; + +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.PKIXParameters; +import java.security.cert.TrustAnchor; +import java.security.cert.X509Certificate; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class CertificatesUnitTest { + + private static final String GODADDY_CA_ALIAS = "godaddyrootg2ca [jdk]"; + + @Test + public void whenLoadingCacertsKeyStore_thenCertificatesArePresent() throws Exception { + KeyStore keyStore = loadKeyStore(); + PKIXParameters params = new PKIXParameters(keyStore); + + Set trustAnchors = params.getTrustAnchors(); + List certificates = trustAnchors.stream() + .map(TrustAnchor::getTrustedCert) + .collect(Collectors.toList()); + + assertFalse(certificates.isEmpty()); + } + + @Test + public void whenLoadingDefaultKeyStore_thenCertificatesArePresent() throws Exception { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init((KeyStore)null); + + List trustManagers = Arrays.asList(trustManagerFactory.getTrustManagers()); + List certificates = trustManagers.stream() + .filter(X509TrustManager.class::isInstance) + .map(X509TrustManager.class::cast) + .map(trustManager -> Arrays.asList(trustManager.getAcceptedIssuers())) + .flatMap(Collection::stream) + .collect(Collectors.toList()); + + assertFalse(certificates.isEmpty()); + } + + @Test + public void whenLoadingKeyStore_thenGoDaddyCALabelIsPresent() throws Exception { + KeyStore keyStore = loadKeyStore(); + + Enumeration aliasEnumeration = keyStore.aliases(); + List aliases = Collections.list(aliasEnumeration); + + assertTrue(aliases.contains(GODADDY_CA_ALIAS)); + } + + @Test + public void whenLoadingKeyStore_thenGoDaddyCertificateIsPresent() throws Exception { + KeyStore keyStore = loadKeyStore(); + + Certificate goDaddyCertificate = keyStore.getCertificate(GODADDY_CA_ALIAS); + + assertNotNull(goDaddyCertificate); + } + + private KeyStore loadKeyStore() throws CertificateException, NoSuchAlgorithmException, IOException, KeyStoreException { + String relativeCacertsPath = "/lib/security/cacerts".replace("/", File.separator); + String filename = System.getProperty("java.home") + relativeCacertsPath; + FileInputStream is = new FileInputStream(filename); + + KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); + String password = "changeit"; + keystore.load(is, password.toCharArray()); + + return keystore; + } +} From f84e6099381ef89d4c2276a5fe878e939be04ece Mon Sep 17 00:00:00 2001 From: Cavero Barca Date: Tue, 22 Sep 2020 01:08:21 +0200 Subject: [PATCH 021/302] Add a new project with dependencies to separate the layers --- docker/docker-internal-dto/pom.xml | 14 +++++++++ .../java/com/baeldung/docker/VariableDto.java | 14 +++++++++ docker/docker-spring-boot/pom.xml | 28 ++++++++++------- .../src/main/docker/Dockerfile | 4 +-- docker/pom.xml | 30 +++++++++++++++++++ 5 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 docker/docker-internal-dto/pom.xml create mode 100644 docker/docker-internal-dto/src/main/java/com/baeldung/docker/VariableDto.java create mode 100644 docker/pom.xml diff --git a/docker/docker-internal-dto/pom.xml b/docker/docker-internal-dto/pom.xml new file mode 100644 index 0000000000..d7ba6d7373 --- /dev/null +++ b/docker/docker-internal-dto/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + com.baeldung.docker + docker-spring-boot-parent + 0.0.1 + + + docker-internal-dto + + \ No newline at end of file diff --git a/docker/docker-internal-dto/src/main/java/com/baeldung/docker/VariableDto.java b/docker/docker-internal-dto/src/main/java/com/baeldung/docker/VariableDto.java new file mode 100644 index 0000000000..86e173e351 --- /dev/null +++ b/docker/docker-internal-dto/src/main/java/com/baeldung/docker/VariableDto.java @@ -0,0 +1,14 @@ +package com.baeldung.docker; + +public class VariableDto { + + private final String value; + + public VariableDto(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/docker/docker-spring-boot/pom.xml b/docker/docker-spring-boot/pom.xml index e8f6c134b1..9524f68a5a 100644 --- a/docker/docker-spring-boot/pom.xml +++ b/docker/docker-spring-boot/pom.xml @@ -1,21 +1,21 @@ - + 4.0.0 - org.springframework.boot - spring-boot-starter-parent - 2.3.1.RELEASE - + com.baeldung.docker + docker-spring-boot-parent + 0.0.1 - com.baeldung.docker - spring-boot-docker - 0.0.1-SNAPSHOT - spring-boot-docker + + docker-spring-boot + + docker-spring-boot Demo project showing Spring Boot and Docker - 8 + 11 @@ -24,6 +24,12 @@ spring-boot-starter-web + + com.baeldung.docker + docker-internal-dto + 0.0.1 + + org.springframework.boot spring-boot-starter-test diff --git a/docker/docker-spring-boot/src/main/docker/Dockerfile b/docker/docker-spring-boot/src/main/docker/Dockerfile index 663cc94490..c0fd9c9cdb 100644 --- a/docker/docker-spring-boot/src/main/docker/Dockerfile +++ b/docker/docker-spring-boot/src/main/docker/Dockerfile @@ -9,8 +9,8 @@ RUN java -Djarmode=layertools -jar application.jar extract FROM adoptopenjdk:11-jre-hotspot COPY --from=builder dependencies/ ./ -COPY --from=builder snapshot-dependencies/ ./ -COPY --from=builder internal-dependencies/ ./ COPY --from=builder spring-boot-loader/ ./ +COPY --from=builder internal-dependencies/ ./ +COPY --from=builder snapshot-dependencies/ ./ COPY --from=builder application/ ./ ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] \ No newline at end of file diff --git a/docker/pom.xml b/docker/pom.xml new file mode 100644 index 0000000000..3668ceb0fc --- /dev/null +++ b/docker/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.3.1.RELEASE + + + + com.baeldung.docker + docker-spring-boot-parent + 0.0.1 + docker-spring-boot-parent + Demo project showing Spring Boot and Docker + pom + + + 11 + + + + docker-internal-dto + docker-spring-boot + + + From 27953f3bb15115001c634a81c098746b5cbc9af0 Mon Sep 17 00:00:00 2001 From: "sahil.singla" Date: Tue, 22 Sep 2020 22:18:17 +0530 Subject: [PATCH 022/302] Applied formatter --- .../stopexecution/StopExecution.java | 79 +++++++++---------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java index 2eb807020c..20f66da5da 100644 --- a/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java +++ b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/stopexecution/StopExecution.java @@ -29,16 +29,14 @@ public class StopExecution { LOG.info("done"); } - - public void testUsingLoop(){ + public void testUsingLoop() { long start = System.currentTimeMillis(); long end = start + 5000; List items = new ArrayList<>(); int counter = 0; // Let this loop run only upto 5 seconds - while (System.currentTimeMillis() < end && counter < items.size()) - { + while (System.currentTimeMillis() < end && counter < items.size()) { // Fetch the item from the list. // Some expensive operation on the item. try { @@ -50,7 +48,7 @@ public class StopExecution { } } - public static void testThreads(){ + public static void testThreads() { Thread thread = new Thread(new Runnable() { @Override public void run() { @@ -65,7 +63,7 @@ public class StopExecution { } }); thread.start(); - while (thread.getState() != Thread.State.TERMINATED){ + while (thread.getState() != Thread.State.TERMINATED) { LOG.info(thread.getState().name()); try { Thread.sleep(500); @@ -74,16 +72,16 @@ public class StopExecution { } } } - public static void testExecutor(){ + + public static void testExecutor() { final ExecutorService service = Executors.newSingleThreadExecutor(); Future f = null; try { - f = service.submit(() -> { + f = service.submit(() -> { // Do you long running calculation here try { Thread.sleep(2737); // Simulate some delay - } - catch (InterruptedException e){ + } catch (InterruptedException e) { LOG.info("Interrupted"); return "interrupted"; } @@ -92,18 +90,17 @@ public class StopExecution { }); LOG.info(f.get(2, TimeUnit.SECONDS)); - } catch (final TimeoutException e) { + } catch (TimeoutException e) { f.cancel(true); LOG.error("Calculation took to long"); - } catch (final Exception e) { + } catch (Exception e) { throw new RuntimeException(e); } finally { service.shutdown(); } } - - public void testExecutor2(){ + public void testExecutor2() { final ExecutorService service = Executors.newSingleThreadExecutor(); Future f = null; try { @@ -120,27 +117,28 @@ public class StopExecution { } } - public void testScheduledExecutor(){ + public void testScheduledExecutor() { LOG.info("testScheduledExecutor"); ScheduledExecutorService executor = Executors.newScheduledThreadPool(2); Future future = executor.submit(new LongRunningTask()); - executor.schedule(new Runnable(){ - public void run(){ + executor.schedule(new Runnable() { + public void run() { future.cancel(true); } }, 1000, TimeUnit.MILLISECONDS); executor.shutdown(); } - public void testThreadAndInterrupt(){ + + public void testThreadAndInterrupt() { Thread t; try { - t = new Thread(new LongRunningTask()); + t = new Thread(new LongRunningTask()); LOG.info("testExecutor3"); long end = System.currentTimeMillis() + 2000; t.start(); - while (t.isAlive() && System.currentTimeMillis() < end){ + while (t.isAlive() && System.currentTimeMillis() < end) { Thread.sleep(50); } t.interrupt(); @@ -148,7 +146,8 @@ public class StopExecution { throw new RuntimeException(e); } } - public void testTimer(){ + + public void testTimer() { LOG.info("Timer test"); Thread t = new Thread(new LongRunningTask()); Timer timeoutTimer = new Timer(); @@ -156,30 +155,26 @@ public class StopExecution { t.start(); } - class MyRunnableTask implements Runnable{ - public void run() - { - try - { + class MyRunnableTask implements Runnable { + public void run() { + try { LOG.info("MyRunnable..."); Thread.sleep(10000); - } - catch (InterruptedException ie) - { + } catch (InterruptedException ie) { LOG.info("MyRunnable interrupted..."); } } } - class TimeOutTask extends TimerTask { private Thread t; private Timer timer; - TimeOutTask(Thread t, Timer timer){ + TimeOutTask(Thread t, Timer timer) { this.t = t; this.timer = timer; } + public void run() { if (t != null && t.isAlive()) { t.interrupt(); @@ -188,26 +183,25 @@ public class StopExecution { } } - class LongRunningTask implements Runnable{ + class LongRunningTask implements Runnable { @Override public void run() { longRunningSort(); } - private void longRunningOperation(){ + private void longRunningOperation() { LOG.info("long Running operation started"); try { //Thread.sleep(500); longFileRead(); LOG.info("long running operation finished"); - } - catch (InterruptedException e){ + } catch (InterruptedException e) { LOG.info("long Running operation interrupted"); } } - private void longRunningSort(){ + private void longRunningSort() { LOG.info("long Running task started"); // Do you long running calculation here int len = 100000; @@ -234,16 +228,16 @@ public class StopExecution { } LOG.info("Index position: " + i); LOG.info("Long running task finished"); - }catch (InterruptedException e){ + } catch (InterruptedException e) { LOG.info("long Running operation interrupted"); } } - private void longFileRead() throws InterruptedException{ + private void longFileRead() throws InterruptedException { String file = "input.txt"; ClassLoader classloader = getClass().getClassLoader(); - try (InputStream inputStream = classloader.getResourceAsStream(file)){ + try (InputStream inputStream = classloader.getResourceAsStream(file)) { Reader inputStreamReader = new InputStreamReader(inputStream); int data = inputStreamReader.read(); @@ -252,12 +246,13 @@ public class StopExecution { data = inputStreamReader.read(); throwExceptionOnThreadInterrupt(); } - } catch (IOException e){ + } catch (IOException e) { LOG.error("Exception: ", e); } } - private void throwExceptionOnThreadInterrupt() throws InterruptedException{ - if (Thread.currentThread().interrupted()){ + + private void throwExceptionOnThreadInterrupt() throws InterruptedException { + if (Thread.currentThread().interrupted()) { throw new InterruptedException(); } } From 465a878d02e5f2b4140ffd6bce02beb76aa01e73 Mon Sep 17 00:00:00 2001 From: Cristian Rosu Date: Wed, 23 Sep 2020 17:34:42 +0300 Subject: [PATCH 023/302] BAEL-4415 correct package name --- .../baeldung/trustedcert}/CertificatesUnitTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-java-modules/core-java-security-2/src/test/java/{certificates => com/baeldung/trustedcert}/CertificatesUnitTest.java (99%) diff --git a/core-java-modules/core-java-security-2/src/test/java/certificates/CertificatesUnitTest.java b/core-java-modules/core-java-security-2/src/test/java/com/baeldung/trustedcert/CertificatesUnitTest.java similarity index 99% rename from core-java-modules/core-java-security-2/src/test/java/certificates/CertificatesUnitTest.java rename to core-java-modules/core-java-security-2/src/test/java/com/baeldung/trustedcert/CertificatesUnitTest.java index a631df086b..d99589a2ec 100644 --- a/core-java-modules/core-java-security-2/src/test/java/certificates/CertificatesUnitTest.java +++ b/core-java-modules/core-java-security-2/src/test/java/com/baeldung/trustedcert/CertificatesUnitTest.java @@ -1,4 +1,4 @@ -package certificates; +package com.baeldung.trustedcert; import org.junit.jupiter.api.Test; From 478e6ccff6b60de96d4cabbaaa042d1ca45496ea Mon Sep 17 00:00:00 2001 From: Cristian Rosu Date: Wed, 23 Sep 2020 17:36:48 +0300 Subject: [PATCH 024/302] BAEL-4415 correct line continuations indent to 2 spaces --- .../baeldung/trustedcert/CertificatesUnitTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core-java-modules/core-java-security-2/src/test/java/com/baeldung/trustedcert/CertificatesUnitTest.java b/core-java-modules/core-java-security-2/src/test/java/com/baeldung/trustedcert/CertificatesUnitTest.java index d99589a2ec..4f40c3c195 100644 --- a/core-java-modules/core-java-security-2/src/test/java/com/baeldung/trustedcert/CertificatesUnitTest.java +++ b/core-java-modules/core-java-security-2/src/test/java/com/baeldung/trustedcert/CertificatesUnitTest.java @@ -39,8 +39,8 @@ public class CertificatesUnitTest { Set trustAnchors = params.getTrustAnchors(); List certificates = trustAnchors.stream() - .map(TrustAnchor::getTrustedCert) - .collect(Collectors.toList()); + .map(TrustAnchor::getTrustedCert) + .collect(Collectors.toList()); assertFalse(certificates.isEmpty()); } @@ -52,11 +52,11 @@ public class CertificatesUnitTest { List trustManagers = Arrays.asList(trustManagerFactory.getTrustManagers()); List certificates = trustManagers.stream() - .filter(X509TrustManager.class::isInstance) - .map(X509TrustManager.class::cast) - .map(trustManager -> Arrays.asList(trustManager.getAcceptedIssuers())) - .flatMap(Collection::stream) - .collect(Collectors.toList()); + .filter(X509TrustManager.class::isInstance) + .map(X509TrustManager.class::cast) + .map(trustManager -> Arrays.asList(trustManager.getAcceptedIssuers())) + .flatMap(Collection::stream) + .collect(Collectors.toList()); assertFalse(certificates.isEmpty()); } From 0fd213eb5d5874ccf1c93d38911e9e9c2ceab154 Mon Sep 17 00:00:00 2001 From: mikr Date: Thu, 24 Sep 2020 19:13:13 +0200 Subject: [PATCH 025/302] Java-82 Fix test (change port) --- .../baeldung/reactive/security/SpringSecurity5Application.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java index d315bf8238..bb0f007ada 100644 --- a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java @@ -28,7 +28,7 @@ public class SpringSecurity5Application { HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context) .build(); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler); - HttpServer httpServer = HttpServer.create().host("localhost").port(8080); + HttpServer httpServer = HttpServer.create().host("localhost").port(8083); return httpServer.handle(adapter).bindNow(); } From b5d49958eb8a20250e774e872d037abee64972da Mon Sep 17 00:00:00 2001 From: Liu Chuang Date: Fri, 25 Sep 2020 15:12:35 +0800 Subject: [PATCH 026/302] Update MaxSizeConstraintValidator.java --- .../constraint/MaxSizeConstraintValidator.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java b/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java index 0154fb636a..7e725a3981 100644 --- a/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java +++ b/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java @@ -11,11 +11,7 @@ public class MaxSizeConstraintValidator implements ConstraintValidator values, ConstraintValidatorContext context) { - boolean isValid = true; - if (values.size() > 4) { - isValid = false; - } - return isValid; + return value.size()<=4 } } From c245528f3d78c400c0ccd9f91551af0d45455863 Mon Sep 17 00:00:00 2001 From: Liu Chuang Date: Fri, 25 Sep 2020 15:14:41 +0800 Subject: [PATCH 027/302] Update MaxSizeConstraintValidator.java --- .../listvalidation/constraint/MaxSizeConstraintValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java b/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java index 7e725a3981..524e98a39e 100644 --- a/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java +++ b/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java @@ -11,7 +11,7 @@ public class MaxSizeConstraintValidator implements ConstraintValidator values, ConstraintValidatorContext context) { - return value.size()<=4 + return values.size()<=4 } } From ce9356179e75db29685d44577914bcfc0c3183d6 Mon Sep 17 00:00:00 2001 From: fdpro Date: Mon, 14 Sep 2020 20:49:03 +0200 Subject: [PATCH 028/302] [JAVA-1671] Upgraded JUnit and Maven Surefire Plugin versions * For modules inheriting from spring-cloud directly * Other modules as well --- spring-cloud/pom.xml | 24 +++++++++++++++++++ spring-cloud/spring-cloud-aws/pom.xml | 5 ++++ .../spring-cloud-bootstrap/config/pom.xml | 12 ++++++++++ .../customer-service/pom.xml | 5 ++++ .../spring-cloud-bootstrap/discovery/pom.xml | 5 ++++ .../spring-cloud-bootstrap/gateway/pom.xml | 5 ++++ .../order-service/order-client/pom.xml | 1 - .../order-service/pom.xml | 12 ++++++++++ .../spring-cloud-bootstrap/svc-book/pom.xml | 5 ++++ .../spring-cloud-bootstrap/svc-rating/pom.xml | 5 ++++ .../spring-cloud-bootstrap/zipkin/pom.xml | 12 ++++++++++ .../spring-cloud-config/client/pom.xml | 1 - spring-cloud/spring-cloud-config/pom.xml | 12 ++++++++++ .../spring-cloud-config/server/pom.xml | 1 - .../spring-cloud-connectors-heroku/pom.xml | 5 ++++ .../spring-cloud-eureka-client/pom.xml | 7 ++++++ .../spring-cloud-eureka-feign-client/pom.xml | 7 ++++++ .../spring-cloud-eureka-server/pom.xml | 7 ++++++ spring-cloud/spring-cloud-functions/pom.xml | 5 ++++ spring-cloud/spring-cloud-gateway/pom.xml | 15 +++++------- .../feign-rest-consumer/pom.xml | 7 ++++++ .../rest-consumer/pom.xml | 7 ++++++ .../kubernetes-minikube/demo-frontend/pom.xml | 1 - spring-cloud/spring-cloud-kubernetes/pom.xml | 6 +++++ .../spring-cloud-rest-books-api/pom.xml | 14 ++++++++++- .../spring-cloud-rest-config-server/pom.xml | 12 ++++++++++ .../pom.xml | 12 ++++++++++ .../spring-cloud-rest-reviews-api/pom.xml | 12 ++++++++++ .../spring-cloud-ribbon-client/pom.xml | 12 ++++++++++ .../spring-cloud-ribbon-retry/pom.xml | 12 ++++++++++ spring-cloud/spring-cloud-security/pom.xml | 6 +++++ .../spring-cloud-stream-kafka/pom.xml | 5 ++++ .../spring-cloud-stream-kinesis/pom.xml | 5 ++++ spring-cloud/spring-cloud-task/pom.xml | 12 ++++++++++ spring-cloud/spring-cloud-vault/pom.xml | 5 ++++ .../api-gateway/pom.xml | 8 +++++++ .../weather-service/pom.xml | 7 ++++++ spring-cloud/spring-cloud-zuul/pom.xml | 12 ++++++++++ .../spring-zuul-rate-limiting/pom.xml | 12 ---------- 39 files changed, 292 insertions(+), 26 deletions(-) diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index ee7b80ffc1..928db8adb7 100644 --- a/spring-cloud/pom.xml +++ b/spring-cloud/pom.xml @@ -58,6 +58,25 @@ + + + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + Hoxton.SR4 2.2.3.RELEASE @@ -68,6 +87,11 @@ 3.0.6.RELEASE 2.3.1.RELEASE 2.3.1.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index 2b05020888..3952ffdec1 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -67,6 +67,11 @@ com.baeldung.spring.cloud.aws.SpringCloudAwsApplication Dalston.SR4 2.2.1.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-bootstrap/config/pom.xml b/spring-cloud/spring-cloud-bootstrap/config/pom.xml index 67831d0c7f..65a9830495 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/config/pom.xml @@ -30,6 +30,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -42,6 +49,11 @@ Brixton.SR7 + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml b/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml index 8fcf4adadb..026a7a1841 100644 --- a/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml @@ -78,5 +78,10 @@ 1.8 1.8 + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml index 46550031e1..eaebaacc4d 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml @@ -51,6 +51,11 @@ Edgware.SR5 + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml index 10a04db197..aacd2cdbf7 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml @@ -100,6 +100,11 @@ Dalston.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml index 4c8cf742b1..01e8afeec3 100644 --- a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml @@ -14,5 +14,4 @@ order-service 1.0.0-SNAPSHOT - diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml index a1c6c1c39f..04901f9936 100644 --- a/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml @@ -23,6 +23,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.boot spring-boot-dependencies @@ -118,5 +125,10 @@ 1.8 1.8 com.baeldung.orderservice.OrderApplication + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml index 36227f93c6..cf34e44f24 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml @@ -73,6 +73,11 @@ Dalston.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml index 0a01488628..a232861cad 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml @@ -82,6 +82,11 @@ Dalston.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml index bf7525a8e4..134038b94a 100644 --- a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml @@ -38,6 +38,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -50,6 +57,11 @@ Brixton.SR7 + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-config/client/pom.xml b/spring-cloud/spring-cloud-config/client/pom.xml index 4f4a420238..805a50bfdb 100644 --- a/spring-cloud/spring-cloud-config/client/pom.xml +++ b/spring-cloud/spring-cloud-config/client/pom.xml @@ -36,5 +36,4 @@ - diff --git a/spring-cloud/spring-cloud-config/pom.xml b/spring-cloud/spring-cloud-config/pom.xml index 8411a65500..e693bc7a29 100644 --- a/spring-cloud/spring-cloud-config/pom.xml +++ b/spring-cloud/spring-cloud-config/pom.xml @@ -22,6 +22,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -34,6 +41,11 @@ Hoxton.SR4 + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-config/server/pom.xml b/spring-cloud/spring-cloud-config/server/pom.xml index 9574834457..e32a473cd6 100644 --- a/spring-cloud/spring-cloud-config/server/pom.xml +++ b/spring-cloud/spring-cloud-config/server/pom.xml @@ -40,5 +40,4 @@ - diff --git a/spring-cloud/spring-cloud-connectors-heroku/pom.xml b/spring-cloud/spring-cloud-connectors-heroku/pom.xml index 7d85e07bb8..2e84061be9 100644 --- a/spring-cloud/spring-cloud-connectors-heroku/pom.xml +++ b/spring-cloud/spring-cloud-connectors-heroku/pom.xml @@ -64,6 +64,11 @@ Hoxton.SR4 42.2.10 1.10.10 + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml index d82ee6566d..dc6a1ae236 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml @@ -17,6 +17,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-starter-parent diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml index 1ecc50a81f..e0d63dc15d 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml @@ -17,6 +17,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-starter-parent diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml index 627be513ba..9c0a933753 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml @@ -17,6 +17,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-starter-parent diff --git a/spring-cloud/spring-cloud-functions/pom.xml b/spring-cloud/spring-cloud-functions/pom.xml index 7e6f5dfbdc..19b5e3cd8d 100644 --- a/spring-cloud/spring-cloud-functions/pom.xml +++ b/spring-cloud/spring-cloud-functions/pom.xml @@ -86,6 +86,11 @@ 2.0.2 1.1.0 1.0.10.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-gateway/pom.xml b/spring-cloud/spring-cloud-gateway/pom.xml index bbacf7a8ce..c9c087d738 100644 --- a/spring-cloud/spring-cloud-gateway/pom.xml +++ b/spring-cloud/spring-cloud-gateway/pom.xml @@ -17,19 +17,16 @@ - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud-dependencies.version} + org.junit + junit-bom + ${junit-jupiter.version} pom import - - - org.junit - junit-bom - ${junit-bom.version} + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} pom import diff --git a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml index acb9993881..9b43542f02 100644 --- a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml @@ -17,6 +17,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-starter-parent diff --git a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml index ba03ad3348..7989b09ed4 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml @@ -16,6 +16,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-starter-parent diff --git a/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml index 9a4924b903..004fabeb09 100644 --- a/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml @@ -33,5 +33,4 @@ - diff --git a/spring-cloud/spring-cloud-kubernetes/pom.xml b/spring-cloud/spring-cloud-kubernetes/pom.xml index ed4bccbf78..c936024753 100644 --- a/spring-cloud/spring-cloud-kubernetes/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/pom.xml @@ -24,4 +24,10 @@ kubernetes-guide/travel-agency-service + + + 2.22.2 + 5.6.2 + 4.13 + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml index 042f7657ab..1dcf14f104 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml @@ -18,6 +18,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -65,7 +72,12 @@ org.springframework.boot spring-boot-starter-data-redis - + + + 2.22.2 + 5.6.2 + 4.13 + diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml index 5fb9364752..736b8bdf78 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml @@ -18,6 +18,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -45,6 +52,11 @@ Camden.SR4 + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml index 5e35a7c0f5..12f8b6ae6a 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml @@ -18,6 +18,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -53,6 +60,11 @@ Edgware.SR4 + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml index 7503418ad2..0e7aed7f6a 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml @@ -18,6 +18,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -75,6 +82,11 @@ 3.0.1 0.6 + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-ribbon-client/pom.xml b/spring-cloud/spring-cloud-ribbon-client/pom.xml index e19d3beaad..ce57cfd7d3 100644 --- a/spring-cloud/spring-cloud-ribbon-client/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-client/pom.xml @@ -16,6 +16,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -39,6 +46,11 @@ Hoxton.SR4 + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-ribbon-retry/pom.xml b/spring-cloud/spring-cloud-ribbon-retry/pom.xml index 27037d6710..198473d5e5 100644 --- a/spring-cloud/spring-cloud-ribbon-retry/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-retry/pom.xml @@ -23,6 +23,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-starter-parent @@ -48,5 +55,10 @@ Hoxton.SR3 + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-security/pom.xml b/spring-cloud/spring-cloud-security/pom.xml index 498c88ac48..0997b1f3aa 100644 --- a/spring-cloud/spring-cloud-security/pom.xml +++ b/spring-cloud/spring-cloud-security/pom.xml @@ -20,4 +20,10 @@ auth-server + + + 2.22.2 + 5.6.2 + 4.13 + diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml index 669499efb7..3283d4d07c 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml @@ -105,6 +105,11 @@ Greenwich.SR1 4.0.0 1.8.2 + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml index 9e706cc239..d3182433e9 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml @@ -43,6 +43,11 @@ 1.11.632 2.0.2.RELEASE 2.2.1.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-task/pom.xml b/spring-cloud/spring-cloud-task/pom.xml index e2006ee9d3..bb18c1390b 100644 --- a/spring-cloud/spring-cloud-task/pom.xml +++ b/spring-cloud/spring-cloud-task/pom.xml @@ -22,6 +22,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-task-dependencies @@ -42,6 +49,11 @@ Hoxton.SR4 2.2.3.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-vault/pom.xml b/spring-cloud/spring-cloud-vault/pom.xml index d9ae6b515f..a713e47fe2 100644 --- a/spring-cloud/spring-cloud-vault/pom.xml +++ b/spring-cloud/spring-cloud-vault/pom.xml @@ -83,6 +83,11 @@ Greenwich.RELEASE + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml b/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml index 136461ccb9..4e092736a5 100644 --- a/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml +++ b/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml @@ -12,10 +12,18 @@ com.baeldung.spring.cloud spring-cloud-zuul-fallback 1.0.0-SNAPSHOT + ../pom.xml + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-starter-parent diff --git a/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml b/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml index bafd4ffcd1..d2914b48bf 100644 --- a/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml +++ b/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml @@ -15,6 +15,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-starter-parent diff --git a/spring-cloud/spring-cloud-zuul/pom.xml b/spring-cloud/spring-cloud-zuul/pom.xml index b3c66dd1c6..3884e67388 100644 --- a/spring-cloud/spring-cloud-zuul/pom.xml +++ b/spring-cloud/spring-cloud-zuul/pom.xml @@ -24,6 +24,13 @@ + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + org.springframework.cloud spring-cloud-dependencies @@ -73,6 +80,11 @@ Hoxton.SR4 + + + 2.22.2 + 5.6.2 + 4.13 diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml index 8873282d1e..b42d32b6b3 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml @@ -13,18 +13,6 @@ 0.0.1-SNAPSHOT - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - com.marcosbarbero.cloud From 76c4f84e641570c4f8e4044c52831fb4f541866a Mon Sep 17 00:00:00 2001 From: Lachezar Atanasov <53919277+lachezarat@users.noreply.github.com> Date: Sun, 27 Sep 2020 11:44:45 +0300 Subject: [PATCH 029/302] Update README.md --- algorithms-miscellaneous-1/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms-miscellaneous-1/README.md b/algorithms-miscellaneous-1/README.md index 25e2733538..77c621339a 100644 --- a/algorithms-miscellaneous-1/README.md +++ b/algorithms-miscellaneous-1/README.md @@ -10,4 +10,4 @@ This module contains articles about algorithms. Some classes of algorithms, e.g. - [Introduction to Minimax Algorithm](https://www.baeldung.com/java-minimax-algorithm) - [How to Calculate Levenshtein Distance in Java?](https://www.baeldung.com/java-levenshtein-distance) - [How to Find the Kth Largest Element in Java](https://www.baeldung.com/java-kth-largest-element) -- More articles: [[next -->]](/../algorithms-miscellaneous-2) +- More articles: [[next -->]](/algorithms-miscellaneous-2) From 60201640d966b0ead5d6f35c28c8f79948ba4bed Mon Sep 17 00:00:00 2001 From: Lachezar Atanasov <53919277+lachezarat@users.noreply.github.com> Date: Sun, 27 Sep 2020 11:45:13 +0300 Subject: [PATCH 030/302] Update README.md --- algorithms-miscellaneous-2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms-miscellaneous-2/README.md b/algorithms-miscellaneous-2/README.md index 26737b61f0..265416534e 100644 --- a/algorithms-miscellaneous-2/README.md +++ b/algorithms-miscellaneous-2/README.md @@ -14,4 +14,4 @@ This module contains articles about algorithms. Some classes of algorithms, e.g. - [Displaying Money Amounts in Words](https://www.baeldung.com/java-money-into-words) - [A Collaborative Filtering Recommendation System in Java](https://www.baeldung.com/java-collaborative-filtering-recommendations) - [Implementing A* Pathfinding in Java](https://www.baeldung.com/java-a-star-pathfinding) -- More articles: [[<-- prev]](/../algorithms-miscellaneous-1) [[next -->]](/../algorithms-miscellaneous-3) +- More articles: [[<-- prev]](/algorithms-miscellaneous-1) [[next -->]](/algorithms-miscellaneous-3) From 0055fb2e1b9b27b102c69ba7502c7445d3b2ea0e Mon Sep 17 00:00:00 2001 From: Lachezar Atanasov <53919277+lachezarat@users.noreply.github.com> Date: Sun, 27 Sep 2020 11:45:57 +0300 Subject: [PATCH 031/302] Update README.md --- algorithms-miscellaneous-5/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms-miscellaneous-5/README.md b/algorithms-miscellaneous-5/README.md index 3e6eeb4c93..e5d46ace1c 100644 --- a/algorithms-miscellaneous-5/README.md +++ b/algorithms-miscellaneous-5/README.md @@ -15,5 +15,5 @@ This module contains articles about algorithms. Some classes of algorithms, e.g. - [Maximum Subarray Problem](https://www.baeldung.com/java-maximum-subarray) - [How to Merge Two Sorted Arrays](https://www.baeldung.com/java-merge-sorted-arrays) - [Median of Stream of Integers using Heap](https://www.baeldung.com/java-stream-integers-median-using-heap) -- More articles: [[<-- prev]](/../algorithms-miscellaneous-4) [[next -->]](/../algorithms-miscellaneous-6) +- More articles: [[<-- prev]](/algorithms-miscellaneous-4) [[next -->]](/algorithms-miscellaneous-6) From 0a9ccbfeddbc2cd33f85276f270bf64cd676911c Mon Sep 17 00:00:00 2001 From: Lachezar Atanasov <53919277+lachezarat@users.noreply.github.com> Date: Sun, 27 Sep 2020 11:46:14 +0300 Subject: [PATCH 032/302] Update README.md --- algorithms-miscellaneous-6/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms-miscellaneous-6/README.md b/algorithms-miscellaneous-6/README.md index 6ddae75f43..70acb69b6f 100644 --- a/algorithms-miscellaneous-6/README.md +++ b/algorithms-miscellaneous-6/README.md @@ -9,4 +9,4 @@ - [The Caesar Cipher in Java](https://www.baeldung.com/java-caesar-cipher) - [Implementing a 2048 Solver in Java](https://www.baeldung.com/2048-java-solver) - [Finding Top K Elements in an Array](https://www.baeldung.com/java-array-top-elements) -- More articles: [[<-- prev]](/../algorithms-miscellaneous-5) +- More articles: [[<-- prev]](/algorithms-miscellaneous-5) From ea8e33f434d95d57b6c3b570d4a391401645d6a5 Mon Sep 17 00:00:00 2001 From: Simone Cusimano Date: Sun, 27 Sep 2020 18:37:50 +0200 Subject: [PATCH 033/302] Add dependency management module --- .../gradle-dependency-management/.gitignore | 34 ++++ .../gradle-dependency-management/build.gradle | 46 +++++ .../gradle/wrapper/gradle-wrapper.properties | 5 + gradle/gradle-dependency-management/gradlew | 184 ++++++++++++++++++ .../gradle-dependency-management/gradlew.bat | 89 +++++++++ .../settings.gradle | 1 + .../DependencyManagementApplication.java | 13 ++ .../src/main/resources/application.properties | 1 + .../DependencyManagementApplicationTests.java | 13 ++ 9 files changed, 386 insertions(+) create mode 100644 gradle/gradle-dependency-management/.gitignore create mode 100644 gradle/gradle-dependency-management/build.gradle create mode 100644 gradle/gradle-dependency-management/gradle/wrapper/gradle-wrapper.properties create mode 100644 gradle/gradle-dependency-management/gradlew create mode 100644 gradle/gradle-dependency-management/gradlew.bat create mode 100644 gradle/gradle-dependency-management/settings.gradle create mode 100644 gradle/gradle-dependency-management/src/main/java/com/gradle/dependencymanagement/DependencyManagementApplication.java create mode 100644 gradle/gradle-dependency-management/src/main/resources/application.properties create mode 100644 gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/DependencyManagementApplicationTests.java diff --git a/gradle/gradle-dependency-management/.gitignore b/gradle/gradle-dependency-management/.gitignore new file mode 100644 index 0000000000..84695dca6f --- /dev/null +++ b/gradle/gradle-dependency-management/.gitignore @@ -0,0 +1,34 @@ +HELP.md +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ diff --git a/gradle/gradle-dependency-management/build.gradle b/gradle/gradle-dependency-management/build.gradle new file mode 100644 index 0000000000..db908b6457 --- /dev/null +++ b/gradle/gradle-dependency-management/build.gradle @@ -0,0 +1,46 @@ +plugins { + id 'org.springframework.boot' version '2.3.4.RELEASE' + id 'io.spring.dependency-management' version '1.0.10.RELEASE' + id 'java' +} + +group = 'com.gradle' +version = '1.0.0' +sourceCompatibility = '14' + +configurations { + compileOnly { + extendsFrom annotationProcessor + } +} + +repositories { + mavenCentral() +} + +ext { + set('testcontainersVersion', "1.14.3") +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-webflux' + developmentOnly 'org.springframework.boot:spring-boot-devtools' + annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' + testImplementation('org.springframework.boot:spring-boot-starter-test') { + exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' + } + testImplementation 'io.projectreactor:reactor-test' + testImplementation 'org.springframework.security:spring-security-test' + testImplementation 'org.testcontainers:junit-jupiter' +} + +dependencyManagement { + imports { + mavenBom "org.testcontainers:testcontainers-bom:${testcontainersVersion}" + } +} + +test { + useJUnitPlatform() +} diff --git a/gradle/gradle-dependency-management/gradle/wrapper/gradle-wrapper.properties b/gradle/gradle-dependency-management/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..12d38de6a4 --- /dev/null +++ b/gradle/gradle-dependency-management/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradle/gradle-dependency-management/gradlew b/gradle/gradle-dependency-management/gradlew new file mode 100644 index 0000000000..8f8904743c --- /dev/null +++ b/gradle/gradle-dependency-management/gradlew @@ -0,0 +1,184 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' >/dev/null; then + PRG="$link" + else + PRG=$(dirname "$PRG")"/$link" + fi +done +SAVED="$(pwd)" +cd "$(dirname \"$PRG\")/" >/dev/null +APP_HOME="$(pwd -P)" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=$(basename "$0") + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn() { + echo "$*" +} + +die() { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$(uname)" in +CYGWIN*) + cygwin=true + ;; +Darwin*) + darwin=true + ;; +MINGW*) + msys=true + ;; +NONSTOP*) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ]; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then + MAX_FD_LIMIT=$(ulimit -H -n) + if [ $? -eq 0 ]; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ]; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ]; then + APP_HOME=$(cygpath --path --mixed "$APP_HOME") + CLASSPATH=$(cygpath --path --mixed "$CLASSPATH") + + JAVACMD=$(cygpath --unix "$JAVACMD") + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null) + SEP="" + for dir in $ROOTDIRSRAW; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ]; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@"; do + CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -) + CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition + eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg") + else + eval $(echo args$i)="\"$arg\"" + fi + i=$(expr $i + 1) + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save() { + for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradle/gradle-dependency-management/gradlew.bat b/gradle/gradle-dependency-management/gradlew.bat new file mode 100644 index 0000000000..107acd32c4 --- /dev/null +++ b/gradle/gradle-dependency-management/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/gradle/gradle-dependency-management/settings.gradle b/gradle/gradle-dependency-management/settings.gradle new file mode 100644 index 0000000000..09bfe08af7 --- /dev/null +++ b/gradle/gradle-dependency-management/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'dependencymanagement' diff --git a/gradle/gradle-dependency-management/src/main/java/com/gradle/dependencymanagement/DependencyManagementApplication.java b/gradle/gradle-dependency-management/src/main/java/com/gradle/dependencymanagement/DependencyManagementApplication.java new file mode 100644 index 0000000000..7e589c0477 --- /dev/null +++ b/gradle/gradle-dependency-management/src/main/java/com/gradle/dependencymanagement/DependencyManagementApplication.java @@ -0,0 +1,13 @@ +package com.gradle.dependencymanagement; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DependencyManagementApplication { + + public static void main(String[] args) { + SpringApplication.run(DependencyManagementApplication.class, args); + } + +} diff --git a/gradle/gradle-dependency-management/src/main/resources/application.properties b/gradle/gradle-dependency-management/src/main/resources/application.properties new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/gradle/gradle-dependency-management/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/DependencyManagementApplicationTests.java b/gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/DependencyManagementApplicationTests.java new file mode 100644 index 0000000000..85634a052e --- /dev/null +++ b/gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/DependencyManagementApplicationTests.java @@ -0,0 +1,13 @@ +package com.gradle.dependencymanagement; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DependencyManagementApplicationTests { + + @Test + void contextLoads() { + } + +} From 29c91cde2e39b7dbb8c29ffde57444da97e6914c Mon Sep 17 00:00:00 2001 From: Anirban Chatterjee Date: Mon, 28 Sep 2020 01:24:17 +0200 Subject: [PATCH 034/302] Added component scan and auto configuration annotations --- .../EmployeeApplication.java | 26 +++++++++++++++++++ .../doctor/Doctor.java | 7 +++++ .../employee/Employee.java | 7 +++++ .../employee/SeniorEmployee.java | 7 +++++ .../student/Student.java | 7 +++++ .../teacher/Teacher.java | 7 +++++ 6 files changed, 61 insertions(+) create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/doctor/Doctor.java create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/Employee.java create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/student/Student.java create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/teacher/Teacher.java diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java new file mode 100644 index 0000000000..108dd1a695 --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java @@ -0,0 +1,26 @@ +package com.baeldung.annotations.componentscanautoconfigure; + +import com.baeldung.annotations.componentscanautoconfigure.teacher.Teacher; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.aop.AopAutoConfiguration; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ComponentScan(basePackages = {"com.baeldung.annotations.componentscanautoconfigure.doctor", "com.baeldung.annotations.componentscanautoconfigure.employee"}, + basePackageClasses = Teacher.class) +@EnableAutoConfiguration(exclude={AopAutoConfiguration.class}) +//@EnableAutoConfiguration(excludeName = {"org.springframework.boot.autoconfigure.aop"}) +public class EmployeeApplication { + + public static void main(String[] args) { + ApplicationContext context = SpringApplication.run(EmployeeApplication.class, args); + System.out.println("Configures Doctor: " + context.containsBeanDefinition("doctor")); + System.out.println("Configures Employee: " + context.containsBeanDefinition("employee")); + System.out.println("Configures Senior Employee: " + context.containsBeanDefinition("seniorEmployee")); + System.out.println("Configures Student: " + context.containsBeanDefinition("student")); + System.out.println("Configures Teacher: " + context.containsBeanDefinition("teacher")); + } +} diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/doctor/Doctor.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/doctor/Doctor.java new file mode 100644 index 0000000000..40bb68259a --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/doctor/Doctor.java @@ -0,0 +1,7 @@ +package com.baeldung.annotations.componentscanautoconfigure.doctor; + +import org.springframework.stereotype.Component; + +@Component("doctor") +public class Doctor { +} diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/Employee.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/Employee.java new file mode 100644 index 0000000000..bdc0b3f2d9 --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/Employee.java @@ -0,0 +1,7 @@ +package com.baeldung.annotations.componentscanautoconfigure.employee; + +import org.springframework.stereotype.Component; + +@Component("employee") +public class Employee { +} diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java new file mode 100644 index 0000000000..fc02a17df6 --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java @@ -0,0 +1,7 @@ +package com.baeldung.annotations.componentscanautoconfigure.employee; + +import org.springframework.stereotype.Component; + +@Component("seniorEmployee") +public class SeniorEmployee { +} diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/student/Student.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/student/Student.java new file mode 100644 index 0000000000..820d0bea10 --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/student/Student.java @@ -0,0 +1,7 @@ +package com.baeldung.annotations.componentscanautoconfigure.student; + +import org.springframework.stereotype.Component; + +@Component("student") +public class Student { +} diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/teacher/Teacher.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/teacher/Teacher.java new file mode 100644 index 0000000000..699b8ccfb4 --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/teacher/Teacher.java @@ -0,0 +1,7 @@ +package com.baeldung.annotations.componentscanautoconfigure.teacher; + +import org.springframework.stereotype.Component; + +@Component("teacher") +public class Teacher { +} From e134c020ceb050ecacfb23509f1a8418fe481e41 Mon Sep 17 00:00:00 2001 From: Oussama BEN MAHMOUD Date: Mon, 28 Sep 2020 10:43:07 +0200 Subject: [PATCH 035/302] BAEL-4443 Reading HTTP ResponseBody as a String --- httpclient-2/pom.xml | 29 ++++++++++++++++ .../ApacheHttpClientUnitTest.java | 26 ++++++++++++++ .../HttpClientUnitTest.java | 29 ++++++++++++++++ .../HttpUrlConnectionUnitTest.java | 34 +++++++++++++++++++ .../SpringRestTemplateUnitTest.java | 17 ++++++++++ pom.xml | 4 +-- 6 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/ApacheHttpClientUnitTest.java create mode 100644 httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/HttpClientUnitTest.java create mode 100644 httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/HttpUrlConnectionUnitTest.java create mode 100644 httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/SpringRestTemplateUnitTest.java diff --git a/httpclient-2/pom.xml b/httpclient-2/pom.xml index 1a27d9b5fe..7638c692dc 100644 --- a/httpclient-2/pom.xml +++ b/httpclient-2/pom.xml @@ -4,6 +4,7 @@ 4.0.0 httpclient-2 0.1-SNAPSHOT + httpclient-2 com.baeldung @@ -13,6 +14,7 @@ + org.apache.httpcomponents httpclient @@ -24,6 +26,19 @@ + + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot.version} + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot.version} + test + @@ -34,10 +49,24 @@ true + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source.version} + ${maven.compiler.target.version} + + + 4.5.8 + 11 + 11 + 2.1.7.RELEASE \ No newline at end of file diff --git a/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/ApacheHttpClientUnitTest.java b/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/ApacheHttpClientUnitTest.java new file mode 100644 index 0000000000..5a638b2bd5 --- /dev/null +++ b/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/ApacheHttpClientUnitTest.java @@ -0,0 +1,26 @@ +package com.baeldung.httpclient.readresponsebodystring; + +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.junit.Test; + +import java.io.IOException; + +public class ApacheHttpClientUnitTest { + public static final String DUMMY_URL = "https://postman-echo.com/get"; + + @Test + public void whenUseApacheHttpClient_thenCorrect() throws IOException { + HttpGet request = new HttpGet(DUMMY_URL); + + try (CloseableHttpClient client = HttpClients.createDefault(); CloseableHttpResponse response = client.execute(request)) { + HttpEntity entity = response.getEntity(); + String result = EntityUtils.toString(entity); + System.out.println("Response -> " + result); + } + } +} diff --git a/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/HttpClientUnitTest.java b/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/HttpClientUnitTest.java new file mode 100644 index 0000000000..1dca1bf7c6 --- /dev/null +++ b/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/HttpClientUnitTest.java @@ -0,0 +1,29 @@ +package com.baeldung.httpclient.readresponsebodystring; + +import org.junit.Test; + +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; + +public class HttpClientUnitTest { + public static final String DUMMY_URL = "https://postman-echo.com/get"; + + @Test + public void whenUseHttpClient_thenCorrect() throws IOException, InterruptedException { + HttpClient client = HttpClient.newHttpClient(); + HttpRequest request = HttpRequest.newBuilder().uri(URI.create(DUMMY_URL)).build(); + + // synchronous response + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + System.out.println(response.body()); + + // asynchronous response + client.sendAsync(request, HttpResponse.BodyHandlers.ofString()) + .thenApply(HttpResponse::body) + .thenAccept(System.out::println) + .join(); + } +} diff --git a/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/HttpUrlConnectionUnitTest.java b/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/HttpUrlConnectionUnitTest.java new file mode 100644 index 0000000000..54ae887eb4 --- /dev/null +++ b/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/HttpUrlConnectionUnitTest.java @@ -0,0 +1,34 @@ +package com.baeldung.httpclient.readresponsebodystring; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + +public class HttpUrlConnectionUnitTest { + + public static final String DUMMY_URL = "https://postman-echo.com/get"; + + @Test + public void whenUseHttpUrlConnection_thenCorrect() throws IOException { + HttpURLConnection connection = (HttpURLConnection) new URL(DUMMY_URL).openConnection(); + + InputStream inputStream = connection.getInputStream(); + + BufferedReader in = new BufferedReader(new InputStreamReader(inputStream)); + StringBuilder response = new StringBuilder(); + String currentLine; + + while ((currentLine = in.readLine()) != null) + response.append(currentLine); + + in.close(); + Assert.assertNotNull(response.toString()); + System.out.println("Response -> " + response.toString()); + } +} diff --git a/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/SpringRestTemplateUnitTest.java b/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/SpringRestTemplateUnitTest.java new file mode 100644 index 0000000000..c59d7662f1 --- /dev/null +++ b/httpclient-2/src/test/java/com/baeldung/httpclient/readresponsebodystring/SpringRestTemplateUnitTest.java @@ -0,0 +1,17 @@ +package com.baeldung.httpclient.readresponsebodystring; + +import org.junit.Test; +import org.springframework.web.client.RestTemplate; + +public class SpringRestTemplateUnitTest { + + public static final String DUMMY_URL = "https://postman-echo.com/get"; + + @Test + public void whenUseRestTemplate_thenCorrect() { + RestTemplate restTemplate = new RestTemplate(); + String response = restTemplate.getForObject(DUMMY_URL, String.class); + System.out.println(response); + } + +} diff --git a/pom.xml b/pom.xml index 065d6abbdd..c93aeffcbd 100644 --- a/pom.xml +++ b/pom.xml @@ -424,7 +424,7 @@ hazelcast helidon httpclient - httpclient-2 + httpclient-simple hystrix @@ -936,7 +936,7 @@ hazelcast helidon httpclient - httpclient-2 + httpclient-simple hystrix From 664d170cf45b392c23652aa443a945ba0beae5d0 Mon Sep 17 00:00:00 2001 From: kwoyke Date: Mon, 28 Sep 2020 16:29:44 +0200 Subject: [PATCH 036/302] BAEL-4656: Get available port number for the test (#10096) --- .../PactConsumerDrivenContractUnitTest.java | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/libraries-5/src/test/java/com/baeldung/pact/PactConsumerDrivenContractUnitTest.java b/libraries-5/src/test/java/com/baeldung/pact/PactConsumerDrivenContractUnitTest.java index e4ac8a3a95..8d4918a3e7 100644 --- a/libraries-5/src/test/java/com/baeldung/pact/PactConsumerDrivenContractUnitTest.java +++ b/libraries-5/src/test/java/com/baeldung/pact/PactConsumerDrivenContractUnitTest.java @@ -7,22 +7,38 @@ import au.com.dius.pact.consumer.dsl.PactDslWithProvider; import au.com.dius.pact.model.RequestResponsePact; import org.junit.Rule; import org.junit.Test; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; +import org.springframework.http.*; import org.springframework.web.client.RestTemplate; +import java.io.IOException; +import java.net.ServerSocket; import java.util.HashMap; import java.util.Map; +import java.util.Random; import static org.assertj.core.api.Assertions.assertThat; public class PactConsumerDrivenContractUnitTest { + private static int getAvailablePort() { + return new Random() + .ints(6000, 9000) + .filter(PactConsumerDrivenContractUnitTest::isFree) + .findFirst() + .orElse(8080); + } + + private static boolean isFree(int port) { + try { + new ServerSocket(port).close(); + return true; + } catch (IOException e) { + return false; + } + } + @Rule - public PactProviderRuleMk2 mockProvider = new PactProviderRuleMk2("test_provider", "localhost", 8080, this); + public PactProviderRuleMk2 mockProvider = new PactProviderRuleMk2("test_provider", "localhost", getAvailablePort(), this); @Pact(consumer = "test_consumer") public RequestResponsePact createPact(PactDslWithProvider builder) { From 7ee94d7455955233b462267d99366e0992e6306a Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 28 Sep 2020 23:10:40 +0530 Subject: [PATCH 037/302] JAVA-2432: Moved articles from here to other modules --- .../spring-hibernate4/.gitignore | 15 - .../spring-hibernate4/README.md | 24 -- persistence-modules/spring-hibernate4/pom.xml | 166 ----------- .../hibernate/audit/AuditorAwareImpl.java | 19 -- .../hibernate/criteria/model/Item.java | 81 ------ .../hibernate/fetching/model/OrderDetail.java | 58 ---- .../hibernate/fetching/model/UserEager.java | 71 ----- .../hibernate/fetching/model/UserLazy.java | 71 ----- .../fetching/util/HibernateUtil.java | 29 -- .../fetching/view/FetchingAppView.java | 68 ----- .../persistence/dao/IBarAuditableDao.java | 8 - .../persistence/dao/IBarCrudRepository.java | 10 - .../com/baeldung/persistence/dao/IBarDao.java | 8 - .../baeldung/persistence/dao/IChildDao.java | 8 - .../persistence/dao/IFooAuditableDao.java | 8 - .../com/baeldung/persistence/dao/IFooDao.java | 8 - .../baeldung/persistence/dao/IParentDao.java | 8 - .../persistence/dao/common/AbstractDao.java | 14 - .../common/AbstractHibernateAuditableDao.java | 37 --- .../dao/common/AbstractHibernateDao.java | 59 ---- .../dao/common/AbstractJpaDao.java | 56 ---- .../dao/common/GenericHibernateDao.java | 13 - .../dao/common/IAuditOperations.java | 14 - .../persistence/dao/common/IGenericDao.java | 7 - .../persistence/dao/common/IOperations.java | 20 -- .../persistence/dao/impl/BarAuditableDao.java | 28 -- .../baeldung/persistence/dao/impl/BarDao.java | 19 -- .../persistence/dao/impl/BarJpaDao.java | 19 -- .../persistence/dao/impl/ChildDao.java | 19 -- .../persistence/dao/impl/FooAuditableDao.java | 17 -- .../baeldung/persistence/dao/impl/FooDao.java | 19 -- .../persistence/dao/impl/ParentDao.java | 19 -- .../com/baeldung/persistence/model/Bar.java | 242 ---------------- .../com/baeldung/persistence/model/Child.java | 51 ---- .../com/baeldung/persistence/model/Foo.java | 105 ------- .../baeldung/persistence/model/Parent.java | 60 ---- .../baeldung/persistence/model/Person.java | 31 --- .../service/IBarAuditableService.java | 8 - .../persistence/service/IBarService.java | 8 - .../persistence/service/IChildService.java | 8 - .../service/IFooAuditableService.java | 8 - .../persistence/service/IFooService.java | 8 - .../persistence/service/IParentService.java | 8 - .../AbstractHibernateAuditableService.java | 30 -- .../common/AbstractHibernateService.java | 42 --- .../service/common/AbstractJpaService.java | 42 --- .../service/common/AbstractService.java | 42 --- .../common/AbstractSpringDataJpaService.java | 46 --- .../service/impl/BarAuditableService.java | 41 --- .../service/impl/BarJpaService.java | 30 -- .../persistence/service/impl/BarService.java | 30 -- .../service/impl/BarSpringDataJpaService.java | 26 -- .../service/impl/ChildService.java | 28 -- .../service/impl/FooAuditableService.java | 41 --- .../persistence/service/impl/FooService.java | 30 -- .../service/impl/ParentService.java | 28 -- .../baeldung/spring/PersistenceConfig.java | 186 ------------- .../baeldung/spring/PersistenceXmlConfig.java | 18 -- .../src/main/resources/fetching.cfg.xml | 20 -- .../src/main/resources/fetchingLazy.cfg.xml | 17 -- .../resources/fetching_create_queries.sql | 14 - .../src/main/resources/hibernate4Config.xml | 34 --- .../src/main/resources/immutable.cfg.xml | 38 --- .../src/main/resources/insert_statements.sql | 31 --- .../src/main/resources/logback.xml | 19 -- .../resources/persistence-mysql.properties | 13 - .../src/main/resources/stored_procedure.sql | 20 -- .../src/main/resources/webSecurityConfig.xml | 37 --- .../java/com/baeldung/SpringContextTest.java | 18 -- .../HibernateFetchingIntegrationTest.java | 42 --- .../persistence/IntegrationTestSuite.java | 25 -- .../persistence/audit/AuditTestSuite.java | 14 - .../EnversFooBarAuditIntegrationTest.java | 146 ---------- .../audit/JPABarAuditIntegrationTest.java | 103 ------- .../SpringDataJPABarAuditIntegrationTest.java | 77 ----- .../persistence/hibernate/FooFixtures.java | 101 ------- ...oPaginationPersistenceIntegrationTest.java | 185 ------------- .../FooSortingPersistenceIntegrationTest.java | 174 ------------ .../save/SaveMethodsIntegrationTest.java | 262 ------------------ ...erviceBasicPersistenceIntegrationTest.java | 55 ---- .../FooServicePersistenceIntegrationTest.java | 64 ----- .../service/FooStoredProceduresLiveTest.java | 121 -------- ...rentServicePersistenceIntegrationTest.java | 70 ----- .../spring/config/PersistenceTestConfig.java | 179 ------------ .../src/test/resources/.gitignore | 13 - .../src/test/resources/fetching.cfg.xml | 19 -- .../src/test/resources/fetchingLazy.cfg.xml | 19 -- .../test/resources/persistence-h2.properties | 13 - 88 files changed, 4160 deletions(-) delete mode 100644 persistence-modules/spring-hibernate4/.gitignore delete mode 100644 persistence-modules/spring-hibernate4/README.md delete mode 100644 persistence-modules/spring-hibernate4/pom.xml delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/audit/AuditorAwareImpl.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/criteria/model/Item.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IChildDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IParentDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IOperations.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Bar.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Child.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Foo.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Parent.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Person.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IChildService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IParentService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ChildService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ParentService.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/fetching.cfg.xml delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/fetchingLazy.cfg.xml delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/fetching_create_queries.sql delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/hibernate4Config.xml delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/immutable.cfg.xml delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/insert_statements.sql delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/logback.xml delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/persistence-mysql.properties delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/stored_procedure.sql delete mode 100644 persistence-modules/spring-hibernate4/src/main/resources/webSecurityConfig.xml delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/SpringContextTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java delete mode 100644 persistence-modules/spring-hibernate4/src/test/resources/.gitignore delete mode 100644 persistence-modules/spring-hibernate4/src/test/resources/fetching.cfg.xml delete mode 100644 persistence-modules/spring-hibernate4/src/test/resources/fetchingLazy.cfg.xml delete mode 100644 persistence-modules/spring-hibernate4/src/test/resources/persistence-h2.properties diff --git a/persistence-modules/spring-hibernate4/.gitignore b/persistence-modules/spring-hibernate4/.gitignore deleted file mode 100644 index d31cc4c619..0000000000 --- a/persistence-modules/spring-hibernate4/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear -/target/ -/target/ diff --git a/persistence-modules/spring-hibernate4/README.md b/persistence-modules/spring-hibernate4/README.md deleted file mode 100644 index a5a72a9b7e..0000000000 --- a/persistence-modules/spring-hibernate4/README.md +++ /dev/null @@ -1,24 +0,0 @@ -## Spring with Hibernate 4 - -This module contains articles about Spring with Hibernate 4 - -### Relevant Articles: -- [Guide to Hibernate 4 with Spring](https://www.baeldung.com/hibernate-4-spring) -- [Hibernate Pagination](https://www.baeldung.com/hibernate-pagination) -- [Sorting with Hibernate](https://www.baeldung.com/hibernate-sort) -- [Stored Procedures with Hibernate](https://www.baeldung.com/stored-procedures-with-hibernate-tutorial) -- [Hibernate: save, persist, update, merge, saveOrUpdate](https://www.baeldung.com/hibernate-save-persist-update-merge-saveorupdate) -- [Eager/Lazy Loading In Hibernate](https://www.baeldung.com/hibernate-lazy-eager-loading) -- [Auditing with JPA, Hibernate, and Spring Data JPA](https://www.baeldung.com/database-auditing-jpa) - -### Quick Start - -``` -git clone git://github.com/eugenp/REST.git -cd REST -mvn install -mvn cargo:run -``` - -- **note**: starts on port `8082` - diff --git a/persistence-modules/spring-hibernate4/pom.xml b/persistence-modules/spring-hibernate4/pom.xml deleted file mode 100644 index 3e5a6f913f..0000000000 --- a/persistence-modules/spring-hibernate4/pom.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - 4.0.0 - spring-hibernate4 - 0.1-SNAPSHOT - spring-hibernate4 - - - com.baeldung - parent-spring-4 - 0.0.1-SNAPSHOT - ../../parent-spring-4 - - - - - - - org.springframework - spring-context - ${org.springframework.version} - - - commons-logging - commons-logging - - - - - org.springframework - spring-aspects - ${org.springframework.version} - - - org.springframework.security - spring-security-core - ${org.springframework.security.version} - - - - - - org.springframework - spring-orm - ${org.springframework.version} - - - org.springframework.data - spring-data-jpa - ${org.springframework.data.version} - - - org.hibernate - hibernate-core - ${hibernate.version} - - - org.hibernate - hibernate-envers - ${hibernate-envers.version} - - - javax.transaction - jta - ${jta.version} - - - mysql - mysql-connector-java - ${mysql-connector-java.version} - - - - org.apache.tomcat - tomcat-dbcp - ${tomcat-dbcp.version} - - - - - - org.hibernate - hibernate-validator - ${hibernate-validator.version} - - - javax.el - javax.el-api - ${javax.el-api.version} - - - - - - com.google.guava - guava - ${guava.version} - - - - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - test - - - - org.springframework - spring-test - ${org.springframework.version} - test - - - - org.springframework.security - spring-security-test - ${org.springframework.security.version} - test - - - - org.hsqldb - hsqldb - ${hsqldb.version} - test - - - com.h2database - h2 - ${h2.version} - test - - - - - - - 4.3.4.RELEASE - 4.2.0.RELEASE - 1.10.5.RELEASE - - - 4.3.11.Final - ${hibernate.version} - 5.1.40 - 8.5.8 - 1.1 - 2.3.4 - - - 5.3.3.Final - 2.2.5 - - - 19.0 - - - 2.22.2 - 5.6.2 - 4.13 - - - diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/audit/AuditorAwareImpl.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/audit/AuditorAwareImpl.java deleted file mode 100644 index 7aef08b2ce..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/audit/AuditorAwareImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.hibernate.audit; - -import java.util.Optional; - -import org.springframework.data.domain.AuditorAware; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; - -public class AuditorAwareImpl implements AuditorAware { - - @Override - public String getCurrentAuditor() { - return Optional.ofNullable(SecurityContextHolder.getContext()) - .map(e -> e.getAuthentication()) - .map(Authentication::getName) - .orElse(null); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/criteria/model/Item.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/criteria/model/Item.java deleted file mode 100644 index 957207b7e6..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/criteria/model/Item.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.baeldung.hibernate.criteria.model; - -import java.io.Serializable; - -public class Item implements Serializable { - - private static final long serialVersionUID = 1L; - private Integer itemId; - private String itemName; - private String itemDescription; - private Integer itemPrice; - - // constructors - public Item() { - - } - - public Item(final Integer itemId, final String itemName, final String itemDescription) { - super(); - this.itemId = itemId; - this.itemName = itemName; - this.itemDescription = itemDescription; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((itemId == null) ? 0 : itemId.hashCode()); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final Item other = (Item) obj; - if (itemId == null) { - if (other.itemId != null) - return false; - } else if (!itemId.equals(other.itemId)) - return false; - return true; - } - - public Integer getItemId() { - return itemId; - } - - public void setItemId(final Integer itemId) { - this.itemId = itemId; - } - - public String getItemName() { - return itemName; - } - - public void setItemName(final String itemName) { - this.itemName = itemName; - } - - public String getItemDescription() { - return itemDescription; - } - - public Integer getItemPrice() { - return itemPrice; - } - - public void setItemPrice(final Integer itemPrice) { - this.itemPrice = itemPrice; - } - - public void setItemDescription(final String itemDescription) { - this.itemDescription = itemDescription; - } -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java deleted file mode 100644 index f4a9b8a678..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.baeldung.hibernate.fetching.model; - -import javax.persistence.*; -import java.io.Serializable; -import java.sql.Date; - -@Entity -@Table(name = "USER_ORDER") -public class OrderDetail implements Serializable { - - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue - @Column(name = "ORDER_ID") - private Long orderId; - - public OrderDetail() { - } - - public OrderDetail(Date orderDate, String orderDesc) { - super(); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((orderId == null) ? 0 : orderId.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - OrderDetail other = (OrderDetail) obj; - if (orderId == null) { - if (other.orderId != null) - return false; - } else if (!orderId.equals(other.orderId)) - return false; - - return true; - } - - public Long getOrderId() { - return orderId; - } - - public void setOrderId(Long orderId) { - this.orderId = orderId; - } -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java deleted file mode 100644 index 9fda4c43bb..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.baeldung.hibernate.fetching.model; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.HashSet; -import java.util.Set; - -@Entity -@Table(name = "USER") -public class UserEager implements Serializable { - - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue - @Column(name = "USER_ID") - private Long userId; - - @OneToMany(fetch = FetchType.EAGER) - private Set orderDetail = new HashSet(); - - public UserEager() { - } - - public UserEager(final Long userId) { - super(); - this.userId = userId; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((userId == null) ? 0 : userId.hashCode()); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final UserEager other = (UserEager) obj; - if (userId == null) { - if (other.userId != null) - return false; - } else if (!userId.equals(other.userId)) - return false; - return true; - } - - public Long getUserId() { - return userId; - } - - public void setUserId(final Long userId) { - this.userId = userId; - } - - public Set getOrderDetail() { - return orderDetail; - } - - public void setOrderDetail(Set orderDetail) { - this.orderDetail = orderDetail; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java deleted file mode 100644 index a78eaa4ac0..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.baeldung.hibernate.fetching.model; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.HashSet; -import java.util.Set; - -@Entity -@Table(name = "USER") -public class UserLazy implements Serializable { - - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue - @Column(name = "USER_ID") - private Long userId; - - @OneToMany(fetch = FetchType.LAZY) - private Set orderDetail = new HashSet(); - - public UserLazy() { - } - - public UserLazy(final Long userId) { - super(); - this.userId = userId; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((userId == null) ? 0 : userId.hashCode()); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final UserLazy other = (UserLazy) obj; - if (userId == null) { - if (other.userId != null) - return false; - } else if (!userId.equals(other.userId)) - return false; - return true; - } - - public Long getUserId() { - return userId; - } - - public void setUserId(final Long userId) { - this.userId = userId; - } - - public Set getOrderDetail() { - return orderDetail; - } - - public void setOrderDetail(Set orderDetail) { - this.orderDetail = orderDetail; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java deleted file mode 100644 index c7be96abb7..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.baeldung.hibernate.fetching.util; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.cfg.Configuration; - -public class HibernateUtil { - - @SuppressWarnings("deprecation") - public static Session getHibernateSession(String fetchMethod) { - // two config files are there - // one with lazy loading enabled - // another lazy = false - SessionFactory sf; - if ("lazy".equals(fetchMethod)) { - sf = new Configuration().configure("fetchingLazy.cfg.xml").buildSessionFactory(); - } else { - sf = new Configuration().configure("fetching.cfg.xml").buildSessionFactory(); - } - - // fetching.cfg.xml is used for this example - return sf.openSession(); - } - - public static Session getHibernateSession() { - return new Configuration().configure("fetching.cfg.xml").buildSessionFactory().openSession(); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java deleted file mode 100644 index 35cdd254e3..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.baeldung.hibernate.fetching.view; - -import com.baeldung.hibernate.fetching.model.OrderDetail; -import com.baeldung.hibernate.fetching.model.UserEager; -import com.baeldung.hibernate.fetching.model.UserLazy; -import com.baeldung.hibernate.fetching.util.HibernateUtil; -import org.hibernate.Session; -import org.hibernate.Transaction; - -import java.util.List; -import java.util.Set; - -public class FetchingAppView { - - public FetchingAppView() { - - } - - // lazily loaded - public Set lazyLoaded() { - final Session sessionLazy = HibernateUtil.getHibernateSession("lazy"); - List users = sessionLazy.createQuery("From UserLazy").list(); - UserLazy userLazyLoaded = users.get(0); - // since data is lazyloaded so data won't be initialized - return (userLazyLoaded.getOrderDetail()); - } - - // eagerly loaded - public Set eagerLoaded() { - final Session sessionEager = HibernateUtil.getHibernateSession(); - // data should be loaded in the following line - // also note the queries generated - List user = sessionEager.createQuery("From UserEager").list(); - UserEager userEagerLoaded = user.get(0); - return userEagerLoaded.getOrderDetail(); - } - - // creates test data - // call this method to create the data in the database - public void createTestData() { - - final Session session = HibernateUtil.getHibernateSession("lazy"); - Transaction tx = session.beginTransaction(); - final UserLazy user1 = new UserLazy(); - final UserLazy user2 = new UserLazy(); - final UserLazy user3 = new UserLazy(); - - session.save(user1); - session.save(user2); - session.save(user3); - - final OrderDetail order1 = new OrderDetail(); - final OrderDetail order2 = new OrderDetail(); - final OrderDetail order3 = new OrderDetail(); - final OrderDetail order4 = new OrderDetail(); - final OrderDetail order5 = new OrderDetail(); - - session.saveOrUpdate(order1); - session.saveOrUpdate(order2); - session.saveOrUpdate(order3); - session.saveOrUpdate(order4); - session.saveOrUpdate(order5); - - tx.commit(); - session.close(); - - } -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java deleted file mode 100644 index 182b493592..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.dao.common.IAuditOperations; -import com.baeldung.persistence.model.Bar; - -public interface IBarAuditableDao extends IBarDao, IAuditOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java deleted file mode 100644 index 4d7db64240..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.baeldung.persistence.dao; - -import java.io.Serializable; - -import com.baeldung.persistence.model.Bar; -import org.springframework.data.repository.CrudRepository; - -public interface IBarCrudRepository extends CrudRepository { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarDao.java deleted file mode 100644 index 7896a2a84a..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarDao.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.model.Bar; - -public interface IBarDao extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IChildDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IChildDao.java deleted file mode 100644 index a55a0b0598..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IChildDao.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.model.Child; -import com.baeldung.persistence.dao.common.IOperations; - -public interface IChildDao extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java deleted file mode 100644 index ddbb685988..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.dao.common.IAuditOperations; -import com.baeldung.persistence.model.Foo; - -public interface IFooAuditableDao extends IFooDao, IAuditOperations { - // -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooDao.java deleted file mode 100644 index 0935772dbd..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooDao.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.model.Foo; -import com.baeldung.persistence.dao.common.IOperations; - -public interface IFooDao extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IParentDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IParentDao.java deleted file mode 100644 index 03680158bb..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IParentDao.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.model.Parent; -import com.baeldung.persistence.dao.common.IOperations; - -public interface IParentDao extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java deleted file mode 100644 index 5a6c76a93a..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.persistence.dao.common; - -import java.io.Serializable; - -import com.google.common.base.Preconditions; - -public abstract class AbstractDao implements IOperations { - - protected Class clazz; - - protected final void setClazz(final Class clazzToSet) { - clazz = Preconditions.checkNotNull(clazzToSet); - } -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java deleted file mode 100644 index 41184669ad..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.baeldung.persistence.dao.common; - -import java.io.Serializable; -import java.util.List; - -import org.hibernate.envers.AuditReader; -import org.hibernate.envers.AuditReaderFactory; -import org.hibernate.envers.query.AuditQuery; - -@SuppressWarnings("unchecked") -public class AbstractHibernateAuditableDao extends AbstractHibernateDao implements IAuditOperations { - - @Override - public List getEntitiesAtRevision(final Number revision) { - final AuditReader auditReader = AuditReaderFactory.get(getCurrentSession()); - final AuditQuery query = auditReader.createQuery().forEntitiesAtRevision(clazz, revision); - final List resultList = query.getResultList(); - return resultList; - } - - @Override - public List getEntitiesModifiedAtRevision(final Number revision) { - final AuditReader auditReader = AuditReaderFactory.get(getCurrentSession()); - final AuditQuery query = auditReader.createQuery().forEntitiesModifiedAtRevision(clazz, revision); - final List resultList = query.getResultList(); - return resultList; - } - - @Override - public List getRevisions() { - final AuditReader auditReader = AuditReaderFactory.get(getCurrentSession()); - final AuditQuery query = auditReader.createQuery().forRevisionsOfEntity(clazz, true, true); - final List resultList = query.getResultList(); - return resultList; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java deleted file mode 100644 index f3ade67f80..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.baeldung.persistence.dao.common; - -import java.io.Serializable; -import java.util.List; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.beans.factory.annotation.Autowired; - -import com.google.common.base.Preconditions; - -@SuppressWarnings("unchecked") -public abstract class AbstractHibernateDao extends AbstractDao implements IOperations { - - @Autowired - protected SessionFactory sessionFactory; - - // API - - @Override - public T findOne(final long id) { - return (T) getCurrentSession().get(clazz, id); - } - - @Override - public List findAll() { - return getCurrentSession().createQuery("from " + clazz.getName()).list(); - } - - @Override - public void create(final T entity) { - Preconditions.checkNotNull(entity); - getCurrentSession().saveOrUpdate(entity); - } - - @Override - public T update(final T entity) { - Preconditions.checkNotNull(entity); - return (T) getCurrentSession().merge(entity); - } - - @Override - public void delete(final T entity) { - Preconditions.checkNotNull(entity); - getCurrentSession().delete(entity); - } - - @Override - public void deleteById(final long entityId) { - final T entity = findOne(entityId); - Preconditions.checkState(entity != null); - delete(entity); - } - - protected Session getCurrentSession() { - return sessionFactory.getCurrentSession(); - } - -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java deleted file mode 100644 index 69f8e58c25..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.baeldung.persistence.dao.common; - -import java.io.Serializable; -import java.util.List; - -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Root; - -public class AbstractJpaDao extends AbstractDao implements IOperations { - - @PersistenceContext - private EntityManager em; - - // API - - @Override - public T findOne(final long id) { - return em.find(clazz, Long.valueOf(id).intValue()); - } - - @Override - public List findAll() { - final CriteriaBuilder cb = em.getCriteriaBuilder(); - final CriteriaQuery cq = cb.createQuery(clazz); - final Root rootEntry = cq.from(clazz); - final CriteriaQuery all = cq.select(rootEntry); - final TypedQuery allQuery = em.createQuery(all); - return allQuery.getResultList(); - } - - @Override - public void create(final T entity) { - em.persist(entity); - } - - @Override - public T update(final T entity) { - em.merge(entity); - return entity; - } - - @Override - public void delete(final T entity) { - em.remove(entity); - } - - @Override - public void deleteById(final long entityId) { - delete(findOne(entityId)); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java deleted file mode 100644 index 18b16fa033..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.persistence.dao.common; - -import java.io.Serializable; - -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Repository; - -@Repository -@Scope(BeanDefinition.SCOPE_PROTOTYPE) -public class GenericHibernateDao extends AbstractHibernateDao implements IGenericDao { - // -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java deleted file mode 100644 index 169d3fed72..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.persistence.dao.common; - -import java.io.Serializable; -import java.util.List; - -public interface IAuditOperations { - - List getEntitiesAtRevision(Number revision); - - List getEntitiesModifiedAtRevision(Number revision); - - List getRevisions(); - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java deleted file mode 100644 index 8d8af18394..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.baeldung.persistence.dao.common; - -import java.io.Serializable; - -public interface IGenericDao extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IOperations.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IOperations.java deleted file mode 100644 index 4ef99221ab..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IOperations.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung.persistence.dao.common; - -import java.io.Serializable; -import java.util.List; - -public interface IOperations { - - T findOne(final long id); - - List findAll(); - - void create(final T entity); - - T update(final T entity); - - void delete(final T entity); - - void deleteById(final long entityId); - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java deleted file mode 100644 index e12b6ae2da..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.persistence.dao.impl; - -import java.util.List; - -import com.baeldung.persistence.dao.IBarAuditableDao; -import com.baeldung.persistence.dao.common.AbstractHibernateAuditableDao; -import com.baeldung.persistence.model.Bar; - -public class BarAuditableDao extends AbstractHibernateAuditableDao implements IBarAuditableDao { - - public BarAuditableDao() { - super(); - - setClazz(Bar.class); - } - - // API - - @Override - public List getRevisions() { - final List resultList = super.getRevisions(); - for (final Bar bar : resultList) { - bar.getFooSet().size(); // force FooSet initialization - } - return resultList; - } - -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java deleted file mode 100644 index 0ead802dc5..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.persistence.dao.impl; - -import com.baeldung.persistence.dao.common.AbstractHibernateDao; -import com.baeldung.persistence.dao.IBarDao; -import com.baeldung.persistence.model.Bar; -import org.springframework.stereotype.Repository; - -@Repository -public class BarDao extends AbstractHibernateDao implements IBarDao { - - public BarDao() { - super(); - - setClazz(Bar.class); - } - - // API - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java deleted file mode 100644 index e0fa382d41..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.persistence.dao.impl; - -import com.baeldung.persistence.dao.IBarDao; -import com.baeldung.persistence.dao.common.AbstractJpaDao; -import com.baeldung.persistence.model.Bar; -import org.springframework.stereotype.Repository; - -@Repository -public class BarJpaDao extends AbstractJpaDao implements IBarDao { - - public BarJpaDao() { - super(); - - setClazz(Bar.class); - } - - // API - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java deleted file mode 100644 index b55da6e43a..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.persistence.dao.impl; - -import com.baeldung.persistence.dao.common.AbstractHibernateDao; -import com.baeldung.persistence.model.Child; -import com.baeldung.persistence.dao.IChildDao; -import org.springframework.stereotype.Repository; - -@Repository -public class ChildDao extends AbstractHibernateDao implements IChildDao { - - public ChildDao() { - super(); - - setClazz(Child.class); - } - - // API - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java deleted file mode 100644 index 05064c1478..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.persistence.dao.impl; - -import com.baeldung.persistence.dao.common.AbstractHibernateAuditableDao; -import com.baeldung.persistence.model.Foo; -import com.baeldung.persistence.dao.IFooAuditableDao; - -public class FooAuditableDao extends AbstractHibernateAuditableDao implements IFooAuditableDao { - - public FooAuditableDao() { - super(); - - setClazz(Foo.class); - } - - // API - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java deleted file mode 100644 index 787c449b1d..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.persistence.dao.impl; - -import com.baeldung.persistence.dao.common.AbstractHibernateDao; -import com.baeldung.persistence.dao.IFooDao; -import com.baeldung.persistence.model.Foo; -import org.springframework.stereotype.Repository; - -@Repository -public class FooDao extends AbstractHibernateDao implements IFooDao { - - public FooDao() { - super(); - - setClazz(Foo.class); - } - - // API - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java deleted file mode 100644 index 4602b5f30e..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.persistence.dao.impl; - -import com.baeldung.persistence.dao.IParentDao; -import com.baeldung.persistence.dao.common.AbstractHibernateDao; -import com.baeldung.persistence.model.Parent; -import org.springframework.stereotype.Repository; - -@Repository -public class ParentDao extends AbstractHibernateDao implements IParentDao { - - public ParentDao() { - super(); - - setClazz(Parent.class); - } - - // API - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Bar.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Bar.java deleted file mode 100644 index c7f05254cc..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Bar.java +++ /dev/null @@ -1,242 +0,0 @@ -package com.baeldung.persistence.model; - -import java.io.Serializable; -import java.util.Date; -import java.util.Set; - -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityListeners; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.NamedQuery; -import javax.persistence.OneToMany; -import javax.persistence.PrePersist; -import javax.persistence.PreRemove; -import javax.persistence.PreUpdate; - -import org.hibernate.annotations.OrderBy; -import org.hibernate.envers.Audited; -import org.jboss.logging.Logger; -import org.springframework.data.annotation.CreatedBy; -import org.springframework.data.annotation.CreatedDate; -import org.springframework.data.annotation.LastModifiedBy; -import org.springframework.data.annotation.LastModifiedDate; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import com.google.common.collect.Sets; - -@Entity -@NamedQuery(name = "Bar.findAll", query = "SELECT b FROM Bar b") -@Audited -@EntityListeners(AuditingEntityListener.class) -public class Bar implements Serializable { - - private static Logger logger = Logger.getLogger(Bar.class); - - public enum OPERATION { - INSERT, UPDATE, DELETE; - private String value; - - OPERATION() { - value = toString(); - } - - public String getValue() { - return value; - } - - public static OPERATION parse(final String value) { - OPERATION operation = null; - for (final OPERATION op : OPERATION.values()) { - if (op.getValue().equals(value)) { - operation = op; - break; - } - } - return operation; - } - }; - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name = "id") - private int id; - - @Column(name = "name") - private String name; - - @OneToMany(mappedBy = "bar", cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @OrderBy(clause = "NAME DESC") - // @NotAudited - private Set fooSet = Sets.newHashSet(); - - @Column(name = "operation") - private String operation; - - @Column(name = "timestamp") - private long timestamp; - - @Column(name = "created_date", updatable = false, nullable = false) - @CreatedDate - private long createdDate; - - @Column(name = "modified_date") - @LastModifiedDate - private long modifiedDate; - - @Column(name = "created_by") - @CreatedBy - private String createdBy; - - @Column(name = "modified_by") - @LastModifiedBy - private String modifiedBy; - - public Bar() { - super(); - } - - public Bar(final String name) { - super(); - - this.name = name; - } - - // API - - public Set getFooSet() { - return fooSet; - } - - public void setFooSet(final Set fooSet) { - this.fooSet = fooSet; - } - - public int getId() { - return id; - } - - public void setId(final int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - public OPERATION getOperation() { - return OPERATION.parse(operation); - } - - public void setOperation(final OPERATION operation) { - this.operation = operation.getValue(); - } - - public long getTimestamp() { - return timestamp; - } - - public void setTimestamp(final long timestamp) { - this.timestamp = timestamp; - } - - public long getCreatedDate() { - return createdDate; - } - - public void setCreatedDate(final long createdDate) { - this.createdDate = createdDate; - } - - public long getModifiedDate() { - return modifiedDate; - } - - public void setModifiedDate(final long modifiedDate) { - this.modifiedDate = modifiedDate; - } - - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(final String createdBy) { - this.createdBy = createdBy; - } - - public String getModifiedBy() { - return modifiedBy; - } - - public void setModifiedBy(final String modifiedBy) { - this.modifiedBy = modifiedBy; - } - - public void setOperation(final String operation) { - this.operation = operation; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final Bar other = (Bar) obj; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - return true; - } - - @Override - public String toString() { - final StringBuilder builder = new StringBuilder(); - builder.append("Bar [name=").append(name).append("]"); - return builder.toString(); - } - - @PrePersist - public void onPrePersist() { - logger.info("@PrePersist"); - audit(OPERATION.INSERT); - } - - @PreUpdate - public void onPreUpdate() { - logger.info("@PreUpdate"); - audit(OPERATION.UPDATE); - } - - @PreRemove - public void onPreRemove() { - logger.info("@PreRemove"); - audit(OPERATION.DELETE); - } - - private void audit(final OPERATION operation) { - setOperation(operation); - setTimestamp((new Date()).getTime()); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Child.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Child.java deleted file mode 100644 index 19cfb2e237..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Child.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.baeldung.persistence.model; - -import java.io.Serializable; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.OneToOne; - -@Entity -public class Child implements Serializable { - - @Id - @GeneratedValue - private long id; - - @OneToOne(mappedBy = "child") - private Parent parent; - - public Child() { - super(); - } - - // API - - public long getId() { - return id; - } - - public void setId(final long id) { - this.id = id; - } - - public Parent getParent() { - return parent; - } - - public void setParent(final Parent parent) { - this.parent = parent; - } - - // - - @Override - public String toString() { - final StringBuilder builder = new StringBuilder(); - builder.append("Child [id=").append(id).append("]"); - return builder.toString(); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Foo.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Foo.java deleted file mode 100644 index d36a1e58cf..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Foo.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.baeldung.persistence.model; - -import java.io.Serializable; - -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.NamedNativeQueries; -import javax.persistence.NamedNativeQuery; - -import org.hibernate.envers.Audited; - -@NamedNativeQueries({ @NamedNativeQuery(name = "callGetAllFoos", query = "CALL GetAllFoos()", resultClass = Foo.class), @NamedNativeQuery(name = "callGetFoosByName", query = "CALL GetFoosByName(:fooName)", resultClass = Foo.class) }) -@Entity -@Audited -// @Proxy(lazy = false) -public class Foo implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name = "id") - private long id; - - @Column(name = "name") - private String name; - - @ManyToOne(targetEntity = Bar.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "BAR_ID") - private Bar bar = new Bar(); - - public Foo() { - super(); - } - - public Foo(final String name) { - super(); - this.name = name; - } - - // - - public Bar getBar() { - return bar; - } - - public void setBar(final Bar bar) { - this.bar = bar; - } - - public long getId() { - return id; - } - - public void setId(final long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - // - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final Foo other = (Foo) obj; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - return true; - } - - @Override - public String toString() { - final StringBuilder builder = new StringBuilder(); - builder.append("Foo [name=").append(name).append("]"); - return builder.toString(); - } -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Parent.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Parent.java deleted file mode 100644 index fa6948990b..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Parent.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.baeldung.persistence.model; - -import java.io.Serializable; - -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToOne; - -@Entity -public class Parent implements Serializable { - - @Id - @GeneratedValue - private long id; - - @OneToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.DETACH }) - @JoinColumn(name = "child_fk") - private Child child; - - public Parent() { - super(); - } - - public Parent(final Child child) { - super(); - - this.child = child; - } - - // API - - public long getId() { - return id; - } - - public void setId(final long id) { - this.id = id; - } - - public Child getChild() { - return child; - } - - public void setChild(final Child child) { - this.child = child; - } - - // - - @Override - public String toString() { - final StringBuilder builder = new StringBuilder(); - builder.append("Parent [id=").append(id).append("]"); - return builder.toString(); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Person.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Person.java deleted file mode 100644 index 6a95a7acf5..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Person.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.baeldung.persistence.model; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; - -@Entity -public class Person { - - @Id - @GeneratedValue - private Long id; - - private String name; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java deleted file mode 100644 index 33e5634d12..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.service; - -import com.baeldung.persistence.dao.common.IAuditOperations; -import com.baeldung.persistence.model.Bar; - -public interface IBarAuditableService extends IBarService, IAuditOperations { - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarService.java deleted file mode 100644 index 21185b5990..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.service; - -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.model.Bar; - -public interface IBarService extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IChildService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IChildService.java deleted file mode 100644 index afe67a70c2..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IChildService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.service; - -import com.baeldung.persistence.model.Child; -import com.baeldung.persistence.dao.common.IOperations; - -public interface IChildService extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java deleted file mode 100644 index b787e7fe91..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.service; - -import com.baeldung.persistence.dao.common.IAuditOperations; -import com.baeldung.persistence.model.Foo; - -public interface IFooAuditableService extends IFooService, IAuditOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooService.java deleted file mode 100644 index ffdb53964a..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.service; - -import com.baeldung.persistence.model.Foo; -import com.baeldung.persistence.dao.common.IOperations; - -public interface IFooService extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IParentService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IParentService.java deleted file mode 100644 index f941416aac..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IParentService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.persistence.service; - -import com.baeldung.persistence.model.Parent; -import com.baeldung.persistence.dao.common.IOperations; - -public interface IParentService extends IOperations { - // -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java deleted file mode 100644 index 2695d7760a..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.persistence.service.common; - -import java.io.Serializable; -import java.util.List; - -import com.baeldung.persistence.dao.common.IAuditOperations; -import com.baeldung.persistence.dao.common.IOperations; -import org.springframework.transaction.annotation.Transactional; - -@Transactional(value = "hibernateTransactionManager") -public abstract class AbstractHibernateAuditableService extends AbstractHibernateService implements IOperations, IAuditOperations { - - @Override - public List getEntitiesAtRevision(final Number revision) { - return getAuditableDao().getEntitiesAtRevision(revision); - } - - @Override - public List getEntitiesModifiedAtRevision(final Number revision) { - return getAuditableDao().getEntitiesModifiedAtRevision(revision); - } - - @Override - public List getRevisions() { - return getAuditableDao().getRevisions(); - } - - abstract protected IAuditOperations getAuditableDao(); - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java deleted file mode 100644 index 02b8ccf48b..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.baeldung.persistence.service.common; - -import java.io.Serializable; -import java.util.List; - -import com.baeldung.persistence.dao.common.IOperations; -import org.springframework.transaction.annotation.Transactional; - -@Transactional(value = "hibernateTransactionManager") -public abstract class AbstractHibernateService extends AbstractService implements IOperations { - - @Override - public T findOne(final long id) { - return super.findOne(id); - } - - @Override - public List findAll() { - return super.findAll(); - } - - @Override - public void create(final T entity) { - super.create(entity); - } - - @Override - public T update(final T entity) { - return super.update(entity); - } - - @Override - public void delete(final T entity) { - super.delete(entity); - } - - @Override - public void deleteById(final long entityId) { - super.deleteById(entityId); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java deleted file mode 100644 index a1c6fe9edf..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.baeldung.persistence.service.common; - -import java.io.Serializable; -import java.util.List; - -import com.baeldung.persistence.dao.common.IOperations; -import org.springframework.transaction.annotation.Transactional; - -@Transactional(value = "jpaTransactionManager") -public abstract class AbstractJpaService extends AbstractService implements IOperations { - - @Override - public T findOne(final long id) { - return super.findOne(id); - } - - @Override - public List findAll() { - return super.findAll(); - } - - @Override - public void create(final T entity) { - super.create(entity); - } - - @Override - public T update(final T entity) { - return super.update(entity); - } - - @Override - public void delete(final T entity) { - super.delete(entity); - } - - @Override - public void deleteById(final long entityId) { - super.deleteById(entityId); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractService.java deleted file mode 100644 index 9b001b1fac..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.baeldung.persistence.service.common; - -import java.io.Serializable; -import java.util.List; - -import com.baeldung.persistence.dao.common.IOperations; - -public abstract class AbstractService implements IOperations { - - @Override - public T findOne(final long id) { - return getDao().findOne(id); - } - - @Override - public List findAll() { - return getDao().findAll(); - } - - @Override - public void create(final T entity) { - getDao().create(entity); - } - - @Override - public T update(final T entity) { - return getDao().update(entity); - } - - @Override - public void delete(final T entity) { - getDao().delete(entity); - } - - @Override - public void deleteById(final long entityId) { - getDao().deleteById(entityId); - } - - protected abstract IOperations getDao(); - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java deleted file mode 100644 index cef483e6bf..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.baeldung.persistence.service.common; - -import java.io.Serializable; -import java.util.List; - -import com.baeldung.persistence.dao.common.IOperations; -import org.springframework.data.repository.CrudRepository; -import org.springframework.transaction.annotation.Transactional; - -import com.google.common.collect.Lists; - -@Transactional(value = "jpaTransactionManager") -public abstract class AbstractSpringDataJpaService implements IOperations { - - @Override - public T findOne(final long id) { - return getDao().findOne(Long.valueOf(id)); - } - - @Override - public List findAll() { - return Lists.newArrayList(getDao().findAll()); - } - - @Override - public void create(final T entity) { - getDao().save(entity); - } - - @Override - public T update(final T entity) { - return getDao().save(entity); - } - - @Override - public void delete(final T entity) { - getDao().delete(entity); - } - - @Override - public void deleteById(final long entityId) { - getDao().delete(Long.valueOf(entityId)); - } - - protected abstract CrudRepository getDao(); -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java deleted file mode 100644 index d84c28caa5..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.baeldung.persistence.service.impl; - -import com.baeldung.persistence.dao.common.IAuditOperations; -import com.baeldung.persistence.service.common.AbstractHibernateAuditableService; -import com.baeldung.persistence.dao.IBarAuditableDao; -import com.baeldung.persistence.dao.IBarDao; -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.model.Bar; -import com.baeldung.persistence.service.IBarAuditableService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -@Service -public class BarAuditableService extends AbstractHibernateAuditableService implements IBarAuditableService { - - @Autowired - @Qualifier("barHibernateDao") - private IBarDao dao; - - @Autowired - @Qualifier("barHibernateAuditableDao") - private IBarAuditableDao auditDao; - - public BarAuditableService() { - super(); - } - - // API - - @Override - protected IOperations getDao() { - return dao; - } - - @Override - protected IAuditOperations getAuditableDao() { - return auditDao; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java deleted file mode 100644 index 1c1b7a2274..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.persistence.service.impl; - -import com.baeldung.persistence.dao.IBarDao; -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.model.Bar; -import com.baeldung.persistence.service.IBarService; -import com.baeldung.persistence.service.common.AbstractJpaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -@Service -public class BarJpaService extends AbstractJpaService implements IBarService { - - @Autowired - @Qualifier("barJpaDao") - private IBarDao dao; - - public BarJpaService() { - super(); - } - - // API - - @Override - protected IOperations getDao() { - return dao; - } - -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarService.java deleted file mode 100644 index 32d1f919c5..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.persistence.service.impl; - -import com.baeldung.persistence.dao.IBarDao; -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.model.Bar; -import com.baeldung.persistence.service.IBarService; -import com.baeldung.persistence.service.common.AbstractHibernateService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -@Service -public class BarService extends AbstractHibernateService implements IBarService { - - @Autowired - @Qualifier("barHibernateDao") - private IBarDao dao; - - public BarService() { - super(); - } - - // API - - @Override - protected IOperations getDao() { - return dao; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java deleted file mode 100644 index 4a55d08a35..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.baeldung.persistence.service.impl; - -import java.io.Serializable; - -import com.baeldung.persistence.service.common.AbstractSpringDataJpaService; -import com.baeldung.persistence.dao.IBarCrudRepository; -import com.baeldung.persistence.model.Bar; -import com.baeldung.persistence.service.IBarService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.repository.CrudRepository; - -public class BarSpringDataJpaService extends AbstractSpringDataJpaService implements IBarService { - - @Autowired - private IBarCrudRepository dao; - - public BarSpringDataJpaService() { - super(); - } - - @Override - protected CrudRepository getDao() { - return dao; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ChildService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ChildService.java deleted file mode 100644 index 417fe2c49a..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ChildService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.persistence.service.impl; - -import com.baeldung.persistence.model.Child; -import com.baeldung.persistence.service.IChildService; -import com.baeldung.persistence.dao.IChildDao; -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.service.common.AbstractHibernateService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ChildService extends AbstractHibernateService implements IChildService { - - @Autowired - private IChildDao dao; - - public ChildService() { - super(); - } - - // API - - @Override - protected IOperations getDao() { - return dao; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java deleted file mode 100644 index 45ad315c42..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.baeldung.persistence.service.impl; - -import com.baeldung.persistence.dao.common.IAuditOperations; -import com.baeldung.persistence.service.IFooAuditableService; -import com.baeldung.persistence.service.common.AbstractHibernateAuditableService; -import com.baeldung.persistence.dao.IFooAuditableDao; -import com.baeldung.persistence.dao.IFooDao; -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.model.Foo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -@Service -public class FooAuditableService extends AbstractHibernateAuditableService implements IFooAuditableService { - - @Autowired - @Qualifier("fooHibernateDao") - private IFooDao dao; - - @Autowired - @Qualifier("fooHibernateAuditableDao") - private IFooAuditableDao auditDao; - - public FooAuditableService() { - super(); - } - - // API - - @Override - protected IOperations getDao() { - return dao; - } - - @Override - protected IAuditOperations getAuditableDao() { - return auditDao; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooService.java deleted file mode 100644 index 84cf018fee..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.persistence.service.impl; - -import com.baeldung.persistence.dao.IFooDao; -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.model.Foo; -import com.baeldung.persistence.service.IFooService; -import com.baeldung.persistence.service.common.AbstractHibernateService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -@Service -public class FooService extends AbstractHibernateService implements IFooService { - - @Autowired - @Qualifier("fooHibernateDao") - private IFooDao dao; - - public FooService() { - super(); - } - - // API - - @Override - protected IOperations getDao() { - return dao; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ParentService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ParentService.java deleted file mode 100644 index 078acfc369..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ParentService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.persistence.service.impl; - -import com.baeldung.persistence.model.Parent; -import com.baeldung.persistence.service.IParentService; -import com.baeldung.persistence.dao.IParentDao; -import com.baeldung.persistence.dao.common.IOperations; -import com.baeldung.persistence.service.common.AbstractHibernateService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ParentService extends AbstractHibernateService implements IParentService { - - @Autowired - private IParentDao dao; - - public ParentService() { - super(); - } - - // API - - @Override - protected IOperations getDao() { - return dao; - } - -} diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java deleted file mode 100644 index 4927c9957c..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.baeldung.spring; - -import java.util.Properties; - -import javax.sql.DataSource; - -import org.apache.tomcat.dbcp.dbcp2.BasicDataSource; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.core.env.Environment; -import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; -import org.springframework.data.domain.AuditorAware; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.orm.hibernate4.HibernateTransactionManager; -import org.springframework.orm.hibernate4.LocalSessionFactoryBean; -import org.springframework.orm.jpa.JpaTransactionManager; -import org.springframework.orm.jpa.JpaVendorAdapter; -import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; -import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; -import org.springframework.transaction.PlatformTransactionManager; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -import com.baeldung.hibernate.audit.AuditorAwareImpl; -import com.baeldung.persistence.dao.IBarAuditableDao; -import com.baeldung.persistence.dao.IBarDao; -import com.baeldung.persistence.dao.IFooAuditableDao; -import com.baeldung.persistence.dao.IFooDao; -import com.baeldung.persistence.dao.impl.BarAuditableDao; -import com.baeldung.persistence.dao.impl.BarDao; -import com.baeldung.persistence.dao.impl.BarJpaDao; -import com.baeldung.persistence.dao.impl.FooAuditableDao; -import com.baeldung.persistence.dao.impl.FooDao; -import com.baeldung.persistence.service.IBarAuditableService; -import com.baeldung.persistence.service.IBarService; -import com.baeldung.persistence.service.IFooAuditableService; -import com.baeldung.persistence.service.IFooService; -import com.baeldung.persistence.service.impl.BarAuditableService; -import com.baeldung.persistence.service.impl.BarJpaService; -import com.baeldung.persistence.service.impl.BarSpringDataJpaService; -import com.baeldung.persistence.service.impl.FooAuditableService; -import com.baeldung.persistence.service.impl.FooService; -import com.google.common.base.Preconditions; - -@Configuration -@EnableTransactionManagement -@EnableJpaRepositories(basePackages = { "com.baeldung.persistence" }, transactionManagerRef = "jpaTransactionManager") -@EnableJpaAuditing(auditorAwareRef = "auditorProvider") -@PropertySource({ "classpath:persistence-h2.properties" }) -@ComponentScan({ "com.baeldung.persistence" }) -public class PersistenceConfig { - - @Autowired - private Environment env; - - public PersistenceConfig() { - super(); - } - - @Bean("auditorProvider") - public AuditorAware auditorProvider() { - return new AuditorAwareImpl(); - } - - @Bean - public LocalSessionFactoryBean sessionFactory() { - final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); - sessionFactory.setDataSource(restDataSource()); - sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); - sessionFactory.setHibernateProperties(hibernateProperties()); - - return sessionFactory; - } - - @Bean - public LocalContainerEntityManagerFactoryBean entityManagerFactory() { - final LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean(); - emf.setDataSource(restDataSource()); - emf.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); - - final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); - emf.setJpaVendorAdapter(vendorAdapter); - emf.setJpaProperties(hibernateProperties()); - - return emf; - } - - @Bean - public DataSource restDataSource() { - final BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName"))); - dataSource.setUrl(Preconditions.checkNotNull(env.getProperty("jdbc.url"))); - dataSource.setUsername(Preconditions.checkNotNull(env.getProperty("jdbc.user"))); - dataSource.setPassword(Preconditions.checkNotNull(env.getProperty("jdbc.pass"))); - - return dataSource; - } - - @Bean - public PlatformTransactionManager hibernateTransactionManager() { - final HibernateTransactionManager transactionManager = new HibernateTransactionManager(); - transactionManager.setSessionFactory(sessionFactory().getObject()); - return transactionManager; - } - - @Bean - public PlatformTransactionManager jpaTransactionManager() { - final JpaTransactionManager transactionManager = new JpaTransactionManager(); - transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); - return transactionManager; - } - - @Bean - public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { - return new PersistenceExceptionTranslationPostProcessor(); - } - - @Bean - public IBarService barJpaService() { - return new BarJpaService(); - } - - @Bean - public IBarService barSpringDataJpaService() { - return new BarSpringDataJpaService(); - } - - @Bean - public IFooService fooHibernateService() { - return new FooService(); - } - - @Bean - public IBarAuditableService barHibernateAuditableService() { - return new BarAuditableService(); - } - - @Bean - public IFooAuditableService fooHibernateAuditableService() { - return new FooAuditableService(); - } - - @Bean - public IBarDao barJpaDao() { - return new BarJpaDao(); - } - - @Bean - public IBarDao barHibernateDao() { - return new BarDao(); - } - - @Bean - public IBarAuditableDao barHibernateAuditableDao() { - return new BarAuditableDao(); - } - - @Bean - public IFooDao fooHibernateDao() { - return new FooDao(); - } - - @Bean - public IFooAuditableDao fooHibernateAuditableDao() { - return new FooAuditableDao(); - } - - private final Properties hibernateProperties() { - final Properties hibernateProperties = new Properties(); - hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); - hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); - - hibernateProperties.setProperty("hibernate.show_sql", "true"); - // hibernateProperties.setProperty("hibernate.format_sql", "true"); - // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); - - // Envers properties - hibernateProperties.setProperty("org.hibernate.envers.audit_table_suffix", env.getProperty("envers.audit_table_suffix")); - - return hibernateProperties; - } - -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java deleted file mode 100644 index 9cbeb8e1f8..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.spring; - -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.ImportResource; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -@Configuration -@EnableTransactionManagement -@ComponentScan({ "com.baeldung.persistence.dao", "com.baeldung.persistence.service" }) -@ImportResource({ "classpath:hibernate4Config.xml" }) -public class PersistenceXmlConfig { - - public PersistenceXmlConfig() { - super(); - } - -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/resources/fetching.cfg.xml b/persistence-modules/spring-hibernate4/src/main/resources/fetching.cfg.xml deleted file mode 100644 index 1b9a4a191c..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/fetching.cfg.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - com.mysql.jdbc.Driver - jdbc:mysql://localhost:3306/test - root - iamtheking - org.hibernate.dialect.MySQLDialect - true - validate - - - - - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/resources/fetchingLazy.cfg.xml b/persistence-modules/spring-hibernate4/src/main/resources/fetchingLazy.cfg.xml deleted file mode 100644 index c5f608e1a7..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/fetchingLazy.cfg.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - com.mysql.jdbc.Driver - jdbc:mysql://localhost:3306/test - root - iamtheking - org.hibernate.dialect.MySQLDialect - true - - - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/resources/fetching_create_queries.sql b/persistence-modules/spring-hibernate4/src/main/resources/fetching_create_queries.sql deleted file mode 100644 index b36d9828f1..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/fetching_create_queries.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE `user` ( - `user_id` int(10) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 ; - - -CREATE TABLE `user_order` ( - `ORDER_ID` int(10) NOT NULL AUTO_INCREMENT, - `USER_ID` int(10) NOT NULL DEFAULT '0', - PRIMARY KEY (`ORDER_ID`,`USER_ID`), - KEY `USER_ID` (`USER_ID`), - CONSTRAINT `user_order_ibfk_1` FOREIGN KEY (`USER_ID`) REFERENCES `USER` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; - diff --git a/persistence-modules/spring-hibernate4/src/main/resources/hibernate4Config.xml b/persistence-modules/spring-hibernate4/src/main/resources/hibernate4Config.xml deleted file mode 100644 index ca507802cd..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/hibernate4Config.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - ${hibernate.hbm2ddl.auto} - ${hibernate.dialect} - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/resources/immutable.cfg.xml b/persistence-modules/spring-hibernate4/src/main/resources/immutable.cfg.xml deleted file mode 100644 index fe1e3cb723..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/immutable.cfg.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - org.hsqldb.jdbcDriver - jdbc:hsqldb:hsql:mem://localhost/xdb - sa - - - - 1 - - - org.hibernate.dialect.HSQLDialect - - - thread - - - org.hibernate.cache.NoCacheProvider - - - true - - - update - - - - - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/resources/insert_statements.sql b/persistence-modules/spring-hibernate4/src/main/resources/insert_statements.sql deleted file mode 100644 index ae008f29bc..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/insert_statements.sql +++ /dev/null @@ -1,31 +0,0 @@ -insert into item (item_id, item_name, item_desc, item_price) -values(1,'item One', 'test 1', 35.12); - -insert into item (item_id, item_name, item_desc, item_price) -values(2,'Pogo stick', 'Pogo stick', 466.12); -insert into item (item_id, item_name, item_desc, item_price) -values(3,'Raft', 'Raft', 345.12); - -insert into item (item_id, item_name, item_desc, item_price) -values(4,'Skate Board', 'Skating', 135.71); - -insert into item (item_id, item_name, item_desc, item_price) -values(5,'Umbrella', 'Umbrella for Rain', 619.25); - -insert into item (item_id, item_name, item_desc, item_price) -values(6,'Glue', 'Glue for home', 432.73); - -insert into item (item_id, item_name, item_desc, item_price) -values(7,'Paint', 'Paint for Room', 1311.40); - -insert into item (item_id, item_name, item_desc, item_price) -values(8,'Red paint', 'Red paint for room', 1135.71); - -insert into item (item_id, item_name, item_desc, item_price) -values(9,'Household Chairs', 'Chairs for house', 25.71); - -insert into item (item_id, item_name, item_desc, item_price) -values(10,'Office Chairs', 'Chairs for office', 395.98); - -insert into item (item_id, item_name, item_desc, item_price) -values(11,'Outdoor Chairs', 'Chairs for outdoor activities', 1234.36); diff --git a/persistence-modules/spring-hibernate4/src/main/resources/logback.xml b/persistence-modules/spring-hibernate4/src/main/resources/logback.xml deleted file mode 100644 index 56af2d397e..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/logback.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/resources/persistence-mysql.properties b/persistence-modules/spring-hibernate4/src/main/resources/persistence-mysql.properties deleted file mode 100644 index f6b6ab6fca..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/persistence-mysql.properties +++ /dev/null @@ -1,13 +0,0 @@ -# jdbc.X -jdbc.driverClassName=com.mysql.jdbc.Driver -jdbc.url=jdbc:mysql://localhost:3306/spring_hibernate4_01?createDatabaseIfNotExist=true -jdbc.user=tutorialuser -jdbc.pass=tutorialmy5ql - -# hibernate.X -hibernate.dialect=org.hibernate.dialect.MySQL5Dialect -hibernate.show_sql=false -hibernate.hbm2ddl.auto=create-drop - -# envers.X -envers.audit_table_suffix=_audit_log diff --git a/persistence-modules/spring-hibernate4/src/main/resources/stored_procedure.sql b/persistence-modules/spring-hibernate4/src/main/resources/stored_procedure.sql deleted file mode 100644 index 9cedb75c37..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/stored_procedure.sql +++ /dev/null @@ -1,20 +0,0 @@ -DELIMITER // - CREATE PROCEDURE GetFoosByName(IN fooName VARCHAR(255)) - LANGUAGE SQL - DETERMINISTIC - SQL SECURITY DEFINER - BEGIN - SELECT * FROM foo WHERE name = fooName; - END // -DELIMITER ; - - -DELIMITER // - CREATE PROCEDURE GetAllFoos() - LANGUAGE SQL - DETERMINISTIC - SQL SECURITY DEFINER - BEGIN - SELECT * FROM foo; - END // -DELIMITER ; \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/main/resources/webSecurityConfig.xml b/persistence-modules/spring-hibernate4/src/main/resources/webSecurityConfig.xml deleted file mode 100644 index e5c19a4ad7..0000000000 --- a/persistence-modules/spring-hibernate4/src/main/resources/webSecurityConfig.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/SpringContextTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/SpringContextTest.java deleted file mode 100644 index e19965773e..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/SpringContextTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.spring.PersistenceConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java deleted file mode 100644 index 65bf36f8bf..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.baeldung.hibernate.fetching; - -import com.baeldung.hibernate.fetching.model.OrderDetail; -import com.baeldung.hibernate.fetching.view.FetchingAppView; -import org.hibernate.Hibernate; -import org.junit.Before; -import org.junit.Test; - -import java.util.Set; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class HibernateFetchingIntegrationTest { - - // this loads sample data in the database - @Before - public void addFecthingTestData() { - FetchingAppView fav = new FetchingAppView(); - fav.createTestData(); - } - - // testLazyFetching() tests the lazy loading - // Since it lazily loaded so orderDetalSetLazy won't - // be initialized - @Test - public void testLazyFetching() { - FetchingAppView fav = new FetchingAppView(); - Set orderDetalSetLazy = fav.lazyLoaded(); - assertFalse(Hibernate.isInitialized(orderDetalSetLazy)); - } - - // testEagerFetching() tests the eager loading - // Since it eagerly loaded so orderDetalSetLazy would - // be initialized - @Test - public void testEagerFetching() { - FetchingAppView fav = new FetchingAppView(); - Set orderDetalSetEager = fav.eagerLoaded(); - assertTrue(Hibernate.isInitialized(orderDetalSetEager)); - } -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java deleted file mode 100644 index f5c45a5d6f..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.persistence; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -import com.baeldung.persistence.audit.AuditTestSuite; -import com.baeldung.persistence.hibernate.FooPaginationPersistenceIntegrationTest; -import com.baeldung.persistence.hibernate.FooSortingPersistenceIntegrationTest; -import com.baeldung.persistence.service.FooServiceBasicPersistenceIntegrationTest; -import com.baeldung.persistence.service.FooServicePersistenceIntegrationTest; -import com.baeldung.persistence.service.ParentServicePersistenceIntegrationTest; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ // @formatter:off - AuditTestSuite.class - ,FooServiceBasicPersistenceIntegrationTest.class - ,FooPaginationPersistenceIntegrationTest.class - ,FooServicePersistenceIntegrationTest.class - ,ParentServicePersistenceIntegrationTest.class - ,FooSortingPersistenceIntegrationTest.class - -}) // @formatter:on -public class IntegrationTestSuite { - // -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java deleted file mode 100644 index 34c725d62b..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.persistence.audit; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ // @formatter:off - EnversFooBarAuditIntegrationTest.class, - JPABarAuditIntegrationTest.class, - SpringDataJPABarAuditIntegrationTest.class -}) // @formatter:on -public class AuditTestSuite { - // -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java deleted file mode 100644 index 444324dafc..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.baeldung.persistence.audit; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.List; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Bar; -import com.baeldung.persistence.model.Foo; -import com.baeldung.persistence.service.IBarAuditableService; -import com.baeldung.persistence.service.IFooAuditableService; -import com.baeldung.spring.config.PersistenceTestConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) -@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS) -public class EnversFooBarAuditIntegrationTest { - - private static Logger logger = LoggerFactory.getLogger(EnversFooBarAuditIntegrationTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - logger.info("setUpBeforeClass()"); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - logger.info("tearDownAfterClass()"); - } - - @Autowired - @Qualifier("fooHibernateAuditableService") - private IFooAuditableService fooService; - - @Autowired - @Qualifier("barHibernateAuditableService") - private IBarAuditableService barService; - - @Autowired - private SessionFactory sessionFactory; - - private Session session; - - @Before - public void setUp() throws Exception { - logger.info("setUp()"); - makeRevisions(); - session = sessionFactory.openSession(); - } - - @After - public void tearDown() throws Exception { - logger.info("tearDown()"); - session.close(); - } - - private void makeRevisions() { - final Bar bar = rev1(); - rev2(bar); - rev3(bar); - rev4(bar); - } - - // REV #1: insert BAR & FOO1 - private Bar rev1() { - final Bar bar = new Bar("BAR"); - final Foo foo1 = new Foo("FOO1"); - foo1.setBar(bar); - fooService.create(foo1); - return bar; - } - - // REV #2: insert FOO2 & update BAR - private void rev2(final Bar bar) { - final Foo foo2 = new Foo("FOO2"); - foo2.setBar(bar); - fooService.create(foo2); - } - - // REV #3: update BAR - private void rev3(final Bar bar) { - - bar.setName("BAR1"); - barService.update(bar); - } - - // REV #4: insert FOO3 & update BAR - private void rev4(final Bar bar) { - - final Foo foo3 = new Foo("FOO3"); - foo3.setBar(bar); - fooService.create(foo3); - } - - @Test - public final void whenFooBarsModified_thenFooBarsAudited() { - - List barRevisionList; - List fooRevisionList; - - // test Bar revisions - - barRevisionList = barService.getRevisions(); - - assertNotNull(barRevisionList); - assertEquals(4, barRevisionList.size()); - - assertEquals("BAR", barRevisionList.get(0).getName()); - assertEquals("BAR", barRevisionList.get(1).getName()); - assertEquals("BAR1", barRevisionList.get(2).getName()); - assertEquals("BAR1", barRevisionList.get(3).getName()); - - assertEquals(1, barRevisionList.get(0).getFooSet().size()); - assertEquals(2, barRevisionList.get(1).getFooSet().size()); - assertEquals(2, barRevisionList.get(2).getFooSet().size()); - assertEquals(3, barRevisionList.get(3).getFooSet().size()); - - // test Foo revisions - - fooRevisionList = fooService.getRevisions(); - assertNotNull(fooRevisionList); - assertEquals(3, fooRevisionList.size()); - assertEquals("FOO1", fooRevisionList.get(0).getName()); - assertEquals("FOO2", fooRevisionList.get(1).getName()); - assertEquals("FOO3", fooRevisionList.get(2).getName()); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java deleted file mode 100644 index 733074a6a3..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.baeldung.persistence.audit; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Bar; -import com.baeldung.persistence.model.Bar.OPERATION; -import com.baeldung.persistence.service.IBarService; -import com.baeldung.spring.config.PersistenceTestConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) -public class JPABarAuditIntegrationTest { - - private static Logger logger = LoggerFactory.getLogger(JPABarAuditIntegrationTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - logger.info("setUpBeforeClass()"); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - logger.info("tearDownAfterClass()"); - } - - @Autowired - @Qualifier("barJpaService") - private IBarService barService; - - @Autowired - private EntityManagerFactory entityManagerFactory; - - private EntityManager em; - - @Before - public void setUp() throws Exception { - logger.info("setUp()"); - em = entityManagerFactory.createEntityManager(); - } - - @After - public void tearDown() throws Exception { - logger.info("tearDown()"); - em.close(); - } - - @Test - public final void whenBarsModified_thenBarsAudited() { - - // insert BAR1 - Bar bar1 = new Bar("BAR1"); - barService.create(bar1); - - // update BAR1 - bar1.setName("BAR1a"); - barService.update(bar1); - - // insert BAR2 - Bar bar2 = new Bar("BAR2"); - barService.create(bar2); - - // update BAR1 - bar1.setName("BAR1b"); - barService.update(bar1); - - // get BAR1 and BAR2 from the DB and check the audit values - // detach instances from persistence context to make sure we fire db - em.detach(bar1); - em.detach(bar2); - bar1 = barService.findOne(bar1.getId()); - bar2 = barService.findOne(bar2.getId()); - - assertNotNull(bar1); - assertNotNull(bar2); - assertEquals(OPERATION.UPDATE, bar1.getOperation()); - assertEquals(OPERATION.INSERT, bar2.getOperation()); - assertTrue(bar1.getTimestamp() > bar2.getTimestamp()); - - barService.deleteById(bar1.getId()); - barService.deleteById(bar2.getId()); - - } - -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java deleted file mode 100644 index 18227abd28..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.baeldung.persistence.audit; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Bar; -import com.baeldung.persistence.service.IBarService; -import com.baeldung.spring.config.PersistenceTestConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) -public class SpringDataJPABarAuditIntegrationTest { - - private static Logger logger = LoggerFactory.getLogger(SpringDataJPABarAuditIntegrationTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - logger.info("setUpBeforeClass()"); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - logger.info("tearDownAfterClass()"); - } - - @Autowired - @Qualifier("barSpringDataJpaService") - private IBarService barService; - - @Autowired - private EntityManagerFactory entityManagerFactory; - - private EntityManager em; - - @Before - public void setUp() throws Exception { - logger.info("setUp()"); - em = entityManagerFactory.createEntityManager(); - } - - @After - public void tearDown() throws Exception { - logger.info("tearDown()"); - em.close(); - } - - @Test - @WithMockUser(username = "tutorialuser") - public final void whenBarsModified_thenBarsAudited() { - Bar bar = new Bar("BAR1"); - barService.create(bar); - assertEquals(bar.getCreatedDate(), bar.getModifiedDate()); - assertEquals("tutorialuser", bar.getCreatedBy(), bar.getModifiedBy()); - bar.setName("BAR2"); - bar = barService.update(bar); - assertTrue(bar.getCreatedDate() < bar.getModifiedDate()); - assertEquals("tutorialuser", bar.getCreatedBy(), bar.getModifiedBy()); - } -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java deleted file mode 100644 index da840dc027..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.baeldung.persistence.hibernate; - -import java.util.List; - -import com.baeldung.persistence.model.Foo; -import com.baeldung.persistence.model.Bar; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; - -import com.google.common.collect.Lists; - -public class FooFixtures { - private SessionFactory sessionFactory; - - public FooFixtures(final SessionFactory sessionFactory) { - super(); - - this.sessionFactory = sessionFactory; - } - - // API - - public void createBars() { - Session session = null; - Transaction tx = null; - session = sessionFactory.openSession(); - tx = session.getTransaction(); - try { - tx.begin(); - for (int i = 156; i < 160; i++) { - final Bar bar = new Bar(); - bar.setName("Bar_" + i); - final Foo foo = new Foo("Foo_" + (i + 120)); - foo.setBar(bar); - session.save(foo); - final Foo foo2 = new Foo(null); - if (i % 2 == 0) - foo2.setName("LuckyFoo" + (i + 120)); - foo2.setBar(bar); - session.save(foo2); - bar.getFooSet().add(foo); - bar.getFooSet().add(foo2); - session.merge(bar); - } - tx.commit(); - session.flush(); - } catch (final HibernateException he) { - if (tx != null) - tx.rollback(); - System.out.println("Not able to open session"); - he.printStackTrace(); - } catch (final Exception e) { - e.printStackTrace(); - } finally { - if (session != null) - session.close(); - } - - } - - public void createFoos() { - Session session = null; - Transaction tx = null; - session = sessionFactory.openSession(); - tx = session.getTransaction(); - final List fooList = Lists.newArrayList(); - for (int i = 35; i < 46; i++) { - - final Foo foo = new Foo(); - foo.setName("Foo_" + (i + 120)); - final Bar bar = new Bar("bar_" + i); - bar.getFooSet().add(foo); - foo.setBar(bar); - fooList.add(foo); - - } - try { - tx.begin(); - for (final Foo foo : fooList) { - - session.save(foo.getBar()); - session.save(foo); - } - tx.commit(); - session.flush(); - } catch (final HibernateException he) { - if (tx != null) - tx.rollback(); - System.out.println("Not able to open session"); - he.printStackTrace(); - } catch (final Exception e) { - e.printStackTrace(); - } finally { - if (session != null) - session.close(); - } - } - -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java deleted file mode 100644 index fd7bc4aabf..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.baeldung.persistence.hibernate; - -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.lessThan; -import static org.junit.Assert.assertThat; - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Query; -import org.hibernate.ScrollMode; -import org.hibernate.ScrollableResults; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.criterion.Projections; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Foo; -import com.baeldung.persistence.service.IFooService; -import com.baeldung.spring.config.PersistenceTestConfig; -import com.google.common.collect.Lists; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) -public class FooPaginationPersistenceIntegrationTest { - - @Autowired - private IFooService fooService; - - @Autowired - private SessionFactory sessionFactory; - - private Session session; - - // tests - - @Before - public final void before() { - final int minimalNumberOfEntities = 25; - if (fooService.findAll().size() <= minimalNumberOfEntities) { - for (int i = 0; i < minimalNumberOfEntities; i++) { - fooService.create(new Foo(randomAlphabetic(6))); - } - } - - session = sessionFactory.openSession(); - } - - @After - public final void after() { - session.close(); - } - - // tests - - @Test - public final void whenContextIsBootstrapped_thenNoExceptions() { - // - } - - @SuppressWarnings("unchecked") - @Test - public final void whenRetrievingPaginatedEntities_thenCorrectSize() { - final int pageNumber = 1; - final int pageSize = 10; - - final Query query = session.createQuery("From Foo"); - query.setFirstResult((pageNumber - 1) * pageSize); - query.setMaxResults(pageSize); - final List fooList = query.list(); - - assertThat(fooList, hasSize(pageSize)); - } - - @SuppressWarnings("unchecked") - @Test - public final void whenRetrievingAllPages_thenCorrect() { - int pageNumber = 1; - final int pageSize = 10; - - final String countQ = "Select count (f.id) from Foo f"; - final Query countQuery = session.createQuery(countQ); - final Long countResult = (Long) countQuery.uniqueResult(); - - final List fooList = Lists.newArrayList(); - int totalEntities = 0; - final Query query = session.createQuery("From Foo"); - while (totalEntities < countResult) { - query.setFirstResult((pageNumber - 1) * pageSize); - query.setMaxResults(pageSize); - fooList.addAll(query.list()); - totalEntities = fooList.size(); - pageNumber++; - } - } - - @SuppressWarnings("unchecked") - @Test - public final void whenRetrievingLastPage_thenCorrectSize() { - final int pageSize = 10; - - final String countQ = "Select count (f.id) from Foo f"; - final Query countQuery = session.createQuery(countQ); - final Long countResults = (Long) countQuery.uniqueResult(); - final int lastPageNumber = (int) (Math.ceil(countResults / pageSize)); - - final Query selectQuery = session.createQuery("From Foo"); - selectQuery.setFirstResult((lastPageNumber - 1) * pageSize); - selectQuery.setMaxResults(pageSize); - final List lastPage = selectQuery.list(); - - assertThat(lastPage, hasSize(lessThan(pageSize + 1))); - } - - // testing - scrollable - - @Test - public final void givenUsingTheScrollableApi_whenRetrievingPaginatedData_thenCorrect() { - final int pageSize = 10; - final String hql = "FROM Foo f order by f.name"; - final Query query = session.createQuery(hql); - - final ScrollableResults resultScroll = query.scroll(ScrollMode.FORWARD_ONLY); - - // resultScroll.last(); - // final int totalResults = resultScroll.getRowNumber() + 1; - - resultScroll.first(); - resultScroll.scroll(0); - final List fooPage = Lists.newArrayList(); - int i = 0; - while (pageSize > i++) { - fooPage.add((Foo) resultScroll.get(0)); - if (!resultScroll.next()) { - break; - } - } - - assertThat(fooPage, hasSize(lessThan(10 + 1))); - } - - @SuppressWarnings("unchecked") - @Test - public final void givenUsingTheCriteriaApi_whenRetrievingFirstPage_thenCorrect() { - final int pageSize = 10; - - final Criteria criteria = session.createCriteria(Foo.class); - criteria.setFirstResult(0); - criteria.setMaxResults(pageSize); - final List firstPage = criteria.list(); - - assertThat(firstPage, hasSize(pageSize)); - } - - @SuppressWarnings("unchecked") - @Test - public final void givenUsingTheCriteriaApi_whenRetrievingPaginatedData_thenCorrect() { - final Criteria criteriaCount = session.createCriteria(Foo.class); - criteriaCount.setProjection(Projections.rowCount()); - final Long count = (Long) criteriaCount.uniqueResult(); - - int pageNumber = 1; - final int pageSize = 10; - final List fooList = Lists.newArrayList(); - - final Criteria criteria = session.createCriteria(Foo.class); - int totalEntities = 0; - while (totalEntities < count.intValue()) { - criteria.setFirstResult((pageNumber - 1) * pageSize); - criteria.setMaxResults(pageSize); - fooList.addAll(criteria.list()); - totalEntities = fooList.size(); - pageNumber++; - } - } - -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java deleted file mode 100644 index 8173088af0..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.baeldung.persistence.hibernate; - -import static org.junit.Assert.assertNull; - -import java.util.List; -import java.util.Set; - -import org.hibernate.Criteria; -import org.hibernate.NullPrecedence; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.criterion.Order; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Bar; -import com.baeldung.persistence.model.Foo; -import com.baeldung.spring.config.PersistenceTestConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) -@SuppressWarnings("unchecked") -public class FooSortingPersistenceIntegrationTest { - - @Autowired - private SessionFactory sessionFactory; - - private Session session; - - @Before - public void before() { - session = sessionFactory.openSession(); - - session.beginTransaction(); - - final FooFixtures fooData = new FooFixtures(sessionFactory); - fooData.createBars(); - } - - @After - public void after() { - session.getTransaction().commit(); - session.close(); - } - - @Test - public final void whenHQlSortingByOneAttribute_thenPrintSortedResults() { - final String hql = "FROM Foo f ORDER BY f.name"; - final Query query = session.createQuery(hql); - final List fooList = query.list(); - for (final Foo foo : fooList) { - System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); - } - } - - @Test - public final void whenHQlSortingByStringNullLast_thenLastNull() { - final String hql = "FROM Foo f ORDER BY f.name NULLS LAST"; - final Query query = session.createQuery(hql); - final List fooList = query.list(); - - assertNull(fooList.get(fooList.toArray().length - 1).getName()); - for (final Foo foo : fooList) { - System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); - } - } - - @Test - public final void whenSortingByStringNullsFirst_thenReturnNullsFirst() { - final String hql = "FROM Foo f ORDER BY f.name NULLS FIRST"; - final Query query = session.createQuery(hql); - final List fooList = query.list(); - assertNull(fooList.get(0).getName()); - for (final Foo foo : fooList) { - System.out.println("Name:" + foo.getName()); - - } - } - - @Test - public final void whenHQlSortingByOneAttribute_andOrderDirection_thenPrintSortedResults() { - final String hql = "FROM Foo f ORDER BY f.name ASC"; - final Query query = session.createQuery(hql); - final List fooList = query.list(); - for (final Foo foo : fooList) { - System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); - } - } - - @Test - public final void whenHQlSortingByMultipleAttributes_thenSortedResults() { - final String hql = "FROM Foo f ORDER BY f.name, f.id"; - final Query query = session.createQuery(hql); - final List fooList = query.list(); - for (final Foo foo : fooList) { - System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); - } - } - - @Test - public final void whenHQlSortingByMultipleAttributes_andOrderDirection_thenPrintSortedResults() { - final String hql = "FROM Foo f ORDER BY f.name DESC, f.id ASC"; - final Query query = session.createQuery(hql); - final List fooList = query.list(); - for (final Foo foo : fooList) { - System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); - } - } - - @Test - public final void whenHQLCriteriaSortingByOneAttr_thenPrintSortedResults() { - final Criteria criteria = session.createCriteria(Foo.class, "FOO"); - criteria.addOrder(Order.asc("id")); - final List fooList = criteria.list(); - for (final Foo foo : fooList) { - System.out.println("Id: " + foo.getId() + ", FirstName: " + foo.getName()); - } - } - - @Test - public final void whenHQLCriteriaSortingByMultipAttr_thenSortedResults() { - final Criteria criteria = session.createCriteria(Foo.class, "FOO"); - criteria.addOrder(Order.asc("name")); - criteria.addOrder(Order.asc("id")); - final List fooList = criteria.list(); - for (final Foo foo : fooList) { - System.out.println("Id: " + foo.getId() + ", FirstName: " + foo.getName()); - } - } - - @Test - public final void whenCriteriaSortingStringNullsLastAsc_thenNullsLast() { - final Criteria criteria = session.createCriteria(Foo.class, "FOO"); - criteria.addOrder(Order.asc("name").nulls(NullPrecedence.LAST)); - final List fooList = criteria.list(); - assertNull(fooList.get(fooList.toArray().length - 1).getName()); - for (final Foo foo : fooList) { - System.out.println("Id: " + foo.getId() + ", FirstName: " + foo.getName()); - } - } - - @Test - public final void whenCriteriaSortingStringNullsFirstDesc_thenNullsFirst() { - final Criteria criteria = session.createCriteria(Foo.class, "FOO"); - criteria.addOrder(Order.desc("name").nulls(NullPrecedence.FIRST)); - final List fooList = criteria.list(); - assertNull(fooList.get(0).getName()); - for (final Foo foo : fooList) { - System.out.println("Id: " + foo.getId() + ", FirstName: " + foo.getName()); - } - } - - @Test - public final void whenSortingBars_thenBarsWithSortedFoos() { - final String hql = "FROM Bar b ORDER BY b.id"; - final Query query = session.createQuery(hql); - final List barList = query.list(); - for (final Bar bar : barList) { - final Set fooSet = bar.getFooSet(); - System.out.println("Bar Id:" + bar.getId()); - for (final Foo foo : fooSet) { - System.out.println("FooName:" + foo.getName()); - } - } - } - -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java deleted file mode 100644 index ef83af3a0d..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java +++ /dev/null @@ -1,262 +0,0 @@ -package com.baeldung.persistence.save; - -import com.baeldung.persistence.model.Person; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.boot.registry.StandardServiceRegistryBuilder; -import org.hibernate.cfg.Configuration; -import org.hibernate.dialect.HSQLDialect; -import org.hibernate.service.ServiceRegistry; -import org.junit.*; - -import static org.junit.Assert.*; - -/** - * Testing specific implementation details for different methods: - * persist, save, merge, update, saveOrUpdate. - */ -public class SaveMethodsIntegrationTest { - - private static SessionFactory sessionFactory; - - private Session session; - - @BeforeClass - public static void beforeTests() { - Configuration configuration = new Configuration().addAnnotatedClass(Person.class).setProperty("hibernate.dialect", HSQLDialect.class.getName()).setProperty("hibernate.connection.driver_class", org.hsqldb.jdbcDriver.class.getName()) - .setProperty("hibernate.connection.url", "jdbc:hsqldb:mem:test").setProperty("hibernate.connection.username", "sa").setProperty("hibernate.connection.password", "").setProperty("hibernate.hbm2ddl.auto", "update"); - ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); - sessionFactory = configuration.buildSessionFactory(serviceRegistry); - } - - @Before - public void setUp() { - session = sessionFactory.openSession(); - session.beginTransaction(); - } - - @Test - public void whenPersistTransient_thenSavedToDatabaseOnCommit() { - - Person person = new Person(); - person.setName("John"); - session.persist(person); - - session.getTransaction().commit(); - session.close(); - - session = sessionFactory.openSession(); - session.beginTransaction(); - - assertNotNull(session.get(Person.class, person.getId())); - - } - - @Test - public void whenPersistPersistent_thenNothingHappens() { - - Person person = new Person(); - person.setName("John"); - - session.persist(person); - Long id1 = person.getId(); - - session.persist(person); - Long id2 = person.getId(); - - assertEquals(id1, id2); - } - - @Test(expected = HibernateException.class) - public void whenPersistDetached_thenThrowsException() { - - Person person = new Person(); - person.setName("John"); - session.persist(person); - session.evict(person); - - session.persist(person); - - } - - @Test - public void whenSaveTransient_thenIdGeneratedImmediately() { - - Person person = new Person(); - person.setName("John"); - - assertNull(person.getId()); - - Long id = (Long) session.save(person); - - assertNotNull(id); - - session.getTransaction().commit(); - session.close(); - - assertEquals(id, person.getId()); - - session = sessionFactory.openSession(); - session.beginTransaction(); - - assertNotNull(session.get(Person.class, person.getId())); - - } - - @Test - public void whenSavePersistent_thenNothingHappens() { - - Person person = new Person(); - person.setName("John"); - Long id1 = (Long) session.save(person); - Long id2 = (Long) session.save(person); - assertEquals(id1, id2); - - } - - @Test - public void whenSaveDetached_thenNewInstancePersisted() { - - Person person = new Person(); - person.setName("John"); - Long id1 = (Long) session.save(person); - session.evict(person); - - Long id2 = (Long) session.save(person); - assertNotEquals(id1, id2); - - } - - @Test - public void whenMergeDetached_thenEntityUpdatedFromDatabase() { - - Person person = new Person(); - person.setName("John"); - session.save(person); - session.evict(person); - - person.setName("Mary"); - Person mergedPerson = (Person) session.merge(person); - - assertNotSame(person, mergedPerson); - assertEquals("Mary", mergedPerson.getName()); - - } - - @Test - public void whenMergeTransient_thenNewEntitySavedToDatabase() { - - Person person = new Person(); - person.setName("John"); - Person mergedPerson = (Person) session.merge(person); - - session.getTransaction().commit(); - session.beginTransaction(); - - assertNull(person.getId()); - assertNotNull(mergedPerson.getId()); - - } - - @Test - public void whenMergePersistent_thenReturnsSameObject() { - - Person person = new Person(); - person.setName("John"); - session.save(person); - - Person mergedPerson = (Person) session.merge(person); - - assertSame(person, mergedPerson); - - } - - @Test - public void whenUpdateDetached_thenEntityUpdatedFromDatabase() { - - Person person = new Person(); - person.setName("John"); - session.save(person); - session.evict(person); - - person.setName("Mary"); - session.update(person); - assertEquals("Mary", person.getName()); - - } - - @Test(expected = HibernateException.class) - public void whenUpdateTransient_thenThrowsException() { - - Person person = new Person(); - person.setName("John"); - session.update(person); - - } - - @Test - public void whenUpdatePersistent_thenNothingHappens() { - - Person person = new Person(); - person.setName("John"); - session.save(person); - - session.update(person); - - } - - @Test - public void whenSaveOrUpdateDetached_thenEntityUpdatedFromDatabase() { - - Person person = new Person(); - person.setName("John"); - session.save(person); - session.evict(person); - - person.setName("Mary"); - session.saveOrUpdate(person); - assertEquals("Mary", person.getName()); - - } - - @Test - public void whenSaveOrUpdateTransient_thenSavedToDatabaseOnCommit() { - - Person person = new Person(); - person.setName("John"); - session.saveOrUpdate(person); - - session.getTransaction().commit(); - session.close(); - - session = sessionFactory.openSession(); - session.beginTransaction(); - - assertNotNull(session.get(Person.class, person.getId())); - - } - - @Test - public void whenSaveOrUpdatePersistent_thenNothingHappens() { - - Person person = new Person(); - person.setName("John"); - session.save(person); - - session.saveOrUpdate(person); - - } - - @After - public void tearDown() { - session.getTransaction().commit(); - session.close(); - } - - @AfterClass - public static void afterTests() { - sessionFactory.close(); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java deleted file mode 100644 index 146f8e9622..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.baeldung.persistence.service; - -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Foo; -import com.baeldung.spring.config.PersistenceTestConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) -public class FooServiceBasicPersistenceIntegrationTest { - - @Autowired - private SessionFactory sessionFactory; - - @Autowired - private IFooService fooService; - - private Session session; - - // tests - - @Before - public final void before() { - session = sessionFactory.openSession(); - } - - @After - public final void after() { - session.close(); - } - - // tests - - @Test - public final void whenContextIsBootstrapped_thenNoExceptions() { - // - } - - @Test - public final void whenEntityIsCreated_thenNoExceptions() { - fooService.create(new Foo(randomAlphabetic(6))); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java deleted file mode 100644 index 6d426849a6..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.baeldung.persistence.service; - -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; - -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Foo; -import com.baeldung.spring.config.PersistenceTestConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) -public class FooServicePersistenceIntegrationTest { - - @Autowired - @Qualifier("fooHibernateService") - private IFooService service; - - // tests - - @Test - public final void whenContextIsBootstrapped_thenNoExceptions() { - // - } - - @Test - public final void whenEntityIsCreated_thenNoExceptions() { - service.create(new Foo(randomAlphabetic(6))); - } - - @Test(expected = DataIntegrityViolationException.class) - @Ignore("work in progress") - public final void whenInvalidEntityIsCreated_thenDataException() { - service.create(new Foo()); - } - - @Test(expected = DataIntegrityViolationException.class) - public final void whenEntityWithLongNameIsCreated_thenDataException() { - service.create(new Foo(randomAlphabetic(2048))); - } - - @Test(expected = InvalidDataAccessApiUsageException.class) - @Ignore("Right now, persist has saveOrUpdate semantics, so this will no longer fail") - public final void whenSameEntityIsCreatedTwice_thenDataException() { - final Foo entity = new Foo(randomAlphabetic(8)); - service.create(entity); - service.create(entity); - } - - @Test(expected = DataAccessException.class) - public final void temp_whenInvalidEntityIsCreated_thenDataException() { - service.create(new Foo(randomAlphabetic(2048))); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java deleted file mode 100644 index d9353f1ad1..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.baeldung.persistence.service; - -import java.util.List; - -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; -import static org.junit.Assert.assertEquals; - -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.exception.SQLGrammarException; -import org.junit.After; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Foo; -import com.baeldung.spring.PersistenceConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) -public class FooStoredProceduresLiveTest { - - private static final Logger LOGGER = LoggerFactory.getLogger(FooStoredProceduresLiveTest.class); - - @Autowired - private SessionFactory sessionFactory; - - @Autowired - private IFooService fooService; - - private Session session; - - @Before - public final void before() { - session = sessionFactory.openSession(); - Assume.assumeTrue(getAllFoosExists()); - Assume.assumeTrue(getFoosByNameExists()); - } - - private boolean getFoosByNameExists() { - try { - Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); - sqlQuery.list(); - return true; - } catch (SQLGrammarException e) { - LOGGER.error("WARNING : GetFoosByName() Procedure is may be missing ", e); - return false; - } - } - - private boolean getAllFoosExists() { - try { - Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); - sqlQuery.list(); - return true; - } catch (SQLGrammarException e) { - LOGGER.error("WARNING : GetAllFoos() Procedure is may be missing ", e); - return false; - } - } - - @After - public final void after() { - session.close(); - } - - @Test - public final void getAllFoosUsingStoredProcedures() { - - fooService.create(new Foo(randomAlphabetic(6))); - - // Stored procedure getAllFoos using createSQLQuery - Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); - @SuppressWarnings("unchecked") - List allFoos = sqlQuery.list(); - for (Foo foo : allFoos) { - LOGGER.info("getAllFoos() SQL Query result : {}", foo.getName()); - } - assertEquals(allFoos.size(), fooService.findAll().size()); - - // Stored procedure getAllFoos using a Named Query - Query namedQuery = session.getNamedQuery("callGetAllFoos"); - @SuppressWarnings("unchecked") - List allFoos2 = namedQuery.list(); - for (Foo foo : allFoos2) { - LOGGER.info("getAllFoos() NamedQuery result : {}", foo.getName()); - } - assertEquals(allFoos2.size(), fooService.findAll().size()); - } - - @Test - public final void getFoosByNameUsingStoredProcedures() { - - fooService.create(new Foo("NewFooName")); - - // Stored procedure getFoosByName using createSQLQuery() - Query sqlQuery = session.createSQLQuery("CALL GetFoosByName(:fooName)").addEntity(Foo.class).setParameter("fooName", "NewFooName"); - @SuppressWarnings("unchecked") - List allFoosByName = sqlQuery.list(); - for (Foo foo : allFoosByName) { - LOGGER.info("getFoosByName() using SQL Query : found => {}", foo.toString()); - } - - // Stored procedure getFoosByName using getNamedQuery() - Query namedQuery = session.getNamedQuery("callGetFoosByName").setParameter("fooName", "NewFooName"); - @SuppressWarnings("unchecked") - List allFoosByName2 = namedQuery.list(); - for (Foo foo : allFoosByName2) { - LOGGER.info("getFoosByName() using Native Query : found => {}", foo.toString()); - } - - } -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java deleted file mode 100644 index 5a73e39ca2..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.baeldung.persistence.service; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Child; -import com.baeldung.persistence.model.Parent; -import com.baeldung.spring.config.PersistenceTestConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) -public class ParentServicePersistenceIntegrationTest { - - @Autowired - private IParentService service; - - @Autowired - private IChildService childService; - - // tests - - @Test - public final void whenContextIsBootstrapped_thenNoExceptions() { - // - } - - @Test - public final void whenOneToOneEntitiesAreCreated_thenNoExceptions() { - final Child childEntity = new Child(); - childService.create(childEntity); - - final Parent parentEntity = new Parent(childEntity); - service.create(parentEntity); - - System.out.println("Child = " + childService.findOne(childEntity.getId())); - System.out.println("Child - parent = " + childService.findOne(childEntity.getId()).getParent()); - - System.out.println("Parent = " + service.findOne(parentEntity.getId())); - System.out.println("Parent - child = " + service.findOne(parentEntity.getId()).getChild()); - } - - @Test(expected = DataIntegrityViolationException.class) - public final void whenChildIsDeletedWhileParentStillHasForeignKeyToIt_thenDataException() { - final Child childEntity = new Child(); - childService.create(childEntity); - - final Parent parentEntity = new Parent(childEntity); - service.create(parentEntity); - - childService.delete(childEntity); - } - - @Test - public final void whenChildIsDeletedAfterTheParent_thenNoExceptions() { - final Child childEntity = new Child(); - childService.create(childEntity); - - final Parent parentEntity = new Parent(childEntity); - service.create(parentEntity); - - service.delete(parentEntity); - childService.delete(childEntity); - } - -} diff --git a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java deleted file mode 100644 index 9bf55c902a..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.baeldung.spring.config; - -import java.util.Properties; - -import javax.sql.DataSource; - -import org.apache.tomcat.dbcp.dbcp2.BasicDataSource; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.core.env.Environment; -import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.orm.hibernate4.HibernateTransactionManager; -import org.springframework.orm.hibernate4.LocalSessionFactoryBean; -import org.springframework.orm.jpa.JpaTransactionManager; -import org.springframework.orm.jpa.JpaVendorAdapter; -import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; -import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; -import org.springframework.transaction.PlatformTransactionManager; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -import com.baeldung.persistence.dao.IBarAuditableDao; -import com.baeldung.persistence.dao.IBarDao; -import com.baeldung.persistence.dao.IFooAuditableDao; -import com.baeldung.persistence.dao.IFooDao; -import com.baeldung.persistence.dao.impl.BarAuditableDao; -import com.baeldung.persistence.dao.impl.BarDao; -import com.baeldung.persistence.dao.impl.BarJpaDao; -import com.baeldung.persistence.dao.impl.FooAuditableDao; -import com.baeldung.persistence.dao.impl.FooDao; -import com.baeldung.persistence.service.IBarAuditableService; -import com.baeldung.persistence.service.IBarService; -import com.baeldung.persistence.service.IFooAuditableService; -import com.baeldung.persistence.service.IFooService; -import com.baeldung.persistence.service.impl.BarAuditableService; -import com.baeldung.persistence.service.impl.BarJpaService; -import com.baeldung.persistence.service.impl.BarSpringDataJpaService; -import com.baeldung.persistence.service.impl.FooAuditableService; -import com.baeldung.persistence.service.impl.FooService; -import com.google.common.base.Preconditions; - -@Configuration -@EnableTransactionManagement -@EnableJpaRepositories(basePackages = { "com.baeldung.persistence" }, transactionManagerRef = "jpaTransactionManager") -@EnableJpaAuditing -@PropertySource({ "classpath:persistence-h2.properties" }) -@ComponentScan({ "com.baeldung.persistence" }) -public class PersistenceTestConfig { - - @Autowired - private Environment env; - - public PersistenceTestConfig() { - super(); - } - - @Bean - public LocalSessionFactoryBean sessionFactory() { - final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); - sessionFactory.setDataSource(restDataSource()); - sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); - sessionFactory.setHibernateProperties(hibernateProperties()); - - return sessionFactory; - } - - @Bean - public LocalContainerEntityManagerFactoryBean entityManagerFactory() { - final LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean(); - emf.setDataSource(restDataSource()); - emf.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); - - final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); - emf.setJpaVendorAdapter(vendorAdapter); - emf.setJpaProperties(hibernateProperties()); - - return emf; - } - - @Bean - public DataSource restDataSource() { - final BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName"))); - dataSource.setUrl(Preconditions.checkNotNull(env.getProperty("jdbc.url"))); - dataSource.setUsername(Preconditions.checkNotNull(env.getProperty("jdbc.user"))); - dataSource.setPassword(Preconditions.checkNotNull(env.getProperty("jdbc.pass"))); - - return dataSource; - } - - @Bean - public PlatformTransactionManager hibernateTransactionManager() { - final HibernateTransactionManager transactionManager = new HibernateTransactionManager(); - transactionManager.setSessionFactory(sessionFactory().getObject()); - return transactionManager; - } - - @Bean - public PlatformTransactionManager jpaTransactionManager() { - final JpaTransactionManager transactionManager = new JpaTransactionManager(); - transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); - return transactionManager; - } - - @Bean - public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { - return new PersistenceExceptionTranslationPostProcessor(); - } - - @Bean - public IBarService barJpaService() { - return new BarJpaService(); - } - - @Bean - public IBarService barSpringDataJpaService() { - return new BarSpringDataJpaService(); - } - - @Bean - public IFooService fooHibernateService() { - return new FooService(); - } - - @Bean - public IBarAuditableService barHibernateAuditableService() { - return new BarAuditableService(); - } - - @Bean - public IFooAuditableService fooHibernateAuditableService() { - return new FooAuditableService(); - } - - @Bean - public IBarDao barJpaDao() { - return new BarJpaDao(); - } - - @Bean - public IBarDao barHibernateDao() { - return new BarDao(); - } - - @Bean - public IBarAuditableDao barHibernateAuditableDao() { - return new BarAuditableDao(); - } - - @Bean - public IFooDao fooHibernateDao() { - return new FooDao(); - } - - @Bean - public IFooAuditableDao fooHibernateAuditableDao() { - return new FooAuditableDao(); - } - - private final Properties hibernateProperties() { - final Properties hibernateProperties = new Properties(); - hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); - hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); - - hibernateProperties.setProperty("hibernate.show_sql", "true"); - // hibernateProperties.setProperty("hibernate.format_sql", "true"); - // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); - - // Envers properties - hibernateProperties.setProperty("org.hibernate.envers.audit_table_suffix", env.getProperty("envers.audit_table_suffix")); - - return hibernateProperties; - } - -} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/test/resources/.gitignore b/persistence-modules/spring-hibernate4/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/test/resources/fetching.cfg.xml b/persistence-modules/spring-hibernate4/src/test/resources/fetching.cfg.xml deleted file mode 100644 index 55a3aeb51c..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/resources/fetching.cfg.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - org.h2.Driver - jdbc:h2:mem:testdb - sa - - org.hibernate.dialect.H2Dialect - update - true - - - - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/test/resources/fetchingLazy.cfg.xml b/persistence-modules/spring-hibernate4/src/test/resources/fetchingLazy.cfg.xml deleted file mode 100644 index 8fcf578660..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/resources/fetchingLazy.cfg.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - org.h2.Driver - jdbc:h2:mem:testdb - sa - - org.hibernate.dialect.H2Dialect - update - true - - - - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate4/src/test/resources/persistence-h2.properties b/persistence-modules/spring-hibernate4/src/test/resources/persistence-h2.properties deleted file mode 100644 index 911619193b..0000000000 --- a/persistence-modules/spring-hibernate4/src/test/resources/persistence-h2.properties +++ /dev/null @@ -1,13 +0,0 @@ -# jdbc.X -jdbc.driverClassName=org.h2.Driver -jdbc.url=jdbc:h2:mem:test -jdbc.user=sa -jdbc.pass= - -# hibernate.X -hibernate.dialect=org.hibernate.dialect.H2Dialect -hibernate.show_sql=false -hibernate.hbm2ddl.auto=create-drop - -# envers.X -envers.audit_table_suffix=_audit_log From 0ba96c9c43465a133934b244313e7e36433233d9 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 28 Sep 2020 23:12:26 +0530 Subject: [PATCH 038/302] JAVA-2432: Moved 1 article to hibernate-enterprise --- .../hibernate-enterprise/README.md | 3 ++- .../hibernate-enterprise/pom.xml | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/persistence-modules/hibernate-enterprise/README.md b/persistence-modules/hibernate-enterprise/README.md index c5606d0970..1a86c32afa 100644 --- a/persistence-modules/hibernate-enterprise/README.md +++ b/persistence-modules/hibernate-enterprise/README.md @@ -9,4 +9,5 @@ This module contains articles about enterprise concerns such as Multitenancy, Er - [Hibernate Aggregate Functions](https://www.baeldung.com/hibernate-aggregate-functions) - [Common Hibernate Exceptions](https://www.baeldung.com/hibernate-exceptions) - [Hibernate Error “Not all named parameters have been set”](https://www.baeldung.com/hibernate-error-named-parameters-not-set) -- [Various Logging Levels in Hibernate](https://www.baeldung.com/hibernate-logging-levels) \ No newline at end of file +- [Various Logging Levels in Hibernate](https://www.baeldung.com/hibernate-logging-levels) +- [Hibernate: save, persist, update, merge, saveOrUpdate](https://www.baeldung.com/hibernate-save-persist-update-merge-saveorupdate) \ No newline at end of file diff --git a/persistence-modules/hibernate-enterprise/pom.xml b/persistence-modules/hibernate-enterprise/pom.xml index ae58e409c4..c088cc1eca 100644 --- a/persistence-modules/hibernate-enterprise/pom.xml +++ b/persistence-modules/hibernate-enterprise/pom.xml @@ -61,13 +61,25 @@ ${byte-buddy.version} test + + org.hsqldb + hsqldb + ${hsqldb.version} + test + - geodb-repo - GeoDB repository - http://repo.boundlessgeo.com/main/ + osgeo + OSGeo Release Repository + https://repo.osgeo.org/repository/release/ + + false + + + true + @@ -77,6 +89,7 @@ 2.2.3 3.8.0 0.9 + 2.3.4 From d77c22b05f944119f7bde91af4b35deb9081f979 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 28 Sep 2020 23:13:14 +0530 Subject: [PATCH 039/302] JAVA-2432: Moved 1 article to hibernate-enterprise --- .../baeldung/persistence/model/Person.java | 31 ++ .../save/SaveMethodsIntegrationTest.java | 291 ++++++++++++++++++ 2 files changed, 322 insertions(+) create mode 100644 persistence-modules/hibernate-enterprise/src/main/java/com/baeldung/persistence/model/Person.java create mode 100644 persistence-modules/hibernate-enterprise/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java diff --git a/persistence-modules/hibernate-enterprise/src/main/java/com/baeldung/persistence/model/Person.java b/persistence-modules/hibernate-enterprise/src/main/java/com/baeldung/persistence/model/Person.java new file mode 100644 index 0000000000..6a95a7acf5 --- /dev/null +++ b/persistence-modules/hibernate-enterprise/src/main/java/com/baeldung/persistence/model/Person.java @@ -0,0 +1,31 @@ +package com.baeldung.persistence.model; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue + private Long id; + + private String name; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/persistence-modules/hibernate-enterprise/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java b/persistence-modules/hibernate-enterprise/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java new file mode 100644 index 0000000000..8c571428b4 --- /dev/null +++ b/persistence-modules/hibernate-enterprise/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java @@ -0,0 +1,291 @@ +package com.baeldung.persistence.save; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + +import javax.persistence.PersistenceException; + +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.Configuration; +import org.hibernate.dialect.HSQLDialect; +import org.hibernate.service.ServiceRegistry; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.baeldung.persistence.model.Person; + +/** + * Testing specific implementation details for different methods: + * persist, save, merge, update, saveOrUpdate. + */ +public class SaveMethodsIntegrationTest { + + private static SessionFactory sessionFactory; + + private Session session; + private boolean doNotCommit = false; + + @BeforeClass + public static void beforeTests() { + Configuration configuration = new Configuration().addAnnotatedClass(Person.class) + .setProperty("hibernate.dialect", HSQLDialect.class.getName()) + .setProperty("hibernate.connection.driver_class", org.hsqldb.jdbcDriver.class.getName()) + .setProperty("hibernate.connection.url", "jdbc:hsqldb:mem:test") + .setProperty("hibernate.connection.username", "sa") + .setProperty("hibernate.connection.password", "") + .setProperty("hibernate.hbm2ddl.auto", "update"); + ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()) + .build(); + sessionFactory = configuration.buildSessionFactory(serviceRegistry); + } + + @Before + public void setUp() { + session = sessionFactory.openSession(); + session.beginTransaction(); + doNotCommit = false; + } + + @Test + public void whenPersistTransient_thenSavedToDatabaseOnCommit() { + + Person person = new Person(); + person.setName("John"); + session.persist(person); + + session.getTransaction() + .commit(); + session.close(); + + session = sessionFactory.openSession(); + session.beginTransaction(); + + assertNotNull(session.get(Person.class, person.getId())); + + } + + @Test + public void whenPersistPersistent_thenNothingHappens() { + + Person person = new Person(); + person.setName("John"); + + session.persist(person); + Long id1 = person.getId(); + + session.persist(person); + Long id2 = person.getId(); + + assertEquals(id1, id2); + } + + @Test(expected = PersistenceException.class) + public void whenPersistDetached_thenThrowsException() { + + doNotCommit = true; + + Person person = new Person(); + person.setName("John"); + session.persist(person); + session.evict(person); + + session.persist(person); + } + + @Test + public void whenMergeDetached_thenEntityUpdatedFromDatabase() { + + Person person = new Person(); + person.setName("John"); + session.save(person); + session.flush(); + session.evict(person); + + person.setName("Mary"); + Person mergedPerson = (Person) session.merge(person); + + assertNotSame(person, mergedPerson); + assertEquals("Mary", mergedPerson.getName()); + + } + + @Test + public void whenSaveTransient_thenIdGeneratedImmediately() { + + Person person = new Person(); + person.setName("John"); + + assertNull(person.getId()); + + Long id = (Long) session.save(person); + + assertNotNull(id); + + session.getTransaction() + .commit(); + session.close(); + + assertEquals(id, person.getId()); + + session = sessionFactory.openSession(); + session.beginTransaction(); + + assertNotNull(session.get(Person.class, person.getId())); + + } + + @Test + public void whenSavePersistent_thenNothingHappens() { + + Person person = new Person(); + person.setName("John"); + Long id1 = (Long) session.save(person); + Long id2 = (Long) session.save(person); + assertEquals(id1, id2); + + } + + @Test + public void whenSaveDetached_thenNewInstancePersisted() { + + Person person = new Person(); + person.setName("John"); + Long id1 = (Long) session.save(person); + session.evict(person); + + Long id2 = (Long) session.save(person); + assertNotEquals(id1, id2); + + } + + @Test + public void whenMergeTransient_thenNewEntitySavedToDatabase() { + + Person person = new Person(); + person.setName("John"); + Person mergedPerson = (Person) session.merge(person); + + session.getTransaction() + .commit(); + session.beginTransaction(); + + assertNull(person.getId()); + assertNotNull(mergedPerson.getId()); + + } + + @Test + public void whenMergePersistent_thenReturnsSameObject() { + + Person person = new Person(); + person.setName("John"); + session.save(person); + + Person mergedPerson = (Person) session.merge(person); + + assertSame(person, mergedPerson); + + } + + @Test + public void whenUpdateDetached_thenEntityUpdatedFromDatabase() { + + Person person = new Person(); + person.setName("John"); + session.save(person); + session.evict(person); + + person.setName("Mary"); + session.update(person); + assertEquals("Mary", person.getName()); + + } + + @Test(expected = HibernateException.class) + public void whenUpdateTransient_thenThrowsException() { + + Person person = new Person(); + person.setName("John"); + session.update(person); + + } + + @Test + public void whenUpdatePersistent_thenNothingHappens() { + + Person person = new Person(); + person.setName("John"); + session.save(person); + + session.update(person); + + } + + @Test + public void whenSaveOrUpdateDetached_thenEntityUpdatedFromDatabase() { + + Person person = new Person(); + person.setName("John"); + session.save(person); + session.evict(person); + + person.setName("Mary"); + session.saveOrUpdate(person); + assertEquals("Mary", person.getName()); + + } + + @Test + public void whenSaveOrUpdateTransient_thenSavedToDatabaseOnCommit() { + + Person person = new Person(); + person.setName("John"); + session.saveOrUpdate(person); + + session.getTransaction() + .commit(); + session.close(); + + session = sessionFactory.openSession(); + session.beginTransaction(); + + assertNotNull(session.get(Person.class, person.getId())); + + } + + @Test + public void whenSaveOrUpdatePersistent_thenNothingHappens() { + + Person person = new Person(); + person.setName("John"); + session.save(person); + + session.saveOrUpdate(person); + + } + + @After + public void tearDown() { + if (!doNotCommit) { + session.getTransaction() + .commit(); + } + session.close(); + } + + @AfterClass + public static void afterTests() { + sessionFactory.close(); + } + +} From 7de65d1211d54e5b15fdd6ee4c432e04b1c74e2a Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 28 Sep 2020 23:13:49 +0530 Subject: [PATCH 040/302] JAVA-2432: removed unused module from parent pom --- persistence-modules/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index def2deb941..0e9c04f55d 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -80,8 +80,7 @@ spring-data-redis spring-data-solr spring-hibernate-3 - spring-hibernate-5 - spring-hibernate4 + spring-hibernate-5 spring-jpa spring-jpa-2 spring-jdbc From 2dd77a259db8eaa15f1a61b2752fee17d85611d4 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 28 Sep 2020 23:17:31 +0530 Subject: [PATCH 041/302] JAVA-2432: Moved 5 articles to spring-data-jpa-query-2 --- .../spring-data-jpa-query-2/README.md | 6 + .../spring-data-jpa-query-2/pom.xml | 58 +++++ .../baeldung/config/PersistenceConfig.java | 186 ++++++++++++++ .../baeldung/config/PersistenceXmlConfig.java | 18 ++ .../hibernate/audit/AuditorAwareImpl.java | 18 ++ .../hibernate/fetching/model/OrderDetail.java | 58 +++++ .../hibernate/fetching/model/UserEager.java | 71 +++++ .../hibernate/fetching/model/UserLazy.java | 71 +++++ .../fetching/util/HibernateUtil.java | 29 +++ .../fetching/view/FetchingAppView.java | 68 +++++ .../persistence/dao/BookRepository.java | 9 - .../persistence/dao/BookRepositoryCustom.java | 11 - .../persistence/dao/BookRepositoryImpl.java | 44 ---- .../baeldung/persistence/dao/BookService.java | 25 -- .../persistence/dao/BookSpecifications.java | 16 -- .../persistence/dao/IBarAuditableDao.java | 8 + .../persistence/dao/IBarCrudRepository.java | 10 + .../com/baeldung/persistence/dao/IBarDao.java | 8 + .../baeldung/persistence/dao/IChildDao.java | 8 + .../persistence/dao/IFooAuditableDao.java | 8 + .../com/baeldung/persistence/dao/IFooDao.java | 8 + .../baeldung/persistence/dao/IParentDao.java | 8 + .../persistence/dao/common/AbstractDao.java | 14 + .../common/AbstractHibernateAuditableDao.java | 37 +++ .../dao/common/AbstractHibernateDao.java | 59 +++++ .../dao/common/AbstractJpaDao.java | 56 ++++ .../dao/common/GenericHibernateDao.java | 13 + .../dao/common/IAuditOperations.java | 14 + .../persistence/dao/common/IGenericDao.java | 7 + .../persistence/dao/common/IOperations.java | 20 ++ .../persistence/dao/impl/BarAuditableDao.java | 28 ++ .../baeldung/persistence/dao/impl/BarDao.java | 19 ++ .../persistence/dao/impl/BarJpaDao.java | 19 ++ .../persistence/dao/impl/ChildDao.java | 19 ++ .../persistence/dao/impl/FooAuditableDao.java | 17 ++ .../baeldung/persistence/dao/impl/FooDao.java | 19 ++ .../persistence/dao/impl/ParentDao.java | 19 ++ .../com/baeldung/persistence/model/Bar.java | 242 ++++++++++++++++++ .../com/baeldung/persistence/model/Book.java | 36 --- .../com/baeldung/persistence/model/Child.java | 51 ++++ .../com/baeldung/persistence/model/Foo.java | 105 ++++++++ .../baeldung/persistence/model/Parent.java | 60 +++++ .../baeldung/persistence/model/Person.java | 31 +++ .../service/IBarAuditableService.java | 8 + .../persistence/service/IBarService.java | 8 + .../persistence/service/IChildService.java | 8 + .../service/IFooAuditableService.java | 8 + .../persistence/service/IFooService.java | 8 + .../persistence/service/IParentService.java | 8 + .../AbstractHibernateAuditableService.java | 30 +++ .../common/AbstractHibernateService.java | 42 +++ .../service/common/AbstractJpaService.java | 42 +++ .../service/common/AbstractService.java | 42 +++ .../common/AbstractSpringDataJpaService.java | 48 ++++ .../service/impl/BarAuditableService.java | 41 +++ .../service/impl/BarJpaService.java | 30 +++ .../persistence/service/impl/BarService.java | 30 +++ .../service/impl/BarSpringDataJpaService.java | 26 ++ .../service/impl/ChildService.java | 28 ++ .../service/impl/FooAuditableService.java | 41 +++ .../persistence/service/impl/FooService.java | 30 +++ .../service/impl/ParentService.java | 28 ++ .../src/main/resources/fetching.cfg.xml | 20 ++ .../src/main/resources/fetchingLazy.cfg.xml | 17 ++ .../resources/fetching_create_queries.sql | 14 + .../src/main/resources/hibernate5Config.xml | 34 +++ .../resources/hibernate5Configuration.xml | 30 +++ .../src/main/resources/immutable.cfg.xml | 38 +++ .../src/main/resources/insert_statements.sql | 31 +++ .../src/main/resources/logback.xml | 19 ++ .../resources/persistence-mysql.properties | 13 + .../src/main/resources/stored_procedure.sql | 20 ++ .../src/main/resources/webSecurityConfig.xml | 37 +++ .../HibernateFetchingIntegrationTest.java | 42 +++ .../persistence/IntegrationTestSuite.java | 25 ++ .../persistence/audit/AuditTestSuite.java | 14 + .../EnversFooBarAuditIntegrationTest.java | 146 +++++++++++ .../audit/JPABarAuditIntegrationTest.java | 104 ++++++++ .../SpringDataJPABarAuditIntegrationTest.java | 78 ++++++ .../persistence/hibernate/FooFixtures.java | 101 ++++++++ ...oPaginationPersistenceIntegrationTest.java | 185 +++++++++++++ .../FooSortingPersistenceIntegrationTest.java | 174 +++++++++++++ ...erviceBasicPersistenceIntegrationTest.java | 55 ++++ .../FooServicePersistenceIntegrationTest.java | 64 +++++ .../service/FooStoredProceduresLiveTest.java | 121 +++++++++ ...rentServicePersistenceIntegrationTest.java | 70 +++++ .../spring/config/PersistenceTestConfig.java | 179 +++++++++++++ .../ArticleRepositoryIntegrationTest.java | 3 + .../src/test/resources/fetching.cfg.xml | 19 ++ .../src/test/resources/fetchingLazy.cfg.xml | 19 ++ .../test/resources/persistence-h2.properties | 13 + 91 files changed, 3681 insertions(+), 141 deletions(-) create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceConfig.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceXmlConfig.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/audit/AuditorAwareImpl.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java delete mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepository.java delete mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepositoryCustom.java delete mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepositoryImpl.java delete mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookService.java delete mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookSpecifications.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IChildDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IFooDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IParentDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IOperations.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Bar.java delete mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Book.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Child.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Foo.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Parent.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Person.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IBarService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IChildService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IFooService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IParentService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/ChildService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/FooService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/ParentService.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching.cfg.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/fetchingLazy.cfg.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching_create_queries.sql create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/hibernate5Config.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/hibernate5Configuration.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/immutable.cfg.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/insert_statements.sql create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/logback.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/persistence-mysql.properties create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/stored_procedure.sql create mode 100644 persistence-modules/spring-data-jpa-query-2/src/main/resources/webSecurityConfig.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/resources/fetching.cfg.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/resources/fetchingLazy.cfg.xml create mode 100644 persistence-modules/spring-data-jpa-query-2/src/test/resources/persistence-h2.properties diff --git a/persistence-modules/spring-data-jpa-query-2/README.md b/persistence-modules/spring-data-jpa-query-2/README.md index fdb4ce3db7..bdc8d7cb32 100644 --- a/persistence-modules/spring-data-jpa-query-2/README.md +++ b/persistence-modules/spring-data-jpa-query-2/README.md @@ -6,6 +6,12 @@ This module contains articles about querying data using Spring Data JPA - [Spring Data JPA @Query Annotation](https://www.baeldung.com/spring-data-jpa-query) - [Use Criteria Queries in a Spring Data Application](https://www.baeldung.com/spring-data-criteria-queries) - [Query Entities by Dates and Times with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-query-by-date) +- [Hibernate Pagination](https://www.baeldung.com/hibernate-pagination) +- [Sorting with Hibernate](https://www.baeldung.com/hibernate-sort) +- [Stored Procedures with Hibernate](https://www.baeldung.com/stored-procedures-with-hibernate-tutorial) +- [Eager/Lazy Loading In Hibernate](https://www.baeldung.com/hibernate-lazy-eager-loading) +- [Auditing with JPA, Hibernate, and Spring Data JPA](https://www.baeldung.com/database-auditing-jpa) + - More articles: [[<-- prev]](../spring-data-jpa-query) ### Eclipse Config diff --git a/persistence-modules/spring-data-jpa-query-2/pom.xml b/persistence-modules/spring-data-jpa-query-2/pom.xml index 231640284e..abac7b28da 100644 --- a/persistence-modules/spring-data-jpa-query-2/pom.xml +++ b/persistence-modules/spring-data-jpa-query-2/pom.xml @@ -18,6 +18,10 @@ org.springframework.boot spring-boot-starter-data-jpa + + org.springframework.security + spring-security-core + com.h2database @@ -28,6 +32,55 @@ com.fasterxml.jackson.core jackson-databind + + + org.hibernate + hibernate-envers + + + javax.transaction + jta + ${jta.version} + + + mysql + mysql-connector-java + + + com.google.guava + guava + ${guava.version} + + + org.apache.tomcat + tomcat-dbcp + ${tomcat-dbcp.version} + + + org.hibernate + hibernate-core + ${hibernate.version} + + + org.hibernate + hibernate-envers + ${hibernate.version} + + + org.springframework + spring-test + test + + + org.springframework.security + spring-security-test + test + + + org.hsqldb + hsqldb + test + @@ -35,5 +88,10 @@ 2.22.2 5.6.2 4.13 + 9.0.0.M26 + 1.1 + 21.0 + + 5.2.10.Final \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceConfig.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceConfig.java new file mode 100644 index 0000000000..a0d70ed006 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceConfig.java @@ -0,0 +1,186 @@ +package com.baeldung.config; + +import java.util.Properties; + +import javax.sql.DataSource; + +import org.apache.tomcat.dbcp.dbcp2.BasicDataSource; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.env.Environment; +import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; +import org.springframework.data.domain.AuditorAware; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.orm.hibernate5.HibernateTransactionManager; +import org.springframework.orm.hibernate5.LocalSessionFactoryBean; +import org.springframework.orm.jpa.JpaTransactionManager; +import org.springframework.orm.jpa.JpaVendorAdapter; +import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; +import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import com.baeldung.hibernate.audit.AuditorAwareImpl; +import com.baeldung.persistence.dao.IBarAuditableDao; +import com.baeldung.persistence.dao.IBarDao; +import com.baeldung.persistence.dao.IFooAuditableDao; +import com.baeldung.persistence.dao.IFooDao; +import com.baeldung.persistence.dao.impl.BarAuditableDao; +import com.baeldung.persistence.dao.impl.BarDao; +import com.baeldung.persistence.dao.impl.BarJpaDao; +import com.baeldung.persistence.dao.impl.FooAuditableDao; +import com.baeldung.persistence.dao.impl.FooDao; +import com.baeldung.persistence.service.IBarAuditableService; +import com.baeldung.persistence.service.IBarService; +import com.baeldung.persistence.service.IFooAuditableService; +import com.baeldung.persistence.service.IFooService; +import com.baeldung.persistence.service.impl.BarAuditableService; +import com.baeldung.persistence.service.impl.BarJpaService; +import com.baeldung.persistence.service.impl.BarSpringDataJpaService; +import com.baeldung.persistence.service.impl.FooAuditableService; +import com.baeldung.persistence.service.impl.FooService; +import com.google.common.base.Preconditions; + +@Configuration +@EnableTransactionManagement +@EnableJpaRepositories(basePackages = { "com.baeldung.persistence" }, transactionManagerRef = "jpaTransactionManager", entityManagerFactoryRef = "jpaEntityManager") +@EnableJpaAuditing(auditorAwareRef = "auditorProvider") +@PropertySource({ "classpath:persistence-h2.properties" }) +@ComponentScan({ "com.baeldung.persistence" }) +public class PersistenceConfig { + + @Autowired + private Environment env; + + public PersistenceConfig() { + super(); + } + + @Bean("auditorProvider") + public AuditorAware auditorProvider() { + return new AuditorAwareImpl(); + } + + @Bean + public LocalSessionFactoryBean sessionFactory() { + final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); + sessionFactory.setDataSource(restDataSource()); + sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); + sessionFactory.setHibernateProperties(hibernateProperties()); + + return sessionFactory; + } + + @Bean("jpaEntityManager") + public LocalContainerEntityManagerFactoryBean entityManagerFactory() { + final LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean(); + emf.setDataSource(restDataSource()); + emf.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); + + final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); + emf.setJpaVendorAdapter(vendorAdapter); + emf.setJpaProperties(hibernateProperties()); + + return emf; + } + + @Bean + public DataSource restDataSource() { + final BasicDataSource dataSource = new BasicDataSource(); + dataSource.setDriverClassName(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName"))); + dataSource.setUrl(Preconditions.checkNotNull(env.getProperty("jdbc.url"))); + dataSource.setUsername(Preconditions.checkNotNull(env.getProperty("jdbc.user"))); + dataSource.setPassword(Preconditions.checkNotNull(env.getProperty("jdbc.pass"))); + + return dataSource; + } + + @Bean + public PlatformTransactionManager hibernateTransactionManager() { + final HibernateTransactionManager transactionManager = new HibernateTransactionManager(); + transactionManager.setSessionFactory(sessionFactory().getObject()); + return transactionManager; + } + + @Bean + public PlatformTransactionManager jpaTransactionManager() { + final JpaTransactionManager transactionManager = new JpaTransactionManager(); + transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); + return transactionManager; + } + + @Bean + public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { + return new PersistenceExceptionTranslationPostProcessor(); + } + + @Bean + public IBarService barJpaService() { + return new BarJpaService(); + } + + @Bean + public IBarService barSpringDataJpaService() { + return new BarSpringDataJpaService(); + } + + @Bean + public IFooService fooHibernateService() { + return new FooService(); + } + + @Bean + public IBarAuditableService barHibernateAuditableService() { + return new BarAuditableService(); + } + + @Bean + public IFooAuditableService fooHibernateAuditableService() { + return new FooAuditableService(); + } + + @Bean + public IBarDao barJpaDao() { + return new BarJpaDao(); + } + + @Bean + public IBarDao barHibernateDao() { + return new BarDao(); + } + + @Bean + public IBarAuditableDao barHibernateAuditableDao() { + return new BarAuditableDao(); + } + + @Bean + public IFooDao fooHibernateDao() { + return new FooDao(); + } + + @Bean + public IFooAuditableDao fooHibernateAuditableDao() { + return new FooAuditableDao(); + } + + private final Properties hibernateProperties() { + final Properties hibernateProperties = new Properties(); + hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); + hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); + + hibernateProperties.setProperty("hibernate.show_sql", "true"); + // hibernateProperties.setProperty("hibernate.format_sql", "true"); + // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); + + // Envers properties + hibernateProperties.setProperty("org.hibernate.envers.audit_table_suffix", env.getProperty("envers.audit_table_suffix")); + + return hibernateProperties; + } + +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceXmlConfig.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceXmlConfig.java new file mode 100644 index 0000000000..388494b21a --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceXmlConfig.java @@ -0,0 +1,18 @@ +package com.baeldung.config; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.ImportResource; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@Configuration +@EnableTransactionManagement +@ComponentScan({ "com.baeldung.persistence.dao", "com.baeldung.persistence.service" }) +@ImportResource({ "classpath:hibernate4Config.xml" }) +public class PersistenceXmlConfig { + + public PersistenceXmlConfig() { + super(); + } + +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/audit/AuditorAwareImpl.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/audit/AuditorAwareImpl.java new file mode 100644 index 0000000000..5dd12e6841 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/audit/AuditorAwareImpl.java @@ -0,0 +1,18 @@ +package com.baeldung.hibernate.audit; + +import java.util.Optional; + +import org.springframework.data.domain.AuditorAware; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; + +public class AuditorAwareImpl implements AuditorAware { + + @Override + public Optional getCurrentAuditor() { + return Optional.ofNullable(SecurityContextHolder.getContext()) + .map(e -> e.getAuthentication()) + .map(Authentication::getName); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java new file mode 100644 index 0000000000..f4a9b8a678 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java @@ -0,0 +1,58 @@ +package com.baeldung.hibernate.fetching.model; + +import javax.persistence.*; +import java.io.Serializable; +import java.sql.Date; + +@Entity +@Table(name = "USER_ORDER") +public class OrderDetail implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue + @Column(name = "ORDER_ID") + private Long orderId; + + public OrderDetail() { + } + + public OrderDetail(Date orderDate, String orderDesc) { + super(); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((orderId == null) ? 0 : orderId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + OrderDetail other = (OrderDetail) obj; + if (orderId == null) { + if (other.orderId != null) + return false; + } else if (!orderId.equals(other.orderId)) + return false; + + return true; + } + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java new file mode 100644 index 0000000000..9fda4c43bb --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java @@ -0,0 +1,71 @@ +package com.baeldung.hibernate.fetching.model; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +@Entity +@Table(name = "USER") +public class UserEager implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue + @Column(name = "USER_ID") + private Long userId; + + @OneToMany(fetch = FetchType.EAGER) + private Set orderDetail = new HashSet(); + + public UserEager() { + } + + public UserEager(final Long userId) { + super(); + this.userId = userId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((userId == null) ? 0 : userId.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final UserEager other = (UserEager) obj; + if (userId == null) { + if (other.userId != null) + return false; + } else if (!userId.equals(other.userId)) + return false; + return true; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(final Long userId) { + this.userId = userId; + } + + public Set getOrderDetail() { + return orderDetail; + } + + public void setOrderDetail(Set orderDetail) { + this.orderDetail = orderDetail; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java new file mode 100644 index 0000000000..a78eaa4ac0 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java @@ -0,0 +1,71 @@ +package com.baeldung.hibernate.fetching.model; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +@Entity +@Table(name = "USER") +public class UserLazy implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue + @Column(name = "USER_ID") + private Long userId; + + @OneToMany(fetch = FetchType.LAZY) + private Set orderDetail = new HashSet(); + + public UserLazy() { + } + + public UserLazy(final Long userId) { + super(); + this.userId = userId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((userId == null) ? 0 : userId.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final UserLazy other = (UserLazy) obj; + if (userId == null) { + if (other.userId != null) + return false; + } else if (!userId.equals(other.userId)) + return false; + return true; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(final Long userId) { + this.userId = userId; + } + + public Set getOrderDetail() { + return orderDetail; + } + + public void setOrderDetail(Set orderDetail) { + this.orderDetail = orderDetail; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java new file mode 100644 index 0000000000..c7be96abb7 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java @@ -0,0 +1,29 @@ +package com.baeldung.hibernate.fetching.util; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; + +public class HibernateUtil { + + @SuppressWarnings("deprecation") + public static Session getHibernateSession(String fetchMethod) { + // two config files are there + // one with lazy loading enabled + // another lazy = false + SessionFactory sf; + if ("lazy".equals(fetchMethod)) { + sf = new Configuration().configure("fetchingLazy.cfg.xml").buildSessionFactory(); + } else { + sf = new Configuration().configure("fetching.cfg.xml").buildSessionFactory(); + } + + // fetching.cfg.xml is used for this example + return sf.openSession(); + } + + public static Session getHibernateSession() { + return new Configuration().configure("fetching.cfg.xml").buildSessionFactory().openSession(); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java new file mode 100644 index 0000000000..35cdd254e3 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java @@ -0,0 +1,68 @@ +package com.baeldung.hibernate.fetching.view; + +import com.baeldung.hibernate.fetching.model.OrderDetail; +import com.baeldung.hibernate.fetching.model.UserEager; +import com.baeldung.hibernate.fetching.model.UserLazy; +import com.baeldung.hibernate.fetching.util.HibernateUtil; +import org.hibernate.Session; +import org.hibernate.Transaction; + +import java.util.List; +import java.util.Set; + +public class FetchingAppView { + + public FetchingAppView() { + + } + + // lazily loaded + public Set lazyLoaded() { + final Session sessionLazy = HibernateUtil.getHibernateSession("lazy"); + List users = sessionLazy.createQuery("From UserLazy").list(); + UserLazy userLazyLoaded = users.get(0); + // since data is lazyloaded so data won't be initialized + return (userLazyLoaded.getOrderDetail()); + } + + // eagerly loaded + public Set eagerLoaded() { + final Session sessionEager = HibernateUtil.getHibernateSession(); + // data should be loaded in the following line + // also note the queries generated + List user = sessionEager.createQuery("From UserEager").list(); + UserEager userEagerLoaded = user.get(0); + return userEagerLoaded.getOrderDetail(); + } + + // creates test data + // call this method to create the data in the database + public void createTestData() { + + final Session session = HibernateUtil.getHibernateSession("lazy"); + Transaction tx = session.beginTransaction(); + final UserLazy user1 = new UserLazy(); + final UserLazy user2 = new UserLazy(); + final UserLazy user3 = new UserLazy(); + + session.save(user1); + session.save(user2); + session.save(user3); + + final OrderDetail order1 = new OrderDetail(); + final OrderDetail order2 = new OrderDetail(); + final OrderDetail order3 = new OrderDetail(); + final OrderDetail order4 = new OrderDetail(); + final OrderDetail order5 = new OrderDetail(); + + session.saveOrUpdate(order1); + session.saveOrUpdate(order2); + session.saveOrUpdate(order3); + session.saveOrUpdate(order4); + session.saveOrUpdate(order5); + + tx.commit(); + session.close(); + + } +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepository.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepository.java deleted file mode 100644 index 48620f4ff1..0000000000 --- a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.model.Book; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -public interface BookRepository extends JpaRepository, BookRepositoryCustom, JpaSpecificationExecutor { - -} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepositoryCustom.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepositoryCustom.java deleted file mode 100644 index eda34542df..0000000000 --- a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepositoryCustom.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.model.Book; - -import java.util.List; - -public interface BookRepositoryCustom { - - List findBooksByAuthorNameAndTitle(String authorName, String title); - -} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepositoryImpl.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepositoryImpl.java deleted file mode 100644 index 7f5bedd018..0000000000 --- a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookRepositoryImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.model.Book; -import org.springframework.stereotype.Repository; - -import javax.persistence.EntityManager; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; -import java.util.ArrayList; -import java.util.List; - -@Repository -public class BookRepositoryImpl implements BookRepositoryCustom { - - private EntityManager em; - - public BookRepositoryImpl(EntityManager em) { - this.em = em; - } - - @Override - public List findBooksByAuthorNameAndTitle(String authorName, String title) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(Book.class); - - Root book = cq.from(Book.class); - List predicates = new ArrayList<>(); - - if (authorName != null) { - predicates.add(cb.equal(book.get("author"), authorName)); - } - if (title != null) { - predicates.add(cb.like(book.get("title"), "%" + title + "%")); - } - cq.where(predicates.toArray(new Predicate[0])); - - TypedQuery query = em.createQuery(cq); - return query.getResultList(); - } - -} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookService.java deleted file mode 100644 index 4165cd8eb9..0000000000 --- a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.model.Book; -import org.springframework.stereotype.Service; - -import java.util.List; - -import static com.baeldung.persistence.dao.BookSpecifications.hasAuthor; -import static com.baeldung.persistence.dao.BookSpecifications.titleContains; -import static org.springframework.data.jpa.domain.Specification.where; - -@Service -public class BookService { - - private BookRepository bookRepository; - - public BookService(BookRepository bookRepository) { - this.bookRepository = bookRepository; - } - - public List query(String author, String title) { - return bookRepository.findAll(where(hasAuthor(author)).and(titleContains(title))); - } - -} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookSpecifications.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookSpecifications.java deleted file mode 100644 index 16646a5b4b..0000000000 --- a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/BookSpecifications.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.persistence.dao; - -import com.baeldung.persistence.model.Book; -import org.springframework.data.jpa.domain.Specification; - -public class BookSpecifications { - - public static Specification hasAuthor(String author) { - return (book, cq, cb) -> cb.equal(book.get("author"), author); - } - - public static Specification titleContains(String title) { - return (book, cq, cb) -> cb.like(book.get("title"), "%" + title + "%"); - } - -} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java new file mode 100644 index 0000000000..182b493592 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.dao; + +import com.baeldung.persistence.dao.common.IAuditOperations; +import com.baeldung.persistence.model.Bar; + +public interface IBarAuditableDao extends IBarDao, IAuditOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java new file mode 100644 index 0000000000..4d7db64240 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java @@ -0,0 +1,10 @@ +package com.baeldung.persistence.dao; + +import java.io.Serializable; + +import com.baeldung.persistence.model.Bar; +import org.springframework.data.repository.CrudRepository; + +public interface IBarCrudRepository extends CrudRepository { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarDao.java new file mode 100644 index 0000000000..7896a2a84a --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IBarDao.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.dao; + +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.model.Bar; + +public interface IBarDao extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IChildDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IChildDao.java new file mode 100644 index 0000000000..a55a0b0598 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IChildDao.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.dao; + +import com.baeldung.persistence.model.Child; +import com.baeldung.persistence.dao.common.IOperations; + +public interface IChildDao extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java new file mode 100644 index 0000000000..ddbb685988 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.dao; + +import com.baeldung.persistence.dao.common.IAuditOperations; +import com.baeldung.persistence.model.Foo; + +public interface IFooAuditableDao extends IFooDao, IAuditOperations { + // +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IFooDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IFooDao.java new file mode 100644 index 0000000000..0935772dbd --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IFooDao.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.dao; + +import com.baeldung.persistence.model.Foo; +import com.baeldung.persistence.dao.common.IOperations; + +public interface IFooDao extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IParentDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IParentDao.java new file mode 100644 index 0000000000..03680158bb --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/IParentDao.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.dao; + +import com.baeldung.persistence.model.Parent; +import com.baeldung.persistence.dao.common.IOperations; + +public interface IParentDao extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java new file mode 100644 index 0000000000..5a6c76a93a --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java @@ -0,0 +1,14 @@ +package com.baeldung.persistence.dao.common; + +import java.io.Serializable; + +import com.google.common.base.Preconditions; + +public abstract class AbstractDao implements IOperations { + + protected Class clazz; + + protected final void setClazz(final Class clazzToSet) { + clazz = Preconditions.checkNotNull(clazzToSet); + } +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java new file mode 100644 index 0000000000..41184669ad --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java @@ -0,0 +1,37 @@ +package com.baeldung.persistence.dao.common; + +import java.io.Serializable; +import java.util.List; + +import org.hibernate.envers.AuditReader; +import org.hibernate.envers.AuditReaderFactory; +import org.hibernate.envers.query.AuditQuery; + +@SuppressWarnings("unchecked") +public class AbstractHibernateAuditableDao extends AbstractHibernateDao implements IAuditOperations { + + @Override + public List getEntitiesAtRevision(final Number revision) { + final AuditReader auditReader = AuditReaderFactory.get(getCurrentSession()); + final AuditQuery query = auditReader.createQuery().forEntitiesAtRevision(clazz, revision); + final List resultList = query.getResultList(); + return resultList; + } + + @Override + public List getEntitiesModifiedAtRevision(final Number revision) { + final AuditReader auditReader = AuditReaderFactory.get(getCurrentSession()); + final AuditQuery query = auditReader.createQuery().forEntitiesModifiedAtRevision(clazz, revision); + final List resultList = query.getResultList(); + return resultList; + } + + @Override + public List getRevisions() { + final AuditReader auditReader = AuditReaderFactory.get(getCurrentSession()); + final AuditQuery query = auditReader.createQuery().forRevisionsOfEntity(clazz, true, true); + final List resultList = query.getResultList(); + return resultList; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java new file mode 100644 index 0000000000..f3ade67f80 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java @@ -0,0 +1,59 @@ +package com.baeldung.persistence.dao.common; + +import java.io.Serializable; +import java.util.List; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import com.google.common.base.Preconditions; + +@SuppressWarnings("unchecked") +public abstract class AbstractHibernateDao extends AbstractDao implements IOperations { + + @Autowired + protected SessionFactory sessionFactory; + + // API + + @Override + public T findOne(final long id) { + return (T) getCurrentSession().get(clazz, id); + } + + @Override + public List findAll() { + return getCurrentSession().createQuery("from " + clazz.getName()).list(); + } + + @Override + public void create(final T entity) { + Preconditions.checkNotNull(entity); + getCurrentSession().saveOrUpdate(entity); + } + + @Override + public T update(final T entity) { + Preconditions.checkNotNull(entity); + return (T) getCurrentSession().merge(entity); + } + + @Override + public void delete(final T entity) { + Preconditions.checkNotNull(entity); + getCurrentSession().delete(entity); + } + + @Override + public void deleteById(final long entityId) { + final T entity = findOne(entityId); + Preconditions.checkState(entity != null); + delete(entity); + } + + protected Session getCurrentSession() { + return sessionFactory.getCurrentSession(); + } + +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java new file mode 100644 index 0000000000..79bdd86658 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java @@ -0,0 +1,56 @@ +package com.baeldung.persistence.dao.common; + +import java.io.Serializable; +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Root; + +public class AbstractJpaDao extends AbstractDao implements IOperations { + + @PersistenceContext(unitName = "jpaEntityManager") + private EntityManager em; + + // API + + @Override + public T findOne(final long id) { + return em.find(clazz, Long.valueOf(id).intValue()); + } + + @Override + public List findAll() { + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(clazz); + final Root rootEntry = cq.from(clazz); + final CriteriaQuery all = cq.select(rootEntry); + final TypedQuery allQuery = em.createQuery(all); + return allQuery.getResultList(); + } + + @Override + public void create(final T entity) { + em.persist(entity); + } + + @Override + public T update(final T entity) { + em.merge(entity); + return entity; + } + + @Override + public void delete(final T entity) { + em.remove(entity); + } + + @Override + public void deleteById(final long entityId) { + delete(findOne(entityId)); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java new file mode 100644 index 0000000000..18b16fa033 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java @@ -0,0 +1,13 @@ +package com.baeldung.persistence.dao.common; + +import java.io.Serializable; + +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Repository; + +@Repository +@Scope(BeanDefinition.SCOPE_PROTOTYPE) +public class GenericHibernateDao extends AbstractHibernateDao implements IGenericDao { + // +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java new file mode 100644 index 0000000000..169d3fed72 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java @@ -0,0 +1,14 @@ +package com.baeldung.persistence.dao.common; + +import java.io.Serializable; +import java.util.List; + +public interface IAuditOperations { + + List getEntitiesAtRevision(Number revision); + + List getEntitiesModifiedAtRevision(Number revision); + + List getRevisions(); + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java new file mode 100644 index 0000000000..8d8af18394 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java @@ -0,0 +1,7 @@ +package com.baeldung.persistence.dao.common; + +import java.io.Serializable; + +public interface IGenericDao extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IOperations.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IOperations.java new file mode 100644 index 0000000000..4ef99221ab --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/common/IOperations.java @@ -0,0 +1,20 @@ +package com.baeldung.persistence.dao.common; + +import java.io.Serializable; +import java.util.List; + +public interface IOperations { + + T findOne(final long id); + + List findAll(); + + void create(final T entity); + + T update(final T entity); + + void delete(final T entity); + + void deleteById(final long entityId); + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java new file mode 100644 index 0000000000..e12b6ae2da --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java @@ -0,0 +1,28 @@ +package com.baeldung.persistence.dao.impl; + +import java.util.List; + +import com.baeldung.persistence.dao.IBarAuditableDao; +import com.baeldung.persistence.dao.common.AbstractHibernateAuditableDao; +import com.baeldung.persistence.model.Bar; + +public class BarAuditableDao extends AbstractHibernateAuditableDao implements IBarAuditableDao { + + public BarAuditableDao() { + super(); + + setClazz(Bar.class); + } + + // API + + @Override + public List getRevisions() { + final List resultList = super.getRevisions(); + for (final Bar bar : resultList) { + bar.getFooSet().size(); // force FooSet initialization + } + return resultList; + } + +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java new file mode 100644 index 0000000000..0ead802dc5 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java @@ -0,0 +1,19 @@ +package com.baeldung.persistence.dao.impl; + +import com.baeldung.persistence.dao.common.AbstractHibernateDao; +import com.baeldung.persistence.dao.IBarDao; +import com.baeldung.persistence.model.Bar; +import org.springframework.stereotype.Repository; + +@Repository +public class BarDao extends AbstractHibernateDao implements IBarDao { + + public BarDao() { + super(); + + setClazz(Bar.class); + } + + // API + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java new file mode 100644 index 0000000000..e0fa382d41 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java @@ -0,0 +1,19 @@ +package com.baeldung.persistence.dao.impl; + +import com.baeldung.persistence.dao.IBarDao; +import com.baeldung.persistence.dao.common.AbstractJpaDao; +import com.baeldung.persistence.model.Bar; +import org.springframework.stereotype.Repository; + +@Repository +public class BarJpaDao extends AbstractJpaDao implements IBarDao { + + public BarJpaDao() { + super(); + + setClazz(Bar.class); + } + + // API + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java new file mode 100644 index 0000000000..b55da6e43a --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java @@ -0,0 +1,19 @@ +package com.baeldung.persistence.dao.impl; + +import com.baeldung.persistence.dao.common.AbstractHibernateDao; +import com.baeldung.persistence.model.Child; +import com.baeldung.persistence.dao.IChildDao; +import org.springframework.stereotype.Repository; + +@Repository +public class ChildDao extends AbstractHibernateDao implements IChildDao { + + public ChildDao() { + super(); + + setClazz(Child.class); + } + + // API + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java new file mode 100644 index 0000000000..05064c1478 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java @@ -0,0 +1,17 @@ +package com.baeldung.persistence.dao.impl; + +import com.baeldung.persistence.dao.common.AbstractHibernateAuditableDao; +import com.baeldung.persistence.model.Foo; +import com.baeldung.persistence.dao.IFooAuditableDao; + +public class FooAuditableDao extends AbstractHibernateAuditableDao implements IFooAuditableDao { + + public FooAuditableDao() { + super(); + + setClazz(Foo.class); + } + + // API + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java new file mode 100644 index 0000000000..787c449b1d --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java @@ -0,0 +1,19 @@ +package com.baeldung.persistence.dao.impl; + +import com.baeldung.persistence.dao.common.AbstractHibernateDao; +import com.baeldung.persistence.dao.IFooDao; +import com.baeldung.persistence.model.Foo; +import org.springframework.stereotype.Repository; + +@Repository +public class FooDao extends AbstractHibernateDao implements IFooDao { + + public FooDao() { + super(); + + setClazz(Foo.class); + } + + // API + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java new file mode 100644 index 0000000000..4602b5f30e --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java @@ -0,0 +1,19 @@ +package com.baeldung.persistence.dao.impl; + +import com.baeldung.persistence.dao.IParentDao; +import com.baeldung.persistence.dao.common.AbstractHibernateDao; +import com.baeldung.persistence.model.Parent; +import org.springframework.stereotype.Repository; + +@Repository +public class ParentDao extends AbstractHibernateDao implements IParentDao { + + public ParentDao() { + super(); + + setClazz(Parent.class); + } + + // API + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Bar.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Bar.java new file mode 100644 index 0000000000..c7f05254cc --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Bar.java @@ -0,0 +1,242 @@ +package com.baeldung.persistence.model; + +import java.io.Serializable; +import java.util.Date; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.PrePersist; +import javax.persistence.PreRemove; +import javax.persistence.PreUpdate; + +import org.hibernate.annotations.OrderBy; +import org.hibernate.envers.Audited; +import org.jboss.logging.Logger; +import org.springframework.data.annotation.CreatedBy; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedBy; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import com.google.common.collect.Sets; + +@Entity +@NamedQuery(name = "Bar.findAll", query = "SELECT b FROM Bar b") +@Audited +@EntityListeners(AuditingEntityListener.class) +public class Bar implements Serializable { + + private static Logger logger = Logger.getLogger(Bar.class); + + public enum OPERATION { + INSERT, UPDATE, DELETE; + private String value; + + OPERATION() { + value = toString(); + } + + public String getValue() { + return value; + } + + public static OPERATION parse(final String value) { + OPERATION operation = null; + for (final OPERATION op : OPERATION.values()) { + if (op.getValue().equals(value)) { + operation = op; + break; + } + } + return operation; + } + }; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private int id; + + @Column(name = "name") + private String name; + + @OneToMany(mappedBy = "bar", cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @OrderBy(clause = "NAME DESC") + // @NotAudited + private Set fooSet = Sets.newHashSet(); + + @Column(name = "operation") + private String operation; + + @Column(name = "timestamp") + private long timestamp; + + @Column(name = "created_date", updatable = false, nullable = false) + @CreatedDate + private long createdDate; + + @Column(name = "modified_date") + @LastModifiedDate + private long modifiedDate; + + @Column(name = "created_by") + @CreatedBy + private String createdBy; + + @Column(name = "modified_by") + @LastModifiedBy + private String modifiedBy; + + public Bar() { + super(); + } + + public Bar(final String name) { + super(); + + this.name = name; + } + + // API + + public Set getFooSet() { + return fooSet; + } + + public void setFooSet(final Set fooSet) { + this.fooSet = fooSet; + } + + public int getId() { + return id; + } + + public void setId(final int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + public OPERATION getOperation() { + return OPERATION.parse(operation); + } + + public void setOperation(final OPERATION operation) { + this.operation = operation.getValue(); + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(final long timestamp) { + this.timestamp = timestamp; + } + + public long getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(final long createdDate) { + this.createdDate = createdDate; + } + + public long getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(final long modifiedDate) { + this.modifiedDate = modifiedDate; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(final String createdBy) { + this.createdBy = createdBy; + } + + public String getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(final String modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public void setOperation(final String operation) { + this.operation = operation; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final Bar other = (Bar) obj; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + return true; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("Bar [name=").append(name).append("]"); + return builder.toString(); + } + + @PrePersist + public void onPrePersist() { + logger.info("@PrePersist"); + audit(OPERATION.INSERT); + } + + @PreUpdate + public void onPreUpdate() { + logger.info("@PreUpdate"); + audit(OPERATION.UPDATE); + } + + @PreRemove + public void onPreRemove() { + logger.info("@PreRemove"); + audit(OPERATION.DELETE); + } + + private void audit(final OPERATION operation) { + setOperation(operation); + setTimestamp((new Date()).getTime()); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Book.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Book.java deleted file mode 100644 index 507043dd56..0000000000 --- a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Book.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.baeldung.persistence.model; - -import javax.persistence.Entity; -import javax.persistence.Id; - -@Entity -public class Book { - - @Id - private Long id; - - private String title; - - private String author; - - public Long getId() { - return id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - -} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Child.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Child.java new file mode 100644 index 0000000000..19cfb2e237 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Child.java @@ -0,0 +1,51 @@ +package com.baeldung.persistence.model; + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToOne; + +@Entity +public class Child implements Serializable { + + @Id + @GeneratedValue + private long id; + + @OneToOne(mappedBy = "child") + private Parent parent; + + public Child() { + super(); + } + + // API + + public long getId() { + return id; + } + + public void setId(final long id) { + this.id = id; + } + + public Parent getParent() { + return parent; + } + + public void setParent(final Parent parent) { + this.parent = parent; + } + + // + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("Child [id=").append(id).append("]"); + return builder.toString(); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Foo.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Foo.java new file mode 100644 index 0000000000..d36a1e58cf --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Foo.java @@ -0,0 +1,105 @@ +package com.baeldung.persistence.model; + +import java.io.Serializable; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedNativeQueries; +import javax.persistence.NamedNativeQuery; + +import org.hibernate.envers.Audited; + +@NamedNativeQueries({ @NamedNativeQuery(name = "callGetAllFoos", query = "CALL GetAllFoos()", resultClass = Foo.class), @NamedNativeQuery(name = "callGetFoosByName", query = "CALL GetFoosByName(:fooName)", resultClass = Foo.class) }) +@Entity +@Audited +// @Proxy(lazy = false) +public class Foo implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private long id; + + @Column(name = "name") + private String name; + + @ManyToOne(targetEntity = Bar.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @JoinColumn(name = "BAR_ID") + private Bar bar = new Bar(); + + public Foo() { + super(); + } + + public Foo(final String name) { + super(); + this.name = name; + } + + // + + public Bar getBar() { + return bar; + } + + public void setBar(final Bar bar) { + this.bar = bar; + } + + public long getId() { + return id; + } + + public void setId(final long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + // + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final Foo other = (Foo) obj; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + return true; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("Foo [name=").append(name).append("]"); + return builder.toString(); + } +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Parent.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Parent.java new file mode 100644 index 0000000000..fa6948990b --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Parent.java @@ -0,0 +1,60 @@ +package com.baeldung.persistence.model; + +import java.io.Serializable; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; + +@Entity +public class Parent implements Serializable { + + @Id + @GeneratedValue + private long id; + + @OneToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.DETACH }) + @JoinColumn(name = "child_fk") + private Child child; + + public Parent() { + super(); + } + + public Parent(final Child child) { + super(); + + this.child = child; + } + + // API + + public long getId() { + return id; + } + + public void setId(final long id) { + this.id = id; + } + + public Child getChild() { + return child; + } + + public void setChild(final Child child) { + this.child = child; + } + + // + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("Parent [id=").append(id).append("]"); + return builder.toString(); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Person.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Person.java new file mode 100644 index 0000000000..6a95a7acf5 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/model/Person.java @@ -0,0 +1,31 @@ +package com.baeldung.persistence.model; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue + private Long id; + + private String name; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java new file mode 100644 index 0000000000..33e5634d12 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.service; + +import com.baeldung.persistence.dao.common.IAuditOperations; +import com.baeldung.persistence.model.Bar; + +public interface IBarAuditableService extends IBarService, IAuditOperations { + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IBarService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IBarService.java new file mode 100644 index 0000000000..21185b5990 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IBarService.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.service; + +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.model.Bar; + +public interface IBarService extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IChildService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IChildService.java new file mode 100644 index 0000000000..afe67a70c2 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IChildService.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.service; + +import com.baeldung.persistence.model.Child; +import com.baeldung.persistence.dao.common.IOperations; + +public interface IChildService extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java new file mode 100644 index 0000000000..b787e7fe91 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.service; + +import com.baeldung.persistence.dao.common.IAuditOperations; +import com.baeldung.persistence.model.Foo; + +public interface IFooAuditableService extends IFooService, IAuditOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IFooService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IFooService.java new file mode 100644 index 0000000000..ffdb53964a --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IFooService.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.service; + +import com.baeldung.persistence.model.Foo; +import com.baeldung.persistence.dao.common.IOperations; + +public interface IFooService extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IParentService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IParentService.java new file mode 100644 index 0000000000..f941416aac --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/IParentService.java @@ -0,0 +1,8 @@ +package com.baeldung.persistence.service; + +import com.baeldung.persistence.model.Parent; +import com.baeldung.persistence.dao.common.IOperations; + +public interface IParentService extends IOperations { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java new file mode 100644 index 0000000000..2695d7760a --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java @@ -0,0 +1,30 @@ +package com.baeldung.persistence.service.common; + +import java.io.Serializable; +import java.util.List; + +import com.baeldung.persistence.dao.common.IAuditOperations; +import com.baeldung.persistence.dao.common.IOperations; +import org.springframework.transaction.annotation.Transactional; + +@Transactional(value = "hibernateTransactionManager") +public abstract class AbstractHibernateAuditableService extends AbstractHibernateService implements IOperations, IAuditOperations { + + @Override + public List getEntitiesAtRevision(final Number revision) { + return getAuditableDao().getEntitiesAtRevision(revision); + } + + @Override + public List getEntitiesModifiedAtRevision(final Number revision) { + return getAuditableDao().getEntitiesModifiedAtRevision(revision); + } + + @Override + public List getRevisions() { + return getAuditableDao().getRevisions(); + } + + abstract protected IAuditOperations getAuditableDao(); + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java new file mode 100644 index 0000000000..02b8ccf48b --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java @@ -0,0 +1,42 @@ +package com.baeldung.persistence.service.common; + +import java.io.Serializable; +import java.util.List; + +import com.baeldung.persistence.dao.common.IOperations; +import org.springframework.transaction.annotation.Transactional; + +@Transactional(value = "hibernateTransactionManager") +public abstract class AbstractHibernateService extends AbstractService implements IOperations { + + @Override + public T findOne(final long id) { + return super.findOne(id); + } + + @Override + public List findAll() { + return super.findAll(); + } + + @Override + public void create(final T entity) { + super.create(entity); + } + + @Override + public T update(final T entity) { + return super.update(entity); + } + + @Override + public void delete(final T entity) { + super.delete(entity); + } + + @Override + public void deleteById(final long entityId) { + super.deleteById(entityId); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java new file mode 100644 index 0000000000..a1c6fe9edf --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java @@ -0,0 +1,42 @@ +package com.baeldung.persistence.service.common; + +import java.io.Serializable; +import java.util.List; + +import com.baeldung.persistence.dao.common.IOperations; +import org.springframework.transaction.annotation.Transactional; + +@Transactional(value = "jpaTransactionManager") +public abstract class AbstractJpaService extends AbstractService implements IOperations { + + @Override + public T findOne(final long id) { + return super.findOne(id); + } + + @Override + public List findAll() { + return super.findAll(); + } + + @Override + public void create(final T entity) { + super.create(entity); + } + + @Override + public T update(final T entity) { + return super.update(entity); + } + + @Override + public void delete(final T entity) { + super.delete(entity); + } + + @Override + public void deleteById(final long entityId) { + super.deleteById(entityId); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractService.java new file mode 100644 index 0000000000..9b001b1fac --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractService.java @@ -0,0 +1,42 @@ +package com.baeldung.persistence.service.common; + +import java.io.Serializable; +import java.util.List; + +import com.baeldung.persistence.dao.common.IOperations; + +public abstract class AbstractService implements IOperations { + + @Override + public T findOne(final long id) { + return getDao().findOne(id); + } + + @Override + public List findAll() { + return getDao().findAll(); + } + + @Override + public void create(final T entity) { + getDao().create(entity); + } + + @Override + public T update(final T entity) { + return getDao().update(entity); + } + + @Override + public void delete(final T entity) { + getDao().delete(entity); + } + + @Override + public void deleteById(final long entityId) { + getDao().deleteById(entityId); + } + + protected abstract IOperations getDao(); + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java new file mode 100644 index 0000000000..73fe27e9ec --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java @@ -0,0 +1,48 @@ +package com.baeldung.persistence.service.common; + +import java.io.Serializable; +import java.util.List; +import java.util.Optional; + +import com.baeldung.persistence.dao.common.IOperations; +import org.springframework.data.repository.CrudRepository; +import org.springframework.transaction.annotation.Transactional; + +import com.google.common.collect.Lists; + +@Transactional(value = "jpaTransactionManager") +public abstract class AbstractSpringDataJpaService implements IOperations { + + @Override + public T findOne(final long id) { + Optional opt = getDao().findById(Long.valueOf(id)); + return opt.get(); + } + + @Override + public List findAll() { + return Lists.newArrayList(getDao().findAll()); + } + + @Override + public void create(final T entity) { + getDao().save(entity); + } + + @Override + public T update(final T entity) { + return getDao().save(entity); + } + + @Override + public void delete(final T entity) { + getDao().delete(entity); + } + + @Override + public void deleteById(final long entityId) { + getDao().deleteById(Long.valueOf(entityId)); + } + + protected abstract CrudRepository getDao(); +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java new file mode 100644 index 0000000000..d84c28caa5 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java @@ -0,0 +1,41 @@ +package com.baeldung.persistence.service.impl; + +import com.baeldung.persistence.dao.common.IAuditOperations; +import com.baeldung.persistence.service.common.AbstractHibernateAuditableService; +import com.baeldung.persistence.dao.IBarAuditableDao; +import com.baeldung.persistence.dao.IBarDao; +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.model.Bar; +import com.baeldung.persistence.service.IBarAuditableService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; + +@Service +public class BarAuditableService extends AbstractHibernateAuditableService implements IBarAuditableService { + + @Autowired + @Qualifier("barHibernateDao") + private IBarDao dao; + + @Autowired + @Qualifier("barHibernateAuditableDao") + private IBarAuditableDao auditDao; + + public BarAuditableService() { + super(); + } + + // API + + @Override + protected IOperations getDao() { + return dao; + } + + @Override + protected IAuditOperations getAuditableDao() { + return auditDao; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java new file mode 100644 index 0000000000..1c1b7a2274 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java @@ -0,0 +1,30 @@ +package com.baeldung.persistence.service.impl; + +import com.baeldung.persistence.dao.IBarDao; +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.model.Bar; +import com.baeldung.persistence.service.IBarService; +import com.baeldung.persistence.service.common.AbstractJpaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; + +@Service +public class BarJpaService extends AbstractJpaService implements IBarService { + + @Autowired + @Qualifier("barJpaDao") + private IBarDao dao; + + public BarJpaService() { + super(); + } + + // API + + @Override + protected IOperations getDao() { + return dao; + } + +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarService.java new file mode 100644 index 0000000000..32d1f919c5 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarService.java @@ -0,0 +1,30 @@ +package com.baeldung.persistence.service.impl; + +import com.baeldung.persistence.dao.IBarDao; +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.model.Bar; +import com.baeldung.persistence.service.IBarService; +import com.baeldung.persistence.service.common.AbstractHibernateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; + +@Service +public class BarService extends AbstractHibernateService implements IBarService { + + @Autowired + @Qualifier("barHibernateDao") + private IBarDao dao; + + public BarService() { + super(); + } + + // API + + @Override + protected IOperations getDao() { + return dao; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java new file mode 100644 index 0000000000..4a55d08a35 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java @@ -0,0 +1,26 @@ +package com.baeldung.persistence.service.impl; + +import java.io.Serializable; + +import com.baeldung.persistence.service.common.AbstractSpringDataJpaService; +import com.baeldung.persistence.dao.IBarCrudRepository; +import com.baeldung.persistence.model.Bar; +import com.baeldung.persistence.service.IBarService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.repository.CrudRepository; + +public class BarSpringDataJpaService extends AbstractSpringDataJpaService implements IBarService { + + @Autowired + private IBarCrudRepository dao; + + public BarSpringDataJpaService() { + super(); + } + + @Override + protected CrudRepository getDao() { + return dao; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/ChildService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/ChildService.java new file mode 100644 index 0000000000..417fe2c49a --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/ChildService.java @@ -0,0 +1,28 @@ +package com.baeldung.persistence.service.impl; + +import com.baeldung.persistence.model.Child; +import com.baeldung.persistence.service.IChildService; +import com.baeldung.persistence.dao.IChildDao; +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.service.common.AbstractHibernateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ChildService extends AbstractHibernateService implements IChildService { + + @Autowired + private IChildDao dao; + + public ChildService() { + super(); + } + + // API + + @Override + protected IOperations getDao() { + return dao; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java new file mode 100644 index 0000000000..45ad315c42 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java @@ -0,0 +1,41 @@ +package com.baeldung.persistence.service.impl; + +import com.baeldung.persistence.dao.common.IAuditOperations; +import com.baeldung.persistence.service.IFooAuditableService; +import com.baeldung.persistence.service.common.AbstractHibernateAuditableService; +import com.baeldung.persistence.dao.IFooAuditableDao; +import com.baeldung.persistence.dao.IFooDao; +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.model.Foo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; + +@Service +public class FooAuditableService extends AbstractHibernateAuditableService implements IFooAuditableService { + + @Autowired + @Qualifier("fooHibernateDao") + private IFooDao dao; + + @Autowired + @Qualifier("fooHibernateAuditableDao") + private IFooAuditableDao auditDao; + + public FooAuditableService() { + super(); + } + + // API + + @Override + protected IOperations getDao() { + return dao; + } + + @Override + protected IAuditOperations getAuditableDao() { + return auditDao; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/FooService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/FooService.java new file mode 100644 index 0000000000..84cf018fee --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/FooService.java @@ -0,0 +1,30 @@ +package com.baeldung.persistence.service.impl; + +import com.baeldung.persistence.dao.IFooDao; +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.model.Foo; +import com.baeldung.persistence.service.IFooService; +import com.baeldung.persistence.service.common.AbstractHibernateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; + +@Service +public class FooService extends AbstractHibernateService implements IFooService { + + @Autowired + @Qualifier("fooHibernateDao") + private IFooDao dao; + + public FooService() { + super(); + } + + // API + + @Override + protected IOperations getDao() { + return dao; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/ParentService.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/ParentService.java new file mode 100644 index 0000000000..078acfc369 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/persistence/service/impl/ParentService.java @@ -0,0 +1,28 @@ +package com.baeldung.persistence.service.impl; + +import com.baeldung.persistence.model.Parent; +import com.baeldung.persistence.service.IParentService; +import com.baeldung.persistence.dao.IParentDao; +import com.baeldung.persistence.dao.common.IOperations; +import com.baeldung.persistence.service.common.AbstractHibernateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ParentService extends AbstractHibernateService implements IParentService { + + @Autowired + private IParentDao dao; + + public ParentService() { + super(); + } + + // API + + @Override + protected IOperations getDao() { + return dao; + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching.cfg.xml new file mode 100644 index 0000000000..1b9a4a191c --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching.cfg.xml @@ -0,0 +1,20 @@ + + + + + + com.mysql.jdbc.Driver + jdbc:mysql://localhost:3306/test + root + iamtheking + org.hibernate.dialect.MySQLDialect + true + validate + + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetchingLazy.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetchingLazy.cfg.xml new file mode 100644 index 0000000000..c5f608e1a7 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetchingLazy.cfg.xml @@ -0,0 +1,17 @@ + + + + + + com.mysql.jdbc.Driver + jdbc:mysql://localhost:3306/test + root + iamtheking + org.hibernate.dialect.MySQLDialect + true + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching_create_queries.sql b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching_create_queries.sql new file mode 100644 index 0000000000..b36d9828f1 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching_create_queries.sql @@ -0,0 +1,14 @@ +CREATE TABLE `user` ( + `user_id` int(10) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 ; + + +CREATE TABLE `user_order` ( + `ORDER_ID` int(10) NOT NULL AUTO_INCREMENT, + `USER_ID` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`ORDER_ID`,`USER_ID`), + KEY `USER_ID` (`USER_ID`), + CONSTRAINT `user_order_ibfk_1` FOREIGN KEY (`USER_ID`) REFERENCES `USER` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; + diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/hibernate5Config.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/hibernate5Config.xml new file mode 100644 index 0000000000..bbb61cb3e0 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/hibernate5Config.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + ${hibernate.hbm2ddl.auto} + ${hibernate.dialect} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/hibernate5Configuration.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/hibernate5Configuration.xml new file mode 100644 index 0000000000..1870cfb917 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/hibernate5Configuration.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + ${hibernate.hbm2ddl.auto} + ${hibernate.dialect} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/immutable.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/immutable.cfg.xml new file mode 100644 index 0000000000..fe1e3cb723 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/immutable.cfg.xml @@ -0,0 +1,38 @@ + + + + + + + + + org.hsqldb.jdbcDriver + jdbc:hsqldb:hsql:mem://localhost/xdb + sa + + + + 1 + + + org.hibernate.dialect.HSQLDialect + + + thread + + + org.hibernate.cache.NoCacheProvider + + + true + + + update + + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/insert_statements.sql b/persistence-modules/spring-data-jpa-query-2/src/main/resources/insert_statements.sql new file mode 100644 index 0000000000..ae008f29bc --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/insert_statements.sql @@ -0,0 +1,31 @@ +insert into item (item_id, item_name, item_desc, item_price) +values(1,'item One', 'test 1', 35.12); + +insert into item (item_id, item_name, item_desc, item_price) +values(2,'Pogo stick', 'Pogo stick', 466.12); +insert into item (item_id, item_name, item_desc, item_price) +values(3,'Raft', 'Raft', 345.12); + +insert into item (item_id, item_name, item_desc, item_price) +values(4,'Skate Board', 'Skating', 135.71); + +insert into item (item_id, item_name, item_desc, item_price) +values(5,'Umbrella', 'Umbrella for Rain', 619.25); + +insert into item (item_id, item_name, item_desc, item_price) +values(6,'Glue', 'Glue for home', 432.73); + +insert into item (item_id, item_name, item_desc, item_price) +values(7,'Paint', 'Paint for Room', 1311.40); + +insert into item (item_id, item_name, item_desc, item_price) +values(8,'Red paint', 'Red paint for room', 1135.71); + +insert into item (item_id, item_name, item_desc, item_price) +values(9,'Household Chairs', 'Chairs for house', 25.71); + +insert into item (item_id, item_name, item_desc, item_price) +values(10,'Office Chairs', 'Chairs for office', 395.98); + +insert into item (item_id, item_name, item_desc, item_price) +values(11,'Outdoor Chairs', 'Chairs for outdoor activities', 1234.36); diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/logback.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/logback.xml new file mode 100644 index 0000000000..56af2d397e --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/logback.xml @@ -0,0 +1,19 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/persistence-mysql.properties b/persistence-modules/spring-data-jpa-query-2/src/main/resources/persistence-mysql.properties new file mode 100644 index 0000000000..f6b6ab6fca --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/persistence-mysql.properties @@ -0,0 +1,13 @@ +# jdbc.X +jdbc.driverClassName=com.mysql.jdbc.Driver +jdbc.url=jdbc:mysql://localhost:3306/spring_hibernate4_01?createDatabaseIfNotExist=true +jdbc.user=tutorialuser +jdbc.pass=tutorialmy5ql + +# hibernate.X +hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +hibernate.show_sql=false +hibernate.hbm2ddl.auto=create-drop + +# envers.X +envers.audit_table_suffix=_audit_log diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/stored_procedure.sql b/persistence-modules/spring-data-jpa-query-2/src/main/resources/stored_procedure.sql new file mode 100644 index 0000000000..9cedb75c37 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/stored_procedure.sql @@ -0,0 +1,20 @@ +DELIMITER // + CREATE PROCEDURE GetFoosByName(IN fooName VARCHAR(255)) + LANGUAGE SQL + DETERMINISTIC + SQL SECURITY DEFINER + BEGIN + SELECT * FROM foo WHERE name = fooName; + END // +DELIMITER ; + + +DELIMITER // + CREATE PROCEDURE GetAllFoos() + LANGUAGE SQL + DETERMINISTIC + SQL SECURITY DEFINER + BEGIN + SELECT * FROM foo; + END // +DELIMITER ; \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/webSecurityConfig.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/webSecurityConfig.xml new file mode 100644 index 0000000000..e5c19a4ad7 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/webSecurityConfig.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java new file mode 100644 index 0000000000..65bf36f8bf --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java @@ -0,0 +1,42 @@ +package com.baeldung.hibernate.fetching; + +import com.baeldung.hibernate.fetching.model.OrderDetail; +import com.baeldung.hibernate.fetching.view.FetchingAppView; +import org.hibernate.Hibernate; +import org.junit.Before; +import org.junit.Test; + +import java.util.Set; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class HibernateFetchingIntegrationTest { + + // this loads sample data in the database + @Before + public void addFecthingTestData() { + FetchingAppView fav = new FetchingAppView(); + fav.createTestData(); + } + + // testLazyFetching() tests the lazy loading + // Since it lazily loaded so orderDetalSetLazy won't + // be initialized + @Test + public void testLazyFetching() { + FetchingAppView fav = new FetchingAppView(); + Set orderDetalSetLazy = fav.lazyLoaded(); + assertFalse(Hibernate.isInitialized(orderDetalSetLazy)); + } + + // testEagerFetching() tests the eager loading + // Since it eagerly loaded so orderDetalSetLazy would + // be initialized + @Test + public void testEagerFetching() { + FetchingAppView fav = new FetchingAppView(); + Set orderDetalSetEager = fav.eagerLoaded(); + assertTrue(Hibernate.isInitialized(orderDetalSetEager)); + } +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java new file mode 100644 index 0000000000..f5c45a5d6f --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java @@ -0,0 +1,25 @@ +package com.baeldung.persistence; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +import com.baeldung.persistence.audit.AuditTestSuite; +import com.baeldung.persistence.hibernate.FooPaginationPersistenceIntegrationTest; +import com.baeldung.persistence.hibernate.FooSortingPersistenceIntegrationTest; +import com.baeldung.persistence.service.FooServiceBasicPersistenceIntegrationTest; +import com.baeldung.persistence.service.FooServicePersistenceIntegrationTest; +import com.baeldung.persistence.service.ParentServicePersistenceIntegrationTest; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ // @formatter:off + AuditTestSuite.class + ,FooServiceBasicPersistenceIntegrationTest.class + ,FooPaginationPersistenceIntegrationTest.class + ,FooServicePersistenceIntegrationTest.class + ,ParentServicePersistenceIntegrationTest.class + ,FooSortingPersistenceIntegrationTest.class + +}) // @formatter:on +public class IntegrationTestSuite { + // +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java new file mode 100644 index 0000000000..34c725d62b --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java @@ -0,0 +1,14 @@ +package com.baeldung.persistence.audit; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ // @formatter:off + EnversFooBarAuditIntegrationTest.class, + JPABarAuditIntegrationTest.class, + SpringDataJPABarAuditIntegrationTest.class +}) // @formatter:on +public class AuditTestSuite { + // +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java new file mode 100644 index 0000000000..444324dafc --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java @@ -0,0 +1,146 @@ +package com.baeldung.persistence.audit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Bar; +import com.baeldung.persistence.model.Foo; +import com.baeldung.persistence.service.IBarAuditableService; +import com.baeldung.persistence.service.IFooAuditableService; +import com.baeldung.spring.config.PersistenceTestConfig; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) +@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS) +public class EnversFooBarAuditIntegrationTest { + + private static Logger logger = LoggerFactory.getLogger(EnversFooBarAuditIntegrationTest.class); + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + logger.info("setUpBeforeClass()"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + logger.info("tearDownAfterClass()"); + } + + @Autowired + @Qualifier("fooHibernateAuditableService") + private IFooAuditableService fooService; + + @Autowired + @Qualifier("barHibernateAuditableService") + private IBarAuditableService barService; + + @Autowired + private SessionFactory sessionFactory; + + private Session session; + + @Before + public void setUp() throws Exception { + logger.info("setUp()"); + makeRevisions(); + session = sessionFactory.openSession(); + } + + @After + public void tearDown() throws Exception { + logger.info("tearDown()"); + session.close(); + } + + private void makeRevisions() { + final Bar bar = rev1(); + rev2(bar); + rev3(bar); + rev4(bar); + } + + // REV #1: insert BAR & FOO1 + private Bar rev1() { + final Bar bar = new Bar("BAR"); + final Foo foo1 = new Foo("FOO1"); + foo1.setBar(bar); + fooService.create(foo1); + return bar; + } + + // REV #2: insert FOO2 & update BAR + private void rev2(final Bar bar) { + final Foo foo2 = new Foo("FOO2"); + foo2.setBar(bar); + fooService.create(foo2); + } + + // REV #3: update BAR + private void rev3(final Bar bar) { + + bar.setName("BAR1"); + barService.update(bar); + } + + // REV #4: insert FOO3 & update BAR + private void rev4(final Bar bar) { + + final Foo foo3 = new Foo("FOO3"); + foo3.setBar(bar); + fooService.create(foo3); + } + + @Test + public final void whenFooBarsModified_thenFooBarsAudited() { + + List barRevisionList; + List fooRevisionList; + + // test Bar revisions + + barRevisionList = barService.getRevisions(); + + assertNotNull(barRevisionList); + assertEquals(4, barRevisionList.size()); + + assertEquals("BAR", barRevisionList.get(0).getName()); + assertEquals("BAR", barRevisionList.get(1).getName()); + assertEquals("BAR1", barRevisionList.get(2).getName()); + assertEquals("BAR1", barRevisionList.get(3).getName()); + + assertEquals(1, barRevisionList.get(0).getFooSet().size()); + assertEquals(2, barRevisionList.get(1).getFooSet().size()); + assertEquals(2, barRevisionList.get(2).getFooSet().size()); + assertEquals(3, barRevisionList.get(3).getFooSet().size()); + + // test Foo revisions + + fooRevisionList = fooService.getRevisions(); + assertNotNull(fooRevisionList); + assertEquals(3, fooRevisionList.size()); + assertEquals("FOO1", fooRevisionList.get(0).getName()); + assertEquals("FOO2", fooRevisionList.get(1).getName()); + assertEquals("FOO3", fooRevisionList.get(2).getName()); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java new file mode 100644 index 0000000000..f591773cde --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java @@ -0,0 +1,104 @@ +package com.baeldung.persistence.audit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Bar; +import com.baeldung.persistence.model.Bar.OPERATION; +import com.baeldung.persistence.service.IBarService; +import com.baeldung.spring.config.PersistenceTestConfig; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) +public class JPABarAuditIntegrationTest { + + private static Logger logger = LoggerFactory.getLogger(JPABarAuditIntegrationTest.class); + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + logger.info("setUpBeforeClass()"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + logger.info("tearDownAfterClass()"); + } + + @Autowired + @Qualifier("barJpaService") + private IBarService barService; + + @Autowired + @Qualifier("jpaEntityManager") + private EntityManagerFactory entityManagerFactory; + + private EntityManager em; + + @Before + public void setUp() throws Exception { + logger.info("setUp()"); + em = entityManagerFactory.createEntityManager(); + } + + @After + public void tearDown() throws Exception { + logger.info("tearDown()"); + em.close(); + } + + @Test + public final void whenBarsModified_thenBarsAudited() { + + // insert BAR1 + Bar bar1 = new Bar("BAR1"); + barService.create(bar1); + + // update BAR1 + bar1.setName("BAR1a"); + barService.update(bar1); + + // insert BAR2 + Bar bar2 = new Bar("BAR2"); + barService.create(bar2); + + // update BAR1 + bar1.setName("BAR1b"); + barService.update(bar1); + + // get BAR1 and BAR2 from the DB and check the audit values + // detach instances from persistence context to make sure we fire db + em.detach(bar1); + em.detach(bar2); + bar1 = barService.findOne(bar1.getId()); + bar2 = barService.findOne(bar2.getId()); + + assertNotNull(bar1); + assertNotNull(bar2); + assertEquals(OPERATION.UPDATE, bar1.getOperation()); + assertEquals(OPERATION.INSERT, bar2.getOperation()); + assertTrue(bar1.getTimestamp() > bar2.getTimestamp()); + + barService.deleteById(bar1.getId()); + barService.deleteById(bar2.getId()); + + } + +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java new file mode 100644 index 0000000000..0603067810 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java @@ -0,0 +1,78 @@ +package com.baeldung.persistence.audit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Bar; +import com.baeldung.persistence.service.IBarService; +import com.baeldung.spring.config.PersistenceTestConfig; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) +public class SpringDataJPABarAuditIntegrationTest { + + private static Logger logger = LoggerFactory.getLogger(SpringDataJPABarAuditIntegrationTest.class); + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + logger.info("setUpBeforeClass()"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + logger.info("tearDownAfterClass()"); + } + + @Autowired + @Qualifier("barSpringDataJpaService") + private IBarService barService; + + @Autowired + @Qualifier("jpaEntityManager") + private EntityManagerFactory entityManagerFactory; + + private EntityManager em; + + @Before + public void setUp() throws Exception { + logger.info("setUp()"); + em = entityManagerFactory.createEntityManager(); + } + + @After + public void tearDown() throws Exception { + logger.info("tearDown()"); + em.close(); + } + + @Test + @WithMockUser(username = "tutorialuser") + public final void whenBarsModified_thenBarsAudited() { + Bar bar = new Bar("BAR1"); + barService.create(bar); + assertEquals(bar.getCreatedDate(), bar.getModifiedDate()); + assertEquals("tutorialuser", bar.getCreatedBy(), bar.getModifiedBy()); + bar.setName("BAR2"); + bar = barService.update(bar); + assertTrue(bar.getCreatedDate() < bar.getModifiedDate()); + assertEquals("tutorialuser", bar.getCreatedBy(), bar.getModifiedBy()); + } +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java new file mode 100644 index 0000000000..da840dc027 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java @@ -0,0 +1,101 @@ +package com.baeldung.persistence.hibernate; + +import java.util.List; + +import com.baeldung.persistence.model.Foo; +import com.baeldung.persistence.model.Bar; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.Transaction; + +import com.google.common.collect.Lists; + +public class FooFixtures { + private SessionFactory sessionFactory; + + public FooFixtures(final SessionFactory sessionFactory) { + super(); + + this.sessionFactory = sessionFactory; + } + + // API + + public void createBars() { + Session session = null; + Transaction tx = null; + session = sessionFactory.openSession(); + tx = session.getTransaction(); + try { + tx.begin(); + for (int i = 156; i < 160; i++) { + final Bar bar = new Bar(); + bar.setName("Bar_" + i); + final Foo foo = new Foo("Foo_" + (i + 120)); + foo.setBar(bar); + session.save(foo); + final Foo foo2 = new Foo(null); + if (i % 2 == 0) + foo2.setName("LuckyFoo" + (i + 120)); + foo2.setBar(bar); + session.save(foo2); + bar.getFooSet().add(foo); + bar.getFooSet().add(foo2); + session.merge(bar); + } + tx.commit(); + session.flush(); + } catch (final HibernateException he) { + if (tx != null) + tx.rollback(); + System.out.println("Not able to open session"); + he.printStackTrace(); + } catch (final Exception e) { + e.printStackTrace(); + } finally { + if (session != null) + session.close(); + } + + } + + public void createFoos() { + Session session = null; + Transaction tx = null; + session = sessionFactory.openSession(); + tx = session.getTransaction(); + final List fooList = Lists.newArrayList(); + for (int i = 35; i < 46; i++) { + + final Foo foo = new Foo(); + foo.setName("Foo_" + (i + 120)); + final Bar bar = new Bar("bar_" + i); + bar.getFooSet().add(foo); + foo.setBar(bar); + fooList.add(foo); + + } + try { + tx.begin(); + for (final Foo foo : fooList) { + + session.save(foo.getBar()); + session.save(foo); + } + tx.commit(); + session.flush(); + } catch (final HibernateException he) { + if (tx != null) + tx.rollback(); + System.out.println("Not able to open session"); + he.printStackTrace(); + } catch (final Exception e) { + e.printStackTrace(); + } finally { + if (session != null) + session.close(); + } + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java new file mode 100644 index 0000000000..fd7bc4aabf --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java @@ -0,0 +1,185 @@ +package com.baeldung.persistence.hibernate; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.lessThan; +import static org.junit.Assert.assertThat; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.ScrollMode; +import org.hibernate.ScrollableResults; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Projections; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Foo; +import com.baeldung.persistence.service.IFooService; +import com.baeldung.spring.config.PersistenceTestConfig; +import com.google.common.collect.Lists; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) +public class FooPaginationPersistenceIntegrationTest { + + @Autowired + private IFooService fooService; + + @Autowired + private SessionFactory sessionFactory; + + private Session session; + + // tests + + @Before + public final void before() { + final int minimalNumberOfEntities = 25; + if (fooService.findAll().size() <= minimalNumberOfEntities) { + for (int i = 0; i < minimalNumberOfEntities; i++) { + fooService.create(new Foo(randomAlphabetic(6))); + } + } + + session = sessionFactory.openSession(); + } + + @After + public final void after() { + session.close(); + } + + // tests + + @Test + public final void whenContextIsBootstrapped_thenNoExceptions() { + // + } + + @SuppressWarnings("unchecked") + @Test + public final void whenRetrievingPaginatedEntities_thenCorrectSize() { + final int pageNumber = 1; + final int pageSize = 10; + + final Query query = session.createQuery("From Foo"); + query.setFirstResult((pageNumber - 1) * pageSize); + query.setMaxResults(pageSize); + final List fooList = query.list(); + + assertThat(fooList, hasSize(pageSize)); + } + + @SuppressWarnings("unchecked") + @Test + public final void whenRetrievingAllPages_thenCorrect() { + int pageNumber = 1; + final int pageSize = 10; + + final String countQ = "Select count (f.id) from Foo f"; + final Query countQuery = session.createQuery(countQ); + final Long countResult = (Long) countQuery.uniqueResult(); + + final List fooList = Lists.newArrayList(); + int totalEntities = 0; + final Query query = session.createQuery("From Foo"); + while (totalEntities < countResult) { + query.setFirstResult((pageNumber - 1) * pageSize); + query.setMaxResults(pageSize); + fooList.addAll(query.list()); + totalEntities = fooList.size(); + pageNumber++; + } + } + + @SuppressWarnings("unchecked") + @Test + public final void whenRetrievingLastPage_thenCorrectSize() { + final int pageSize = 10; + + final String countQ = "Select count (f.id) from Foo f"; + final Query countQuery = session.createQuery(countQ); + final Long countResults = (Long) countQuery.uniqueResult(); + final int lastPageNumber = (int) (Math.ceil(countResults / pageSize)); + + final Query selectQuery = session.createQuery("From Foo"); + selectQuery.setFirstResult((lastPageNumber - 1) * pageSize); + selectQuery.setMaxResults(pageSize); + final List lastPage = selectQuery.list(); + + assertThat(lastPage, hasSize(lessThan(pageSize + 1))); + } + + // testing - scrollable + + @Test + public final void givenUsingTheScrollableApi_whenRetrievingPaginatedData_thenCorrect() { + final int pageSize = 10; + final String hql = "FROM Foo f order by f.name"; + final Query query = session.createQuery(hql); + + final ScrollableResults resultScroll = query.scroll(ScrollMode.FORWARD_ONLY); + + // resultScroll.last(); + // final int totalResults = resultScroll.getRowNumber() + 1; + + resultScroll.first(); + resultScroll.scroll(0); + final List fooPage = Lists.newArrayList(); + int i = 0; + while (pageSize > i++) { + fooPage.add((Foo) resultScroll.get(0)); + if (!resultScroll.next()) { + break; + } + } + + assertThat(fooPage, hasSize(lessThan(10 + 1))); + } + + @SuppressWarnings("unchecked") + @Test + public final void givenUsingTheCriteriaApi_whenRetrievingFirstPage_thenCorrect() { + final int pageSize = 10; + + final Criteria criteria = session.createCriteria(Foo.class); + criteria.setFirstResult(0); + criteria.setMaxResults(pageSize); + final List firstPage = criteria.list(); + + assertThat(firstPage, hasSize(pageSize)); + } + + @SuppressWarnings("unchecked") + @Test + public final void givenUsingTheCriteriaApi_whenRetrievingPaginatedData_thenCorrect() { + final Criteria criteriaCount = session.createCriteria(Foo.class); + criteriaCount.setProjection(Projections.rowCount()); + final Long count = (Long) criteriaCount.uniqueResult(); + + int pageNumber = 1; + final int pageSize = 10; + final List fooList = Lists.newArrayList(); + + final Criteria criteria = session.createCriteria(Foo.class); + int totalEntities = 0; + while (totalEntities < count.intValue()) { + criteria.setFirstResult((pageNumber - 1) * pageSize); + criteria.setMaxResults(pageSize); + fooList.addAll(criteria.list()); + totalEntities = fooList.size(); + pageNumber++; + } + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java new file mode 100644 index 0000000000..8173088af0 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java @@ -0,0 +1,174 @@ +package com.baeldung.persistence.hibernate; + +import static org.junit.Assert.assertNull; + +import java.util.List; +import java.util.Set; + +import org.hibernate.Criteria; +import org.hibernate.NullPrecedence; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Order; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Bar; +import com.baeldung.persistence.model.Foo; +import com.baeldung.spring.config.PersistenceTestConfig; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) +@SuppressWarnings("unchecked") +public class FooSortingPersistenceIntegrationTest { + + @Autowired + private SessionFactory sessionFactory; + + private Session session; + + @Before + public void before() { + session = sessionFactory.openSession(); + + session.beginTransaction(); + + final FooFixtures fooData = new FooFixtures(sessionFactory); + fooData.createBars(); + } + + @After + public void after() { + session.getTransaction().commit(); + session.close(); + } + + @Test + public final void whenHQlSortingByOneAttribute_thenPrintSortedResults() { + final String hql = "FROM Foo f ORDER BY f.name"; + final Query query = session.createQuery(hql); + final List fooList = query.list(); + for (final Foo foo : fooList) { + System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); + } + } + + @Test + public final void whenHQlSortingByStringNullLast_thenLastNull() { + final String hql = "FROM Foo f ORDER BY f.name NULLS LAST"; + final Query query = session.createQuery(hql); + final List fooList = query.list(); + + assertNull(fooList.get(fooList.toArray().length - 1).getName()); + for (final Foo foo : fooList) { + System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); + } + } + + @Test + public final void whenSortingByStringNullsFirst_thenReturnNullsFirst() { + final String hql = "FROM Foo f ORDER BY f.name NULLS FIRST"; + final Query query = session.createQuery(hql); + final List fooList = query.list(); + assertNull(fooList.get(0).getName()); + for (final Foo foo : fooList) { + System.out.println("Name:" + foo.getName()); + + } + } + + @Test + public final void whenHQlSortingByOneAttribute_andOrderDirection_thenPrintSortedResults() { + final String hql = "FROM Foo f ORDER BY f.name ASC"; + final Query query = session.createQuery(hql); + final List fooList = query.list(); + for (final Foo foo : fooList) { + System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); + } + } + + @Test + public final void whenHQlSortingByMultipleAttributes_thenSortedResults() { + final String hql = "FROM Foo f ORDER BY f.name, f.id"; + final Query query = session.createQuery(hql); + final List fooList = query.list(); + for (final Foo foo : fooList) { + System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); + } + } + + @Test + public final void whenHQlSortingByMultipleAttributes_andOrderDirection_thenPrintSortedResults() { + final String hql = "FROM Foo f ORDER BY f.name DESC, f.id ASC"; + final Query query = session.createQuery(hql); + final List fooList = query.list(); + for (final Foo foo : fooList) { + System.out.println("Name: " + foo.getName() + ", Id: " + foo.getId()); + } + } + + @Test + public final void whenHQLCriteriaSortingByOneAttr_thenPrintSortedResults() { + final Criteria criteria = session.createCriteria(Foo.class, "FOO"); + criteria.addOrder(Order.asc("id")); + final List fooList = criteria.list(); + for (final Foo foo : fooList) { + System.out.println("Id: " + foo.getId() + ", FirstName: " + foo.getName()); + } + } + + @Test + public final void whenHQLCriteriaSortingByMultipAttr_thenSortedResults() { + final Criteria criteria = session.createCriteria(Foo.class, "FOO"); + criteria.addOrder(Order.asc("name")); + criteria.addOrder(Order.asc("id")); + final List fooList = criteria.list(); + for (final Foo foo : fooList) { + System.out.println("Id: " + foo.getId() + ", FirstName: " + foo.getName()); + } + } + + @Test + public final void whenCriteriaSortingStringNullsLastAsc_thenNullsLast() { + final Criteria criteria = session.createCriteria(Foo.class, "FOO"); + criteria.addOrder(Order.asc("name").nulls(NullPrecedence.LAST)); + final List fooList = criteria.list(); + assertNull(fooList.get(fooList.toArray().length - 1).getName()); + for (final Foo foo : fooList) { + System.out.println("Id: " + foo.getId() + ", FirstName: " + foo.getName()); + } + } + + @Test + public final void whenCriteriaSortingStringNullsFirstDesc_thenNullsFirst() { + final Criteria criteria = session.createCriteria(Foo.class, "FOO"); + criteria.addOrder(Order.desc("name").nulls(NullPrecedence.FIRST)); + final List fooList = criteria.list(); + assertNull(fooList.get(0).getName()); + for (final Foo foo : fooList) { + System.out.println("Id: " + foo.getId() + ", FirstName: " + foo.getName()); + } + } + + @Test + public final void whenSortingBars_thenBarsWithSortedFoos() { + final String hql = "FROM Bar b ORDER BY b.id"; + final Query query = session.createQuery(hql); + final List barList = query.list(); + for (final Bar bar : barList) { + final Set fooSet = bar.getFooSet(); + System.out.println("Bar Id:" + bar.getId()); + for (final Foo foo : fooSet) { + System.out.println("FooName:" + foo.getName()); + } + } + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java new file mode 100644 index 0000000000..146f8e9622 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java @@ -0,0 +1,55 @@ +package com.baeldung.persistence.service; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Foo; +import com.baeldung.spring.config.PersistenceTestConfig; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) +public class FooServiceBasicPersistenceIntegrationTest { + + @Autowired + private SessionFactory sessionFactory; + + @Autowired + private IFooService fooService; + + private Session session; + + // tests + + @Before + public final void before() { + session = sessionFactory.openSession(); + } + + @After + public final void after() { + session.close(); + } + + // tests + + @Test + public final void whenContextIsBootstrapped_thenNoExceptions() { + // + } + + @Test + public final void whenEntityIsCreated_thenNoExceptions() { + fooService.create(new Foo(randomAlphabetic(6))); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java new file mode 100644 index 0000000000..6d426849a6 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java @@ -0,0 +1,64 @@ +package com.baeldung.persistence.service; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; + +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.dao.DataAccessException; +import org.springframework.dao.DataIntegrityViolationException; +import org.springframework.dao.InvalidDataAccessApiUsageException; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Foo; +import com.baeldung.spring.config.PersistenceTestConfig; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) +public class FooServicePersistenceIntegrationTest { + + @Autowired + @Qualifier("fooHibernateService") + private IFooService service; + + // tests + + @Test + public final void whenContextIsBootstrapped_thenNoExceptions() { + // + } + + @Test + public final void whenEntityIsCreated_thenNoExceptions() { + service.create(new Foo(randomAlphabetic(6))); + } + + @Test(expected = DataIntegrityViolationException.class) + @Ignore("work in progress") + public final void whenInvalidEntityIsCreated_thenDataException() { + service.create(new Foo()); + } + + @Test(expected = DataIntegrityViolationException.class) + public final void whenEntityWithLongNameIsCreated_thenDataException() { + service.create(new Foo(randomAlphabetic(2048))); + } + + @Test(expected = InvalidDataAccessApiUsageException.class) + @Ignore("Right now, persist has saveOrUpdate semantics, so this will no longer fail") + public final void whenSameEntityIsCreatedTwice_thenDataException() { + final Foo entity = new Foo(randomAlphabetic(8)); + service.create(entity); + service.create(entity); + } + + @Test(expected = DataAccessException.class) + public final void temp_whenInvalidEntityIsCreated_thenDataException() { + service.create(new Foo(randomAlphabetic(2048))); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java new file mode 100644 index 0000000000..8bf33c4110 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java @@ -0,0 +1,121 @@ +package com.baeldung.persistence.service; + +import java.util.List; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.junit.Assert.assertEquals; + +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.exception.SQLGrammarException; +import org.junit.After; +import org.junit.Assume; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.config.PersistenceConfig; +import com.baeldung.persistence.model.Foo; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) +public class FooStoredProceduresLiveTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(FooStoredProceduresLiveTest.class); + + @Autowired + private SessionFactory sessionFactory; + + @Autowired + private IFooService fooService; + + private Session session; + + @Before + public final void before() { + session = sessionFactory.openSession(); + Assume.assumeTrue(getAllFoosExists()); + Assume.assumeTrue(getFoosByNameExists()); + } + + private boolean getFoosByNameExists() { + try { + Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); + sqlQuery.list(); + return true; + } catch (SQLGrammarException e) { + LOGGER.error("WARNING : GetFoosByName() Procedure is may be missing ", e); + return false; + } + } + + private boolean getAllFoosExists() { + try { + Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); + sqlQuery.list(); + return true; + } catch (SQLGrammarException e) { + LOGGER.error("WARNING : GetAllFoos() Procedure is may be missing ", e); + return false; + } + } + + @After + public final void after() { + session.close(); + } + + @Test + public final void getAllFoosUsingStoredProcedures() { + + fooService.create(new Foo(randomAlphabetic(6))); + + // Stored procedure getAllFoos using createSQLQuery + Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); + @SuppressWarnings("unchecked") + List allFoos = sqlQuery.list(); + for (Foo foo : allFoos) { + LOGGER.info("getAllFoos() SQL Query result : {}", foo.getName()); + } + assertEquals(allFoos.size(), fooService.findAll().size()); + + // Stored procedure getAllFoos using a Named Query + Query namedQuery = session.getNamedQuery("callGetAllFoos"); + @SuppressWarnings("unchecked") + List allFoos2 = namedQuery.list(); + for (Foo foo : allFoos2) { + LOGGER.info("getAllFoos() NamedQuery result : {}", foo.getName()); + } + assertEquals(allFoos2.size(), fooService.findAll().size()); + } + + @Test + public final void getFoosByNameUsingStoredProcedures() { + + fooService.create(new Foo("NewFooName")); + + // Stored procedure getFoosByName using createSQLQuery() + Query sqlQuery = session.createSQLQuery("CALL GetFoosByName(:fooName)").addEntity(Foo.class).setParameter("fooName", "NewFooName"); + @SuppressWarnings("unchecked") + List allFoosByName = sqlQuery.list(); + for (Foo foo : allFoosByName) { + LOGGER.info("getFoosByName() using SQL Query : found => {}", foo.toString()); + } + + // Stored procedure getFoosByName using getNamedQuery() + Query namedQuery = session.getNamedQuery("callGetFoosByName").setParameter("fooName", "NewFooName"); + @SuppressWarnings("unchecked") + List allFoosByName2 = namedQuery.list(); + for (Foo foo : allFoosByName2) { + LOGGER.info("getFoosByName() using Native Query : found => {}", foo.toString()); + } + + } +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java new file mode 100644 index 0000000000..5a73e39ca2 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java @@ -0,0 +1,70 @@ +package com.baeldung.persistence.service; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataIntegrityViolationException; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Child; +import com.baeldung.persistence.model.Parent; +import com.baeldung.spring.config.PersistenceTestConfig; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceTestConfig.class }, loader = AnnotationConfigContextLoader.class) +public class ParentServicePersistenceIntegrationTest { + + @Autowired + private IParentService service; + + @Autowired + private IChildService childService; + + // tests + + @Test + public final void whenContextIsBootstrapped_thenNoExceptions() { + // + } + + @Test + public final void whenOneToOneEntitiesAreCreated_thenNoExceptions() { + final Child childEntity = new Child(); + childService.create(childEntity); + + final Parent parentEntity = new Parent(childEntity); + service.create(parentEntity); + + System.out.println("Child = " + childService.findOne(childEntity.getId())); + System.out.println("Child - parent = " + childService.findOne(childEntity.getId()).getParent()); + + System.out.println("Parent = " + service.findOne(parentEntity.getId())); + System.out.println("Parent - child = " + service.findOne(parentEntity.getId()).getChild()); + } + + @Test(expected = DataIntegrityViolationException.class) + public final void whenChildIsDeletedWhileParentStillHasForeignKeyToIt_thenDataException() { + final Child childEntity = new Child(); + childService.create(childEntity); + + final Parent parentEntity = new Parent(childEntity); + service.create(parentEntity); + + childService.delete(childEntity); + } + + @Test + public final void whenChildIsDeletedAfterTheParent_thenNoExceptions() { + final Child childEntity = new Child(); + childService.create(childEntity); + + final Parent parentEntity = new Parent(childEntity); + service.create(parentEntity); + + service.delete(parentEntity); + childService.delete(childEntity); + } + +} diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java new file mode 100644 index 0000000000..34301741fe --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java @@ -0,0 +1,179 @@ +package com.baeldung.spring.config; + +import java.util.Properties; + +import javax.sql.DataSource; + +import org.apache.tomcat.dbcp.dbcp2.BasicDataSource; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.env.Environment; +import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.orm.hibernate5.HibernateTransactionManager; +import org.springframework.orm.hibernate5.LocalSessionFactoryBean; +import org.springframework.orm.jpa.JpaTransactionManager; +import org.springframework.orm.jpa.JpaVendorAdapter; +import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; +import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import com.baeldung.persistence.dao.IBarAuditableDao; +import com.baeldung.persistence.dao.IBarDao; +import com.baeldung.persistence.dao.IFooAuditableDao; +import com.baeldung.persistence.dao.IFooDao; +import com.baeldung.persistence.dao.impl.BarAuditableDao; +import com.baeldung.persistence.dao.impl.BarDao; +import com.baeldung.persistence.dao.impl.BarJpaDao; +import com.baeldung.persistence.dao.impl.FooAuditableDao; +import com.baeldung.persistence.dao.impl.FooDao; +import com.baeldung.persistence.service.IBarAuditableService; +import com.baeldung.persistence.service.IBarService; +import com.baeldung.persistence.service.IFooAuditableService; +import com.baeldung.persistence.service.IFooService; +import com.baeldung.persistence.service.impl.BarAuditableService; +import com.baeldung.persistence.service.impl.BarJpaService; +import com.baeldung.persistence.service.impl.BarSpringDataJpaService; +import com.baeldung.persistence.service.impl.FooAuditableService; +import com.baeldung.persistence.service.impl.FooService; +import com.google.common.base.Preconditions; + +@Configuration +@EnableTransactionManagement +@EnableJpaRepositories(basePackages = { "com.baeldung.persistence" }, transactionManagerRef = "jpaTransactionManager", entityManagerFactoryRef = "jpaEntityManager") +@EnableJpaAuditing +@PropertySource({ "classpath:persistence-h2.properties" }) +@ComponentScan({ "com.baeldung.persistence" }) +public class PersistenceTestConfig { + + @Autowired + private Environment env; + + public PersistenceTestConfig() { + super(); + } + + @Bean + public LocalSessionFactoryBean sessionFactory() { + final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); + sessionFactory.setDataSource(restDataSource()); + sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); + sessionFactory.setHibernateProperties(hibernateProperties()); + + return sessionFactory; + } + + @Bean("jpaEntityManager") + public LocalContainerEntityManagerFactoryBean entityManagerFactory() { + final LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean(); + emf.setDataSource(restDataSource()); + emf.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); + + final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); + emf.setJpaVendorAdapter(vendorAdapter); + emf.setJpaProperties(hibernateProperties()); + + return emf; + } + + @Bean + public DataSource restDataSource() { + final BasicDataSource dataSource = new BasicDataSource(); + dataSource.setDriverClassName(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName"))); + dataSource.setUrl(Preconditions.checkNotNull(env.getProperty("jdbc.url"))); + dataSource.setUsername(Preconditions.checkNotNull(env.getProperty("jdbc.user"))); + dataSource.setPassword(Preconditions.checkNotNull(env.getProperty("jdbc.pass"))); + + return dataSource; + } + + @Bean + public PlatformTransactionManager hibernateTransactionManager() { + final HibernateTransactionManager transactionManager = new HibernateTransactionManager(); + transactionManager.setSessionFactory(sessionFactory().getObject()); + return transactionManager; + } + + @Bean + public PlatformTransactionManager jpaTransactionManager() { + final JpaTransactionManager transactionManager = new JpaTransactionManager(); + transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); + return transactionManager; + } + + @Bean + public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { + return new PersistenceExceptionTranslationPostProcessor(); + } + + @Bean + public IBarService barJpaService() { + return new BarJpaService(); + } + + @Bean + public IBarService barSpringDataJpaService() { + return new BarSpringDataJpaService(); + } + + @Bean + public IFooService fooHibernateService() { + return new FooService(); + } + + @Bean + public IBarAuditableService barHibernateAuditableService() { + return new BarAuditableService(); + } + + @Bean + public IFooAuditableService fooHibernateAuditableService() { + return new FooAuditableService(); + } + + @Bean + public IBarDao barJpaDao() { + return new BarJpaDao(); + } + + @Bean + public IBarDao barHibernateDao() { + return new BarDao(); + } + + @Bean + public IBarAuditableDao barHibernateAuditableDao() { + return new BarAuditableDao(); + } + + @Bean + public IFooDao fooHibernateDao() { + return new FooDao(); + } + + @Bean + public IFooAuditableDao fooHibernateAuditableDao() { + return new FooAuditableDao(); + } + + private final Properties hibernateProperties() { + final Properties hibernateProperties = new Properties(); + hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); + hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); + + hibernateProperties.setProperty("hibernate.show_sql", "true"); + // hibernateProperties.setProperty("hibernate.format_sql", "true"); + // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); + + // Envers properties + hibernateProperties.setProperty("org.hibernate.envers.audit_table_suffix", env.getProperty("envers.audit_table_suffix")); + + return hibernateProperties; + } + +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/spring/data/jpa/query/datetime/ArticleRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/spring/data/jpa/query/datetime/ArticleRepositoryIntegrationTest.java index 38fd804195..b1158b3dae 100644 --- a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/spring/data/jpa/query/datetime/ArticleRepositoryIntegrationTest.java +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/spring/data/jpa/query/datetime/ArticleRepositoryIntegrationTest.java @@ -6,6 +6,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.test.context.junit4.SpringRunner; +import com.baeldung.spring.data.jpa.query.datetime.Article; +import com.baeldung.spring.data.jpa.query.datetime.ArticleRepository; + import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.List; diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetching.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetching.cfg.xml new file mode 100644 index 0000000000..55a3aeb51c --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetching.cfg.xml @@ -0,0 +1,19 @@ + + + + + + org.h2.Driver + jdbc:h2:mem:testdb + sa + + org.hibernate.dialect.H2Dialect + update + true + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetchingLazy.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetchingLazy.cfg.xml new file mode 100644 index 0000000000..8fcf578660 --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetchingLazy.cfg.xml @@ -0,0 +1,19 @@ + + + + + + org.h2.Driver + jdbc:h2:mem:testdb + sa + + org.hibernate.dialect.H2Dialect + update + true + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/resources/persistence-h2.properties b/persistence-modules/spring-data-jpa-query-2/src/test/resources/persistence-h2.properties new file mode 100644 index 0000000000..911619193b --- /dev/null +++ b/persistence-modules/spring-data-jpa-query-2/src/test/resources/persistence-h2.properties @@ -0,0 +1,13 @@ +# jdbc.X +jdbc.driverClassName=org.h2.Driver +jdbc.url=jdbc:h2:mem:test +jdbc.user=sa +jdbc.pass= + +# hibernate.X +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.show_sql=false +hibernate.hbm2ddl.auto=create-drop + +# envers.X +envers.audit_table_suffix=_audit_log From 6d9024049e1cdc01f22c77f3d9160cf3d8e0d410 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 28 Sep 2020 23:18:18 +0530 Subject: [PATCH 042/302] JAVA-2432: Added link to existing article --- persistence-modules/spring-hibernate-5/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/persistence-modules/spring-hibernate-5/README.md b/persistence-modules/spring-hibernate-5/README.md index 6d7526a13b..c7506026dd 100644 --- a/persistence-modules/spring-hibernate-5/README.md +++ b/persistence-modules/spring-hibernate-5/README.md @@ -12,4 +12,5 @@ This module contains articles about Hibernate 5 with Spring. - [Hibernate Second-Level Cache](http://www.baeldung.com/hibernate-second-level-cache) - [Deleting Objects with Hibernate](http://www.baeldung.com/delete-with-hibernate) - [Spring, Hibernate and a JNDI Datasource](http://www.baeldung.com/spring-persistence-jpa-jndi-datasource) -- [@Immutable in Hibernate](http://www.baeldung.com/hibernate-immutable) \ No newline at end of file +- [@Immutable in Hibernate](http://www.baeldung.com/hibernate-immutable) +- [Guide to Hibernate 5 with Spring](https://www.baeldung.com/hibernate-4-spring) \ No newline at end of file From 427581b3a64807d552f0cd58d9c858177121840d Mon Sep 17 00:00:00 2001 From: Anirban Chatterjee Date: Mon, 28 Sep 2020 23:21:40 +0200 Subject: [PATCH 043/302] Code cleanup --- .../componentscanautoconfigure/EmployeeApplication.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java index 108dd1a695..d429b0cdc9 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java @@ -3,7 +3,7 @@ package com.baeldung.annotations.componentscanautoconfigure; import com.baeldung.annotations.componentscanautoconfigure.teacher.Teacher; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.aop.AopAutoConfiguration; +import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -11,8 +11,8 @@ import org.springframework.context.annotation.Configuration; @Configuration @ComponentScan(basePackages = {"com.baeldung.annotations.componentscanautoconfigure.doctor", "com.baeldung.annotations.componentscanautoconfigure.employee"}, basePackageClasses = Teacher.class) -@EnableAutoConfiguration(exclude={AopAutoConfiguration.class}) -//@EnableAutoConfiguration(excludeName = {"org.springframework.boot.autoconfigure.aop"}) +@EnableAutoConfiguration(exclude={JdbcTemplateAutoConfiguration.class}) +//@EnableAutoConfiguration(excludeName = {"org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration"}) public class EmployeeApplication { public static void main(String[] args) { From 42141b88891f3b331435a90957e59892ef49861b Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 29 Sep 2020 05:30:32 +0200 Subject: [PATCH 044/302] BAEL-4520 Getting Started with jOOQ (#10101) Co-authored-by: Krzysztof Majewski --- .../src/main/java/com/baeldung/jooq/Crud.java | 18 +++++----- .../java/com/baeldung/jooq/CrudExamples.java | 34 +++++++++---------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/persistence-modules/jooq/src/main/java/com/baeldung/jooq/Crud.java b/persistence-modules/jooq/src/main/java/com/baeldung/jooq/Crud.java index 0427b71c25..fb3d21c467 100644 --- a/persistence-modules/jooq/src/main/java/com/baeldung/jooq/Crud.java +++ b/persistence-modules/jooq/src/main/java/com/baeldung/jooq/Crud.java @@ -19,14 +19,14 @@ public class Crud { public static Result getAll(DSLContext context, Table table) { return context.select() - .from(table) - .fetch(); + .from(table) + .fetch(); } public static Result getFields(DSLContext context, Table table, SelectFieldOrAsterisk... fields) { return context.select(fields) - .from(table) - .fetch(); + .from(table) + .fetch(); } public static R getOne(DSLContext context, Table table, Condition condition) { @@ -35,9 +35,9 @@ public class Crud { public static void update(DSLContext context, Table table, Map, T> values, Condition condition) { context.update(table) - .set(values) - .where(condition) - .execute(); + .set(values) + .where(condition) + .execute(); } public static > void update(UpdatableRecord record) { @@ -46,8 +46,8 @@ public class Crud { public static void delete(DSLContext context, Table table, Condition condition) { context.delete(table) - .where(condition) - .execute(); + .where(condition) + .execute(); } public static > void delete(UpdatableRecord record) { diff --git a/persistence-modules/jooq/src/main/java/com/baeldung/jooq/CrudExamples.java b/persistence-modules/jooq/src/main/java/com/baeldung/jooq/CrudExamples.java index 87a7b6439e..57f6df4915 100644 --- a/persistence-modules/jooq/src/main/java/com/baeldung/jooq/CrudExamples.java +++ b/persistence-modules/jooq/src/main/java/com/baeldung/jooq/CrudExamples.java @@ -60,8 +60,8 @@ public class CrudExamples { private void readValues(DSLContext context) { Result authors = getAll( - context, - Author.AUTHOR + context, + Author.AUTHOR ); authors.forEach(author -> { @@ -73,15 +73,15 @@ public class CrudExamples { }); Result articles = getFields( - context, - Author.AUTHOR, - Article.ARTICLE.ID, Article.ARTICLE.TITLE + context, + Author.AUTHOR, + Article.ARTICLE.ID, Article.ARTICLE.TITLE ); AuthorRecord author = getOne( - context, - Author.AUTHOR, - Author.AUTHOR.ID.eq(1) + context, + Author.AUTHOR, + Author.AUTHOR.ID.eq(1) ); } @@ -90,24 +90,22 @@ public class CrudExamples { fieldsToUpdate.put(Author.AUTHOR.FIRST_NAME, "David"); fieldsToUpdate.put(Author.AUTHOR.LAST_NAME, "Brown"); update( - context, - Author.AUTHOR, - fieldsToUpdate, - Author.AUTHOR.ID.eq(1) + context, + Author.AUTHOR, + fieldsToUpdate, + Author.AUTHOR.ID.eq(1) ); ArticleRecord article = context.fetchOne(Article.ARTICLE, Article.ARTICLE.ID.eq(1)); article.setTitle("A New Article Title"); - update( - article - ); + update(article); } private void deleteValues(DSLContext context) { delete( - context, - Article.ARTICLE, - Article.ARTICLE.ID.eq(1) + context, + Article.ARTICLE, + Article.ARTICLE.ID.eq(1) ); AuthorRecord author = context.fetchOne(Author.AUTHOR, Author.AUTHOR.ID.eq(1)); From 154a23d9d968933ba697525457f9ffb3ffbfbec8 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 29 Sep 2020 05:32:37 +0200 Subject: [PATCH 045/302] BAEL-3997 (#10102) * BAEL-3997 Verify Working with Date Parameters in Spring app level config * rename properties Co-authored-by: Krzysztof Majewski --- .../com/baeldung/datetime/DateTimeConfig.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/spring-mvc-java-2/src/main/java/com/baeldung/datetime/DateTimeConfig.java b/spring-mvc-java-2/src/main/java/com/baeldung/datetime/DateTimeConfig.java index 8a5d1c71af..c89b043486 100644 --- a/spring-mvc-java-2/src/main/java/com/baeldung/datetime/DateTimeConfig.java +++ b/spring-mvc-java-2/src/main/java/com/baeldung/datetime/DateTimeConfig.java @@ -2,28 +2,35 @@ package com.baeldung.datetime; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.format.datetime.DateFormatter; +import org.springframework.format.datetime.DateFormatterRegistrar; import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; import org.springframework.format.number.NumberFormatAnnotationFormatterFactory; import org.springframework.format.support.DefaultFormattingConversionService; import org.springframework.format.support.FormattingConversionService; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import java.time.format.DateTimeFormatter; @Configuration -class DateTimeConfig { +public class DateTimeConfig extends WebMvcConfigurationSupport { @Bean - public FormattingConversionService conversionService() { + @Override + public FormattingConversionService mvcConversionService() { DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(false); conversionService.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory()); - DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); - registrar.setDateFormatter(DateTimeFormatter.ofPattern("dd.MM.yyyy")); - registrar.setDateTimeFormatter(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss")); - registrar.registerFormatters(conversionService); + DateTimeFormatterRegistrar dateTimeRegistrar = new DateTimeFormatterRegistrar(); + dateTimeRegistrar.setDateFormatter(DateTimeFormatter.ofPattern("dd.MM.yyyy")); + dateTimeRegistrar.setDateTimeFormatter(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss")); + dateTimeRegistrar.registerFormatters(conversionService); + + DateFormatterRegistrar dateRegistrar = new DateFormatterRegistrar(); + dateRegistrar.setFormatter(new DateFormatter("dd.MM.yyyy")); + dateRegistrar.registerFormatters(conversionService); return conversionService; } - } \ No newline at end of file From 92bd1bbae6c75938ff8286671b6195a274ccd24a Mon Sep 17 00:00:00 2001 From: kwoyke Date: Tue, 29 Sep 2020 14:54:05 +0200 Subject: [PATCH 046/302] BAEL-2626: Update Feign to 10.11 (#10105) --- feign/pom.xml | 20 +------------------ .../feign/clients/BookClientLiveTest.java | 3 --- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/feign/pom.xml b/feign/pom.xml index 4b994be1f2..da3cbcb0fd 100644 --- a/feign/pom.xml +++ b/feign/pom.xml @@ -16,11 +16,6 @@ - - io.github.openfeign - feign-core - ${feign.version} - io.github.openfeign feign-okhttp @@ -44,21 +39,8 @@ - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - - - 9.4.0 - 1.4.2.RELEASE + 10.11 diff --git a/feign/src/test/java/com/baeldung/feign/clients/BookClientLiveTest.java b/feign/src/test/java/com/baeldung/feign/clients/BookClientLiveTest.java index bee440bd9e..6f6666de32 100644 --- a/feign/src/test/java/com/baeldung/feign/clients/BookClientLiveTest.java +++ b/feign/src/test/java/com/baeldung/feign/clients/BookClientLiveTest.java @@ -6,8 +6,6 @@ import com.baeldung.feign.models.BookResource; import lombok.extern.slf4j.Slf4j; import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; import java.util.List; import java.util.UUID; @@ -22,7 +20,6 @@ import static org.junit.Assert.assertTrue; * Consumes https://github.com/Baeldung/spring-hypermedia-api */ @Slf4j -@RunWith(JUnit4.class) public class BookClientLiveTest { private BookClient bookClient; From 2f8478db349260fc51b143972b72367af579a3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20G=C5=82=C3=B3wka?= Date: Tue, 29 Sep 2020 19:12:16 +0200 Subject: [PATCH 047/302] BAEL-4446: Getting cookies from httpclient response example (#10104) --- .../HttpClientGettingCookieValueUnitTest.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 httpclient-2/src/test/java/com/baeldung/httpclient/cookies/HttpClientGettingCookieValueUnitTest.java diff --git a/httpclient-2/src/test/java/com/baeldung/httpclient/cookies/HttpClientGettingCookieValueUnitTest.java b/httpclient-2/src/test/java/com/baeldung/httpclient/cookies/HttpClientGettingCookieValueUnitTest.java new file mode 100644 index 0000000000..c3b0ef3c25 --- /dev/null +++ b/httpclient-2/src/test/java/com/baeldung/httpclient/cookies/HttpClientGettingCookieValueUnitTest.java @@ -0,0 +1,54 @@ +package com.baeldung.httpclient.cookies; + +import org.apache.http.client.CookieStore; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.cookie.Cookie; +import org.apache.http.impl.client.BasicCookieStore; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.cookie.BasicClientCookie; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; + +import static org.junit.Assert.assertEquals; + + +public class HttpClientGettingCookieValueUnitTest { + private static Logger log = LoggerFactory.getLogger(HttpClientGettingCookieValueUnitTest.class); + + private static final String SAMPLE_URL = "http://www.baeldung.com/"; + + @Test + public final void whenSettingCustomCookieOnTheRequest_thenGettingTheSameCookieFromTheResponse() throws IOException { + HttpClientContext context = HttpClientContext.create(); + context.setAttribute(HttpClientContext.COOKIE_STORE, createCustomCookieStore()); + + try (CloseableHttpClient httpClient = HttpClients.createDefault()) { + try (CloseableHttpResponse response = httpClient.execute(new HttpGet(SAMPLE_URL), context)) { + CookieStore cookieStore = context.getCookieStore(); + Cookie customCookie = cookieStore.getCookies() + .stream() + .peek(cookie -> log.info("cookie name:{}", cookie.getName())) + .filter(cookie -> "custom_cookie".equals(cookie.getName())) + .findFirst() + .orElseThrow(IllegalStateException::new); + + assertEquals("test_value", customCookie.getValue()); + } + } + } + + private BasicCookieStore createCustomCookieStore() { + BasicCookieStore cookieStore = new BasicCookieStore(); + BasicClientCookie cookie = new BasicClientCookie("custom_cookie", "test_value"); + cookie.setDomain("baeldung.com"); + cookie.setPath("/"); + cookieStore.addCookie(cookie); + return cookieStore; + } +} From d7fc3796d79c97104e8e8586a54c9491b69a1655 Mon Sep 17 00:00:00 2001 From: Daniel Taylor Date: Tue, 29 Sep 2020 16:37:05 -0600 Subject: [PATCH 048/302] change "Aborted" to "Failed" under testFailed() --- .../extensions/testwatcher/TestResultLoggerExtension.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/extensions/testwatcher/TestResultLoggerExtension.java b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/extensions/testwatcher/TestResultLoggerExtension.java index a92c44a85b..1cbebd8d48 100644 --- a/testing-modules/junit-5-advanced/src/test/java/com/baeldung/extensions/testwatcher/TestResultLoggerExtension.java +++ b/testing-modules/junit-5-advanced/src/test/java/com/baeldung/extensions/testwatcher/TestResultLoggerExtension.java @@ -46,7 +46,7 @@ public class TestResultLoggerExtension implements TestWatcher, AfterAllCallback @Override public void testFailed(ExtensionContext context, Throwable cause) { - LOG.info("Test Aborted for test {}: ", context.getDisplayName()); + LOG.info("Test Failed for test {}: ", context.getDisplayName()); testResultsStatus.add(TestResultStatus.FAILED); } From fc1964251c6115574ed0f45bf3deb79687b3632c Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 30 Sep 2020 19:19:44 +0530 Subject: [PATCH 049/302] JAVA-2432 Move articles out of spring-hibernate4 Removed legacy hibernate-4-spring article --- persistence-modules/spring-hibernate-5/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/persistence-modules/spring-hibernate-5/README.md b/persistence-modules/spring-hibernate-5/README.md index c7506026dd..cb227592f6 100644 --- a/persistence-modules/spring-hibernate-5/README.md +++ b/persistence-modules/spring-hibernate-5/README.md @@ -13,4 +13,3 @@ This module contains articles about Hibernate 5 with Spring. - [Deleting Objects with Hibernate](http://www.baeldung.com/delete-with-hibernate) - [Spring, Hibernate and a JNDI Datasource](http://www.baeldung.com/spring-persistence-jpa-jndi-datasource) - [@Immutable in Hibernate](http://www.baeldung.com/hibernate-immutable) -- [Guide to Hibernate 5 with Spring](https://www.baeldung.com/hibernate-4-spring) \ No newline at end of file From 5a8f42080742d63dac7d74dae390be440cc89585 Mon Sep 17 00:00:00 2001 From: Sampada <46674082+sampada07@users.noreply.github.com> Date: Wed, 30 Sep 2020 21:08:21 +0530 Subject: [PATCH 050/302] BAEL-4075: Validating phone number with libphonenumber (#10111) * BAEL-4075: Validating phone number with libphonenumber * BAEL-4075: Validating phone number with libphonenumber --- libraries-6/pom.xml | 7 ++ .../LibPhoneNumberUnitTest.java | 79 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 libraries-6/src/test/java/com/baeldung/libphonenumber/LibPhoneNumberUnitTest.java diff --git a/libraries-6/pom.xml b/libraries-6/pom.xml index 2f8cc385cb..7bb6028f17 100644 --- a/libraries-6/pom.xml +++ b/libraries-6/pom.xml @@ -107,6 +107,12 @@ renjin-script-engine ${renjin.version} + + + com.googlecode.libphonenumber + libphonenumber + ${libphonenumber.version} + @@ -150,6 +156,7 @@ RELEASE 3.0 1.8.1 + 8.12.9 diff --git a/libraries-6/src/test/java/com/baeldung/libphonenumber/LibPhoneNumberUnitTest.java b/libraries-6/src/test/java/com/baeldung/libphonenumber/LibPhoneNumberUnitTest.java new file mode 100644 index 0000000000..39b96b3e38 --- /dev/null +++ b/libraries-6/src/test/java/com/baeldung/libphonenumber/LibPhoneNumberUnitTest.java @@ -0,0 +1,79 @@ +package com.baeldung.libphonenumber; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import com.google.i18n.phonenumbers.NumberParseException; +import com.google.i18n.phonenumbers.PhoneNumberUtil; +import com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberType; +import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber; +import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber.CountryCodeSource; + +public class LibPhoneNumberUnitTest { + + private static final PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance(); + + @Test + public void givenPhoneNumber_whenValid_thenOK() throws Exception { + + PhoneNumber phone = phoneNumberUtil.parse("+911234567890", CountryCodeSource.UNSPECIFIED.name()); + + assertTrue(phoneNumberUtil.isValidNumber(phone)); + assertTrue(phoneNumberUtil.isValidNumberForRegion(phone, "IN")); + assertFalse(phoneNumberUtil.isValidNumberForRegion(phone, "US")); + assertTrue(phoneNumberUtil.isValidNumber(phoneNumberUtil.getExampleNumber("IN"))); + } + + @Test + public void givenPhoneNumber_whenAlphaNumber_thenValid() { + assertTrue(phoneNumberUtil.isAlphaNumber("325-CARS")); + assertTrue(phoneNumberUtil.isAlphaNumber("0800 REPAIR")); + assertTrue(phoneNumberUtil.isAlphaNumber("1-800-MY-APPLE")); + assertTrue(phoneNumberUtil.isAlphaNumber("1-800-MY-APPLE..")); + assertFalse(phoneNumberUtil.isAlphaNumber("+876 1234-1234")); + } + + @Test + public void givenPhoneNumber_whenPossibleForType_thenValid() { + PhoneNumber number = new PhoneNumber(); + number.setCountryCode(54); + + number.setNationalNumber(123456); + assertTrue(phoneNumberUtil.isPossibleNumberForType(number, PhoneNumberType.FIXED_LINE)); + assertFalse(phoneNumberUtil.isPossibleNumberForType(number, PhoneNumberType.TOLL_FREE)); + + number.setNationalNumber(12345678901L); + assertFalse(phoneNumberUtil.isPossibleNumberForType(number, PhoneNumberType.FIXED_LINE)); + assertTrue(phoneNumberUtil.isPossibleNumberForType(number, PhoneNumberType.MOBILE)); + assertFalse(phoneNumberUtil.isPossibleNumberForType(number, PhoneNumberType.TOLL_FREE)); + } + + @Test + public void givenPhoneNumber_whenPossible_thenValid() { + PhoneNumber number = new PhoneNumber(); + number.setCountryCode(1) + .setNationalNumber(123000L); + assertFalse(phoneNumberUtil.isPossibleNumber(number)); + assertFalse(phoneNumberUtil.isPossibleNumber("+1 343 253 00000", "US")); + assertFalse(phoneNumberUtil.isPossibleNumber("(343) 253-00000", "US")); + assertFalse(phoneNumberUtil.isPossibleNumber("dial p for pizza", "US")); + assertFalse(phoneNumberUtil.isPossibleNumber("123-000", "US")); + } + + @Test + public void givenPhoneNumber_whenNumberGeographical_thenValid() throws NumberParseException { + + PhoneNumber phone = phoneNumberUtil.parse("+911234567890", "IN"); + assertTrue(phoneNumberUtil.isNumberGeographical(phone)); + + phone = new PhoneNumber().setCountryCode(1) + .setNationalNumber(2530000L); + assertFalse(phoneNumberUtil.isNumberGeographical(phone)); + + phone = new PhoneNumber().setCountryCode(800) + .setNationalNumber(12345678L); + assertFalse(phoneNumberUtil.isNumberGeographical(phone)); + } +} From cf1b728d3ed87ff964ff0852fb7eed74bfa765cc Mon Sep 17 00:00:00 2001 From: Philippe Date: Wed, 30 Sep 2020 21:47:55 -0300 Subject: [PATCH 051/302] [BAEL-4203] JNA --- apache-bookkeeper/data/zk/myid | 1 + {jni => java-native}/README.md | 0 java-native/core | 0 java-native/hs_err_pid100.log | 793 ++++++++++++++++++ java-native/hs_err_pid98.log | 789 +++++++++++++++++ java-native/pom.xml | 39 + .../com_baeldung_jni_ExampleObjectsJNI.cpp | 0 .../cpp/com_baeldung_jni_ExampleObjectsJNI.h | 0 .../com_baeldung_jni_ExampleParametersJNI.cpp | 0 .../com_baeldung_jni_ExampleParametersJNI.h | 0 .../cpp/com_baeldung_jni_HelloWorldJNI.cpp | 0 .../main/cpp/com_baeldung_jni_HelloWorldJNI.h | 0 .../src/main/cpp/generateNativeLib.bat | 0 .../src/main/cpp/generateNativeLib.sh | 0 .../src/main/cpp/generateNativeLibMac.sh | 0 .../src/main/java/com/baeldung/jna/CMath.java | 10 + .../src/main/java/com/baeldung/jna/Main.java | 8 + .../main/java/com/baeldung/jna/NativeFS.java | 46 + .../src/main/java/com/baeldung/jna/StdC.java | 17 + .../com/baeldung/jni/ExampleObjectsJNI.java | 0 .../baeldung/jni/ExampleParametersJNI.java | 0 .../java/com/baeldung/jni/HelloWorldJNI.java | 0 .../main/java/com/baeldung/jni/UserData.java | 0 .../src/main/resources/logback.xml | 0 .../java/com/baeldung/jna/CMathUnitTest.java | 18 + .../com/baeldung/jna/NativeFSUnitTest.java | 38 + .../java/com/baeldung/jna/StdCUnitTest.java | 47 ++ .../com/baeldung/jni/JNINativeManualTest.java | 0 jni/native/linux_x86_64/libnative.so | Bin 19856 -> 0 bytes jni/native/macos/libnative.dylib | Bin 23056 -> 0 bytes jni/pom.xml | 14 - pom.xml | 4 +- 32 files changed, 1808 insertions(+), 16 deletions(-) create mode 100644 apache-bookkeeper/data/zk/myid rename {jni => java-native}/README.md (100%) create mode 100644 java-native/core create mode 100644 java-native/hs_err_pid100.log create mode 100644 java-native/hs_err_pid98.log create mode 100644 java-native/pom.xml rename {jni => java-native}/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h (100%) rename {jni => java-native}/src/main/cpp/generateNativeLib.bat (100%) rename {jni => java-native}/src/main/cpp/generateNativeLib.sh (100%) mode change 100755 => 100644 rename {jni => java-native}/src/main/cpp/generateNativeLibMac.sh (100%) mode change 100755 => 100644 create mode 100644 java-native/src/main/java/com/baeldung/jna/CMath.java create mode 100644 java-native/src/main/java/com/baeldung/jna/Main.java create mode 100644 java-native/src/main/java/com/baeldung/jna/NativeFS.java create mode 100644 java-native/src/main/java/com/baeldung/jna/StdC.java rename {jni => java-native}/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java (100%) rename {jni => java-native}/src/main/java/com/baeldung/jni/ExampleParametersJNI.java (100%) rename {jni => java-native}/src/main/java/com/baeldung/jni/HelloWorldJNI.java (100%) rename {jni => java-native}/src/main/java/com/baeldung/jni/UserData.java (100%) rename {jni => java-native}/src/main/resources/logback.xml (100%) create mode 100644 java-native/src/test/java/com/baeldung/jna/CMathUnitTest.java create mode 100644 java-native/src/test/java/com/baeldung/jna/NativeFSUnitTest.java create mode 100644 java-native/src/test/java/com/baeldung/jna/StdCUnitTest.java rename {jni => java-native}/src/test/java/com/baeldung/jni/JNINativeManualTest.java (100%) delete mode 100755 jni/native/linux_x86_64/libnative.so delete mode 100755 jni/native/macos/libnative.dylib delete mode 100644 jni/pom.xml diff --git a/apache-bookkeeper/data/zk/myid b/apache-bookkeeper/data/zk/myid new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/apache-bookkeeper/data/zk/myid @@ -0,0 +1 @@ +1 diff --git a/jni/README.md b/java-native/README.md similarity index 100% rename from jni/README.md rename to java-native/README.md diff --git a/java-native/core b/java-native/core new file mode 100644 index 0000000000..e69de29bb2 diff --git a/java-native/hs_err_pid100.log b/java-native/hs_err_pid100.log new file mode 100644 index 0000000000..c05a3fad99 --- /dev/null +++ b/java-native/hs_err_pid100.log @@ -0,0 +1,793 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x00007f7ecd45c090, pid=100, tid=115 +# +# JRE version: OpenJDK Runtime Environment (14.0.2+12) (build 14.0.2+12-46) +# Java VM: OpenJDK 64-Bit Server VM (14.0.2+12-46, mixed mode, sharing, tiered, compressed oops, serial gc, linux-amd64) +# Problematic frame: +# C [libc.so.6+0x15e090] __memset_avx2_unaligned_erms+0x60 +# +# Core dump will be written. Default location: /project/java-native/core +# +# If you would like to submit a bug report, please visit: +# https://bugreport.java.com/bugreport/crash.jsp +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: /project/java-native/target/surefire/surefirebooter15072611568838389395.jar /project/java-native/target/surefire 2020-10-01T00-09-53_430-jvmRun2 surefire3272641396836511080tmp surefire_29468511371192344687tmp + +Host: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz, 1 cores, 1G, Oracle Linux Server release 8.2 +Time: Thu Oct 1 00:10:23 2020 UTC elapsed time: 13 seconds (0d 0h 0m 13s) + +--------------- T H R E A D --------------- + +Current thread (0x00007f7ec4028800): JavaThread "main" [_thread_in_native, id=115, stack(0x00007f7ecde0a000,0x00007f7ecdf0b000)] + +Stack: [0x00007f7ecde0a000,0x00007f7ecdf0b000], sp=0x00007f7ecdf07788, free space=1013k +Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libc.so.6+0x15e090] __memset_avx2_unaligned_erms+0x60 +j com.sun.jna.Native.setMemory(Lcom/sun/jna/Pointer;JJJB)V+0 +j com.sun.jna.Pointer.setMemory(JJB)V+9 +j com.baeldung.jna.StdCUnitTest.whenAccessViolation_thenShouldThrowError()V+17 +v ~StubRoutines::call_stub +V [libjvm.so+0x78e42b] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2fb +V [libjvm.so+0xbb0efb] invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*) [clone .constprop.117]+0x85b +V [libjvm.so+0xbb19cd] Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0xfd +V [libjvm.so+0x83b8e3] JVM_InvokeMethod+0xf3 +j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@14.0.2 +j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@14.0.2 +j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@14.0.2 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@14.0.2 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 +j org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;)Ljava/lang/Object;+32 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+24 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$232.execute()V+12 +j org.junit.jupiter.engine.execution.ThrowableCollector.execute(Lorg/junit/jupiter/api/function/Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+35 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 +j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 +j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 +j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 +j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 +j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 +j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 +j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 +j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 +j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 +j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 +j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 +j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 +j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 +j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 +j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 +j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()V+23 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+13 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/engine/TestEngine;Lorg/junit/platform/engine/ExecutionRequest;)V+2 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/Root;Lorg/junit/platform/engine/ConfigurationParameters;[Lorg/junit/platform/launcher/TestExecutionListener;)V+101 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+36 +j org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(Lorg/apache/maven/surefire/util/TestsToRun;)Lorg/apache/maven/surefire/suite/RunResult;+55 +j org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+31 +j org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Lorg/apache/maven/surefire/booter/ForkingReporterFactory;)Lorg/apache/maven/surefire/suite/RunResult;+9 +j org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess()Lorg/apache/maven/surefire/suite/RunResult;+7 +j org.apache.maven.surefire.booter.ForkedBooter.execute()V+1 +j org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+35 +v ~StubRoutines::call_stub +V [libjvm.so+0x78e42b] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2fb +V [libjvm.so+0x80d2e3] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .isra.125] [clone .constprop.264]+0x193 +V [libjvm.so+0x80f338] jni_CallStaticVoidMethod+0x108 +C [libjli.so+0x4647] JavaMain+0xcd7 +C [libjli.so+0x85a9] ThreadJavaMain+0x9 + +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +j com.sun.jna.Native.setMemory(Lcom/sun/jna/Pointer;JJJB)V+0 +j com.sun.jna.Pointer.setMemory(JJB)V+9 +j com.baeldung.jna.StdCUnitTest.whenAccessViolation_thenShouldThrowError()V+17 +v ~StubRoutines::call_stub +j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@14.0.2 +j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@14.0.2 +j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@14.0.2 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@14.0.2 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 +j org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;)Ljava/lang/Object;+32 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+24 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$232.execute()V+12 +j org.junit.jupiter.engine.execution.ThrowableCollector.execute(Lorg/junit/jupiter/api/function/Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+35 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 +j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 +j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 +j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 +j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 +j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 +j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 +j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 +j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 +j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 +j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 +j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 +j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 +j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 +j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 +j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 +j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()V+23 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+13 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/engine/TestEngine;Lorg/junit/platform/engine/ExecutionRequest;)V+2 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/Root;Lorg/junit/platform/engine/ConfigurationParameters;[Lorg/junit/platform/launcher/TestExecutionListener;)V+101 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+36 +j org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(Lorg/apache/maven/surefire/util/TestsToRun;)Lorg/apache/maven/surefire/suite/RunResult;+55 +j org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+31 +j org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Lorg/apache/maven/surefire/booter/ForkingReporterFactory;)Lorg/apache/maven/surefire/suite/RunResult;+9 +j org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess()Lorg/apache/maven/surefire/suite/RunResult;+7 +j org.apache.maven.surefire.booter.ForkedBooter.execute()V+1 +j org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+35 +v ~StubRoutines::call_stub + +siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000 + +Register to memory mapping: + +RAX=0x0 is NULL +RBX={method} {0x00007f7ecb469628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' +RCX=0x0000000000000080 is an unknown value +RDX=0x0000000000019000 is an unknown value +RSP=0x00007f7ecdf07788 is pointing into the stack for thread: 0x00007f7ec4028800 +RBP=0x00007f7ecdf077c0 is pointing into the stack for thread: 0x00007f7ec4028800 +RSI=0x0 is NULL +RDI=0x0 is NULL +R8 =0x0 is NULL +R9 =0x0000000000019000 is an unknown value +R10=0x0000000000000009 is an unknown value +R11=0x00007f7ecd45bfd0: in /lib64/libc.so.6 at 0x00007f7ecd2fe000 +R12=0x0 is NULL +R13={method} {0x00007f7ecb469628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' +R14=0x00007f7ecdf078b8 is pointing into the stack for thread: 0x00007f7ec4028800 +R15=0x00007f7ec4028800 is a thread + + +Registers: +RAX=0x0000000000000000, RBX=0x00007f7ecb469628, RCX=0x0000000000000080, RDX=0x0000000000019000 +RSP=0x00007f7ecdf07788, RBP=0x00007f7ecdf077c0, RSI=0x0000000000000000, RDI=0x0000000000000000 +R8 =0x0000000000000000, R9 =0x0000000000019000, R10=0x0000000000000009, R11=0x00007f7ecd45bfd0 +R12=0x0000000000000000, R13=0x00007f7ecb469628, R14=0x00007f7ecdf078b8, R15=0x00007f7ec4028800 +RIP=0x00007f7ecd45c090, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000006 + TRAPNO=0x000000000000000e + +Top of Stack: (sp=0x00007f7ecdf07788) +0x00007f7ecdf07788: 00007f7ec9756e8d 00007f7ecb469628 +0x00007f7ecdf07798: 00007f7ec4028b10 0000000000000000 +0x00007f7ecdf077a8: 0000000000019000 0000000000000000 +0x00007f7ecdf077b8: 0000000000000000 00007f7ecdf07860 + +Instructions: (pc=0x00007f7ecd45c090) +0x00007f7ecd45bf90: f3 0f 1e fa 48 39 d1 0f 82 53 d9 fa ff 0f 1f 00 +0x00007f7ecd45bfa0: f3 0f 1e fa 48 c1 e2 02 c5 f9 6e c6 48 89 f8 c4 +0x00007f7ecd45bfb0: e2 7d 58 c0 eb 2a 66 2e 0f 1f 84 00 00 00 00 00 +0x00007f7ecd45bfc0: f3 0f 1e fa 48 39 d1 0f 82 23 d9 fa ff 0f 1f 00 +0x00007f7ecd45bfd0: f3 0f 1e fa c5 f9 6e c6 48 89 f8 c4 e2 7d 78 c0 +0x00007f7ecd45bfe0: 48 83 fa 20 0f 82 04 01 00 00 48 83 fa 40 77 77 +0x00007f7ecd45bff0: c5 fe 7f 44 17 e0 c5 fe 7f 07 c5 f8 77 c3 66 90 +0x00007f7ecd45c000: f3 0f 1e fa c5 f8 77 48 89 d1 40 0f b6 c6 48 89 +0x00007f7ecd45c010: fa f3 aa 48 89 d0 c3 66 0f 1f 84 00 00 00 00 00 +0x00007f7ecd45c020: f3 0f 1e fa 48 39 d1 0f 82 c3 d8 fa ff 0f 1f 00 +0x00007f7ecd45c030: f3 0f 1e fa c5 f9 6e c6 48 89 f8 c4 e2 7d 78 c0 +0x00007f7ecd45c040: 48 83 fa 20 0f 82 a4 00 00 00 48 83 fa 40 77 0e +0x00007f7ecd45c050: c5 fe 7f 44 17 e0 c5 fe 7f 07 c5 f8 77 c3 48 81 +0x00007f7ecd45c060: fa 00 08 00 00 77 9d 48 81 fa 80 00 00 00 77 19 +0x00007f7ecd45c070: c5 fe 7f 07 c5 fe 7f 47 20 c5 fe 7f 44 17 e0 c5 +0x00007f7ecd45c080: fe 7f 44 17 c0 c5 f8 77 c3 48 8d 8f 80 00 00 00 +0x00007f7ecd45c090: c5 fe 7f 07 48 83 e1 80 c5 fe 7f 44 17 e0 c5 fe +0x00007f7ecd45c0a0: 7f 47 20 c5 fe 7f 44 17 c0 c5 fe 7f 47 40 c5 fe +0x00007f7ecd45c0b0: 7f 44 17 a0 c5 fe 7f 47 60 c5 fe 7f 44 17 80 48 +0x00007f7ecd45c0c0: 01 fa 48 83 e2 80 48 39 d1 74 ba c5 fd 7f 01 c5 +0x00007f7ecd45c0d0: fd 7f 41 20 c5 fd 7f 41 40 c5 fd 7f 41 60 48 81 +0x00007f7ecd45c0e0: c1 80 00 00 00 48 39 ca 75 e1 c5 f8 77 c3 80 fa +0x00007f7ecd45c0f0: 10 73 1c c4 e1 f9 7e c1 80 fa 08 73 20 80 fa 04 +0x00007f7ecd45c100: 73 27 80 fa 01 77 2c 72 02 88 0f c5 f8 77 c3 c5 +0x00007f7ecd45c110: fa 7f 44 17 f0 c5 fa 7f 07 c5 f8 77 c3 48 89 4c +0x00007f7ecd45c120: 17 f8 48 89 0f c5 f8 77 c3 89 4c 17 fc 89 0f c5 +0x00007f7ecd45c130: f8 77 c3 66 89 4c 17 fe 66 89 0f c5 f8 77 c3 90 +0x00007f7ecd45c140: f3 0f 1e fa 48 c1 e2 02 48 83 fa 20 0f 82 3e 01 +0x00007f7ecd45c150: 00 00 c5 fe 6f 16 c5 ed 76 17 c5 fd d7 c2 83 e8 +0x00007f7ecd45c160: ff 0f 85 e9 00 00 00 48 83 fa 40 0f 86 c0 00 00 +0x00007f7ecd45c170: 00 c5 fd 76 c0 48 81 fa 00 01 00 00 0f 87 9e 01 +0x00007f7ecd45c180: 00 00 48 81 fa 80 00 00 00 0f 82 28 02 00 00 c5 + + +Stack slot to memory mapping: +stack at sp + 0 slots: 0x00007f7ec9756e8d: Java_com_sun_jna_Native_setMemory+0x00000000000000bd in /root/.cache/JNA/temp/jna17886832672380520920.tmp at 0x00007f7ec9750000 +stack at sp + 1 slots: {method} {0x00007f7ecb469628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' +stack at sp + 2 slots: 0x00007f7ec4028b10 points into unknown readable memory: 80 b8 24 cd 7e 7f 00 00 +stack at sp + 3 slots: 0x0 is NULL +stack at sp + 4 slots: 0x0000000000019000 is an unknown value +stack at sp + 5 slots: 0x0 is NULL +stack at sp + 6 slots: 0x0 is NULL +stack at sp + 7 slots: 0x00007f7ecdf07860 is pointing into the stack for thread: 0x00007f7ec4028800 + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00007f7ec41c0640, length=12, elements={ +0x00007f7ec4028800, 0x00007f7ec40a2000, 0x00007f7ec40a3800, 0x00007f7ec40ad000, +0x00007f7ec40af000, 0x00007f7ec40b1000, 0x00007f7ec40b3000, 0x00007f7ec40b5000, +0x00007f7ec40ef800, 0x00007f7ec40f4800, 0x00007f7ec4188000, 0x00007f7ec41bf000 +} + +Java Threads: ( => current thread ) +=>0x00007f7ec4028800 JavaThread "main" [_thread_in_native, id=115, stack(0x00007f7ecde0a000,0x00007f7ecdf0b000)] + 0x00007f7ec40a2000 JavaThread "Reference Handler" daemon [_thread_blocked, id=121, stack(0x00007f7ecab9d000,0x00007f7ecac9e000)] + 0x00007f7ec40a3800 JavaThread "Finalizer" daemon [_thread_blocked, id=124, stack(0x00007f7ecaa9c000,0x00007f7ecab9d000)] + 0x00007f7ec40ad000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=125, stack(0x00007f7eca2a7000,0x00007f7eca3a8000)] + 0x00007f7ec40af000 JavaThread "Service Thread" daemon [_thread_blocked, id=128, stack(0x00007f7eca1a6000,0x00007f7eca2a7000)] + 0x00007f7ec40b1000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=132, stack(0x00007f7eca0a5000,0x00007f7eca1a6000)] + 0x00007f7ec40b3000 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=135, stack(0x00007f7ec9fa4000,0x00007f7eca0a5000)] + 0x00007f7ec40b5000 JavaThread "Sweeper thread" daemon [_thread_blocked, id=137, stack(0x00007f7ec9ea3000,0x00007f7ec9fa4000)] + 0x00007f7ec40ef800 JavaThread "Notification Thread" daemon [_thread_blocked, id=146, stack(0x00007f7ec9da2000,0x00007f7ec9ea3000)] + 0x00007f7ec40f4800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=148, stack(0x00007f7ec9b9f000,0x00007f7ec9ca0000)] + 0x00007f7ec4188000 JavaThread "surefire-forkedjvm-command-thread" daemon [_thread_in_native, id=151, stack(0x00007f7ec9a87000,0x00007f7ec9b88000)] + 0x00007f7ec41bf000 JavaThread "surefire-forkedjvm-ping-30s" daemon [_thread_blocked, id=154, stack(0x00007f7ec9979000,0x00007f7ec9a7a000)] + +Other Threads: + 0x00007f7ec409e800 VMThread "VM Thread" [stack: 0x00007f7ecaca0000,0x00007f7ecada0000] [id=118] + 0x00007f7ec40f2000 WatcherThread [stack: 0x00007f7ec9ca2000,0x00007f7ec9da2000] [id=147] + +Threads with active compile tasks: + +VM state:not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: None + +Heap address: 0x00000000e0c00000, size: 500 MB, Compressed Oops mode: 32-bit +Narrow klass base: 0x0000000800000000, Narrow klass shift: 3 +Compressed class space size: 1073741824 Address: 0x0000000800b11000 + +Heap: + def new generation total 9792K, used 7588K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) + eden space 8704K, 74% used [0x00000000e0c00000, 0x00000000e1259340, 0x00000000e1480000) + from space 1088K, 100% used [0x00000000e1590000, 0x00000000e16a0000, 0x00000000e16a0000) + to space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) + tenured generation total 21888K, used 1321K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) + the space 21888K, 6% used [0x00000000eb2a0000, 0x00000000eb3ea620, 0x00000000eb3ea800, 0x00000000ec800000) + Metaspace used 4998K, capacity 7071K, committed 7296K, reserved 1056768K + class space used 637K, capacity 881K, committed 896K, reserved 1048576K + +Card table byte_map: [0x00007f7ecb723000,0x00007f7ecb81e000] _byte_map_base: 0x00007f7ecb01d000 + +Polling page: 0x00007f7ecdf20000 + +Metaspace: + +Usage: + Non-class: 6.04 MB capacity, 4.26 MB ( 70%) used, 1.76 MB ( 29%) free+waste, 30.81 KB ( <1%) overhead. + Class: 881.00 KB capacity, 637.46 KB ( 72%) used, 226.48 KB ( 26%) free+waste, 17.06 KB ( 2%) overhead. + Both: 6.91 MB capacity, 4.88 MB ( 71%) used, 1.98 MB ( 29%) free+waste, 47.88 KB ( <1%) overhead. + +Virtual space: + Non-class space: 8.00 MB reserved, 6.25 MB ( 78%) committed + Class space: 1.00 GB reserved, 896.00 KB ( <1%) committed + Both: 1.01 GB reserved, 7.12 MB ( <1%) committed + +Chunk freelists: + Non-Class: 34.00 KB + Class: 11.00 KB + Both: 45.00 KB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB + +CodeHeap 'non-profiled nmethods': size=120036Kb used=272Kb max_used=272Kb free=119763Kb + bounds [0x00007f7eb419c000, 0x00007f7eb440c000, 0x00007f7ebb6d5000] +CodeHeap 'profiled nmethods': size=120032Kb used=1610Kb max_used=1610Kb free=118421Kb + bounds [0x00007f7eacc64000, 0x00007f7eaced4000, 0x00007f7eb419c000] +CodeHeap 'non-nmethods': size=5692Kb used=1155Kb max_used=1170Kb free=4536Kb + bounds [0x00007f7eac6d5000, 0x00007f7eac945000, 0x00007f7eacc64000] + total_blobs=1295 nmethods=879 adapters=332 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 12.944 Thread 0x00007f7ec40b3000 876 ! 3 jdk.internal.loader.BuiltinClassLoader::findClassOnClassPathOrNull (64 bytes) +Event: 12.955 Thread 0x00007f7ec40b3000 nmethod 876 0x00007f7eacdf1a90 code [0x00007f7eacdf1e00, 0x00007f7eacdf3260] +Event: 12.963 Thread 0x00007f7ec40b3000 877 ! 3 java.util.zip.ZipFile$ZipFileInflaterInputStream::close (67 bytes) +Event: 12.969 Thread 0x00007f7ec40b3000 nmethod 877 0x00007f7eacdf3a90 code [0x00007f7eacdf3c80, 0x00007f7eacdf4390] +Event: 12.969 Thread 0x00007f7ec40b3000 878 3 java.util.ArrayDeque::add (7 bytes) +Event: 12.969 Thread 0x00007f7ec40b3000 nmethod 878 0x00007f7eacdf4690 code [0x00007f7eacdf4820, 0x00007f7eacdf4980] +Event: 12.969 Thread 0x00007f7ec40b3000 879 3 java.util.ArrayDeque::addLast (51 bytes) +Event: 12.974 Thread 0x00007f7ec40b3000 nmethod 879 0x00007f7eacdf4a10 code [0x00007f7eacdf4be0, 0x00007f7eacdf5090] +Event: 12.982 Thread 0x00007f7ec40b3000 880 3 java.util.zip.ZipFile$InflaterCleanupAction::run (12 bytes) +Event: 12.982 Thread 0x00007f7ec40b3000 nmethod 880 0x00007f7eacdf5210 code [0x00007f7eacdf53a0, 0x00007f7eacdf5500] +Event: 12.982 Thread 0x00007f7ec40b3000 881 ! 3 java.util.zip.ZipFile$CleanableResource::releaseInflater (53 bytes) +Event: 12.986 Thread 0x00007f7ec40b3000 nmethod 881 0x00007f7eacdf5610 code [0x00007f7eacdf57e0, 0x00007f7eacdf5d00] +Event: 12.986 Thread 0x00007f7ec40b3000 882 ! 3 java.util.zip.Inflater::reset (64 bytes) +Event: 12.991 Thread 0x00007f7ec40b3000 nmethod 882 0x00007f7eacdf5f10 code [0x00007f7eacdf60c0, 0x00007f7eacdf64b0] +Event: 12.993 Thread 0x00007f7ec40b1000 884 4 java.lang.Object:: (1 bytes) +Event: 12.995 Thread 0x00007f7ec40b1000 nmethod 884 0x00007f7eb41dfd90 code [0x00007f7eb41dff00, 0x00007f7eb41dffb8] +Event: 13.004 Thread 0x00007f7ec40b3000 885 3 sun.net.www.protocol.jar.Handler::checkNestedProtocol (18 bytes) +Event: 13.005 Thread 0x00007f7ec40b3000 nmethod 885 0x00007f7eacdf6690 code [0x00007f7eacdf6840, 0x00007f7eacdf6a20] +Event: 13.116 Thread 0x00007f7ec40b1000 886 4 java.lang.Math::min (11 bytes) +Event: 13.117 Thread 0x00007f7ec40b1000 nmethod 886 0x00007f7eb41e0090 code [0x00007f7eb41e0200, 0x00007f7eb41e0258] + +GC Heap History (2 events): +Event: 7.487 GC heap before +{Heap before GC invocations=0 (full 0): + def new generation total 9792K, used 8704K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) + eden space 8704K, 100% used [0x00000000e0c00000, 0x00000000e1480000, 0x00000000e1480000) + from space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) + to space 1088K, 0% used [0x00000000e1590000, 0x00000000e1590000, 0x00000000e16a0000) + tenured generation total 21888K, used 0K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) + the space 21888K, 0% used [0x00000000eb2a0000, 0x00000000eb2a0000, 0x00000000eb2a0200, 0x00000000ec800000) + Metaspace used 3048K, capacity 5805K, committed 6016K, reserved 1056768K + class space used 360K, capacity 627K, committed 640K, reserved 1048576K +} +Event: 7.606 GC heap after +{Heap after GC invocations=1 (full 0): + def new generation total 9792K, used 1088K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) + eden space 8704K, 0% used [0x00000000e0c00000, 0x00000000e0c00000, 0x00000000e1480000) + from space 1088K, 100% used [0x00000000e1590000, 0x00000000e16a0000, 0x00000000e16a0000) + to space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) + tenured generation total 21888K, used 1321K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) + the space 21888K, 6% used [0x00000000eb2a0000, 0x00000000eb3ea620, 0x00000000eb3ea800, 0x00000000ec800000) + Metaspace used 3048K, capacity 5805K, committed 6016K, reserved 1056768K + class space used 360K, capacity 627K, committed 640K, reserved 1048576K +} + +Deoptimization events (20 events): +Event: 1.087 Thread 0x00007f7ec4028800 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007f7eb41a0990 relative=0x00000000000001d0 +Event: 1.087 Thread 0x00007f7ec4028800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f7eb41a0990 method=java.lang.String.hashCode()I @ 42 c2 +Event: 1.087 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eb41a0990 sp=0x00007f7ecdf08320 +Event: 1.087 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71de25 sp=0x00007f7ecdf082d8 mode 2 +Event: 3.662 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eaccb7d84 sp=0x00007f7ecdf08350 +Event: 3.662 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf077e0 mode 0 +Event: 4.371 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eaccc4422 sp=0x00007f7ecdf044a0 +Event: 4.371 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf03928 mode 0 +Event: 4.510 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eacc890af sp=0x00007f7ecdf081b0 +Event: 4.510 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf07658 mode 0 +Event: 5.564 Thread 0x00007f7ec4028800 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007f7eb41a88e8 relative=0x0000000000000068 +Event: 5.564 Thread 0x00007f7ec4028800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f7eb41a88e8 method=java.lang.String.isLatin1()Z @ 10 c2 +Event: 5.564 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eb41a88e8 sp=0x00007f7ecdf088d0 +Event: 5.564 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71de25 sp=0x00007f7ecdf08880 mode 2 +Event: 6.331 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eacccd5e8 sp=0x00007f7ecdf08580 +Event: 6.331 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf079f0 mode 0 +Event: 6.941 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eacccd5e8 sp=0x00007f7ecdf07660 +Event: 6.941 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf06af8 mode 0 +Event: 12.327 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eaccc95c5 sp=0x00007f7ecdf06910 +Event: 12.327 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf05d90 mode 0 + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (17 events): +Event: 2.190 Thread 0x00007f7ec4028800 Exception (0x00000000e0dc5a48) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 5.245 Thread 0x00007f7ec4028800 Exception (0x00000000e12092c8) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 5.649 Thread 0x00007f7ec4028800 Exception (0x00000000e1280798) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.015 Thread 0x00007f7ec4028800 Exception (0x00000000e12d47e0) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.382 Thread 0x00007f7ec4028800 Exception (0x00000000e1346640) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.595 Thread 0x00007f7ec4028800 Exception (0x00000000e137b378) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.672 Thread 0x00007f7ec4028800 Exception (0x00000000e139ef70) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.707 Thread 0x00007f7ec4028800 Exception (0x00000000e13a9150) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.739 Thread 0x00007f7ec4028800 Exception (0x00000000e13b6dd8) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 832] +Event: 6.925 Thread 0x00007f7ec4028800 Exception (0x00000000e13ec548) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 7.737 Thread 0x00007f7ec4028800 Exception (0x00000000e0c25148) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 7.990 Thread 0x00007f7ec4028800 Exception (0x00000000e0c900c0) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 8.395 Thread 0x00007f7ec4028800 Exception (0x00000000e0cfd370) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 8.486 Thread 0x00007f7ec4028800 Exception (0x00000000e0d15688) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 8.487 Thread 0x00007f7ec4028800 Exception (0x00000000e0d18078) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 832] +Event: 10.634 Thread 0x00007f7ec4028800 Exception (0x00000000e0f88b50) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 10.647 Thread 0x00007f7ec4028800 Exception (0x00000000e0f8c210) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] + +Events (20 events): +Event: 12.778 loading class sun/security/provider/ByteArrayAccess +Event: 12.778 loading class sun/security/provider/ByteArrayAccess done +Event: 12.784 loading class java/io/DeleteOnExitHook +Event: 12.786 loading class java/io/DeleteOnExitHook done +Event: 12.786 loading class java/io/DeleteOnExitHook$1 +Event: 12.786 loading class java/io/DeleteOnExitHook$1 done +Event: 12.815 loading class java/io/FileOutputStream$1 +Event: 12.815 loading class java/io/FileOutputStream$1 done +Event: 12.822 Loaded shared library /root/.cache/JNA/temp/jna17886832672380520920.tmp +Event: 12.822 loading class java/nio/ShortBuffer +Event: 12.822 loading class java/nio/ShortBuffer done +Event: 12.822 loading class java/nio/FloatBuffer +Event: 12.834 loading class java/nio/FloatBuffer done +Event: 12.834 loading class java/nio/DoubleBuffer +Event: 12.835 loading class java/nio/DoubleBuffer done +Event: 12.922 Executing VM operation: HandshakeAllThreads +Event: 12.925 Executing VM operation: HandshakeAllThreads done +Event: 12.980 Loaded shared library /usr/java/openjdk-14/lib/libzip.so +Event: 13.028 Executing VM operation: HandshakeAllThreads +Event: 13.036 Executing VM operation: HandshakeAllThreads done + + +Dynamic libraries: +e0c00000-e16a0000 rw-p 00000000 00:00 0 +e16a0000-eb2a0000 ---p 00000000 00:00 0 +eb2a0000-ec800000 rw-p 00000000 00:00 0 +ec800000-100000000 ---p 00000000 00:00 0 +800000000-800003000 rwxp 00001000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa +800003000-8003e4000 rw-p 00004000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa +8003e4000-800b10000 r--p 003e5000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa +800b10000-800b11000 rw-p 00b11000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa +800b11000-800bf1000 rw-p 00000000 00:00 0 +800bf1000-840b11000 ---p 00000000 00:00 0 +55a64bfce000-55a64bfcf000 r-xp 00000000 08:01 3160482 /usr/java/openjdk-14/bin/java +55a64bfd0000-55a64bfd1000 r--p 00001000 08:01 3160482 /usr/java/openjdk-14/bin/java +55a64bfd1000-55a64bfd2000 rw-p 00002000 08:01 3160482 /usr/java/openjdk-14/bin/java +55a64c580000-55a64c5a1000 rw-p 00000000 00:00 0 [heap] +7f7e90000000-7f7e90288000 rw-p 00000000 00:00 0 +7f7e90288000-7f7e94000000 ---p 00000000 00:00 0 +7f7e94000000-7f7e94427000 rw-p 00000000 00:00 0 +7f7e94427000-7f7e98000000 ---p 00000000 00:00 0 +7f7e98000000-7f7e98021000 rw-p 00000000 00:00 0 +7f7e98021000-7f7e9c000000 ---p 00000000 00:00 0 +7f7e9c000000-7f7e9c021000 rw-p 00000000 00:00 0 +7f7e9c021000-7f7ea0000000 ---p 00000000 00:00 0 +7f7ea0000000-7f7ea0021000 rw-p 00000000 00:00 0 +7f7ea0021000-7f7ea4000000 ---p 00000000 00:00 0 +7f7ea4000000-7f7ea4021000 rw-p 00000000 00:00 0 +7f7ea4021000-7f7ea8000000 ---p 00000000 00:00 0 +7f7ea8000000-7f7ea8021000 rw-p 00000000 00:00 0 +7f7ea8021000-7f7eac000000 ---p 00000000 00:00 0 +7f7eac6d5000-7f7eac945000 rwxp 00000000 00:00 0 +7f7eac945000-7f7eacc64000 ---p 00000000 00:00 0 +7f7eacc64000-7f7eaced4000 rwxp 00000000 00:00 0 +7f7eaced4000-7f7eb419c000 ---p 00000000 00:00 0 +7f7eb419c000-7f7eb440c000 rwxp 00000000 00:00 0 +7f7eb440c000-7f7ebb6d5000 ---p 00000000 00:00 0 +7f7ebb6d5000-7f7ec4000000 r--s 00000000 08:01 3160985 /usr/java/openjdk-14/lib/modules +7f7ec4000000-7f7ec44c4000 rw-p 00000000 00:00 0 +7f7ec44c4000-7f7ec8000000 ---p 00000000 00:00 0 +7f7ec9292000-7f7ec9750000 rw-p 00000000 00:00 0 +7f7ec9750000-7f7ec9768000 r-xp 00000000 08:01 3163771 /root/.cache/JNA/temp/jna17886832672380520920.tmp (deleted) +7f7ec9768000-7f7ec9968000 ---p 00018000 08:01 3163771 /root/.cache/JNA/temp/jna17886832672380520920.tmp (deleted) +7f7ec9968000-7f7ec9969000 rw-p 00018000 08:01 3163771 /root/.cache/JNA/temp/jna17886832672380520920.tmp (deleted) +7f7ec9969000-7f7ec9976000 r-xp 00000000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so +7f7ec9976000-7f7ec9978000 r--p 0000c000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so +7f7ec9978000-7f7ec9979000 rw-p 0000e000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so +7f7ec9979000-7f7ec997d000 ---p 00000000 00:00 0 +7f7ec997d000-7f7ec9a7a000 rw-p 00000000 00:00 0 +7f7ec9a7a000-7f7ec9a7f000 r-xp 00000000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so +7f7ec9a7f000-7f7ec9a80000 r--p 00004000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so +7f7ec9a80000-7f7ec9a81000 rw-p 00005000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so +7f7ec9a81000-7f7ec9a85000 r-xp 00000000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so +7f7ec9a85000-7f7ec9a86000 r--p 00003000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so +7f7ec9a86000-7f7ec9a87000 rw-p 00004000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so +7f7ec9a87000-7f7ec9a8b000 ---p 00000000 00:00 0 +7f7ec9a8b000-7f7ec9b88000 rw-p 00000000 00:00 0 +7f7ec9b88000-7f7ec9b9d000 r-xp 00000000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so +7f7ec9b9d000-7f7ec9b9e000 r--p 00014000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so +7f7ec9b9e000-7f7ec9b9f000 rw-p 00015000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so +7f7ec9b9f000-7f7ec9ba3000 ---p 00000000 00:00 0 +7f7ec9ba3000-7f7ec9ca0000 rw-p 00000000 00:00 0 +7f7ec9ca0000-7f7ec9ca1000 ---p 00000000 00:00 0 +7f7ec9ca1000-7f7ec9da2000 rw-p 00000000 00:00 0 +7f7ec9da2000-7f7ec9da6000 ---p 00000000 00:00 0 +7f7ec9da6000-7f7ec9ea3000 rw-p 00000000 00:00 0 +7f7ec9ea3000-7f7ec9ea7000 ---p 00000000 00:00 0 +7f7ec9ea7000-7f7ec9fa4000 rw-p 00000000 00:00 0 +7f7ec9fa4000-7f7ec9fa8000 ---p 00000000 00:00 0 +7f7ec9fa8000-7f7eca0a5000 rw-p 00000000 00:00 0 +7f7eca0a5000-7f7eca0a9000 ---p 00000000 00:00 0 +7f7eca0a9000-7f7eca1a6000 rw-p 00000000 00:00 0 +7f7eca1a6000-7f7eca1aa000 ---p 00000000 00:00 0 +7f7eca1aa000-7f7eca2a7000 rw-p 00000000 00:00 0 +7f7eca2a7000-7f7eca2ab000 ---p 00000000 00:00 0 +7f7eca2ab000-7f7eca3a8000 rw-p 00000000 00:00 0 +7f7eca3a8000-7f7eca3fb000 r--p 00000000 08:01 3154692 /usr/lib/locale/C.utf8/LC_CTYPE +7f7eca3fb000-7f7ecaa9c000 r--p 00000000 08:01 3154691 /usr/lib/locale/C.utf8/LC_COLLATE +7f7ecaa9c000-7f7ecaaa0000 ---p 00000000 00:00 0 +7f7ecaaa0000-7f7ecab9d000 rw-p 00000000 00:00 0 +7f7ecab9d000-7f7ecaba1000 ---p 00000000 00:00 0 +7f7ecaba1000-7f7ecac9e000 rw-p 00000000 00:00 0 +7f7ecac9e000-7f7ecac9f000 ---p 00000000 00:00 0 +7f7ecac9f000-7f7ecb4bc000 rw-p 00000000 00:00 0 +7f7ecb4bc000-7f7ecb67c000 ---p 00000000 00:00 0 +7f7ecb67c000-7f7ecb687000 rw-p 00000000 00:00 0 +7f7ecb687000-7f7ecb723000 ---p 00000000 00:00 0 +7f7ecb723000-7f7ecb729000 rw-p 00000000 00:00 0 +7f7ecb729000-7f7ecb776000 ---p 00000000 00:00 0 +7f7ecb776000-7f7ecb781000 rw-p 00000000 00:00 0 +7f7ecb781000-7f7ecb81d000 ---p 00000000 00:00 0 +7f7ecb81d000-7f7ecb823000 rw-p 00000000 00:00 0 +7f7ecb823000-7f7ecb909000 ---p 00000000 00:00 0 +7f7ecb909000-7f7ecb90e000 rw-p 00000000 00:00 0 +7f7ecb90e000-7f7ecb9f4000 ---p 00000000 00:00 0 +7f7ecb9f4000-7f7ecb9ff000 r-xp 00000000 08:01 3155554 /usr/lib64/libnss_files-2.28.so +7f7ecb9ff000-7f7ecbbfe000 ---p 0000b000 08:01 3155554 /usr/lib64/libnss_files-2.28.so +7f7ecbbfe000-7f7ecbbff000 r--p 0000a000 08:01 3155554 /usr/lib64/libnss_files-2.28.so +7f7ecbbff000-7f7ecbc00000 rw-p 0000b000 08:01 3155554 /usr/lib64/libnss_files-2.28.so +7f7ecbc00000-7f7ecbc06000 rw-p 00000000 00:00 0 +7f7ecbc06000-7f7ecbc0d000 r-xp 00000000 08:01 3155596 /usr/lib64/librt-2.28.so +7f7ecbc0d000-7f7ecbe0d000 ---p 00007000 08:01 3155596 /usr/lib64/librt-2.28.so +7f7ecbe0d000-7f7ecbe0e000 r--p 00007000 08:01 3155596 /usr/lib64/librt-2.28.so +7f7ecbe0e000-7f7ecbe0f000 rw-p 00008000 08:01 3155596 /usr/lib64/librt-2.28.so +7f7ecbe0f000-7f7ecbf90000 r-xp 00000000 08:01 3155521 /usr/lib64/libm-2.28.so +7f7ecbf90000-7f7ecc18f000 ---p 00181000 08:01 3155521 /usr/lib64/libm-2.28.so +7f7ecc18f000-7f7ecc190000 r--p 00180000 08:01 3155521 /usr/lib64/libm-2.28.so +7f7ecc190000-7f7ecc191000 rw-p 00181000 08:01 3155521 /usr/lib64/libm-2.28.so +7f7ecc191000-7f7ecd1a0000 r-xp 00000000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so +7f7ecd1a0000-7f7ecd1a1000 ---p 0100f000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so +7f7ecd1a1000-7f7ecd245000 r--p 0100f000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so +7f7ecd245000-7f7ecd27d000 rw-p 010b3000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so +7f7ecd27d000-7f7ecd2fe000 rw-p 00000000 00:00 0 +7f7ecd2fe000-7f7ecd4b7000 r-xp 00000000 08:01 3155424 /usr/lib64/libc-2.28.so +7f7ecd4b7000-7f7ecd6b6000 ---p 001b9000 08:01 3155424 /usr/lib64/libc-2.28.so +7f7ecd6b6000-7f7ecd6ba000 r--p 001b8000 08:01 3155424 /usr/lib64/libc-2.28.so +7f7ecd6ba000-7f7ecd6bc000 rw-p 001bc000 08:01 3155424 /usr/lib64/libc-2.28.so +7f7ecd6bc000-7f7ecd6c0000 rw-p 00000000 00:00 0 +7f7ecd6c0000-7f7ecd6c3000 r-xp 00000000 08:01 3155440 /usr/lib64/libdl-2.28.so +7f7ecd6c3000-7f7ecd8c2000 ---p 00003000 08:01 3155440 /usr/lib64/libdl-2.28.so +7f7ecd8c2000-7f7ecd8c3000 r--p 00002000 08:01 3155440 /usr/lib64/libdl-2.28.so +7f7ecd8c3000-7f7ecd8c4000 rw-p 00003000 08:01 3155440 /usr/lib64/libdl-2.28.so +7f7ecd8c4000-7f7ecd8df000 r-xp 00000000 08:01 3155583 /usr/lib64/libpthread-2.28.so +7f7ecd8df000-7f7ecdade000 ---p 0001b000 08:01 3155583 /usr/lib64/libpthread-2.28.so +7f7ecdade000-7f7ecdadf000 r--p 0001a000 08:01 3155583 /usr/lib64/libpthread-2.28.so +7f7ecdadf000-7f7ecdae0000 rw-p 0001b000 08:01 3155583 /usr/lib64/libpthread-2.28.so +7f7ecdae0000-7f7ecdae4000 rw-p 00000000 00:00 0 +7f7ecdae4000-7f7ecdafa000 r-xp 00000000 08:01 3155650 /usr/lib64/libz.so.1.2.11 +7f7ecdafa000-7f7ecdcf9000 ---p 00016000 08:01 3155650 /usr/lib64/libz.so.1.2.11 +7f7ecdcf9000-7f7ecdcfa000 r--p 00015000 08:01 3155650 /usr/lib64/libz.so.1.2.11 +7f7ecdcfa000-7f7ecdcfb000 rw-p 00000000 00:00 0 +7f7ecdcfb000-7f7ecdd24000 r-xp 00000000 08:01 3155395 /usr/lib64/ld-2.28.so +7f7ecdd28000-7f7ecdd39000 r-xp 00000000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so +7f7ecdd39000-7f7ecdd3a000 ---p 00011000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so +7f7ecdd3a000-7f7ecdd3b000 r--p 00011000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so +7f7ecdd3b000-7f7ecdd3c000 rw-p 00012000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so +7f7ecdd3c000-7f7ecdd3d000 r--p 00000000 08:01 3154699 /usr/lib/locale/C.utf8/LC_NUMERIC +7f7ecdd3d000-7f7ecdd3e000 r--p 00000000 08:01 3154702 /usr/lib/locale/C.utf8/LC_TIME +7f7ecdd3e000-7f7ecdd3f000 r--p 00000000 08:01 3154697 /usr/lib/locale/C.utf8/LC_MONETARY +7f7ecdd3f000-7f7ecdd40000 r--p 00000000 08:01 3154696 /usr/lib/locale/C.utf8/LC_MESSAGES/SYS_LC_MESSAGES +7f7ecdd40000-7f7ecdd41000 r--p 00000000 08:01 3154700 /usr/lib/locale/C.utf8/LC_PAPER +7f7ecdd41000-7f7ecdd42000 r--p 00000000 08:01 3154698 /usr/lib/locale/C.utf8/LC_NAME +7f7ecdd42000-7f7ecdd43000 r--p 00000000 08:01 3154690 /usr/lib/locale/C.utf8/LC_ADDRESS +7f7ecdd43000-7f7ecdd44000 r--p 00000000 08:01 3154701 /usr/lib/locale/C.utf8/LC_TELEPHONE +7f7ecdd44000-7f7ecdd45000 r--p 00000000 08:01 3154694 /usr/lib/locale/C.utf8/LC_MEASUREMENT +7f7ecdd45000-7f7ecdd4c000 r--s 00000000 08:01 3155357 /usr/lib64/gconv/gconv-modules.cache +7f7ecdd4c000-7f7ecdd4d000 r--p 00000000 08:01 3154693 /usr/lib/locale/C.utf8/LC_IDENTIFICATION +7f7ecdd4d000-7f7ecdd67000 r--p 00000000 08:01 3154703 /usr/lib/locale/locale-archive +7f7ecdd67000-7f7ecddad000 rw-p 00000000 00:00 0 +7f7ecddad000-7f7ecddb4000 ---p 00000000 00:00 0 +7f7ecddb4000-7f7ecddbb000 r-xp 00000000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so +7f7ecddbb000-7f7ecddbc000 r--p 00006000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so +7f7ecddbc000-7f7ecddbd000 rw-p 00007000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so +7f7ecddbd000-7f7ecdde1000 r-xp 00000000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so +7f7ecdde1000-7f7ecdde2000 r--p 00023000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so +7f7ecdde2000-7f7ecdde4000 rw-p 00024000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so +7f7ecdde4000-7f7ecddec000 rw-s 00000000 08:01 3163766 /tmp/hsperfdata_root/100 +7f7ecddec000-7f7ecde07000 r-xp 00000000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so +7f7ecde07000-7f7ecde09000 r--p 0001a000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so +7f7ecde09000-7f7ecde0a000 rw-p 0001c000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so +7f7ecde0a000-7f7ecde0e000 ---p 00000000 00:00 0 +7f7ecde0e000-7f7ecdf0d000 rw-p 00000000 00:00 0 +7f7ecdf0d000-7f7ecdf1b000 r-xp 00000000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so +7f7ecdf1b000-7f7ecdf1c000 ---p 0000e000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so +7f7ecdf1c000-7f7ecdf1d000 r--p 0000e000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so +7f7ecdf1d000-7f7ecdf1e000 rw-p 0000f000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so +7f7ecdf1e000-7f7ecdf20000 rw-p 00000000 00:00 0 +7f7ecdf20000-7f7ecdf21000 ---p 00000000 00:00 0 +7f7ecdf21000-7f7ecdf22000 r--p 00000000 00:00 0 +7f7ecdf22000-7f7ecdf23000 ---p 00000000 00:00 0 +7f7ecdf23000-7f7ecdf24000 r--p 00028000 08:01 3155395 /usr/lib64/ld-2.28.so +7f7ecdf24000-7f7ecdf25000 rw-p 00029000 08:01 3155395 /usr/lib64/ld-2.28.so +7f7ecdf25000-7f7ecdf26000 rw-p 00000000 00:00 0 +7ffd671f1000-7ffd67212000 rw-p 00000000 00:00 0 [stack] +7ffd67244000-7ffd67247000 r--p 00000000 00:00 0 [vvar] +7ffd67247000-7ffd67249000 r-xp 00000000 00:00 0 [vdso] +ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] + + +VM Arguments: +java_command: /project/java-native/target/surefire/surefirebooter15072611568838389395.jar /project/java-native/target/surefire 2020-10-01T00-09-53_430-jvmRun2 surefire3272641396836511080tmp surefire_29468511371192344687tmp +java_class_path (initial): /project/java-native/target/surefire/surefirebooter15072611568838389395.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 2 {product} {ergonomic} + size_t InitialHeapSize = 33554432 {product} {ergonomic} + size_t MaxHeapSize = 524288000 {product} {ergonomic} + size_t MaxNewSize = 174718976 {product} {ergonomic} + size_t MinHeapDeltaBytes = 196608 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + size_t NewSize = 11141120 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5826188 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122916026 {pd product} {ergonomic} + size_t OldSize = 22413312 {product} {ergonomic} + uintx ProfiledCodeHeapSize = 122916026 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 524288000 {manageable} {ergonomic} + bool UseCompressedClassPointers = true {lp64_product} {ergonomic} + bool UseCompressedOops = true {lp64_product} {ergonomic} + bool UseSerialGC = true {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags + #1: stderr all=off uptime,level,tags + +Environment Variables: +JAVA_HOME=/usr/java/openjdk-14 +PATH=/usr/java/openjdk-14/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +Signal Handlers: +SIGSEGV: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGBUS: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGFPE: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGPIPE: [libjvm.so+0xb1bca0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGXFSZ: [libjvm.so+0xb1bca0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGILL: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGUSR2: [libjvm.so+0xb1bb30], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO +SIGHUP: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGINT: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGTERM: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGQUIT: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO + + +--------------- S Y S T E M --------------- + +OS:Oracle Linux Server release 8.2 +uname:Linux 4.14.154-boot2docker #1 SMP Thu Nov 14 19:19:08 UTC 2019 x86_64 +OS uptime: 0 days 13:49 hours +libc:glibc 2.28 NPTL 2.28 +rlimit: STACK 8192k, CORE infinity, NPROC infinity, NOFILE 1048576, AS infinity, DATA infinity, FSIZE infinity +load average:4.05 1.87 0.76 + +/proc/meminfo: +MemTotal: 2045412 kB +MemFree: 1098032 kB +MemAvailable: 1368704 kB +Buffers: 83692 kB +Cached: 471224 kB +SwapCached: 0 kB +Active: 573576 kB +Inactive: 305820 kB +Active(anon): 404060 kB +Inactive(anon): 199632 kB +Active(file): 169516 kB +Inactive(file): 106188 kB +Unevictable: 0 kB +Mlocked: 0 kB +SwapTotal: 1415172 kB +SwapFree: 1415172 kB +Dirty: 324 kB +Writeback: 0 kB +AnonPages: 324536 kB +Mapped: 120864 kB +Shmem: 290620 kB +Slab: 42348 kB +SReclaimable: 27356 kB +SUnreclaim: 14992 kB +KernelStack: 4672 kB +PageTables: 2744 kB +NFS_Unstable: 0 kB +Bounce: 0 kB +WritebackTmp: 0 kB +CommitLimit: 2437876 kB +Committed_AS: 1792468 kB +VmallocTotal: 34359738367 kB +VmallocUsed: 0 kB +VmallocChunk: 0 kB +HugePages_Total: 0 +HugePages_Free: 0 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +Hugepagesize: 2048 kB +DirectMap4k: 42944 kB +DirectMap2M: 2054144 kB + + +/proc/sys/kernel/threads-max (system-wide limit on the number of threads): +15537 + + +/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have): +65530 + + +/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers): +32768 + + + +container (cgroup) information: +container_type: cgroupv1 +cpu_cpuset_cpus: 0 +cpu_memory_nodes: 0 +active_processor_count: 1 +cpu_quota: no quota +cpu_period: 100000 +cpu_shares: no shares +memory_limit_in_bytes: unlimited +memory_and_swap_limit_in_bytes: unlimited +memory_soft_limit_in_bytes: unlimited +memory_usage_in_bytes: 356708352 +memory_max_usage_in_bytes: 394252288 + +KVM virtualization detected +Steal ticks since vm start: 0 +Steal ticks percentage since vm start: 0.000 + +CPU:total 1 (initial active 1) (1 cores per cpu, 1 threads per core) family 6 model 69 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, lzcnt, tsc, tscinvbit +CPU Model and flags from /proc/cpuinfo: +model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase avx2 invpcid md_clear flush_l1d + +Memory: 4k page, physical 2045412k(1098032k free), swap 1415172k(1415172k free) + +vm_info: OpenJDK 64-Bit Server VM (14.0.2+12-46) for linux-amd64 JRE (14.0.2+12-46), built on Jul 8 2020 23:30:21 by "mach5one" with gcc 8.3.0 + +END. diff --git a/java-native/hs_err_pid98.log b/java-native/hs_err_pid98.log new file mode 100644 index 0000000000..25a01096e2 --- /dev/null +++ b/java-native/hs_err_pid98.log @@ -0,0 +1,789 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x00007f01b8795090, pid=98, tid=114 +# +# JRE version: OpenJDK Runtime Environment (14.0.2+12) (build 14.0.2+12-46) +# Java VM: OpenJDK 64-Bit Server VM (14.0.2+12-46, mixed mode, sharing, tiered, compressed oops, serial gc, linux-amd64) +# Problematic frame: +# C [libc.so.6+0x15e090] __memset_avx2_unaligned_erms+0x60 +# +# Core dump will be written. Default location: /project/java-native/core +# +# If you would like to submit a bug report, please visit: +# https://bugreport.java.com/bugreport/crash.jsp +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: /project/java-native/target/surefire/surefirebooter255261521587421006.jar /project/java-native/target/surefire 2020-10-01T00-29-55_633-jvmRun3 surefire15563279322398545368tmp surefire_13579138375161683305tmp + +Host: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz, 1 cores, 1G, Oracle Linux Server release 8.2 +Time: Thu Oct 1 00:30:20 2020 UTC elapsed time: 10 seconds (0d 0h 0m 10s) + +--------------- T H R E A D --------------- + +Current thread (0x00007f01b0028800): JavaThread "main" [_thread_in_native, id=114, stack(0x00007f01b9143000,0x00007f01b9244000)] + +Stack: [0x00007f01b9143000,0x00007f01b9244000], sp=0x00007f01b9240788, free space=1013k +Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libc.so.6+0x15e090] __memset_avx2_unaligned_erms+0x60 +j com.sun.jna.Native.setMemory(Lcom/sun/jna/Pointer;JJJB)V+0 +j com.sun.jna.Pointer.setMemory(JJB)V+9 +j com.baeldung.jna.StdCUnitTest.whenAccessViolation_thenShouldThrowError()V+17 +v ~StubRoutines::call_stub +V [libjvm.so+0x78e42b] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2fb +V [libjvm.so+0xbb0efb] invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*) [clone .constprop.117]+0x85b +V [libjvm.so+0xbb19cd] Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0xfd +V [libjvm.so+0x83b8e3] JVM_InvokeMethod+0xf3 +j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@14.0.2 +j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@14.0.2 +j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@14.0.2 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@14.0.2 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 +j org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;)Ljava/lang/Object;+32 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+24 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$232.execute()V+12 +j org.junit.jupiter.engine.execution.ThrowableCollector.execute(Lorg/junit/jupiter/api/function/Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+35 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 +j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 +j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 +j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 +j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 +j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 +j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 +j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 +j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 +j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 +j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 +j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 +j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 +j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 +j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 +j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 +j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()V+23 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+13 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/engine/TestEngine;Lorg/junit/platform/engine/ExecutionRequest;)V+2 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/Root;Lorg/junit/platform/engine/ConfigurationParameters;[Lorg/junit/platform/launcher/TestExecutionListener;)V+101 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+36 +j org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(Lorg/apache/maven/surefire/util/TestsToRun;)Lorg/apache/maven/surefire/suite/RunResult;+55 +j org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+31 +j org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Lorg/apache/maven/surefire/booter/ForkingReporterFactory;)Lorg/apache/maven/surefire/suite/RunResult;+9 +j org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess()Lorg/apache/maven/surefire/suite/RunResult;+7 +j org.apache.maven.surefire.booter.ForkedBooter.execute()V+1 +j org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+35 +v ~StubRoutines::call_stub +V [libjvm.so+0x78e42b] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2fb +V [libjvm.so+0x80d2e3] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .isra.125] [clone .constprop.264]+0x193 +V [libjvm.so+0x80f338] jni_CallStaticVoidMethod+0x108 +C [libjli.so+0x4647] JavaMain+0xcd7 +C [libjli.so+0x85a9] ThreadJavaMain+0x9 + +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +j com.sun.jna.Native.setMemory(Lcom/sun/jna/Pointer;JJJB)V+0 +j com.sun.jna.Pointer.setMemory(JJB)V+9 +j com.baeldung.jna.StdCUnitTest.whenAccessViolation_thenShouldThrowError()V+17 +v ~StubRoutines::call_stub +j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@14.0.2 +j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@14.0.2 +j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@14.0.2 +j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@14.0.2 +j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 +j org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;)Ljava/lang/Object;+32 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+24 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$232.execute()V+12 +j org.junit.jupiter.engine.execution.ThrowableCollector.execute(Lorg/junit/jupiter/api/function/Executable;)V+1 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 +j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+35 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 +j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 +j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 +j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 +j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 +j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 +j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 +j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 +j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 +j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 +j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 +j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 +j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 +j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 +j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 +j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 +j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 +j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 +j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()V+23 +j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+13 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/engine/TestEngine;Lorg/junit/platform/engine/ExecutionRequest;)V+2 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/Root;Lorg/junit/platform/engine/ConfigurationParameters;[Lorg/junit/platform/launcher/TestExecutionListener;)V+101 +j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+36 +j org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(Lorg/apache/maven/surefire/util/TestsToRun;)Lorg/apache/maven/surefire/suite/RunResult;+55 +j org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+31 +j org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Lorg/apache/maven/surefire/booter/ForkingReporterFactory;)Lorg/apache/maven/surefire/suite/RunResult;+9 +j org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess()Lorg/apache/maven/surefire/suite/RunResult;+7 +j org.apache.maven.surefire.booter.ForkedBooter.execute()V+1 +j org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+35 +v ~StubRoutines::call_stub + +siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000 + +Register to memory mapping: + +RAX=0x0 is NULL +RBX={method} {0x00007f01b6799628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' +RCX=0x0000000000000080 is an unknown value +RDX=0x0000000000019000 is an unknown value +RSP=0x00007f01b9240788 is pointing into the stack for thread: 0x00007f01b0028800 +RBP=0x00007f01b92407c0 is pointing into the stack for thread: 0x00007f01b0028800 +RSI=0x0 is NULL +RDI=0x0 is NULL +R8 =0x0 is NULL +R9 =0x0000000000019000 is an unknown value +R10=0x0000000000000009 is an unknown value +R11=0x00007f01b8794fd0: in /lib64/libc.so.6 at 0x00007f01b8637000 +R12=0x0 is NULL +R13={method} {0x00007f01b6799628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' +R14=0x00007f01b92408b8 is pointing into the stack for thread: 0x00007f01b0028800 +R15=0x00007f01b0028800 is a thread + + +Registers: +RAX=0x0000000000000000, RBX=0x00007f01b6799628, RCX=0x0000000000000080, RDX=0x0000000000019000 +RSP=0x00007f01b9240788, RBP=0x00007f01b92407c0, RSI=0x0000000000000000, RDI=0x0000000000000000 +R8 =0x0000000000000000, R9 =0x0000000000019000, R10=0x0000000000000009, R11=0x00007f01b8794fd0 +R12=0x0000000000000000, R13=0x00007f01b6799628, R14=0x00007f01b92408b8, R15=0x00007f01b0028800 +RIP=0x00007f01b8795090, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000006 + TRAPNO=0x000000000000000e + +Top of Stack: (sp=0x00007f01b9240788) +0x00007f01b9240788: 00007f01b4a8fe8d 00007f01b6799628 +0x00007f01b9240798: 00007f01b0028b10 0000000000000000 +0x00007f01b92407a8: 0000000000019000 0000000000000000 +0x00007f01b92407b8: 0000000000000000 00007f01b9240860 + +Instructions: (pc=0x00007f01b8795090) +0x00007f01b8794f90: f3 0f 1e fa 48 39 d1 0f 82 53 d9 fa ff 0f 1f 00 +0x00007f01b8794fa0: f3 0f 1e fa 48 c1 e2 02 c5 f9 6e c6 48 89 f8 c4 +0x00007f01b8794fb0: e2 7d 58 c0 eb 2a 66 2e 0f 1f 84 00 00 00 00 00 +0x00007f01b8794fc0: f3 0f 1e fa 48 39 d1 0f 82 23 d9 fa ff 0f 1f 00 +0x00007f01b8794fd0: f3 0f 1e fa c5 f9 6e c6 48 89 f8 c4 e2 7d 78 c0 +0x00007f01b8794fe0: 48 83 fa 20 0f 82 04 01 00 00 48 83 fa 40 77 77 +0x00007f01b8794ff0: c5 fe 7f 44 17 e0 c5 fe 7f 07 c5 f8 77 c3 66 90 +0x00007f01b8795000: f3 0f 1e fa c5 f8 77 48 89 d1 40 0f b6 c6 48 89 +0x00007f01b8795010: fa f3 aa 48 89 d0 c3 66 0f 1f 84 00 00 00 00 00 +0x00007f01b8795020: f3 0f 1e fa 48 39 d1 0f 82 c3 d8 fa ff 0f 1f 00 +0x00007f01b8795030: f3 0f 1e fa c5 f9 6e c6 48 89 f8 c4 e2 7d 78 c0 +0x00007f01b8795040: 48 83 fa 20 0f 82 a4 00 00 00 48 83 fa 40 77 0e +0x00007f01b8795050: c5 fe 7f 44 17 e0 c5 fe 7f 07 c5 f8 77 c3 48 81 +0x00007f01b8795060: fa 00 08 00 00 77 9d 48 81 fa 80 00 00 00 77 19 +0x00007f01b8795070: c5 fe 7f 07 c5 fe 7f 47 20 c5 fe 7f 44 17 e0 c5 +0x00007f01b8795080: fe 7f 44 17 c0 c5 f8 77 c3 48 8d 8f 80 00 00 00 +0x00007f01b8795090: c5 fe 7f 07 48 83 e1 80 c5 fe 7f 44 17 e0 c5 fe +0x00007f01b87950a0: 7f 47 20 c5 fe 7f 44 17 c0 c5 fe 7f 47 40 c5 fe +0x00007f01b87950b0: 7f 44 17 a0 c5 fe 7f 47 60 c5 fe 7f 44 17 80 48 +0x00007f01b87950c0: 01 fa 48 83 e2 80 48 39 d1 74 ba c5 fd 7f 01 c5 +0x00007f01b87950d0: fd 7f 41 20 c5 fd 7f 41 40 c5 fd 7f 41 60 48 81 +0x00007f01b87950e0: c1 80 00 00 00 48 39 ca 75 e1 c5 f8 77 c3 80 fa +0x00007f01b87950f0: 10 73 1c c4 e1 f9 7e c1 80 fa 08 73 20 80 fa 04 +0x00007f01b8795100: 73 27 80 fa 01 77 2c 72 02 88 0f c5 f8 77 c3 c5 +0x00007f01b8795110: fa 7f 44 17 f0 c5 fa 7f 07 c5 f8 77 c3 48 89 4c +0x00007f01b8795120: 17 f8 48 89 0f c5 f8 77 c3 89 4c 17 fc 89 0f c5 +0x00007f01b8795130: f8 77 c3 66 89 4c 17 fe 66 89 0f c5 f8 77 c3 90 +0x00007f01b8795140: f3 0f 1e fa 48 c1 e2 02 48 83 fa 20 0f 82 3e 01 +0x00007f01b8795150: 00 00 c5 fe 6f 16 c5 ed 76 17 c5 fd d7 c2 83 e8 +0x00007f01b8795160: ff 0f 85 e9 00 00 00 48 83 fa 40 0f 86 c0 00 00 +0x00007f01b8795170: 00 c5 fd 76 c0 48 81 fa 00 01 00 00 0f 87 9e 01 +0x00007f01b8795180: 00 00 48 81 fa 80 00 00 00 0f 82 28 02 00 00 c5 + + +Stack slot to memory mapping: +stack at sp + 0 slots: 0x00007f01b4a8fe8d: Java_com_sun_jna_Native_setMemory+0x00000000000000bd in /root/.cache/JNA/temp/jna8092103267992246554.tmp at 0x00007f01b4a89000 +stack at sp + 1 slots: {method} {0x00007f01b6799628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' +stack at sp + 2 slots: 0x00007f01b0028b10 points into unknown readable memory: 80 48 58 b8 01 7f 00 00 +stack at sp + 3 slots: 0x0 is NULL +stack at sp + 4 slots: 0x0000000000019000 is an unknown value +stack at sp + 5 slots: 0x0 is NULL +stack at sp + 6 slots: 0x0 is NULL +stack at sp + 7 slots: 0x00007f01b9240860 is pointing into the stack for thread: 0x00007f01b0028800 + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00007f01b01d8a40, length=12, elements={ +0x00007f01b0028800, 0x00007f01b00a2000, 0x00007f01b00a3800, 0x00007f01b00ad000, +0x00007f01b00af000, 0x00007f01b00b1000, 0x00007f01b00b3000, 0x00007f01b00b5000, +0x00007f01b00ef800, 0x00007f01b00f4800, 0x00007f01b0188800, 0x00007f01b01d7800 +} + +Java Threads: ( => current thread ) +=>0x00007f01b0028800 JavaThread "main" [_thread_in_native, id=114, stack(0x00007f01b9143000,0x00007f01b9244000)] + 0x00007f01b00a2000 JavaThread "Reference Handler" daemon [_thread_blocked, id=120, stack(0x00007f01b5ed6000,0x00007f01b5fd7000)] + 0x00007f01b00a3800 JavaThread "Finalizer" daemon [_thread_blocked, id=123, stack(0x00007f01b5dd5000,0x00007f01b5ed6000)] + 0x00007f01b00ad000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=125, stack(0x00007f01b55e0000,0x00007f01b56e1000)] + 0x00007f01b00af000 JavaThread "Service Thread" daemon [_thread_blocked, id=128, stack(0x00007f01b54df000,0x00007f01b55e0000)] + 0x00007f01b00b1000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=130, stack(0x00007f01b53de000,0x00007f01b54df000)] + 0x00007f01b00b3000 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=133, stack(0x00007f01b52dd000,0x00007f01b53de000)] + 0x00007f01b00b5000 JavaThread "Sweeper thread" daemon [_thread_blocked, id=138, stack(0x00007f01b51dc000,0x00007f01b52dd000)] + 0x00007f01b00ef800 JavaThread "Notification Thread" daemon [_thread_blocked, id=140, stack(0x00007f01b50db000,0x00007f01b51dc000)] + 0x00007f01b00f4800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=146, stack(0x00007f01b4ed8000,0x00007f01b4fd9000)] + 0x00007f01b0188800 JavaThread "surefire-forkedjvm-command-thread" daemon [_thread_in_native, id=150, stack(0x00007f01b4dc0000,0x00007f01b4ec1000)] + 0x00007f01b01d7800 JavaThread "surefire-forkedjvm-ping-30s" daemon [_thread_blocked, id=153, stack(0x00007f01b4cb2000,0x00007f01b4db3000)] + +Other Threads: + 0x00007f01b009e800 VMThread "VM Thread" [stack: 0x00007f01b5fd9000,0x00007f01b60d9000] [id=117] + 0x00007f01b00f2000 WatcherThread [stack: 0x00007f01b4fdb000,0x00007f01b50db000] [id=141] + +Threads with active compile tasks: + +VM state:not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: None + +Heap address: 0x00000000e0c00000, size: 500 MB, Compressed Oops mode: 32-bit +Narrow klass base: 0x0000000800000000, Narrow klass shift: 3 +Compressed class space size: 1073741824 Address: 0x0000000800b11000 + +Heap: + def new generation total 9792K, used 7590K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) + eden space 8704K, 74% used [0x00000000e0c00000, 0x00000000e1259a00, 0x00000000e1480000) + from space 1088K, 100% used [0x00000000e1590000, 0x00000000e16a0000, 0x00000000e16a0000) + to space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) + tenured generation total 21888K, used 1321K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) + the space 21888K, 6% used [0x00000000eb2a0000, 0x00000000eb3ea690, 0x00000000eb3ea800, 0x00000000ec800000) + Metaspace used 4992K, capacity 7071K, committed 7296K, reserved 1056768K + class space used 637K, capacity 881K, committed 896K, reserved 1048576K + +Card table byte_map: [0x00007f01b6a5c000,0x00007f01b6b57000] _byte_map_base: 0x00007f01b6356000 + +Polling page: 0x00007f01b9259000 + +Metaspace: + +Usage: + Non-class: 6.04 MB capacity, 4.25 MB ( 70%) used, 1.76 MB ( 29%) free+waste, 30.81 KB ( <1%) overhead. + Class: 881.00 KB capacity, 637.47 KB ( 72%) used, 226.47 KB ( 26%) free+waste, 17.06 KB ( 2%) overhead. + Both: 6.91 MB capacity, 4.88 MB ( 71%) used, 1.98 MB ( 29%) free+waste, 47.88 KB ( <1%) overhead. + +Virtual space: + Non-class space: 8.00 MB reserved, 6.25 MB ( 78%) committed + Class space: 1.00 GB reserved, 896.00 KB ( <1%) committed + Both: 1.01 GB reserved, 7.12 MB ( <1%) committed + +Chunk freelists: + Non-Class: 62.00 KB + Class: 11.00 KB + Both: 73.00 KB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB + +CodeHeap 'non-profiled nmethods': size=120036Kb used=270Kb max_used=270Kb free=119765Kb + bounds [0x00007f01a019c000, 0x00007f01a040c000, 0x00007f01a76d5000] +CodeHeap 'profiled nmethods': size=120032Kb used=1585Kb max_used=1585Kb free=118446Kb + bounds [0x00007f0198c64000, 0x00007f0198ed4000, 0x00007f01a019c000] +CodeHeap 'non-nmethods': size=5692Kb used=1156Kb max_used=1171Kb free=4535Kb + bounds [0x00007f01986d5000, 0x00007f0198945000, 0x00007f0198c64000] + total_blobs=1295 nmethods=879 adapters=332 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 10.134 Thread 0x00007f01b00b3000 876 3 java.util.zip.ZipEntry:: (74 bytes) +Event: 10.135 Thread 0x00007f01b00b3000 nmethod 876 0x00007f0198ded390 code [0x00007f0198ded580, 0x00007f0198dedaf0] +Event: 10.135 Thread 0x00007f01b00b3000 873 3 java.util.jar.JarFile$1::apply (13 bytes) +Event: 10.138 Thread 0x00007f01b00b3000 nmethod 873 0x00007f0198dedd10 code [0x00007f0198dedec0, 0x00007f0198dee1a0] +Event: 10.138 Thread 0x00007f01b00b3000 874 3 java.util.jar.JarFile$JarFileEntry:: (16 bytes) +Event: 10.138 Thread 0x00007f01b00b3000 nmethod 874 0x00007f0198dee310 code [0x00007f0198dee4c0, 0x00007f0198dee6c0] +Event: 10.141 Thread 0x00007f01b00b1000 877 4 java.lang.StringBuilder:: (7 bytes) +Event: 10.144 Thread 0x00007f01b00b1000 nmethod 877 0x00007f01a01df010 code [0x00007f01a01df180, 0x00007f01a01df298] +Event: 10.151 Thread 0x00007f01b00b3000 878 ! 3 java.util.zip.ZipFile$ZipFileInflaterInputStream::close (67 bytes) +Event: 10.152 Thread 0x00007f01b00b3000 nmethod 878 0x00007f0198dee790 code [0x00007f0198dee980, 0x00007f0198def090] +Event: 10.158 Thread 0x00007f01b00b3000 879 3 java.util.ArrayDeque::add (7 bytes) +Event: 10.159 Thread 0x00007f01b00b3000 nmethod 879 0x00007f0198def390 code [0x00007f0198def520, 0x00007f0198def680] +Event: 10.166 Thread 0x00007f01b00b3000 880 3 java.util.zip.ZipFile$InflaterCleanupAction::run (12 bytes) +Event: 10.167 Thread 0x00007f01b00b3000 nmethod 880 0x00007f0198def710 code [0x00007f0198def8a0, 0x00007f0198defa00] +Event: 10.167 Thread 0x00007f01b00b3000 881 ! 3 java.util.zip.Inflater::reset (64 bytes) +Event: 10.167 Thread 0x00007f01b00b3000 nmethod 881 0x00007f0198defb10 code [0x00007f0198defcc0, 0x00007f0198df00b0] +Event: 10.179 Thread 0x00007f01b00b1000 883 4 java.lang.Object:: (1 bytes) +Event: 10.180 Thread 0x00007f01b00b1000 nmethod 883 0x00007f01a01df710 code [0x00007f01a01df880, 0x00007f01a01df938] +Event: 10.185 Thread 0x00007f01b00b3000 884 3 sun.net.www.protocol.jar.Handler::checkNestedProtocol (18 bytes) +Event: 10.186 Thread 0x00007f01b00b3000 nmethod 884 0x00007f0198df0290 code [0x00007f0198df0440, 0x00007f0198df0620] + +GC Heap History (2 events): +Event: 5.704 GC heap before +{Heap before GC invocations=0 (full 0): + def new generation total 9792K, used 8704K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) + eden space 8704K, 100% used [0x00000000e0c00000, 0x00000000e1480000, 0x00000000e1480000) + from space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) + to space 1088K, 0% used [0x00000000e1590000, 0x00000000e1590000, 0x00000000e16a0000) + tenured generation total 21888K, used 0K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) + the space 21888K, 0% used [0x00000000eb2a0000, 0x00000000eb2a0000, 0x00000000eb2a0200, 0x00000000ec800000) + Metaspace used 3047K, capacity 5805K, committed 6016K, reserved 1056768K + class space used 361K, capacity 627K, committed 640K, reserved 1048576K +} +Event: 5.793 GC heap after +{Heap after GC invocations=1 (full 0): + def new generation total 9792K, used 1088K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) + eden space 8704K, 0% used [0x00000000e0c00000, 0x00000000e0c00000, 0x00000000e1480000) + from space 1088K, 100% used [0x00000000e1590000, 0x00000000e16a0000, 0x00000000e16a0000) + to space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) + tenured generation total 21888K, used 1321K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) + the space 21888K, 6% used [0x00000000eb2a0000, 0x00000000eb3ea690, 0x00000000eb3ea800, 0x00000000ec800000) + Metaspace used 3047K, capacity 5805K, committed 6016K, reserved 1056768K + class space used 361K, capacity 627K, committed 640K, reserved 1048576K +} + +Deoptimization events (16 events): +Event: 0.632 Thread 0x00007f01b0028800 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007f01a01a0598 relative=0x00000000000001d8 +Event: 0.632 Thread 0x00007f01b0028800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f01a01a0598 method=java.lang.String.hashCode()I @ 42 c2 +Event: 0.632 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f01a01a0598 sp=0x00007f01b9241330 +Event: 0.632 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871de25 sp=0x00007f01b92412e8 mode 2 +Event: 2.512 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f0198cb6484 sp=0x00007f01b9240b90 +Event: 2.513 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871e33a sp=0x00007f01b9240008 mode 0 +Event: 2.799 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f0198cc1322 sp=0x00007f01b92411c0 +Event: 2.799 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871e33a sp=0x00007f01b9240648 mode 0 +Event: 3.948 Thread 0x00007f01b0028800 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007f01a01a2068 relative=0x0000000000000068 +Event: 3.948 Thread 0x00007f01b0028800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f01a01a2068 method=java.lang.String.isLatin1()Z @ 10 c2 +Event: 3.948 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f01a01a2068 sp=0x00007f01b92418d0 +Event: 3.948 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871de25 sp=0x00007f01b9241880 mode 2 +Event: 6.052 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f0198cca4e8 sp=0x00007f01b9240f60 +Event: 6.052 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871e33a sp=0x00007f01b92403d0 mode 0 +Event: 9.484 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f0198cc64c5 sp=0x00007f01b923f9a0 +Event: 9.485 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871e33a sp=0x00007f01b923ee20 mode 0 + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (17 events): +Event: 1.373 Thread 0x00007f01b0028800 Exception (0x00000000e0dc59d8) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 3.603 Thread 0x00007f01b0028800 Exception (0x00000000e1209430) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 4.004 Thread 0x00007f01b0028800 Exception (0x00000000e12808b8) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 4.253 Thread 0x00007f01b0028800 Exception (0x00000000e12d4648) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 4.809 Thread 0x00007f01b0028800 Exception (0x00000000e1346010) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 4.925 Thread 0x00007f01b0028800 Exception (0x00000000e137ad28) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 4.993 Thread 0x00007f01b0028800 Exception (0x00000000e139e938) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 5.012 Thread 0x00007f01b0028800 Exception (0x00000000e13a8b18) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 5.041 Thread 0x00007f01b0028800 Exception (0x00000000e13b69e8) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 832] +Event: 5.141 Thread 0x00007f01b0028800 Exception (0x00000000e13ebf18) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 5.852 Thread 0x00007f01b0028800 Exception (0x00000000e0c24ce8) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.079 Thread 0x00007f01b0028800 Exception (0x00000000e0c8faf8) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.396 Thread 0x00007f01b0028800 Exception (0x00000000e0cfcd80) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.442 Thread 0x00007f01b0028800 Exception (0x00000000e0d15098) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 6.449 Thread 0x00007f01b0028800 Exception (0x00000000e0d17a88) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 832] +Event: 8.061 Thread 0x00007f01b0028800 Exception (0x00000000e0f73890) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] +Event: 8.061 Thread 0x00007f01b0028800 Exception (0x00000000e0f76c98) +thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] + +Events (20 events): +Event: 10.009 loading class sun/security/provider/ByteArrayAccess +Event: 10.009 loading class sun/security/provider/ByteArrayAccess done +Event: 10.010 loading class java/io/DeleteOnExitHook +Event: 10.010 loading class java/io/DeleteOnExitHook done +Event: 10.010 loading class java/io/DeleteOnExitHook$1 +Event: 10.011 loading class java/io/DeleteOnExitHook$1 done +Event: 10.043 loading class java/io/FileOutputStream$1 +Event: 10.043 loading class java/io/FileOutputStream$1 done +Event: 10.046 Loaded shared library /root/.cache/JNA/temp/jna8092103267992246554.tmp +Event: 10.046 loading class java/nio/ShortBuffer +Event: 10.048 loading class java/nio/ShortBuffer done +Event: 10.051 loading class java/nio/FloatBuffer +Event: 10.051 loading class java/nio/FloatBuffer done +Event: 10.054 loading class java/nio/DoubleBuffer +Event: 10.057 loading class java/nio/DoubleBuffer done +Event: 10.132 Executing VM operation: HandshakeAllThreads +Event: 10.132 Executing VM operation: HandshakeAllThreads done +Event: 10.168 Loaded shared library /usr/java/openjdk-14/lib/libzip.so +Event: 10.207 Executing VM operation: HandshakeAllThreads +Event: 10.210 Executing VM operation: HandshakeAllThreads done + + +Dynamic libraries: +e0c00000-e16a0000 rw-p 00000000 00:00 0 +e16a0000-eb2a0000 ---p 00000000 00:00 0 +eb2a0000-ec800000 rw-p 00000000 00:00 0 +ec800000-100000000 ---p 00000000 00:00 0 +800000000-800003000 rwxp 00001000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa +800003000-8003e4000 rw-p 00004000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa +8003e4000-800b10000 r--p 003e5000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa +800b10000-800b11000 rw-p 00b11000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa +800b11000-800bf1000 rw-p 00000000 00:00 0 +800bf1000-840b11000 ---p 00000000 00:00 0 +56394c07f000-56394c080000 r-xp 00000000 08:01 3160482 /usr/java/openjdk-14/bin/java +56394c081000-56394c082000 r--p 00001000 08:01 3160482 /usr/java/openjdk-14/bin/java +56394c082000-56394c083000 rw-p 00002000 08:01 3160482 /usr/java/openjdk-14/bin/java +56394c563000-56394c584000 rw-p 00000000 00:00 0 [heap] +7f017c000000-7f017c3ce000 rw-p 00000000 00:00 0 +7f017c3ce000-7f0180000000 ---p 00000000 00:00 0 +7f0180000000-7f01802f1000 rw-p 00000000 00:00 0 +7f01802f1000-7f0184000000 ---p 00000000 00:00 0 +7f0184000000-7f0184021000 rw-p 00000000 00:00 0 +7f0184021000-7f0188000000 ---p 00000000 00:00 0 +7f0188000000-7f0188021000 rw-p 00000000 00:00 0 +7f0188021000-7f018c000000 ---p 00000000 00:00 0 +7f018c000000-7f018c021000 rw-p 00000000 00:00 0 +7f018c021000-7f0190000000 ---p 00000000 00:00 0 +7f0190000000-7f0190021000 rw-p 00000000 00:00 0 +7f0190021000-7f0194000000 ---p 00000000 00:00 0 +7f0194000000-7f0194021000 rw-p 00000000 00:00 0 +7f0194021000-7f0198000000 ---p 00000000 00:00 0 +7f01986d5000-7f0198945000 rwxp 00000000 00:00 0 +7f0198945000-7f0198c64000 ---p 00000000 00:00 0 +7f0198c64000-7f0198ed4000 rwxp 00000000 00:00 0 +7f0198ed4000-7f01a019c000 ---p 00000000 00:00 0 +7f01a019c000-7f01a040c000 rwxp 00000000 00:00 0 +7f01a040c000-7f01a76d5000 ---p 00000000 00:00 0 +7f01a76d5000-7f01b0000000 r--s 00000000 08:01 3160985 /usr/java/openjdk-14/lib/modules +7f01b0000000-7f01b04f4000 rw-p 00000000 00:00 0 +7f01b04f4000-7f01b4000000 ---p 00000000 00:00 0 +7f01b45cb000-7f01b4a89000 rw-p 00000000 00:00 0 +7f01b4a89000-7f01b4aa1000 r-xp 00000000 08:01 3163771 /root/.cache/JNA/temp/jna8092103267992246554.tmp (deleted) +7f01b4aa1000-7f01b4ca1000 ---p 00018000 08:01 3163771 /root/.cache/JNA/temp/jna8092103267992246554.tmp (deleted) +7f01b4ca1000-7f01b4ca2000 rw-p 00018000 08:01 3163771 /root/.cache/JNA/temp/jna8092103267992246554.tmp (deleted) +7f01b4ca2000-7f01b4caf000 r-xp 00000000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so +7f01b4caf000-7f01b4cb1000 r--p 0000c000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so +7f01b4cb1000-7f01b4cb2000 rw-p 0000e000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so +7f01b4cb2000-7f01b4cb6000 ---p 00000000 00:00 0 +7f01b4cb6000-7f01b4db3000 rw-p 00000000 00:00 0 +7f01b4db3000-7f01b4db8000 r-xp 00000000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so +7f01b4db8000-7f01b4db9000 r--p 00004000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so +7f01b4db9000-7f01b4dba000 rw-p 00005000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so +7f01b4dba000-7f01b4dbe000 r-xp 00000000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so +7f01b4dbe000-7f01b4dbf000 r--p 00003000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so +7f01b4dbf000-7f01b4dc0000 rw-p 00004000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so +7f01b4dc0000-7f01b4dc4000 ---p 00000000 00:00 0 +7f01b4dc4000-7f01b4ec1000 rw-p 00000000 00:00 0 +7f01b4ec1000-7f01b4ed6000 r-xp 00000000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so +7f01b4ed6000-7f01b4ed7000 r--p 00014000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so +7f01b4ed7000-7f01b4ed8000 rw-p 00015000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so +7f01b4ed8000-7f01b4edc000 ---p 00000000 00:00 0 +7f01b4edc000-7f01b4fd9000 rw-p 00000000 00:00 0 +7f01b4fd9000-7f01b4fda000 ---p 00000000 00:00 0 +7f01b4fda000-7f01b50db000 rw-p 00000000 00:00 0 +7f01b50db000-7f01b50df000 ---p 00000000 00:00 0 +7f01b50df000-7f01b51dc000 rw-p 00000000 00:00 0 +7f01b51dc000-7f01b51e0000 ---p 00000000 00:00 0 +7f01b51e0000-7f01b52dd000 rw-p 00000000 00:00 0 +7f01b52dd000-7f01b52e1000 ---p 00000000 00:00 0 +7f01b52e1000-7f01b53de000 rw-p 00000000 00:00 0 +7f01b53de000-7f01b53e2000 ---p 00000000 00:00 0 +7f01b53e2000-7f01b54df000 rw-p 00000000 00:00 0 +7f01b54df000-7f01b54e3000 ---p 00000000 00:00 0 +7f01b54e3000-7f01b55e0000 rw-p 00000000 00:00 0 +7f01b55e0000-7f01b55e4000 ---p 00000000 00:00 0 +7f01b55e4000-7f01b56e1000 rw-p 00000000 00:00 0 +7f01b56e1000-7f01b5734000 r--p 00000000 08:01 3154692 /usr/lib/locale/C.utf8/LC_CTYPE +7f01b5734000-7f01b5dd5000 r--p 00000000 08:01 3154691 /usr/lib/locale/C.utf8/LC_COLLATE +7f01b5dd5000-7f01b5dd9000 ---p 00000000 00:00 0 +7f01b5dd9000-7f01b5ed6000 rw-p 00000000 00:00 0 +7f01b5ed6000-7f01b5eda000 ---p 00000000 00:00 0 +7f01b5eda000-7f01b5fd7000 rw-p 00000000 00:00 0 +7f01b5fd7000-7f01b5fd8000 ---p 00000000 00:00 0 +7f01b5fd8000-7f01b67f5000 rw-p 00000000 00:00 0 +7f01b67f5000-7f01b69b5000 ---p 00000000 00:00 0 +7f01b69b5000-7f01b69c0000 rw-p 00000000 00:00 0 +7f01b69c0000-7f01b6a5c000 ---p 00000000 00:00 0 +7f01b6a5c000-7f01b6a62000 rw-p 00000000 00:00 0 +7f01b6a62000-7f01b6aaf000 ---p 00000000 00:00 0 +7f01b6aaf000-7f01b6aba000 rw-p 00000000 00:00 0 +7f01b6aba000-7f01b6b56000 ---p 00000000 00:00 0 +7f01b6b56000-7f01b6b5c000 rw-p 00000000 00:00 0 +7f01b6b5c000-7f01b6c42000 ---p 00000000 00:00 0 +7f01b6c42000-7f01b6c47000 rw-p 00000000 00:00 0 +7f01b6c47000-7f01b6d2d000 ---p 00000000 00:00 0 +7f01b6d2d000-7f01b6d38000 r-xp 00000000 08:01 3155554 /usr/lib64/libnss_files-2.28.so +7f01b6d38000-7f01b6f37000 ---p 0000b000 08:01 3155554 /usr/lib64/libnss_files-2.28.so +7f01b6f37000-7f01b6f38000 r--p 0000a000 08:01 3155554 /usr/lib64/libnss_files-2.28.so +7f01b6f38000-7f01b6f39000 rw-p 0000b000 08:01 3155554 /usr/lib64/libnss_files-2.28.so +7f01b6f39000-7f01b6f3f000 rw-p 00000000 00:00 0 +7f01b6f3f000-7f01b6f46000 r-xp 00000000 08:01 3155596 /usr/lib64/librt-2.28.so +7f01b6f46000-7f01b7146000 ---p 00007000 08:01 3155596 /usr/lib64/librt-2.28.so +7f01b7146000-7f01b7147000 r--p 00007000 08:01 3155596 /usr/lib64/librt-2.28.so +7f01b7147000-7f01b7148000 rw-p 00008000 08:01 3155596 /usr/lib64/librt-2.28.so +7f01b7148000-7f01b72c9000 r-xp 00000000 08:01 3155521 /usr/lib64/libm-2.28.so +7f01b72c9000-7f01b74c8000 ---p 00181000 08:01 3155521 /usr/lib64/libm-2.28.so +7f01b74c8000-7f01b74c9000 r--p 00180000 08:01 3155521 /usr/lib64/libm-2.28.so +7f01b74c9000-7f01b74ca000 rw-p 00181000 08:01 3155521 /usr/lib64/libm-2.28.so +7f01b74ca000-7f01b84d9000 r-xp 00000000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so +7f01b84d9000-7f01b84da000 ---p 0100f000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so +7f01b84da000-7f01b857e000 r--p 0100f000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so +7f01b857e000-7f01b85b6000 rw-p 010b3000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so +7f01b85b6000-7f01b8637000 rw-p 00000000 00:00 0 +7f01b8637000-7f01b87f0000 r-xp 00000000 08:01 3155424 /usr/lib64/libc-2.28.so +7f01b87f0000-7f01b89ef000 ---p 001b9000 08:01 3155424 /usr/lib64/libc-2.28.so +7f01b89ef000-7f01b89f3000 r--p 001b8000 08:01 3155424 /usr/lib64/libc-2.28.so +7f01b89f3000-7f01b89f5000 rw-p 001bc000 08:01 3155424 /usr/lib64/libc-2.28.so +7f01b89f5000-7f01b89f9000 rw-p 00000000 00:00 0 +7f01b89f9000-7f01b89fc000 r-xp 00000000 08:01 3155440 /usr/lib64/libdl-2.28.so +7f01b89fc000-7f01b8bfb000 ---p 00003000 08:01 3155440 /usr/lib64/libdl-2.28.so +7f01b8bfb000-7f01b8bfc000 r--p 00002000 08:01 3155440 /usr/lib64/libdl-2.28.so +7f01b8bfc000-7f01b8bfd000 rw-p 00003000 08:01 3155440 /usr/lib64/libdl-2.28.so +7f01b8bfd000-7f01b8c18000 r-xp 00000000 08:01 3155583 /usr/lib64/libpthread-2.28.so +7f01b8c18000-7f01b8e17000 ---p 0001b000 08:01 3155583 /usr/lib64/libpthread-2.28.so +7f01b8e17000-7f01b8e18000 r--p 0001a000 08:01 3155583 /usr/lib64/libpthread-2.28.so +7f01b8e18000-7f01b8e19000 rw-p 0001b000 08:01 3155583 /usr/lib64/libpthread-2.28.so +7f01b8e19000-7f01b8e1d000 rw-p 00000000 00:00 0 +7f01b8e1d000-7f01b8e33000 r-xp 00000000 08:01 3155650 /usr/lib64/libz.so.1.2.11 +7f01b8e33000-7f01b9032000 ---p 00016000 08:01 3155650 /usr/lib64/libz.so.1.2.11 +7f01b9032000-7f01b9033000 r--p 00015000 08:01 3155650 /usr/lib64/libz.so.1.2.11 +7f01b9033000-7f01b9034000 rw-p 00000000 00:00 0 +7f01b9034000-7f01b905d000 r-xp 00000000 08:01 3155395 /usr/lib64/ld-2.28.so +7f01b9061000-7f01b9072000 r-xp 00000000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so +7f01b9072000-7f01b9073000 ---p 00011000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so +7f01b9073000-7f01b9074000 r--p 00011000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so +7f01b9074000-7f01b9075000 rw-p 00012000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so +7f01b9075000-7f01b9076000 r--p 00000000 08:01 3154699 /usr/lib/locale/C.utf8/LC_NUMERIC +7f01b9076000-7f01b9077000 r--p 00000000 08:01 3154702 /usr/lib/locale/C.utf8/LC_TIME +7f01b9077000-7f01b9078000 r--p 00000000 08:01 3154697 /usr/lib/locale/C.utf8/LC_MONETARY +7f01b9078000-7f01b9079000 r--p 00000000 08:01 3154696 /usr/lib/locale/C.utf8/LC_MESSAGES/SYS_LC_MESSAGES +7f01b9079000-7f01b907a000 r--p 00000000 08:01 3154700 /usr/lib/locale/C.utf8/LC_PAPER +7f01b907a000-7f01b907b000 r--p 00000000 08:01 3154698 /usr/lib/locale/C.utf8/LC_NAME +7f01b907b000-7f01b907c000 r--p 00000000 08:01 3154690 /usr/lib/locale/C.utf8/LC_ADDRESS +7f01b907c000-7f01b907d000 r--p 00000000 08:01 3154701 /usr/lib/locale/C.utf8/LC_TELEPHONE +7f01b907d000-7f01b907e000 r--p 00000000 08:01 3154694 /usr/lib/locale/C.utf8/LC_MEASUREMENT +7f01b907e000-7f01b9085000 r--s 00000000 08:01 3155357 /usr/lib64/gconv/gconv-modules.cache +7f01b9085000-7f01b9086000 r--p 00000000 08:01 3154693 /usr/lib/locale/C.utf8/LC_IDENTIFICATION +7f01b9086000-7f01b90a0000 r--p 00000000 08:01 3154703 /usr/lib/locale/locale-archive +7f01b90a0000-7f01b90e6000 rw-p 00000000 00:00 0 +7f01b90e6000-7f01b90ed000 ---p 00000000 00:00 0 +7f01b90ed000-7f01b90f4000 r-xp 00000000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so +7f01b90f4000-7f01b90f5000 r--p 00006000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so +7f01b90f5000-7f01b90f6000 rw-p 00007000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so +7f01b90f6000-7f01b911a000 r-xp 00000000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so +7f01b911a000-7f01b911b000 r--p 00023000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so +7f01b911b000-7f01b911d000 rw-p 00024000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so +7f01b911d000-7f01b9125000 rw-s 00000000 08:01 3163742 /tmp/hsperfdata_root/98 +7f01b9125000-7f01b9140000 r-xp 00000000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so +7f01b9140000-7f01b9142000 r--p 0001a000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so +7f01b9142000-7f01b9143000 rw-p 0001c000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so +7f01b9143000-7f01b9147000 ---p 00000000 00:00 0 +7f01b9147000-7f01b9246000 rw-p 00000000 00:00 0 +7f01b9246000-7f01b9254000 r-xp 00000000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so +7f01b9254000-7f01b9255000 ---p 0000e000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so +7f01b9255000-7f01b9256000 r--p 0000e000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so +7f01b9256000-7f01b9257000 rw-p 0000f000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so +7f01b9257000-7f01b9259000 rw-p 00000000 00:00 0 +7f01b9259000-7f01b925a000 ---p 00000000 00:00 0 +7f01b925a000-7f01b925b000 r--p 00000000 00:00 0 +7f01b925b000-7f01b925c000 ---p 00000000 00:00 0 +7f01b925c000-7f01b925d000 r--p 00028000 08:01 3155395 /usr/lib64/ld-2.28.so +7f01b925d000-7f01b925e000 rw-p 00029000 08:01 3155395 /usr/lib64/ld-2.28.so +7f01b925e000-7f01b925f000 rw-p 00000000 00:00 0 +7fff92d75000-7fff92d96000 rw-p 00000000 00:00 0 [stack] +7fff92da2000-7fff92da5000 r--p 00000000 00:00 0 [vvar] +7fff92da5000-7fff92da7000 r-xp 00000000 00:00 0 [vdso] +ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] + + +VM Arguments: +java_command: /project/java-native/target/surefire/surefirebooter255261521587421006.jar /project/java-native/target/surefire 2020-10-01T00-29-55_633-jvmRun3 surefire15563279322398545368tmp surefire_13579138375161683305tmp +java_class_path (initial): /project/java-native/target/surefire/surefirebooter255261521587421006.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 2 {product} {ergonomic} + size_t InitialHeapSize = 33554432 {product} {ergonomic} + size_t MaxHeapSize = 524288000 {product} {ergonomic} + size_t MaxNewSize = 174718976 {product} {ergonomic} + size_t MinHeapDeltaBytes = 196608 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + size_t NewSize = 11141120 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5826188 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122916026 {pd product} {ergonomic} + size_t OldSize = 22413312 {product} {ergonomic} + uintx ProfiledCodeHeapSize = 122916026 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 524288000 {manageable} {ergonomic} + bool UseCompressedClassPointers = true {lp64_product} {ergonomic} + bool UseCompressedOops = true {lp64_product} {ergonomic} + bool UseSerialGC = true {product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags + #1: stderr all=off uptime,level,tags + +Environment Variables: +JAVA_HOME=/usr/java/openjdk-14 +PATH=/usr/java/openjdk-14/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +Signal Handlers: +SIGSEGV: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGBUS: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGFPE: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGPIPE: [libjvm.so+0xb1bca0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGXFSZ: [libjvm.so+0xb1bca0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGILL: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGUSR2: [libjvm.so+0xb1bb30], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO +SIGHUP: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGINT: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGTERM: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGQUIT: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO + + +--------------- S Y S T E M --------------- + +OS:Oracle Linux Server release 8.2 +uname:Linux 4.14.154-boot2docker #1 SMP Thu Nov 14 19:19:08 UTC 2019 x86_64 +OS uptime: 0 days 14:09 hours +libc:glibc 2.28 NPTL 2.28 +rlimit: STACK 8192k, CORE infinity, NPROC infinity, NOFILE 1048576, AS infinity, DATA infinity, FSIZE infinity +load average:3.31 1.71 0.93 + +/proc/meminfo: +MemTotal: 2045412 kB +MemFree: 1093300 kB +MemAvailable: 1371360 kB +Buffers: 84560 kB +Cached: 472628 kB +SwapCached: 0 kB +Active: 588744 kB +Inactive: 294936 kB +Active(anon): 402104 kB +Inactive(anon): 198736 kB +Active(file): 186640 kB +Inactive(file): 96200 kB +Unevictable: 0 kB +Mlocked: 0 kB +SwapTotal: 1415172 kB +SwapFree: 1415172 kB +Dirty: 676 kB +Writeback: 0 kB +AnonPages: 326512 kB +Mapped: 116960 kB +Shmem: 290620 kB +Slab: 42612 kB +SReclaimable: 27604 kB +SUnreclaim: 15008 kB +KernelStack: 4640 kB +PageTables: 2556 kB +NFS_Unstable: 0 kB +Bounce: 0 kB +WritebackTmp: 0 kB +CommitLimit: 2437876 kB +Committed_AS: 1765096 kB +VmallocTotal: 34359738367 kB +VmallocUsed: 0 kB +VmallocChunk: 0 kB +HugePages_Total: 0 +HugePages_Free: 0 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +Hugepagesize: 2048 kB +DirectMap4k: 44992 kB +DirectMap2M: 2052096 kB + + +/proc/sys/kernel/threads-max (system-wide limit on the number of threads): +15537 + + +/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have): +65530 + + +/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers): +32768 + + + +container (cgroup) information: +container_type: cgroupv1 +cpu_cpuset_cpus: 0 +cpu_memory_nodes: 0 +active_processor_count: 1 +cpu_quota: no quota +cpu_period: 100000 +cpu_shares: no shares +memory_limit_in_bytes: unlimited +memory_and_swap_limit_in_bytes: unlimited +memory_soft_limit_in_bytes: unlimited +memory_usage_in_bytes: 348696576 +memory_max_usage_in_bytes: 387022848 + +KVM virtualization detected +Steal ticks since vm start: 0 +Steal ticks percentage since vm start: 0.000 + +CPU:total 1 (initial active 1) (1 cores per cpu, 1 threads per core) family 6 model 69 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, lzcnt, tsc, tscinvbit +CPU Model and flags from /proc/cpuinfo: +model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase avx2 invpcid md_clear flush_l1d + +Memory: 4k page, physical 2045412k(1093300k free), swap 1415172k(1415172k free) + +vm_info: OpenJDK 64-Bit Server VM (14.0.2+12-46) for linux-amd64 JRE (14.0.2+12-46), built on Jul 8 2020 23:30:21 by "mach5one" with gcc 8.3.0 + +END. diff --git a/java-native/pom.xml b/java-native/pom.xml new file mode 100644 index 0000000000..29fc13b8d8 --- /dev/null +++ b/java-native/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + java-native + java-native + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + 5.6.0 + + + + + net.java.dev.jna + jna-platform + ${jna.version} + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + false + + + + + \ No newline at end of file diff --git a/jni/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp b/java-native/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp rename to java-native/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp diff --git a/jni/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h b/java-native/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h rename to java-native/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h diff --git a/jni/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp b/java-native/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp rename to java-native/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp diff --git a/jni/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h b/java-native/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h rename to java-native/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h diff --git a/jni/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp b/java-native/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp rename to java-native/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp diff --git a/jni/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h b/java-native/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h rename to java-native/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h diff --git a/jni/src/main/cpp/generateNativeLib.bat b/java-native/src/main/cpp/generateNativeLib.bat similarity index 100% rename from jni/src/main/cpp/generateNativeLib.bat rename to java-native/src/main/cpp/generateNativeLib.bat diff --git a/jni/src/main/cpp/generateNativeLib.sh b/java-native/src/main/cpp/generateNativeLib.sh old mode 100755 new mode 100644 similarity index 100% rename from jni/src/main/cpp/generateNativeLib.sh rename to java-native/src/main/cpp/generateNativeLib.sh diff --git a/jni/src/main/cpp/generateNativeLibMac.sh b/java-native/src/main/cpp/generateNativeLibMac.sh old mode 100755 new mode 100644 similarity index 100% rename from jni/src/main/cpp/generateNativeLibMac.sh rename to java-native/src/main/cpp/generateNativeLibMac.sh diff --git a/java-native/src/main/java/com/baeldung/jna/CMath.java b/java-native/src/main/java/com/baeldung/jna/CMath.java new file mode 100644 index 0000000000..3ab5bdf48b --- /dev/null +++ b/java-native/src/main/java/com/baeldung/jna/CMath.java @@ -0,0 +1,10 @@ +package com.baeldung.jna; + +import com.sun.jna.Library; +import com.sun.jna.Native; +import com.sun.jna.Platform; + +public interface CMath extends Library { + CMath INSTANCE = Native.load(Platform.isWindows() ? "msvcrt" : "c", CMath.class); + double cosh(double value); +} diff --git a/java-native/src/main/java/com/baeldung/jna/Main.java b/java-native/src/main/java/com/baeldung/jna/Main.java new file mode 100644 index 0000000000..a81c878cde --- /dev/null +++ b/java-native/src/main/java/com/baeldung/jna/Main.java @@ -0,0 +1,8 @@ +package com.baeldung.jna; + +public class Main { + + public static void main(String[] args) { + + } +} \ No newline at end of file diff --git a/java-native/src/main/java/com/baeldung/jna/NativeFS.java b/java-native/src/main/java/com/baeldung/jna/NativeFS.java new file mode 100644 index 0000000000..58f2bda035 --- /dev/null +++ b/java-native/src/main/java/com/baeldung/jna/NativeFS.java @@ -0,0 +1,46 @@ +package com.baeldung.jna; + +import java.util.Collections; +import java.util.Map; + +import com.sun.jna.FunctionMapper; +import com.sun.jna.LastErrorException; +import com.sun.jna.Library; +import com.sun.jna.Native; +import com.sun.jna.NativeLong; +import com.sun.jna.Platform; +import com.sun.jna.Structure; +import com.sun.jna.Structure.FieldOrder; + +public interface NativeFS extends Library { + + FunctionMapper mapper = (library,method) -> { + if (Platform.isWindows()) { + return "_" + method.getName(); + } + else { + return "__x" + method.getName(); // On Linux, stat is actually _xstat + } + }; + + public NativeFS INSTANCE = Native.load(Platform.isWindows() ? "msvcrt" : "c", + NativeFS.class, + Collections.singletonMap(Library.OPTION_FUNCTION_MAPPER, mapper)); + + int stat(String path, Stat stat) throws LastErrorException; + + @FieldOrder({"st_dev","st_ino","st_mode","st_nlink","st_uid","st_gid","st_rdev","st_size","st_atime","st_mtime","st_ctime"}) + public class Stat extends Structure { + public int st_dev; + public int st_ino; + public short st_mode; + public short st_nlink; + public short st_uid; + public short st_gid; + public int st_rdev; + public NativeLong st_size; + public NativeLong st_atime; + public NativeLong st_mtime; + public NativeLong st_ctime; + } +} diff --git a/java-native/src/main/java/com/baeldung/jna/StdC.java b/java-native/src/main/java/com/baeldung/jna/StdC.java new file mode 100644 index 0000000000..1adbe684c4 --- /dev/null +++ b/java-native/src/main/java/com/baeldung/jna/StdC.java @@ -0,0 +1,17 @@ +package com.baeldung.jna; + +import com.sun.jna.LastErrorException; +import com.sun.jna.Library; +import com.sun.jna.Native; +import com.sun.jna.Platform; +import com.sun.jna.Pointer; + +public interface StdC extends Library { + StdC INSTANCE = Native.load(Platform.isWindows() ? "msvcrt" : "c", StdC.class ); + Pointer malloc(long n); + void free(Pointer p); + Pointer memset(Pointer p, int c, long n); + int open(String path, int flags) throws LastErrorException; + int close(int fd) throws LastErrorException; +} + diff --git a/jni/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java b/java-native/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java similarity index 100% rename from jni/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java rename to java-native/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java diff --git a/jni/src/main/java/com/baeldung/jni/ExampleParametersJNI.java b/java-native/src/main/java/com/baeldung/jni/ExampleParametersJNI.java similarity index 100% rename from jni/src/main/java/com/baeldung/jni/ExampleParametersJNI.java rename to java-native/src/main/java/com/baeldung/jni/ExampleParametersJNI.java diff --git a/jni/src/main/java/com/baeldung/jni/HelloWorldJNI.java b/java-native/src/main/java/com/baeldung/jni/HelloWorldJNI.java similarity index 100% rename from jni/src/main/java/com/baeldung/jni/HelloWorldJNI.java rename to java-native/src/main/java/com/baeldung/jni/HelloWorldJNI.java diff --git a/jni/src/main/java/com/baeldung/jni/UserData.java b/java-native/src/main/java/com/baeldung/jni/UserData.java similarity index 100% rename from jni/src/main/java/com/baeldung/jni/UserData.java rename to java-native/src/main/java/com/baeldung/jni/UserData.java diff --git a/jni/src/main/resources/logback.xml b/java-native/src/main/resources/logback.xml similarity index 100% rename from jni/src/main/resources/logback.xml rename to java-native/src/main/resources/logback.xml diff --git a/java-native/src/test/java/com/baeldung/jna/CMathUnitTest.java b/java-native/src/test/java/com/baeldung/jna/CMathUnitTest.java new file mode 100644 index 0000000000..a9cc6ed1c4 --- /dev/null +++ b/java-native/src/test/java/com/baeldung/jna/CMathUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.jna; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import com.sun.jna.Native; +import com.sun.jna.Platform; + +class CMathUnitTest { + @Test + void whenCallNative_thenSuccess() { + CMath lib = Native.load(Platform.isWindows() ? "msvcrt" : "c", CMath.class); + double result = lib.cosh(0); + assertEquals(1.0,result); + } + +} diff --git a/java-native/src/test/java/com/baeldung/jna/NativeFSUnitTest.java b/java-native/src/test/java/com/baeldung/jna/NativeFSUnitTest.java new file mode 100644 index 0000000000..d296f9e2ca --- /dev/null +++ b/java-native/src/test/java/com/baeldung/jna/NativeFSUnitTest.java @@ -0,0 +1,38 @@ +package com.baeldung.jna; + +import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +import org.junit.jupiter.api.Test; + +import com.baeldung.jna.NativeFS.Stat; +import com.sun.jna.LastErrorException; +import com.sun.jna.Platform; + +public class NativeFSUnitTest { + + + @Test + public void whenCallNative_thenSuccess() throws IOException { + NativeFS lib = NativeFS.INSTANCE; + + File f = Files.createTempFile("junit", ".bin").toFile(); + f.deleteOnExit(); + Stat stat = new Stat(); + try { + if (Platform.isWindows()) { + int rc = lib.stat(f.getAbsolutePath(), stat); + assertEquals(0, rc); + assertEquals(0,stat.st_size.longValue()); + } + } + catch(LastErrorException error) { + fail("stat failed: error code=" + error.getErrorCode()); + } + + } +} diff --git a/java-native/src/test/java/com/baeldung/jna/StdCUnitTest.java b/java-native/src/test/java/com/baeldung/jna/StdCUnitTest.java new file mode 100644 index 0000000000..c536fd63d5 --- /dev/null +++ b/java-native/src/test/java/com/baeldung/jna/StdCUnitTest.java @@ -0,0 +1,47 @@ +package com.baeldung.jna; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.BeforeClass; +import org.junit.jupiter.api.Test; + +import com.sun.jna.Native; +import com.sun.jna.Platform; +import com.sun.jna.Pointer; + +class StdCUnitTest { + + @BeforeClass + public static void setupProtectedMode() { + Native.setProtected(true); + } + + @Test + public void whenMalloc_thenSuccess() { + StdC lib = StdC.INSTANCE; + Pointer p = lib.malloc(1024); + p.setMemory(0l, 1024l, (byte) 0); + lib.free(p); + } + + @Test + public void whenAccessViolation_thenShouldThrowError() { + // Running this test on Linux requires additional setup using libjsig.so + // Details here: http://java-native-access.github.io/jna/5.6.0/javadoc/overview-summary.html#crash-protection + // IMPORTANT NOTICE: Code for illustration purposes only. DON'T DO THIS IN YOUR OWN CODE + if ( Platform.isWindows()) { + Error e = null; + Pointer p = new Pointer(0l); + + try { + p.setMemory(0, 100*1024, (byte) 0); + } + catch(Error err) { + e = err; + } + + assertNotNull(e, "Should throw Error"); + } + } + +} diff --git a/jni/src/test/java/com/baeldung/jni/JNINativeManualTest.java b/java-native/src/test/java/com/baeldung/jni/JNINativeManualTest.java similarity index 100% rename from jni/src/test/java/com/baeldung/jni/JNINativeManualTest.java rename to java-native/src/test/java/com/baeldung/jni/JNINativeManualTest.java diff --git a/jni/native/linux_x86_64/libnative.so b/jni/native/linux_x86_64/libnative.so deleted file mode 100755 index 213491e2688a87bdecd1fea411e578149f8e3f32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19856 zcmeHPe|%h3mA{iTZD>Oipe?0E7_fzg$~4m^ZD_ZWHkt5Jk`nSmBT!!_Gm~UOG81Rs zl(bq6hOmTe+Afvf)8NW(q2~8zDz_o@y$Qj7_pU zr*>(i20&6!R)^PZ5$M!h*KKcQ8(x|}G=0_6PrkY3&-1!mOJ90ppX*AJI}g{zxJb=B zTzAZ=>Yh`0|2gx|ec*=^x3~%^?|rx~!R5wvIj$ABD6ParN=gYqS}g$orS9$(D>@aJbRnUt`L zSfSS~IR!Y*?JQzPFBJHI%$<__B{u#Lx4(#WFBObo)SuEN(w-`54~=6=&r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akQI#e - - 4.0.0 - jni - jni - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 065d6abbdd..bd73fcbf5e 100644 --- a/pom.xml +++ b/pom.xml @@ -465,7 +465,7 @@ jjwt jmeter jmh - jni + java-native jooby jsf json @@ -1502,4 +1502,4 @@ 1.4.197 - \ No newline at end of file + From 0e9ec5c2da96c35911ccbe2213d7b42255c82a0c Mon Sep 17 00:00:00 2001 From: Philippe Date: Wed, 30 Sep 2020 21:57:08 -0300 Subject: [PATCH 052/302] [BAEL-4203] JNA --- apache-bookkeeper/data/zk/myid | 1 - java-native/core | 0 java-native/hs_err_pid100.log | 793 --------------------------------- java-native/hs_err_pid98.log | 789 -------------------------------- 4 files changed, 1583 deletions(-) delete mode 100644 apache-bookkeeper/data/zk/myid delete mode 100644 java-native/core delete mode 100644 java-native/hs_err_pid100.log delete mode 100644 java-native/hs_err_pid98.log diff --git a/apache-bookkeeper/data/zk/myid b/apache-bookkeeper/data/zk/myid deleted file mode 100644 index d00491fd7e..0000000000 --- a/apache-bookkeeper/data/zk/myid +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/java-native/core b/java-native/core deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/java-native/hs_err_pid100.log b/java-native/hs_err_pid100.log deleted file mode 100644 index c05a3fad99..0000000000 --- a/java-native/hs_err_pid100.log +++ /dev/null @@ -1,793 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x00007f7ecd45c090, pid=100, tid=115 -# -# JRE version: OpenJDK Runtime Environment (14.0.2+12) (build 14.0.2+12-46) -# Java VM: OpenJDK 64-Bit Server VM (14.0.2+12-46, mixed mode, sharing, tiered, compressed oops, serial gc, linux-amd64) -# Problematic frame: -# C [libc.so.6+0x15e090] __memset_avx2_unaligned_erms+0x60 -# -# Core dump will be written. Default location: /project/java-native/core -# -# If you would like to submit a bug report, please visit: -# https://bugreport.java.com/bugreport/crash.jsp -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: /project/java-native/target/surefire/surefirebooter15072611568838389395.jar /project/java-native/target/surefire 2020-10-01T00-09-53_430-jvmRun2 surefire3272641396836511080tmp surefire_29468511371192344687tmp - -Host: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz, 1 cores, 1G, Oracle Linux Server release 8.2 -Time: Thu Oct 1 00:10:23 2020 UTC elapsed time: 13 seconds (0d 0h 0m 13s) - ---------------- T H R E A D --------------- - -Current thread (0x00007f7ec4028800): JavaThread "main" [_thread_in_native, id=115, stack(0x00007f7ecde0a000,0x00007f7ecdf0b000)] - -Stack: [0x00007f7ecde0a000,0x00007f7ecdf0b000], sp=0x00007f7ecdf07788, free space=1013k -Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libc.so.6+0x15e090] __memset_avx2_unaligned_erms+0x60 -j com.sun.jna.Native.setMemory(Lcom/sun/jna/Pointer;JJJB)V+0 -j com.sun.jna.Pointer.setMemory(JJB)V+9 -j com.baeldung.jna.StdCUnitTest.whenAccessViolation_thenShouldThrowError()V+17 -v ~StubRoutines::call_stub -V [libjvm.so+0x78e42b] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2fb -V [libjvm.so+0xbb0efb] invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*) [clone .constprop.117]+0x85b -V [libjvm.so+0xbb19cd] Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0xfd -V [libjvm.so+0x83b8e3] JVM_InvokeMethod+0xf3 -j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@14.0.2 -j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@14.0.2 -j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@14.0.2 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@14.0.2 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 -j org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;)Ljava/lang/Object;+32 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+24 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$232.execute()V+12 -j org.junit.jupiter.engine.execution.ThrowableCollector.execute(Lorg/junit/jupiter/api/function/Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+35 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 -j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 -j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 -j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 -j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 -j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 -j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 -j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 -j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 -j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 -j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 -j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 -j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 -j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 -j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 -j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 -j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()V+23 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+13 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/engine/TestEngine;Lorg/junit/platform/engine/ExecutionRequest;)V+2 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/Root;Lorg/junit/platform/engine/ConfigurationParameters;[Lorg/junit/platform/launcher/TestExecutionListener;)V+101 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+36 -j org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(Lorg/apache/maven/surefire/util/TestsToRun;)Lorg/apache/maven/surefire/suite/RunResult;+55 -j org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+31 -j org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Lorg/apache/maven/surefire/booter/ForkingReporterFactory;)Lorg/apache/maven/surefire/suite/RunResult;+9 -j org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess()Lorg/apache/maven/surefire/suite/RunResult;+7 -j org.apache.maven.surefire.booter.ForkedBooter.execute()V+1 -j org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+35 -v ~StubRoutines::call_stub -V [libjvm.so+0x78e42b] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2fb -V [libjvm.so+0x80d2e3] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .isra.125] [clone .constprop.264]+0x193 -V [libjvm.so+0x80f338] jni_CallStaticVoidMethod+0x108 -C [libjli.so+0x4647] JavaMain+0xcd7 -C [libjli.so+0x85a9] ThreadJavaMain+0x9 - -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -j com.sun.jna.Native.setMemory(Lcom/sun/jna/Pointer;JJJB)V+0 -j com.sun.jna.Pointer.setMemory(JJB)V+9 -j com.baeldung.jna.StdCUnitTest.whenAccessViolation_thenShouldThrowError()V+17 -v ~StubRoutines::call_stub -j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@14.0.2 -j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@14.0.2 -j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@14.0.2 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@14.0.2 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 -j org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;)Ljava/lang/Object;+32 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+24 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$232.execute()V+12 -j org.junit.jupiter.engine.execution.ThrowableCollector.execute(Lorg/junit/jupiter/api/function/Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+35 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 -j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 -j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 -j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 -j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 -j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 -j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 -j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 -j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 -j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 -j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 -j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 -j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 -j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 -j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 -j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 -j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()V+23 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+13 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/engine/TestEngine;Lorg/junit/platform/engine/ExecutionRequest;)V+2 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/Root;Lorg/junit/platform/engine/ConfigurationParameters;[Lorg/junit/platform/launcher/TestExecutionListener;)V+101 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+36 -j org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(Lorg/apache/maven/surefire/util/TestsToRun;)Lorg/apache/maven/surefire/suite/RunResult;+55 -j org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+31 -j org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Lorg/apache/maven/surefire/booter/ForkingReporterFactory;)Lorg/apache/maven/surefire/suite/RunResult;+9 -j org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess()Lorg/apache/maven/surefire/suite/RunResult;+7 -j org.apache.maven.surefire.booter.ForkedBooter.execute()V+1 -j org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+35 -v ~StubRoutines::call_stub - -siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000 - -Register to memory mapping: - -RAX=0x0 is NULL -RBX={method} {0x00007f7ecb469628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' -RCX=0x0000000000000080 is an unknown value -RDX=0x0000000000019000 is an unknown value -RSP=0x00007f7ecdf07788 is pointing into the stack for thread: 0x00007f7ec4028800 -RBP=0x00007f7ecdf077c0 is pointing into the stack for thread: 0x00007f7ec4028800 -RSI=0x0 is NULL -RDI=0x0 is NULL -R8 =0x0 is NULL -R9 =0x0000000000019000 is an unknown value -R10=0x0000000000000009 is an unknown value -R11=0x00007f7ecd45bfd0: in /lib64/libc.so.6 at 0x00007f7ecd2fe000 -R12=0x0 is NULL -R13={method} {0x00007f7ecb469628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' -R14=0x00007f7ecdf078b8 is pointing into the stack for thread: 0x00007f7ec4028800 -R15=0x00007f7ec4028800 is a thread - - -Registers: -RAX=0x0000000000000000, RBX=0x00007f7ecb469628, RCX=0x0000000000000080, RDX=0x0000000000019000 -RSP=0x00007f7ecdf07788, RBP=0x00007f7ecdf077c0, RSI=0x0000000000000000, RDI=0x0000000000000000 -R8 =0x0000000000000000, R9 =0x0000000000019000, R10=0x0000000000000009, R11=0x00007f7ecd45bfd0 -R12=0x0000000000000000, R13=0x00007f7ecb469628, R14=0x00007f7ecdf078b8, R15=0x00007f7ec4028800 -RIP=0x00007f7ecd45c090, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000006 - TRAPNO=0x000000000000000e - -Top of Stack: (sp=0x00007f7ecdf07788) -0x00007f7ecdf07788: 00007f7ec9756e8d 00007f7ecb469628 -0x00007f7ecdf07798: 00007f7ec4028b10 0000000000000000 -0x00007f7ecdf077a8: 0000000000019000 0000000000000000 -0x00007f7ecdf077b8: 0000000000000000 00007f7ecdf07860 - -Instructions: (pc=0x00007f7ecd45c090) -0x00007f7ecd45bf90: f3 0f 1e fa 48 39 d1 0f 82 53 d9 fa ff 0f 1f 00 -0x00007f7ecd45bfa0: f3 0f 1e fa 48 c1 e2 02 c5 f9 6e c6 48 89 f8 c4 -0x00007f7ecd45bfb0: e2 7d 58 c0 eb 2a 66 2e 0f 1f 84 00 00 00 00 00 -0x00007f7ecd45bfc0: f3 0f 1e fa 48 39 d1 0f 82 23 d9 fa ff 0f 1f 00 -0x00007f7ecd45bfd0: f3 0f 1e fa c5 f9 6e c6 48 89 f8 c4 e2 7d 78 c0 -0x00007f7ecd45bfe0: 48 83 fa 20 0f 82 04 01 00 00 48 83 fa 40 77 77 -0x00007f7ecd45bff0: c5 fe 7f 44 17 e0 c5 fe 7f 07 c5 f8 77 c3 66 90 -0x00007f7ecd45c000: f3 0f 1e fa c5 f8 77 48 89 d1 40 0f b6 c6 48 89 -0x00007f7ecd45c010: fa f3 aa 48 89 d0 c3 66 0f 1f 84 00 00 00 00 00 -0x00007f7ecd45c020: f3 0f 1e fa 48 39 d1 0f 82 c3 d8 fa ff 0f 1f 00 -0x00007f7ecd45c030: f3 0f 1e fa c5 f9 6e c6 48 89 f8 c4 e2 7d 78 c0 -0x00007f7ecd45c040: 48 83 fa 20 0f 82 a4 00 00 00 48 83 fa 40 77 0e -0x00007f7ecd45c050: c5 fe 7f 44 17 e0 c5 fe 7f 07 c5 f8 77 c3 48 81 -0x00007f7ecd45c060: fa 00 08 00 00 77 9d 48 81 fa 80 00 00 00 77 19 -0x00007f7ecd45c070: c5 fe 7f 07 c5 fe 7f 47 20 c5 fe 7f 44 17 e0 c5 -0x00007f7ecd45c080: fe 7f 44 17 c0 c5 f8 77 c3 48 8d 8f 80 00 00 00 -0x00007f7ecd45c090: c5 fe 7f 07 48 83 e1 80 c5 fe 7f 44 17 e0 c5 fe -0x00007f7ecd45c0a0: 7f 47 20 c5 fe 7f 44 17 c0 c5 fe 7f 47 40 c5 fe -0x00007f7ecd45c0b0: 7f 44 17 a0 c5 fe 7f 47 60 c5 fe 7f 44 17 80 48 -0x00007f7ecd45c0c0: 01 fa 48 83 e2 80 48 39 d1 74 ba c5 fd 7f 01 c5 -0x00007f7ecd45c0d0: fd 7f 41 20 c5 fd 7f 41 40 c5 fd 7f 41 60 48 81 -0x00007f7ecd45c0e0: c1 80 00 00 00 48 39 ca 75 e1 c5 f8 77 c3 80 fa -0x00007f7ecd45c0f0: 10 73 1c c4 e1 f9 7e c1 80 fa 08 73 20 80 fa 04 -0x00007f7ecd45c100: 73 27 80 fa 01 77 2c 72 02 88 0f c5 f8 77 c3 c5 -0x00007f7ecd45c110: fa 7f 44 17 f0 c5 fa 7f 07 c5 f8 77 c3 48 89 4c -0x00007f7ecd45c120: 17 f8 48 89 0f c5 f8 77 c3 89 4c 17 fc 89 0f c5 -0x00007f7ecd45c130: f8 77 c3 66 89 4c 17 fe 66 89 0f c5 f8 77 c3 90 -0x00007f7ecd45c140: f3 0f 1e fa 48 c1 e2 02 48 83 fa 20 0f 82 3e 01 -0x00007f7ecd45c150: 00 00 c5 fe 6f 16 c5 ed 76 17 c5 fd d7 c2 83 e8 -0x00007f7ecd45c160: ff 0f 85 e9 00 00 00 48 83 fa 40 0f 86 c0 00 00 -0x00007f7ecd45c170: 00 c5 fd 76 c0 48 81 fa 00 01 00 00 0f 87 9e 01 -0x00007f7ecd45c180: 00 00 48 81 fa 80 00 00 00 0f 82 28 02 00 00 c5 - - -Stack slot to memory mapping: -stack at sp + 0 slots: 0x00007f7ec9756e8d: Java_com_sun_jna_Native_setMemory+0x00000000000000bd in /root/.cache/JNA/temp/jna17886832672380520920.tmp at 0x00007f7ec9750000 -stack at sp + 1 slots: {method} {0x00007f7ecb469628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' -stack at sp + 2 slots: 0x00007f7ec4028b10 points into unknown readable memory: 80 b8 24 cd 7e 7f 00 00 -stack at sp + 3 slots: 0x0 is NULL -stack at sp + 4 slots: 0x0000000000019000 is an unknown value -stack at sp + 5 slots: 0x0 is NULL -stack at sp + 6 slots: 0x0 is NULL -stack at sp + 7 slots: 0x00007f7ecdf07860 is pointing into the stack for thread: 0x00007f7ec4028800 - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00007f7ec41c0640, length=12, elements={ -0x00007f7ec4028800, 0x00007f7ec40a2000, 0x00007f7ec40a3800, 0x00007f7ec40ad000, -0x00007f7ec40af000, 0x00007f7ec40b1000, 0x00007f7ec40b3000, 0x00007f7ec40b5000, -0x00007f7ec40ef800, 0x00007f7ec40f4800, 0x00007f7ec4188000, 0x00007f7ec41bf000 -} - -Java Threads: ( => current thread ) -=>0x00007f7ec4028800 JavaThread "main" [_thread_in_native, id=115, stack(0x00007f7ecde0a000,0x00007f7ecdf0b000)] - 0x00007f7ec40a2000 JavaThread "Reference Handler" daemon [_thread_blocked, id=121, stack(0x00007f7ecab9d000,0x00007f7ecac9e000)] - 0x00007f7ec40a3800 JavaThread "Finalizer" daemon [_thread_blocked, id=124, stack(0x00007f7ecaa9c000,0x00007f7ecab9d000)] - 0x00007f7ec40ad000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=125, stack(0x00007f7eca2a7000,0x00007f7eca3a8000)] - 0x00007f7ec40af000 JavaThread "Service Thread" daemon [_thread_blocked, id=128, stack(0x00007f7eca1a6000,0x00007f7eca2a7000)] - 0x00007f7ec40b1000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=132, stack(0x00007f7eca0a5000,0x00007f7eca1a6000)] - 0x00007f7ec40b3000 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=135, stack(0x00007f7ec9fa4000,0x00007f7eca0a5000)] - 0x00007f7ec40b5000 JavaThread "Sweeper thread" daemon [_thread_blocked, id=137, stack(0x00007f7ec9ea3000,0x00007f7ec9fa4000)] - 0x00007f7ec40ef800 JavaThread "Notification Thread" daemon [_thread_blocked, id=146, stack(0x00007f7ec9da2000,0x00007f7ec9ea3000)] - 0x00007f7ec40f4800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=148, stack(0x00007f7ec9b9f000,0x00007f7ec9ca0000)] - 0x00007f7ec4188000 JavaThread "surefire-forkedjvm-command-thread" daemon [_thread_in_native, id=151, stack(0x00007f7ec9a87000,0x00007f7ec9b88000)] - 0x00007f7ec41bf000 JavaThread "surefire-forkedjvm-ping-30s" daemon [_thread_blocked, id=154, stack(0x00007f7ec9979000,0x00007f7ec9a7a000)] - -Other Threads: - 0x00007f7ec409e800 VMThread "VM Thread" [stack: 0x00007f7ecaca0000,0x00007f7ecada0000] [id=118] - 0x00007f7ec40f2000 WatcherThread [stack: 0x00007f7ec9ca2000,0x00007f7ec9da2000] [id=147] - -Threads with active compile tasks: - -VM state:not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap address: 0x00000000e0c00000, size: 500 MB, Compressed Oops mode: 32-bit -Narrow klass base: 0x0000000800000000, Narrow klass shift: 3 -Compressed class space size: 1073741824 Address: 0x0000000800b11000 - -Heap: - def new generation total 9792K, used 7588K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) - eden space 8704K, 74% used [0x00000000e0c00000, 0x00000000e1259340, 0x00000000e1480000) - from space 1088K, 100% used [0x00000000e1590000, 0x00000000e16a0000, 0x00000000e16a0000) - to space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) - tenured generation total 21888K, used 1321K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) - the space 21888K, 6% used [0x00000000eb2a0000, 0x00000000eb3ea620, 0x00000000eb3ea800, 0x00000000ec800000) - Metaspace used 4998K, capacity 7071K, committed 7296K, reserved 1056768K - class space used 637K, capacity 881K, committed 896K, reserved 1048576K - -Card table byte_map: [0x00007f7ecb723000,0x00007f7ecb81e000] _byte_map_base: 0x00007f7ecb01d000 - -Polling page: 0x00007f7ecdf20000 - -Metaspace: - -Usage: - Non-class: 6.04 MB capacity, 4.26 MB ( 70%) used, 1.76 MB ( 29%) free+waste, 30.81 KB ( <1%) overhead. - Class: 881.00 KB capacity, 637.46 KB ( 72%) used, 226.48 KB ( 26%) free+waste, 17.06 KB ( 2%) overhead. - Both: 6.91 MB capacity, 4.88 MB ( 71%) used, 1.98 MB ( 29%) free+waste, 47.88 KB ( <1%) overhead. - -Virtual space: - Non-class space: 8.00 MB reserved, 6.25 MB ( 78%) committed - Class space: 1.00 GB reserved, 896.00 KB ( <1%) committed - Both: 1.01 GB reserved, 7.12 MB ( <1%) committed - -Chunk freelists: - Non-Class: 34.00 KB - Class: 11.00 KB - Both: 45.00 KB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB - -CodeHeap 'non-profiled nmethods': size=120036Kb used=272Kb max_used=272Kb free=119763Kb - bounds [0x00007f7eb419c000, 0x00007f7eb440c000, 0x00007f7ebb6d5000] -CodeHeap 'profiled nmethods': size=120032Kb used=1610Kb max_used=1610Kb free=118421Kb - bounds [0x00007f7eacc64000, 0x00007f7eaced4000, 0x00007f7eb419c000] -CodeHeap 'non-nmethods': size=5692Kb used=1155Kb max_used=1170Kb free=4536Kb - bounds [0x00007f7eac6d5000, 0x00007f7eac945000, 0x00007f7eacc64000] - total_blobs=1295 nmethods=879 adapters=332 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 12.944 Thread 0x00007f7ec40b3000 876 ! 3 jdk.internal.loader.BuiltinClassLoader::findClassOnClassPathOrNull (64 bytes) -Event: 12.955 Thread 0x00007f7ec40b3000 nmethod 876 0x00007f7eacdf1a90 code [0x00007f7eacdf1e00, 0x00007f7eacdf3260] -Event: 12.963 Thread 0x00007f7ec40b3000 877 ! 3 java.util.zip.ZipFile$ZipFileInflaterInputStream::close (67 bytes) -Event: 12.969 Thread 0x00007f7ec40b3000 nmethod 877 0x00007f7eacdf3a90 code [0x00007f7eacdf3c80, 0x00007f7eacdf4390] -Event: 12.969 Thread 0x00007f7ec40b3000 878 3 java.util.ArrayDeque::add (7 bytes) -Event: 12.969 Thread 0x00007f7ec40b3000 nmethod 878 0x00007f7eacdf4690 code [0x00007f7eacdf4820, 0x00007f7eacdf4980] -Event: 12.969 Thread 0x00007f7ec40b3000 879 3 java.util.ArrayDeque::addLast (51 bytes) -Event: 12.974 Thread 0x00007f7ec40b3000 nmethod 879 0x00007f7eacdf4a10 code [0x00007f7eacdf4be0, 0x00007f7eacdf5090] -Event: 12.982 Thread 0x00007f7ec40b3000 880 3 java.util.zip.ZipFile$InflaterCleanupAction::run (12 bytes) -Event: 12.982 Thread 0x00007f7ec40b3000 nmethod 880 0x00007f7eacdf5210 code [0x00007f7eacdf53a0, 0x00007f7eacdf5500] -Event: 12.982 Thread 0x00007f7ec40b3000 881 ! 3 java.util.zip.ZipFile$CleanableResource::releaseInflater (53 bytes) -Event: 12.986 Thread 0x00007f7ec40b3000 nmethod 881 0x00007f7eacdf5610 code [0x00007f7eacdf57e0, 0x00007f7eacdf5d00] -Event: 12.986 Thread 0x00007f7ec40b3000 882 ! 3 java.util.zip.Inflater::reset (64 bytes) -Event: 12.991 Thread 0x00007f7ec40b3000 nmethod 882 0x00007f7eacdf5f10 code [0x00007f7eacdf60c0, 0x00007f7eacdf64b0] -Event: 12.993 Thread 0x00007f7ec40b1000 884 4 java.lang.Object:: (1 bytes) -Event: 12.995 Thread 0x00007f7ec40b1000 nmethod 884 0x00007f7eb41dfd90 code [0x00007f7eb41dff00, 0x00007f7eb41dffb8] -Event: 13.004 Thread 0x00007f7ec40b3000 885 3 sun.net.www.protocol.jar.Handler::checkNestedProtocol (18 bytes) -Event: 13.005 Thread 0x00007f7ec40b3000 nmethod 885 0x00007f7eacdf6690 code [0x00007f7eacdf6840, 0x00007f7eacdf6a20] -Event: 13.116 Thread 0x00007f7ec40b1000 886 4 java.lang.Math::min (11 bytes) -Event: 13.117 Thread 0x00007f7ec40b1000 nmethod 886 0x00007f7eb41e0090 code [0x00007f7eb41e0200, 0x00007f7eb41e0258] - -GC Heap History (2 events): -Event: 7.487 GC heap before -{Heap before GC invocations=0 (full 0): - def new generation total 9792K, used 8704K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) - eden space 8704K, 100% used [0x00000000e0c00000, 0x00000000e1480000, 0x00000000e1480000) - from space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) - to space 1088K, 0% used [0x00000000e1590000, 0x00000000e1590000, 0x00000000e16a0000) - tenured generation total 21888K, used 0K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) - the space 21888K, 0% used [0x00000000eb2a0000, 0x00000000eb2a0000, 0x00000000eb2a0200, 0x00000000ec800000) - Metaspace used 3048K, capacity 5805K, committed 6016K, reserved 1056768K - class space used 360K, capacity 627K, committed 640K, reserved 1048576K -} -Event: 7.606 GC heap after -{Heap after GC invocations=1 (full 0): - def new generation total 9792K, used 1088K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) - eden space 8704K, 0% used [0x00000000e0c00000, 0x00000000e0c00000, 0x00000000e1480000) - from space 1088K, 100% used [0x00000000e1590000, 0x00000000e16a0000, 0x00000000e16a0000) - to space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) - tenured generation total 21888K, used 1321K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) - the space 21888K, 6% used [0x00000000eb2a0000, 0x00000000eb3ea620, 0x00000000eb3ea800, 0x00000000ec800000) - Metaspace used 3048K, capacity 5805K, committed 6016K, reserved 1056768K - class space used 360K, capacity 627K, committed 640K, reserved 1048576K -} - -Deoptimization events (20 events): -Event: 1.087 Thread 0x00007f7ec4028800 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007f7eb41a0990 relative=0x00000000000001d0 -Event: 1.087 Thread 0x00007f7ec4028800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f7eb41a0990 method=java.lang.String.hashCode()I @ 42 c2 -Event: 1.087 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eb41a0990 sp=0x00007f7ecdf08320 -Event: 1.087 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71de25 sp=0x00007f7ecdf082d8 mode 2 -Event: 3.662 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eaccb7d84 sp=0x00007f7ecdf08350 -Event: 3.662 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf077e0 mode 0 -Event: 4.371 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eaccc4422 sp=0x00007f7ecdf044a0 -Event: 4.371 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf03928 mode 0 -Event: 4.510 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eacc890af sp=0x00007f7ecdf081b0 -Event: 4.510 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf07658 mode 0 -Event: 5.564 Thread 0x00007f7ec4028800 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007f7eb41a88e8 relative=0x0000000000000068 -Event: 5.564 Thread 0x00007f7ec4028800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f7eb41a88e8 method=java.lang.String.isLatin1()Z @ 10 c2 -Event: 5.564 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eb41a88e8 sp=0x00007f7ecdf088d0 -Event: 5.564 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71de25 sp=0x00007f7ecdf08880 mode 2 -Event: 6.331 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eacccd5e8 sp=0x00007f7ecdf08580 -Event: 6.331 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf079f0 mode 0 -Event: 6.941 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eacccd5e8 sp=0x00007f7ecdf07660 -Event: 6.941 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf06af8 mode 0 -Event: 12.327 Thread 0x00007f7ec4028800 DEOPT PACKING pc=0x00007f7eaccc95c5 sp=0x00007f7ecdf06910 -Event: 12.327 Thread 0x00007f7ec4028800 DEOPT UNPACKING pc=0x00007f7eac71e33a sp=0x00007f7ecdf05d90 mode 0 - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (17 events): -Event: 2.190 Thread 0x00007f7ec4028800 Exception (0x00000000e0dc5a48) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 5.245 Thread 0x00007f7ec4028800 Exception (0x00000000e12092c8) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 5.649 Thread 0x00007f7ec4028800 Exception (0x00000000e1280798) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.015 Thread 0x00007f7ec4028800 Exception (0x00000000e12d47e0) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.382 Thread 0x00007f7ec4028800 Exception (0x00000000e1346640) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.595 Thread 0x00007f7ec4028800 Exception (0x00000000e137b378) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.672 Thread 0x00007f7ec4028800 Exception (0x00000000e139ef70) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.707 Thread 0x00007f7ec4028800 Exception (0x00000000e13a9150) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.739 Thread 0x00007f7ec4028800 Exception (0x00000000e13b6dd8) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 832] -Event: 6.925 Thread 0x00007f7ec4028800 Exception (0x00000000e13ec548) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 7.737 Thread 0x00007f7ec4028800 Exception (0x00000000e0c25148) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 7.990 Thread 0x00007f7ec4028800 Exception (0x00000000e0c900c0) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 8.395 Thread 0x00007f7ec4028800 Exception (0x00000000e0cfd370) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 8.486 Thread 0x00007f7ec4028800 Exception (0x00000000e0d15688) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 8.487 Thread 0x00007f7ec4028800 Exception (0x00000000e0d18078) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 832] -Event: 10.634 Thread 0x00007f7ec4028800 Exception (0x00000000e0f88b50) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 10.647 Thread 0x00007f7ec4028800 Exception (0x00000000e0f8c210) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] - -Events (20 events): -Event: 12.778 loading class sun/security/provider/ByteArrayAccess -Event: 12.778 loading class sun/security/provider/ByteArrayAccess done -Event: 12.784 loading class java/io/DeleteOnExitHook -Event: 12.786 loading class java/io/DeleteOnExitHook done -Event: 12.786 loading class java/io/DeleteOnExitHook$1 -Event: 12.786 loading class java/io/DeleteOnExitHook$1 done -Event: 12.815 loading class java/io/FileOutputStream$1 -Event: 12.815 loading class java/io/FileOutputStream$1 done -Event: 12.822 Loaded shared library /root/.cache/JNA/temp/jna17886832672380520920.tmp -Event: 12.822 loading class java/nio/ShortBuffer -Event: 12.822 loading class java/nio/ShortBuffer done -Event: 12.822 loading class java/nio/FloatBuffer -Event: 12.834 loading class java/nio/FloatBuffer done -Event: 12.834 loading class java/nio/DoubleBuffer -Event: 12.835 loading class java/nio/DoubleBuffer done -Event: 12.922 Executing VM operation: HandshakeAllThreads -Event: 12.925 Executing VM operation: HandshakeAllThreads done -Event: 12.980 Loaded shared library /usr/java/openjdk-14/lib/libzip.so -Event: 13.028 Executing VM operation: HandshakeAllThreads -Event: 13.036 Executing VM operation: HandshakeAllThreads done - - -Dynamic libraries: -e0c00000-e16a0000 rw-p 00000000 00:00 0 -e16a0000-eb2a0000 ---p 00000000 00:00 0 -eb2a0000-ec800000 rw-p 00000000 00:00 0 -ec800000-100000000 ---p 00000000 00:00 0 -800000000-800003000 rwxp 00001000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa -800003000-8003e4000 rw-p 00004000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa -8003e4000-800b10000 r--p 003e5000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa -800b10000-800b11000 rw-p 00b11000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa -800b11000-800bf1000 rw-p 00000000 00:00 0 -800bf1000-840b11000 ---p 00000000 00:00 0 -55a64bfce000-55a64bfcf000 r-xp 00000000 08:01 3160482 /usr/java/openjdk-14/bin/java -55a64bfd0000-55a64bfd1000 r--p 00001000 08:01 3160482 /usr/java/openjdk-14/bin/java -55a64bfd1000-55a64bfd2000 rw-p 00002000 08:01 3160482 /usr/java/openjdk-14/bin/java -55a64c580000-55a64c5a1000 rw-p 00000000 00:00 0 [heap] -7f7e90000000-7f7e90288000 rw-p 00000000 00:00 0 -7f7e90288000-7f7e94000000 ---p 00000000 00:00 0 -7f7e94000000-7f7e94427000 rw-p 00000000 00:00 0 -7f7e94427000-7f7e98000000 ---p 00000000 00:00 0 -7f7e98000000-7f7e98021000 rw-p 00000000 00:00 0 -7f7e98021000-7f7e9c000000 ---p 00000000 00:00 0 -7f7e9c000000-7f7e9c021000 rw-p 00000000 00:00 0 -7f7e9c021000-7f7ea0000000 ---p 00000000 00:00 0 -7f7ea0000000-7f7ea0021000 rw-p 00000000 00:00 0 -7f7ea0021000-7f7ea4000000 ---p 00000000 00:00 0 -7f7ea4000000-7f7ea4021000 rw-p 00000000 00:00 0 -7f7ea4021000-7f7ea8000000 ---p 00000000 00:00 0 -7f7ea8000000-7f7ea8021000 rw-p 00000000 00:00 0 -7f7ea8021000-7f7eac000000 ---p 00000000 00:00 0 -7f7eac6d5000-7f7eac945000 rwxp 00000000 00:00 0 -7f7eac945000-7f7eacc64000 ---p 00000000 00:00 0 -7f7eacc64000-7f7eaced4000 rwxp 00000000 00:00 0 -7f7eaced4000-7f7eb419c000 ---p 00000000 00:00 0 -7f7eb419c000-7f7eb440c000 rwxp 00000000 00:00 0 -7f7eb440c000-7f7ebb6d5000 ---p 00000000 00:00 0 -7f7ebb6d5000-7f7ec4000000 r--s 00000000 08:01 3160985 /usr/java/openjdk-14/lib/modules -7f7ec4000000-7f7ec44c4000 rw-p 00000000 00:00 0 -7f7ec44c4000-7f7ec8000000 ---p 00000000 00:00 0 -7f7ec9292000-7f7ec9750000 rw-p 00000000 00:00 0 -7f7ec9750000-7f7ec9768000 r-xp 00000000 08:01 3163771 /root/.cache/JNA/temp/jna17886832672380520920.tmp (deleted) -7f7ec9768000-7f7ec9968000 ---p 00018000 08:01 3163771 /root/.cache/JNA/temp/jna17886832672380520920.tmp (deleted) -7f7ec9968000-7f7ec9969000 rw-p 00018000 08:01 3163771 /root/.cache/JNA/temp/jna17886832672380520920.tmp (deleted) -7f7ec9969000-7f7ec9976000 r-xp 00000000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so -7f7ec9976000-7f7ec9978000 r--p 0000c000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so -7f7ec9978000-7f7ec9979000 rw-p 0000e000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so -7f7ec9979000-7f7ec997d000 ---p 00000000 00:00 0 -7f7ec997d000-7f7ec9a7a000 rw-p 00000000 00:00 0 -7f7ec9a7a000-7f7ec9a7f000 r-xp 00000000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so -7f7ec9a7f000-7f7ec9a80000 r--p 00004000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so -7f7ec9a80000-7f7ec9a81000 rw-p 00005000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so -7f7ec9a81000-7f7ec9a85000 r-xp 00000000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so -7f7ec9a85000-7f7ec9a86000 r--p 00003000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so -7f7ec9a86000-7f7ec9a87000 rw-p 00004000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so -7f7ec9a87000-7f7ec9a8b000 ---p 00000000 00:00 0 -7f7ec9a8b000-7f7ec9b88000 rw-p 00000000 00:00 0 -7f7ec9b88000-7f7ec9b9d000 r-xp 00000000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so -7f7ec9b9d000-7f7ec9b9e000 r--p 00014000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so -7f7ec9b9e000-7f7ec9b9f000 rw-p 00015000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so -7f7ec9b9f000-7f7ec9ba3000 ---p 00000000 00:00 0 -7f7ec9ba3000-7f7ec9ca0000 rw-p 00000000 00:00 0 -7f7ec9ca0000-7f7ec9ca1000 ---p 00000000 00:00 0 -7f7ec9ca1000-7f7ec9da2000 rw-p 00000000 00:00 0 -7f7ec9da2000-7f7ec9da6000 ---p 00000000 00:00 0 -7f7ec9da6000-7f7ec9ea3000 rw-p 00000000 00:00 0 -7f7ec9ea3000-7f7ec9ea7000 ---p 00000000 00:00 0 -7f7ec9ea7000-7f7ec9fa4000 rw-p 00000000 00:00 0 -7f7ec9fa4000-7f7ec9fa8000 ---p 00000000 00:00 0 -7f7ec9fa8000-7f7eca0a5000 rw-p 00000000 00:00 0 -7f7eca0a5000-7f7eca0a9000 ---p 00000000 00:00 0 -7f7eca0a9000-7f7eca1a6000 rw-p 00000000 00:00 0 -7f7eca1a6000-7f7eca1aa000 ---p 00000000 00:00 0 -7f7eca1aa000-7f7eca2a7000 rw-p 00000000 00:00 0 -7f7eca2a7000-7f7eca2ab000 ---p 00000000 00:00 0 -7f7eca2ab000-7f7eca3a8000 rw-p 00000000 00:00 0 -7f7eca3a8000-7f7eca3fb000 r--p 00000000 08:01 3154692 /usr/lib/locale/C.utf8/LC_CTYPE -7f7eca3fb000-7f7ecaa9c000 r--p 00000000 08:01 3154691 /usr/lib/locale/C.utf8/LC_COLLATE -7f7ecaa9c000-7f7ecaaa0000 ---p 00000000 00:00 0 -7f7ecaaa0000-7f7ecab9d000 rw-p 00000000 00:00 0 -7f7ecab9d000-7f7ecaba1000 ---p 00000000 00:00 0 -7f7ecaba1000-7f7ecac9e000 rw-p 00000000 00:00 0 -7f7ecac9e000-7f7ecac9f000 ---p 00000000 00:00 0 -7f7ecac9f000-7f7ecb4bc000 rw-p 00000000 00:00 0 -7f7ecb4bc000-7f7ecb67c000 ---p 00000000 00:00 0 -7f7ecb67c000-7f7ecb687000 rw-p 00000000 00:00 0 -7f7ecb687000-7f7ecb723000 ---p 00000000 00:00 0 -7f7ecb723000-7f7ecb729000 rw-p 00000000 00:00 0 -7f7ecb729000-7f7ecb776000 ---p 00000000 00:00 0 -7f7ecb776000-7f7ecb781000 rw-p 00000000 00:00 0 -7f7ecb781000-7f7ecb81d000 ---p 00000000 00:00 0 -7f7ecb81d000-7f7ecb823000 rw-p 00000000 00:00 0 -7f7ecb823000-7f7ecb909000 ---p 00000000 00:00 0 -7f7ecb909000-7f7ecb90e000 rw-p 00000000 00:00 0 -7f7ecb90e000-7f7ecb9f4000 ---p 00000000 00:00 0 -7f7ecb9f4000-7f7ecb9ff000 r-xp 00000000 08:01 3155554 /usr/lib64/libnss_files-2.28.so -7f7ecb9ff000-7f7ecbbfe000 ---p 0000b000 08:01 3155554 /usr/lib64/libnss_files-2.28.so -7f7ecbbfe000-7f7ecbbff000 r--p 0000a000 08:01 3155554 /usr/lib64/libnss_files-2.28.so -7f7ecbbff000-7f7ecbc00000 rw-p 0000b000 08:01 3155554 /usr/lib64/libnss_files-2.28.so -7f7ecbc00000-7f7ecbc06000 rw-p 00000000 00:00 0 -7f7ecbc06000-7f7ecbc0d000 r-xp 00000000 08:01 3155596 /usr/lib64/librt-2.28.so -7f7ecbc0d000-7f7ecbe0d000 ---p 00007000 08:01 3155596 /usr/lib64/librt-2.28.so -7f7ecbe0d000-7f7ecbe0e000 r--p 00007000 08:01 3155596 /usr/lib64/librt-2.28.so -7f7ecbe0e000-7f7ecbe0f000 rw-p 00008000 08:01 3155596 /usr/lib64/librt-2.28.so -7f7ecbe0f000-7f7ecbf90000 r-xp 00000000 08:01 3155521 /usr/lib64/libm-2.28.so -7f7ecbf90000-7f7ecc18f000 ---p 00181000 08:01 3155521 /usr/lib64/libm-2.28.so -7f7ecc18f000-7f7ecc190000 r--p 00180000 08:01 3155521 /usr/lib64/libm-2.28.so -7f7ecc190000-7f7ecc191000 rw-p 00181000 08:01 3155521 /usr/lib64/libm-2.28.so -7f7ecc191000-7f7ecd1a0000 r-xp 00000000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so -7f7ecd1a0000-7f7ecd1a1000 ---p 0100f000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so -7f7ecd1a1000-7f7ecd245000 r--p 0100f000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so -7f7ecd245000-7f7ecd27d000 rw-p 010b3000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so -7f7ecd27d000-7f7ecd2fe000 rw-p 00000000 00:00 0 -7f7ecd2fe000-7f7ecd4b7000 r-xp 00000000 08:01 3155424 /usr/lib64/libc-2.28.so -7f7ecd4b7000-7f7ecd6b6000 ---p 001b9000 08:01 3155424 /usr/lib64/libc-2.28.so -7f7ecd6b6000-7f7ecd6ba000 r--p 001b8000 08:01 3155424 /usr/lib64/libc-2.28.so -7f7ecd6ba000-7f7ecd6bc000 rw-p 001bc000 08:01 3155424 /usr/lib64/libc-2.28.so -7f7ecd6bc000-7f7ecd6c0000 rw-p 00000000 00:00 0 -7f7ecd6c0000-7f7ecd6c3000 r-xp 00000000 08:01 3155440 /usr/lib64/libdl-2.28.so -7f7ecd6c3000-7f7ecd8c2000 ---p 00003000 08:01 3155440 /usr/lib64/libdl-2.28.so -7f7ecd8c2000-7f7ecd8c3000 r--p 00002000 08:01 3155440 /usr/lib64/libdl-2.28.so -7f7ecd8c3000-7f7ecd8c4000 rw-p 00003000 08:01 3155440 /usr/lib64/libdl-2.28.so -7f7ecd8c4000-7f7ecd8df000 r-xp 00000000 08:01 3155583 /usr/lib64/libpthread-2.28.so -7f7ecd8df000-7f7ecdade000 ---p 0001b000 08:01 3155583 /usr/lib64/libpthread-2.28.so -7f7ecdade000-7f7ecdadf000 r--p 0001a000 08:01 3155583 /usr/lib64/libpthread-2.28.so -7f7ecdadf000-7f7ecdae0000 rw-p 0001b000 08:01 3155583 /usr/lib64/libpthread-2.28.so -7f7ecdae0000-7f7ecdae4000 rw-p 00000000 00:00 0 -7f7ecdae4000-7f7ecdafa000 r-xp 00000000 08:01 3155650 /usr/lib64/libz.so.1.2.11 -7f7ecdafa000-7f7ecdcf9000 ---p 00016000 08:01 3155650 /usr/lib64/libz.so.1.2.11 -7f7ecdcf9000-7f7ecdcfa000 r--p 00015000 08:01 3155650 /usr/lib64/libz.so.1.2.11 -7f7ecdcfa000-7f7ecdcfb000 rw-p 00000000 00:00 0 -7f7ecdcfb000-7f7ecdd24000 r-xp 00000000 08:01 3155395 /usr/lib64/ld-2.28.so -7f7ecdd28000-7f7ecdd39000 r-xp 00000000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so -7f7ecdd39000-7f7ecdd3a000 ---p 00011000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so -7f7ecdd3a000-7f7ecdd3b000 r--p 00011000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so -7f7ecdd3b000-7f7ecdd3c000 rw-p 00012000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so -7f7ecdd3c000-7f7ecdd3d000 r--p 00000000 08:01 3154699 /usr/lib/locale/C.utf8/LC_NUMERIC -7f7ecdd3d000-7f7ecdd3e000 r--p 00000000 08:01 3154702 /usr/lib/locale/C.utf8/LC_TIME -7f7ecdd3e000-7f7ecdd3f000 r--p 00000000 08:01 3154697 /usr/lib/locale/C.utf8/LC_MONETARY -7f7ecdd3f000-7f7ecdd40000 r--p 00000000 08:01 3154696 /usr/lib/locale/C.utf8/LC_MESSAGES/SYS_LC_MESSAGES -7f7ecdd40000-7f7ecdd41000 r--p 00000000 08:01 3154700 /usr/lib/locale/C.utf8/LC_PAPER -7f7ecdd41000-7f7ecdd42000 r--p 00000000 08:01 3154698 /usr/lib/locale/C.utf8/LC_NAME -7f7ecdd42000-7f7ecdd43000 r--p 00000000 08:01 3154690 /usr/lib/locale/C.utf8/LC_ADDRESS -7f7ecdd43000-7f7ecdd44000 r--p 00000000 08:01 3154701 /usr/lib/locale/C.utf8/LC_TELEPHONE -7f7ecdd44000-7f7ecdd45000 r--p 00000000 08:01 3154694 /usr/lib/locale/C.utf8/LC_MEASUREMENT -7f7ecdd45000-7f7ecdd4c000 r--s 00000000 08:01 3155357 /usr/lib64/gconv/gconv-modules.cache -7f7ecdd4c000-7f7ecdd4d000 r--p 00000000 08:01 3154693 /usr/lib/locale/C.utf8/LC_IDENTIFICATION -7f7ecdd4d000-7f7ecdd67000 r--p 00000000 08:01 3154703 /usr/lib/locale/locale-archive -7f7ecdd67000-7f7ecddad000 rw-p 00000000 00:00 0 -7f7ecddad000-7f7ecddb4000 ---p 00000000 00:00 0 -7f7ecddb4000-7f7ecddbb000 r-xp 00000000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so -7f7ecddbb000-7f7ecddbc000 r--p 00006000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so -7f7ecddbc000-7f7ecddbd000 rw-p 00007000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so -7f7ecddbd000-7f7ecdde1000 r-xp 00000000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so -7f7ecdde1000-7f7ecdde2000 r--p 00023000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so -7f7ecdde2000-7f7ecdde4000 rw-p 00024000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so -7f7ecdde4000-7f7ecddec000 rw-s 00000000 08:01 3163766 /tmp/hsperfdata_root/100 -7f7ecddec000-7f7ecde07000 r-xp 00000000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so -7f7ecde07000-7f7ecde09000 r--p 0001a000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so -7f7ecde09000-7f7ecde0a000 rw-p 0001c000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so -7f7ecde0a000-7f7ecde0e000 ---p 00000000 00:00 0 -7f7ecde0e000-7f7ecdf0d000 rw-p 00000000 00:00 0 -7f7ecdf0d000-7f7ecdf1b000 r-xp 00000000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so -7f7ecdf1b000-7f7ecdf1c000 ---p 0000e000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so -7f7ecdf1c000-7f7ecdf1d000 r--p 0000e000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so -7f7ecdf1d000-7f7ecdf1e000 rw-p 0000f000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so -7f7ecdf1e000-7f7ecdf20000 rw-p 00000000 00:00 0 -7f7ecdf20000-7f7ecdf21000 ---p 00000000 00:00 0 -7f7ecdf21000-7f7ecdf22000 r--p 00000000 00:00 0 -7f7ecdf22000-7f7ecdf23000 ---p 00000000 00:00 0 -7f7ecdf23000-7f7ecdf24000 r--p 00028000 08:01 3155395 /usr/lib64/ld-2.28.so -7f7ecdf24000-7f7ecdf25000 rw-p 00029000 08:01 3155395 /usr/lib64/ld-2.28.so -7f7ecdf25000-7f7ecdf26000 rw-p 00000000 00:00 0 -7ffd671f1000-7ffd67212000 rw-p 00000000 00:00 0 [stack] -7ffd67244000-7ffd67247000 r--p 00000000 00:00 0 [vvar] -7ffd67247000-7ffd67249000 r-xp 00000000 00:00 0 [vdso] -ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] - - -VM Arguments: -java_command: /project/java-native/target/surefire/surefirebooter15072611568838389395.jar /project/java-native/target/surefire 2020-10-01T00-09-53_430-jvmRun2 surefire3272641396836511080tmp surefire_29468511371192344687tmp -java_class_path (initial): /project/java-native/target/surefire/surefirebooter15072611568838389395.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 2 {product} {ergonomic} - size_t InitialHeapSize = 33554432 {product} {ergonomic} - size_t MaxHeapSize = 524288000 {product} {ergonomic} - size_t MaxNewSize = 174718976 {product} {ergonomic} - size_t MinHeapDeltaBytes = 196608 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - size_t NewSize = 11141120 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5826188 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122916026 {pd product} {ergonomic} - size_t OldSize = 22413312 {product} {ergonomic} - uintx ProfiledCodeHeapSize = 122916026 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 524288000 {manageable} {ergonomic} - bool UseCompressedClassPointers = true {lp64_product} {ergonomic} - bool UseCompressedOops = true {lp64_product} {ergonomic} - bool UseSerialGC = true {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags - #1: stderr all=off uptime,level,tags - -Environment Variables: -JAVA_HOME=/usr/java/openjdk-14 -PATH=/usr/java/openjdk-14/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - -Signal Handlers: -SIGSEGV: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGBUS: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGFPE: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGPIPE: [libjvm.so+0xb1bca0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGXFSZ: [libjvm.so+0xb1bca0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGILL: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGUSR2: [libjvm.so+0xb1bb30], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO -SIGHUP: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGINT: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGTERM: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGQUIT: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO - - ---------------- S Y S T E M --------------- - -OS:Oracle Linux Server release 8.2 -uname:Linux 4.14.154-boot2docker #1 SMP Thu Nov 14 19:19:08 UTC 2019 x86_64 -OS uptime: 0 days 13:49 hours -libc:glibc 2.28 NPTL 2.28 -rlimit: STACK 8192k, CORE infinity, NPROC infinity, NOFILE 1048576, AS infinity, DATA infinity, FSIZE infinity -load average:4.05 1.87 0.76 - -/proc/meminfo: -MemTotal: 2045412 kB -MemFree: 1098032 kB -MemAvailable: 1368704 kB -Buffers: 83692 kB -Cached: 471224 kB -SwapCached: 0 kB -Active: 573576 kB -Inactive: 305820 kB -Active(anon): 404060 kB -Inactive(anon): 199632 kB -Active(file): 169516 kB -Inactive(file): 106188 kB -Unevictable: 0 kB -Mlocked: 0 kB -SwapTotal: 1415172 kB -SwapFree: 1415172 kB -Dirty: 324 kB -Writeback: 0 kB -AnonPages: 324536 kB -Mapped: 120864 kB -Shmem: 290620 kB -Slab: 42348 kB -SReclaimable: 27356 kB -SUnreclaim: 14992 kB -KernelStack: 4672 kB -PageTables: 2744 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -WritebackTmp: 0 kB -CommitLimit: 2437876 kB -Committed_AS: 1792468 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 0 kB -VmallocChunk: 0 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -HugePages_Surp: 0 -Hugepagesize: 2048 kB -DirectMap4k: 42944 kB -DirectMap2M: 2054144 kB - - -/proc/sys/kernel/threads-max (system-wide limit on the number of threads): -15537 - - -/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have): -65530 - - -/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers): -32768 - - - -container (cgroup) information: -container_type: cgroupv1 -cpu_cpuset_cpus: 0 -cpu_memory_nodes: 0 -active_processor_count: 1 -cpu_quota: no quota -cpu_period: 100000 -cpu_shares: no shares -memory_limit_in_bytes: unlimited -memory_and_swap_limit_in_bytes: unlimited -memory_soft_limit_in_bytes: unlimited -memory_usage_in_bytes: 356708352 -memory_max_usage_in_bytes: 394252288 - -KVM virtualization detected -Steal ticks since vm start: 0 -Steal ticks percentage since vm start: 0.000 - -CPU:total 1 (initial active 1) (1 cores per cpu, 1 threads per core) family 6 model 69 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, lzcnt, tsc, tscinvbit -CPU Model and flags from /proc/cpuinfo: -model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase avx2 invpcid md_clear flush_l1d - -Memory: 4k page, physical 2045412k(1098032k free), swap 1415172k(1415172k free) - -vm_info: OpenJDK 64-Bit Server VM (14.0.2+12-46) for linux-amd64 JRE (14.0.2+12-46), built on Jul 8 2020 23:30:21 by "mach5one" with gcc 8.3.0 - -END. diff --git a/java-native/hs_err_pid98.log b/java-native/hs_err_pid98.log deleted file mode 100644 index 25a01096e2..0000000000 --- a/java-native/hs_err_pid98.log +++ /dev/null @@ -1,789 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x00007f01b8795090, pid=98, tid=114 -# -# JRE version: OpenJDK Runtime Environment (14.0.2+12) (build 14.0.2+12-46) -# Java VM: OpenJDK 64-Bit Server VM (14.0.2+12-46, mixed mode, sharing, tiered, compressed oops, serial gc, linux-amd64) -# Problematic frame: -# C [libc.so.6+0x15e090] __memset_avx2_unaligned_erms+0x60 -# -# Core dump will be written. Default location: /project/java-native/core -# -# If you would like to submit a bug report, please visit: -# https://bugreport.java.com/bugreport/crash.jsp -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: /project/java-native/target/surefire/surefirebooter255261521587421006.jar /project/java-native/target/surefire 2020-10-01T00-29-55_633-jvmRun3 surefire15563279322398545368tmp surefire_13579138375161683305tmp - -Host: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz, 1 cores, 1G, Oracle Linux Server release 8.2 -Time: Thu Oct 1 00:30:20 2020 UTC elapsed time: 10 seconds (0d 0h 0m 10s) - ---------------- T H R E A D --------------- - -Current thread (0x00007f01b0028800): JavaThread "main" [_thread_in_native, id=114, stack(0x00007f01b9143000,0x00007f01b9244000)] - -Stack: [0x00007f01b9143000,0x00007f01b9244000], sp=0x00007f01b9240788, free space=1013k -Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libc.so.6+0x15e090] __memset_avx2_unaligned_erms+0x60 -j com.sun.jna.Native.setMemory(Lcom/sun/jna/Pointer;JJJB)V+0 -j com.sun.jna.Pointer.setMemory(JJB)V+9 -j com.baeldung.jna.StdCUnitTest.whenAccessViolation_thenShouldThrowError()V+17 -v ~StubRoutines::call_stub -V [libjvm.so+0x78e42b] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2fb -V [libjvm.so+0xbb0efb] invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*) [clone .constprop.117]+0x85b -V [libjvm.so+0xbb19cd] Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0xfd -V [libjvm.so+0x83b8e3] JVM_InvokeMethod+0xf3 -j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@14.0.2 -j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@14.0.2 -j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@14.0.2 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@14.0.2 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 -j org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;)Ljava/lang/Object;+32 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+24 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$232.execute()V+12 -j org.junit.jupiter.engine.execution.ThrowableCollector.execute(Lorg/junit/jupiter/api/function/Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+35 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 -j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 -j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 -j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 -j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 -j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 -j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 -j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 -j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 -j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 -j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 -j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 -j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 -j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 -j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 -j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 -j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()V+23 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+13 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/engine/TestEngine;Lorg/junit/platform/engine/ExecutionRequest;)V+2 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/Root;Lorg/junit/platform/engine/ConfigurationParameters;[Lorg/junit/platform/launcher/TestExecutionListener;)V+101 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+36 -j org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(Lorg/apache/maven/surefire/util/TestsToRun;)Lorg/apache/maven/surefire/suite/RunResult;+55 -j org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+31 -j org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Lorg/apache/maven/surefire/booter/ForkingReporterFactory;)Lorg/apache/maven/surefire/suite/RunResult;+9 -j org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess()Lorg/apache/maven/surefire/suite/RunResult;+7 -j org.apache.maven.surefire.booter.ForkedBooter.execute()V+1 -j org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+35 -v ~StubRoutines::call_stub -V [libjvm.so+0x78e42b] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2fb -V [libjvm.so+0x80d2e3] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .isra.125] [clone .constprop.264]+0x193 -V [libjvm.so+0x80f338] jni_CallStaticVoidMethod+0x108 -C [libjli.so+0x4647] JavaMain+0xcd7 -C [libjli.so+0x85a9] ThreadJavaMain+0x9 - -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -j com.sun.jna.Native.setMemory(Lcom/sun/jna/Pointer;JJJB)V+0 -j com.sun.jna.Pointer.setMemory(JJB)V+9 -j com.baeldung.jna.StdCUnitTest.whenAccessViolation_thenShouldThrowError()V+17 -v ~StubRoutines::call_stub -j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@14.0.2 -j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@14.0.2 -j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@14.0.2 -j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@14.0.2 -j org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+41 -j org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/extension/ExtensionRegistry;)Ljava/lang/Object;+32 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(Lorg/junit/jupiter/api/extension/ExtensionContext;Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;)V+24 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor$$Lambda$232.execute()V+12 -j org.junit.jupiter.engine.execution.ThrowableCollector.execute(Lorg/junit/jupiter/api/function/Executable;)V+1 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)V+21 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/jupiter/engine/execution/JupiterEngineExecutionContext;+44 -j org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/Node$DynamicTestExecutor;)Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;+6 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+35 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 -j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 -j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 -j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 -j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 -j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 -j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 -j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 -j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;Lorg/junit/platform/engine/TestDescriptor;)V+17 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$190.accept(Ljava/lang/Object;)V+12 -j java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V+5 java.base@14.0.2 -j java.util.stream.ReferencePipeline$2$1.accept(Ljava/lang/Object;)V+21 java.base@14.0.2 -j java.util.Iterator.forEachRemaining(Ljava/util/function/Consumer;)V+21 java.base@14.0.2 -j java.util.Spliterators$IteratorSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+52 java.base@14.0.2 -j java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32 java.base@14.0.2 -j java.util.stream.AbstractPipeline.wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;+13 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Void;+3 java.base@14.0.2 -j java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;+3 java.base@14.0.2 -j java.util.stream.AbstractPipeline.evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;+88 java.base@14.0.2 -j java.util.stream.ReferencePipeline.forEach(Ljava/util/function/Consumer;)V+6 java.base@14.0.2 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+75 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor$$Lambda$187.execute()V+8 -j org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(Lorg/junit/platform/engine/support/hierarchical/SingleTestExecutor$Executable;)Lorg/junit/platform/engine/TestExecutionResult;+1 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+27 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(Lorg/junit/platform/engine/support/hierarchical/EngineExecutionContext;Lorg/junit/platform/engine/support/hierarchical/ExecutionTracker;)V+53 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute()V+23 -j org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(Lorg/junit/platform/engine/ExecutionRequest;)V+13 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/engine/TestEngine;Lorg/junit/platform/engine/ExecutionRequest;)V+2 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/core/Root;Lorg/junit/platform/engine/ConfigurationParameters;[Lorg/junit/platform/launcher/TestExecutionListener;)V+101 -j org.junit.platform.launcher.core.DefaultLauncher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;[Lorg/junit/platform/launcher/TestExecutionListener;)V+36 -j org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(Lorg/apache/maven/surefire/util/TestsToRun;)Lorg/apache/maven/surefire/suite/RunResult;+55 -j org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+31 -j org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Lorg/apache/maven/surefire/booter/ForkingReporterFactory;)Lorg/apache/maven/surefire/suite/RunResult;+9 -j org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess()Lorg/apache/maven/surefire/suite/RunResult;+7 -j org.apache.maven.surefire.booter.ForkedBooter.execute()V+1 -j org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+35 -v ~StubRoutines::call_stub - -siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000 - -Register to memory mapping: - -RAX=0x0 is NULL -RBX={method} {0x00007f01b6799628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' -RCX=0x0000000000000080 is an unknown value -RDX=0x0000000000019000 is an unknown value -RSP=0x00007f01b9240788 is pointing into the stack for thread: 0x00007f01b0028800 -RBP=0x00007f01b92407c0 is pointing into the stack for thread: 0x00007f01b0028800 -RSI=0x0 is NULL -RDI=0x0 is NULL -R8 =0x0 is NULL -R9 =0x0000000000019000 is an unknown value -R10=0x0000000000000009 is an unknown value -R11=0x00007f01b8794fd0: in /lib64/libc.so.6 at 0x00007f01b8637000 -R12=0x0 is NULL -R13={method} {0x00007f01b6799628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' -R14=0x00007f01b92408b8 is pointing into the stack for thread: 0x00007f01b0028800 -R15=0x00007f01b0028800 is a thread - - -Registers: -RAX=0x0000000000000000, RBX=0x00007f01b6799628, RCX=0x0000000000000080, RDX=0x0000000000019000 -RSP=0x00007f01b9240788, RBP=0x00007f01b92407c0, RSI=0x0000000000000000, RDI=0x0000000000000000 -R8 =0x0000000000000000, R9 =0x0000000000019000, R10=0x0000000000000009, R11=0x00007f01b8794fd0 -R12=0x0000000000000000, R13=0x00007f01b6799628, R14=0x00007f01b92408b8, R15=0x00007f01b0028800 -RIP=0x00007f01b8795090, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000006 - TRAPNO=0x000000000000000e - -Top of Stack: (sp=0x00007f01b9240788) -0x00007f01b9240788: 00007f01b4a8fe8d 00007f01b6799628 -0x00007f01b9240798: 00007f01b0028b10 0000000000000000 -0x00007f01b92407a8: 0000000000019000 0000000000000000 -0x00007f01b92407b8: 0000000000000000 00007f01b9240860 - -Instructions: (pc=0x00007f01b8795090) -0x00007f01b8794f90: f3 0f 1e fa 48 39 d1 0f 82 53 d9 fa ff 0f 1f 00 -0x00007f01b8794fa0: f3 0f 1e fa 48 c1 e2 02 c5 f9 6e c6 48 89 f8 c4 -0x00007f01b8794fb0: e2 7d 58 c0 eb 2a 66 2e 0f 1f 84 00 00 00 00 00 -0x00007f01b8794fc0: f3 0f 1e fa 48 39 d1 0f 82 23 d9 fa ff 0f 1f 00 -0x00007f01b8794fd0: f3 0f 1e fa c5 f9 6e c6 48 89 f8 c4 e2 7d 78 c0 -0x00007f01b8794fe0: 48 83 fa 20 0f 82 04 01 00 00 48 83 fa 40 77 77 -0x00007f01b8794ff0: c5 fe 7f 44 17 e0 c5 fe 7f 07 c5 f8 77 c3 66 90 -0x00007f01b8795000: f3 0f 1e fa c5 f8 77 48 89 d1 40 0f b6 c6 48 89 -0x00007f01b8795010: fa f3 aa 48 89 d0 c3 66 0f 1f 84 00 00 00 00 00 -0x00007f01b8795020: f3 0f 1e fa 48 39 d1 0f 82 c3 d8 fa ff 0f 1f 00 -0x00007f01b8795030: f3 0f 1e fa c5 f9 6e c6 48 89 f8 c4 e2 7d 78 c0 -0x00007f01b8795040: 48 83 fa 20 0f 82 a4 00 00 00 48 83 fa 40 77 0e -0x00007f01b8795050: c5 fe 7f 44 17 e0 c5 fe 7f 07 c5 f8 77 c3 48 81 -0x00007f01b8795060: fa 00 08 00 00 77 9d 48 81 fa 80 00 00 00 77 19 -0x00007f01b8795070: c5 fe 7f 07 c5 fe 7f 47 20 c5 fe 7f 44 17 e0 c5 -0x00007f01b8795080: fe 7f 44 17 c0 c5 f8 77 c3 48 8d 8f 80 00 00 00 -0x00007f01b8795090: c5 fe 7f 07 48 83 e1 80 c5 fe 7f 44 17 e0 c5 fe -0x00007f01b87950a0: 7f 47 20 c5 fe 7f 44 17 c0 c5 fe 7f 47 40 c5 fe -0x00007f01b87950b0: 7f 44 17 a0 c5 fe 7f 47 60 c5 fe 7f 44 17 80 48 -0x00007f01b87950c0: 01 fa 48 83 e2 80 48 39 d1 74 ba c5 fd 7f 01 c5 -0x00007f01b87950d0: fd 7f 41 20 c5 fd 7f 41 40 c5 fd 7f 41 60 48 81 -0x00007f01b87950e0: c1 80 00 00 00 48 39 ca 75 e1 c5 f8 77 c3 80 fa -0x00007f01b87950f0: 10 73 1c c4 e1 f9 7e c1 80 fa 08 73 20 80 fa 04 -0x00007f01b8795100: 73 27 80 fa 01 77 2c 72 02 88 0f c5 f8 77 c3 c5 -0x00007f01b8795110: fa 7f 44 17 f0 c5 fa 7f 07 c5 f8 77 c3 48 89 4c -0x00007f01b8795120: 17 f8 48 89 0f c5 f8 77 c3 89 4c 17 fc 89 0f c5 -0x00007f01b8795130: f8 77 c3 66 89 4c 17 fe 66 89 0f c5 f8 77 c3 90 -0x00007f01b8795140: f3 0f 1e fa 48 c1 e2 02 48 83 fa 20 0f 82 3e 01 -0x00007f01b8795150: 00 00 c5 fe 6f 16 c5 ed 76 17 c5 fd d7 c2 83 e8 -0x00007f01b8795160: ff 0f 85 e9 00 00 00 48 83 fa 40 0f 86 c0 00 00 -0x00007f01b8795170: 00 c5 fd 76 c0 48 81 fa 00 01 00 00 0f 87 9e 01 -0x00007f01b8795180: 00 00 48 81 fa 80 00 00 00 0f 82 28 02 00 00 c5 - - -Stack slot to memory mapping: -stack at sp + 0 slots: 0x00007f01b4a8fe8d: Java_com_sun_jna_Native_setMemory+0x00000000000000bd in /root/.cache/JNA/temp/jna8092103267992246554.tmp at 0x00007f01b4a89000 -stack at sp + 1 slots: {method} {0x00007f01b6799628} 'setMemory' '(Lcom/sun/jna/Pointer;JJJB)V' in 'com/sun/jna/Native' -stack at sp + 2 slots: 0x00007f01b0028b10 points into unknown readable memory: 80 48 58 b8 01 7f 00 00 -stack at sp + 3 slots: 0x0 is NULL -stack at sp + 4 slots: 0x0000000000019000 is an unknown value -stack at sp + 5 slots: 0x0 is NULL -stack at sp + 6 slots: 0x0 is NULL -stack at sp + 7 slots: 0x00007f01b9240860 is pointing into the stack for thread: 0x00007f01b0028800 - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00007f01b01d8a40, length=12, elements={ -0x00007f01b0028800, 0x00007f01b00a2000, 0x00007f01b00a3800, 0x00007f01b00ad000, -0x00007f01b00af000, 0x00007f01b00b1000, 0x00007f01b00b3000, 0x00007f01b00b5000, -0x00007f01b00ef800, 0x00007f01b00f4800, 0x00007f01b0188800, 0x00007f01b01d7800 -} - -Java Threads: ( => current thread ) -=>0x00007f01b0028800 JavaThread "main" [_thread_in_native, id=114, stack(0x00007f01b9143000,0x00007f01b9244000)] - 0x00007f01b00a2000 JavaThread "Reference Handler" daemon [_thread_blocked, id=120, stack(0x00007f01b5ed6000,0x00007f01b5fd7000)] - 0x00007f01b00a3800 JavaThread "Finalizer" daemon [_thread_blocked, id=123, stack(0x00007f01b5dd5000,0x00007f01b5ed6000)] - 0x00007f01b00ad000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=125, stack(0x00007f01b55e0000,0x00007f01b56e1000)] - 0x00007f01b00af000 JavaThread "Service Thread" daemon [_thread_blocked, id=128, stack(0x00007f01b54df000,0x00007f01b55e0000)] - 0x00007f01b00b1000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=130, stack(0x00007f01b53de000,0x00007f01b54df000)] - 0x00007f01b00b3000 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=133, stack(0x00007f01b52dd000,0x00007f01b53de000)] - 0x00007f01b00b5000 JavaThread "Sweeper thread" daemon [_thread_blocked, id=138, stack(0x00007f01b51dc000,0x00007f01b52dd000)] - 0x00007f01b00ef800 JavaThread "Notification Thread" daemon [_thread_blocked, id=140, stack(0x00007f01b50db000,0x00007f01b51dc000)] - 0x00007f01b00f4800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=146, stack(0x00007f01b4ed8000,0x00007f01b4fd9000)] - 0x00007f01b0188800 JavaThread "surefire-forkedjvm-command-thread" daemon [_thread_in_native, id=150, stack(0x00007f01b4dc0000,0x00007f01b4ec1000)] - 0x00007f01b01d7800 JavaThread "surefire-forkedjvm-ping-30s" daemon [_thread_blocked, id=153, stack(0x00007f01b4cb2000,0x00007f01b4db3000)] - -Other Threads: - 0x00007f01b009e800 VMThread "VM Thread" [stack: 0x00007f01b5fd9000,0x00007f01b60d9000] [id=117] - 0x00007f01b00f2000 WatcherThread [stack: 0x00007f01b4fdb000,0x00007f01b50db000] [id=141] - -Threads with active compile tasks: - -VM state:not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap address: 0x00000000e0c00000, size: 500 MB, Compressed Oops mode: 32-bit -Narrow klass base: 0x0000000800000000, Narrow klass shift: 3 -Compressed class space size: 1073741824 Address: 0x0000000800b11000 - -Heap: - def new generation total 9792K, used 7590K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) - eden space 8704K, 74% used [0x00000000e0c00000, 0x00000000e1259a00, 0x00000000e1480000) - from space 1088K, 100% used [0x00000000e1590000, 0x00000000e16a0000, 0x00000000e16a0000) - to space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) - tenured generation total 21888K, used 1321K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) - the space 21888K, 6% used [0x00000000eb2a0000, 0x00000000eb3ea690, 0x00000000eb3ea800, 0x00000000ec800000) - Metaspace used 4992K, capacity 7071K, committed 7296K, reserved 1056768K - class space used 637K, capacity 881K, committed 896K, reserved 1048576K - -Card table byte_map: [0x00007f01b6a5c000,0x00007f01b6b57000] _byte_map_base: 0x00007f01b6356000 - -Polling page: 0x00007f01b9259000 - -Metaspace: - -Usage: - Non-class: 6.04 MB capacity, 4.25 MB ( 70%) used, 1.76 MB ( 29%) free+waste, 30.81 KB ( <1%) overhead. - Class: 881.00 KB capacity, 637.47 KB ( 72%) used, 226.47 KB ( 26%) free+waste, 17.06 KB ( 2%) overhead. - Both: 6.91 MB capacity, 4.88 MB ( 71%) used, 1.98 MB ( 29%) free+waste, 47.88 KB ( <1%) overhead. - -Virtual space: - Non-class space: 8.00 MB reserved, 6.25 MB ( 78%) committed - Class space: 1.00 GB reserved, 896.00 KB ( <1%) committed - Both: 1.01 GB reserved, 7.12 MB ( <1%) committed - -Chunk freelists: - Non-Class: 62.00 KB - Class: 11.00 KB - Both: 73.00 KB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB - -CodeHeap 'non-profiled nmethods': size=120036Kb used=270Kb max_used=270Kb free=119765Kb - bounds [0x00007f01a019c000, 0x00007f01a040c000, 0x00007f01a76d5000] -CodeHeap 'profiled nmethods': size=120032Kb used=1585Kb max_used=1585Kb free=118446Kb - bounds [0x00007f0198c64000, 0x00007f0198ed4000, 0x00007f01a019c000] -CodeHeap 'non-nmethods': size=5692Kb used=1156Kb max_used=1171Kb free=4535Kb - bounds [0x00007f01986d5000, 0x00007f0198945000, 0x00007f0198c64000] - total_blobs=1295 nmethods=879 adapters=332 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 10.134 Thread 0x00007f01b00b3000 876 3 java.util.zip.ZipEntry:: (74 bytes) -Event: 10.135 Thread 0x00007f01b00b3000 nmethod 876 0x00007f0198ded390 code [0x00007f0198ded580, 0x00007f0198dedaf0] -Event: 10.135 Thread 0x00007f01b00b3000 873 3 java.util.jar.JarFile$1::apply (13 bytes) -Event: 10.138 Thread 0x00007f01b00b3000 nmethod 873 0x00007f0198dedd10 code [0x00007f0198dedec0, 0x00007f0198dee1a0] -Event: 10.138 Thread 0x00007f01b00b3000 874 3 java.util.jar.JarFile$JarFileEntry:: (16 bytes) -Event: 10.138 Thread 0x00007f01b00b3000 nmethod 874 0x00007f0198dee310 code [0x00007f0198dee4c0, 0x00007f0198dee6c0] -Event: 10.141 Thread 0x00007f01b00b1000 877 4 java.lang.StringBuilder:: (7 bytes) -Event: 10.144 Thread 0x00007f01b00b1000 nmethod 877 0x00007f01a01df010 code [0x00007f01a01df180, 0x00007f01a01df298] -Event: 10.151 Thread 0x00007f01b00b3000 878 ! 3 java.util.zip.ZipFile$ZipFileInflaterInputStream::close (67 bytes) -Event: 10.152 Thread 0x00007f01b00b3000 nmethod 878 0x00007f0198dee790 code [0x00007f0198dee980, 0x00007f0198def090] -Event: 10.158 Thread 0x00007f01b00b3000 879 3 java.util.ArrayDeque::add (7 bytes) -Event: 10.159 Thread 0x00007f01b00b3000 nmethod 879 0x00007f0198def390 code [0x00007f0198def520, 0x00007f0198def680] -Event: 10.166 Thread 0x00007f01b00b3000 880 3 java.util.zip.ZipFile$InflaterCleanupAction::run (12 bytes) -Event: 10.167 Thread 0x00007f01b00b3000 nmethod 880 0x00007f0198def710 code [0x00007f0198def8a0, 0x00007f0198defa00] -Event: 10.167 Thread 0x00007f01b00b3000 881 ! 3 java.util.zip.Inflater::reset (64 bytes) -Event: 10.167 Thread 0x00007f01b00b3000 nmethod 881 0x00007f0198defb10 code [0x00007f0198defcc0, 0x00007f0198df00b0] -Event: 10.179 Thread 0x00007f01b00b1000 883 4 java.lang.Object:: (1 bytes) -Event: 10.180 Thread 0x00007f01b00b1000 nmethod 883 0x00007f01a01df710 code [0x00007f01a01df880, 0x00007f01a01df938] -Event: 10.185 Thread 0x00007f01b00b3000 884 3 sun.net.www.protocol.jar.Handler::checkNestedProtocol (18 bytes) -Event: 10.186 Thread 0x00007f01b00b3000 nmethod 884 0x00007f0198df0290 code [0x00007f0198df0440, 0x00007f0198df0620] - -GC Heap History (2 events): -Event: 5.704 GC heap before -{Heap before GC invocations=0 (full 0): - def new generation total 9792K, used 8704K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) - eden space 8704K, 100% used [0x00000000e0c00000, 0x00000000e1480000, 0x00000000e1480000) - from space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) - to space 1088K, 0% used [0x00000000e1590000, 0x00000000e1590000, 0x00000000e16a0000) - tenured generation total 21888K, used 0K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) - the space 21888K, 0% used [0x00000000eb2a0000, 0x00000000eb2a0000, 0x00000000eb2a0200, 0x00000000ec800000) - Metaspace used 3047K, capacity 5805K, committed 6016K, reserved 1056768K - class space used 361K, capacity 627K, committed 640K, reserved 1048576K -} -Event: 5.793 GC heap after -{Heap after GC invocations=1 (full 0): - def new generation total 9792K, used 1088K [0x00000000e0c00000, 0x00000000e16a0000, 0x00000000eb2a0000) - eden space 8704K, 0% used [0x00000000e0c00000, 0x00000000e0c00000, 0x00000000e1480000) - from space 1088K, 100% used [0x00000000e1590000, 0x00000000e16a0000, 0x00000000e16a0000) - to space 1088K, 0% used [0x00000000e1480000, 0x00000000e1480000, 0x00000000e1590000) - tenured generation total 21888K, used 1321K [0x00000000eb2a0000, 0x00000000ec800000, 0x0000000100000000) - the space 21888K, 6% used [0x00000000eb2a0000, 0x00000000eb3ea690, 0x00000000eb3ea800, 0x00000000ec800000) - Metaspace used 3047K, capacity 5805K, committed 6016K, reserved 1056768K - class space used 361K, capacity 627K, committed 640K, reserved 1048576K -} - -Deoptimization events (16 events): -Event: 0.632 Thread 0x00007f01b0028800 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007f01a01a0598 relative=0x00000000000001d8 -Event: 0.632 Thread 0x00007f01b0028800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f01a01a0598 method=java.lang.String.hashCode()I @ 42 c2 -Event: 0.632 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f01a01a0598 sp=0x00007f01b9241330 -Event: 0.632 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871de25 sp=0x00007f01b92412e8 mode 2 -Event: 2.512 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f0198cb6484 sp=0x00007f01b9240b90 -Event: 2.513 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871e33a sp=0x00007f01b9240008 mode 0 -Event: 2.799 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f0198cc1322 sp=0x00007f01b92411c0 -Event: 2.799 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871e33a sp=0x00007f01b9240648 mode 0 -Event: 3.948 Thread 0x00007f01b0028800 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007f01a01a2068 relative=0x0000000000000068 -Event: 3.948 Thread 0x00007f01b0028800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007f01a01a2068 method=java.lang.String.isLatin1()Z @ 10 c2 -Event: 3.948 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f01a01a2068 sp=0x00007f01b92418d0 -Event: 3.948 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871de25 sp=0x00007f01b9241880 mode 2 -Event: 6.052 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f0198cca4e8 sp=0x00007f01b9240f60 -Event: 6.052 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871e33a sp=0x00007f01b92403d0 mode 0 -Event: 9.484 Thread 0x00007f01b0028800 DEOPT PACKING pc=0x00007f0198cc64c5 sp=0x00007f01b923f9a0 -Event: 9.485 Thread 0x00007f01b0028800 DEOPT UNPACKING pc=0x00007f019871e33a sp=0x00007f01b923ee20 mode 0 - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (17 events): -Event: 1.373 Thread 0x00007f01b0028800 Exception (0x00000000e0dc59d8) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 3.603 Thread 0x00007f01b0028800 Exception (0x00000000e1209430) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 4.004 Thread 0x00007f01b0028800 Exception (0x00000000e12808b8) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 4.253 Thread 0x00007f01b0028800 Exception (0x00000000e12d4648) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 4.809 Thread 0x00007f01b0028800 Exception (0x00000000e1346010) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 4.925 Thread 0x00007f01b0028800 Exception (0x00000000e137ad28) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 4.993 Thread 0x00007f01b0028800 Exception (0x00000000e139e938) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 5.012 Thread 0x00007f01b0028800 Exception (0x00000000e13a8b18) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 5.041 Thread 0x00007f01b0028800 Exception (0x00000000e13b69e8) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 832] -Event: 5.141 Thread 0x00007f01b0028800 Exception (0x00000000e13ebf18) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 5.852 Thread 0x00007f01b0028800 Exception (0x00000000e0c24ce8) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.079 Thread 0x00007f01b0028800 Exception (0x00000000e0c8faf8) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.396 Thread 0x00007f01b0028800 Exception (0x00000000e0cfcd80) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.442 Thread 0x00007f01b0028800 Exception (0x00000000e0d15098) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 6.449 Thread 0x00007f01b0028800 Exception (0x00000000e0d17a88) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 832] -Event: 8.061 Thread 0x00007f01b0028800 Exception (0x00000000e0f73890) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] -Event: 8.061 Thread 0x00007f01b0028800 Exception (0x00000000e0f76c98) -thrown [open/src/hotspot/share/interpreter/linkResolver.cpp, line 766] - -Events (20 events): -Event: 10.009 loading class sun/security/provider/ByteArrayAccess -Event: 10.009 loading class sun/security/provider/ByteArrayAccess done -Event: 10.010 loading class java/io/DeleteOnExitHook -Event: 10.010 loading class java/io/DeleteOnExitHook done -Event: 10.010 loading class java/io/DeleteOnExitHook$1 -Event: 10.011 loading class java/io/DeleteOnExitHook$1 done -Event: 10.043 loading class java/io/FileOutputStream$1 -Event: 10.043 loading class java/io/FileOutputStream$1 done -Event: 10.046 Loaded shared library /root/.cache/JNA/temp/jna8092103267992246554.tmp -Event: 10.046 loading class java/nio/ShortBuffer -Event: 10.048 loading class java/nio/ShortBuffer done -Event: 10.051 loading class java/nio/FloatBuffer -Event: 10.051 loading class java/nio/FloatBuffer done -Event: 10.054 loading class java/nio/DoubleBuffer -Event: 10.057 loading class java/nio/DoubleBuffer done -Event: 10.132 Executing VM operation: HandshakeAllThreads -Event: 10.132 Executing VM operation: HandshakeAllThreads done -Event: 10.168 Loaded shared library /usr/java/openjdk-14/lib/libzip.so -Event: 10.207 Executing VM operation: HandshakeAllThreads -Event: 10.210 Executing VM operation: HandshakeAllThreads done - - -Dynamic libraries: -e0c00000-e16a0000 rw-p 00000000 00:00 0 -e16a0000-eb2a0000 ---p 00000000 00:00 0 -eb2a0000-ec800000 rw-p 00000000 00:00 0 -ec800000-100000000 ---p 00000000 00:00 0 -800000000-800003000 rwxp 00001000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa -800003000-8003e4000 rw-p 00004000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa -8003e4000-800b10000 r--p 003e5000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa -800b10000-800b11000 rw-p 00b11000 08:01 3160994 /usr/java/openjdk-14/lib/server/classes.jsa -800b11000-800bf1000 rw-p 00000000 00:00 0 -800bf1000-840b11000 ---p 00000000 00:00 0 -56394c07f000-56394c080000 r-xp 00000000 08:01 3160482 /usr/java/openjdk-14/bin/java -56394c081000-56394c082000 r--p 00001000 08:01 3160482 /usr/java/openjdk-14/bin/java -56394c082000-56394c083000 rw-p 00002000 08:01 3160482 /usr/java/openjdk-14/bin/java -56394c563000-56394c584000 rw-p 00000000 00:00 0 [heap] -7f017c000000-7f017c3ce000 rw-p 00000000 00:00 0 -7f017c3ce000-7f0180000000 ---p 00000000 00:00 0 -7f0180000000-7f01802f1000 rw-p 00000000 00:00 0 -7f01802f1000-7f0184000000 ---p 00000000 00:00 0 -7f0184000000-7f0184021000 rw-p 00000000 00:00 0 -7f0184021000-7f0188000000 ---p 00000000 00:00 0 -7f0188000000-7f0188021000 rw-p 00000000 00:00 0 -7f0188021000-7f018c000000 ---p 00000000 00:00 0 -7f018c000000-7f018c021000 rw-p 00000000 00:00 0 -7f018c021000-7f0190000000 ---p 00000000 00:00 0 -7f0190000000-7f0190021000 rw-p 00000000 00:00 0 -7f0190021000-7f0194000000 ---p 00000000 00:00 0 -7f0194000000-7f0194021000 rw-p 00000000 00:00 0 -7f0194021000-7f0198000000 ---p 00000000 00:00 0 -7f01986d5000-7f0198945000 rwxp 00000000 00:00 0 -7f0198945000-7f0198c64000 ---p 00000000 00:00 0 -7f0198c64000-7f0198ed4000 rwxp 00000000 00:00 0 -7f0198ed4000-7f01a019c000 ---p 00000000 00:00 0 -7f01a019c000-7f01a040c000 rwxp 00000000 00:00 0 -7f01a040c000-7f01a76d5000 ---p 00000000 00:00 0 -7f01a76d5000-7f01b0000000 r--s 00000000 08:01 3160985 /usr/java/openjdk-14/lib/modules -7f01b0000000-7f01b04f4000 rw-p 00000000 00:00 0 -7f01b04f4000-7f01b4000000 ---p 00000000 00:00 0 -7f01b45cb000-7f01b4a89000 rw-p 00000000 00:00 0 -7f01b4a89000-7f01b4aa1000 r-xp 00000000 08:01 3163771 /root/.cache/JNA/temp/jna8092103267992246554.tmp (deleted) -7f01b4aa1000-7f01b4ca1000 ---p 00018000 08:01 3163771 /root/.cache/JNA/temp/jna8092103267992246554.tmp (deleted) -7f01b4ca1000-7f01b4ca2000 rw-p 00018000 08:01 3163771 /root/.cache/JNA/temp/jna8092103267992246554.tmp (deleted) -7f01b4ca2000-7f01b4caf000 r-xp 00000000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so -7f01b4caf000-7f01b4cb1000 r--p 0000c000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so -7f01b4cb1000-7f01b4cb2000 rw-p 0000e000 08:01 3160983 /usr/java/openjdk-14/lib/libverify.so -7f01b4cb2000-7f01b4cb6000 ---p 00000000 00:00 0 -7f01b4cb6000-7f01b4db3000 rw-p 00000000 00:00 0 -7f01b4db3000-7f01b4db8000 r-xp 00000000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so -7f01b4db8000-7f01b4db9000 r--p 00004000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so -7f01b4db9000-7f01b4dba000 rw-p 00005000 08:01 3160973 /usr/java/openjdk-14/lib/libmanagement_ext.so -7f01b4dba000-7f01b4dbe000 r-xp 00000000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so -7f01b4dbe000-7f01b4dbf000 r--p 00003000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so -7f01b4dbf000-7f01b4dc0000 rw-p 00004000 08:01 3160971 /usr/java/openjdk-14/lib/libmanagement.so -7f01b4dc0000-7f01b4dc4000 ---p 00000000 00:00 0 -7f01b4dc4000-7f01b4ec1000 rw-p 00000000 00:00 0 -7f01b4ec1000-7f01b4ed6000 r-xp 00000000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so -7f01b4ed6000-7f01b4ed7000 r--p 00014000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so -7f01b4ed7000-7f01b4ed8000 rw-p 00015000 08:01 3160975 /usr/java/openjdk-14/lib/libnet.so -7f01b4ed8000-7f01b4edc000 ---p 00000000 00:00 0 -7f01b4edc000-7f01b4fd9000 rw-p 00000000 00:00 0 -7f01b4fd9000-7f01b4fda000 ---p 00000000 00:00 0 -7f01b4fda000-7f01b50db000 rw-p 00000000 00:00 0 -7f01b50db000-7f01b50df000 ---p 00000000 00:00 0 -7f01b50df000-7f01b51dc000 rw-p 00000000 00:00 0 -7f01b51dc000-7f01b51e0000 ---p 00000000 00:00 0 -7f01b51e0000-7f01b52dd000 rw-p 00000000 00:00 0 -7f01b52dd000-7f01b52e1000 ---p 00000000 00:00 0 -7f01b52e1000-7f01b53de000 rw-p 00000000 00:00 0 -7f01b53de000-7f01b53e2000 ---p 00000000 00:00 0 -7f01b53e2000-7f01b54df000 rw-p 00000000 00:00 0 -7f01b54df000-7f01b54e3000 ---p 00000000 00:00 0 -7f01b54e3000-7f01b55e0000 rw-p 00000000 00:00 0 -7f01b55e0000-7f01b55e4000 ---p 00000000 00:00 0 -7f01b55e4000-7f01b56e1000 rw-p 00000000 00:00 0 -7f01b56e1000-7f01b5734000 r--p 00000000 08:01 3154692 /usr/lib/locale/C.utf8/LC_CTYPE -7f01b5734000-7f01b5dd5000 r--p 00000000 08:01 3154691 /usr/lib/locale/C.utf8/LC_COLLATE -7f01b5dd5000-7f01b5dd9000 ---p 00000000 00:00 0 -7f01b5dd9000-7f01b5ed6000 rw-p 00000000 00:00 0 -7f01b5ed6000-7f01b5eda000 ---p 00000000 00:00 0 -7f01b5eda000-7f01b5fd7000 rw-p 00000000 00:00 0 -7f01b5fd7000-7f01b5fd8000 ---p 00000000 00:00 0 -7f01b5fd8000-7f01b67f5000 rw-p 00000000 00:00 0 -7f01b67f5000-7f01b69b5000 ---p 00000000 00:00 0 -7f01b69b5000-7f01b69c0000 rw-p 00000000 00:00 0 -7f01b69c0000-7f01b6a5c000 ---p 00000000 00:00 0 -7f01b6a5c000-7f01b6a62000 rw-p 00000000 00:00 0 -7f01b6a62000-7f01b6aaf000 ---p 00000000 00:00 0 -7f01b6aaf000-7f01b6aba000 rw-p 00000000 00:00 0 -7f01b6aba000-7f01b6b56000 ---p 00000000 00:00 0 -7f01b6b56000-7f01b6b5c000 rw-p 00000000 00:00 0 -7f01b6b5c000-7f01b6c42000 ---p 00000000 00:00 0 -7f01b6c42000-7f01b6c47000 rw-p 00000000 00:00 0 -7f01b6c47000-7f01b6d2d000 ---p 00000000 00:00 0 -7f01b6d2d000-7f01b6d38000 r-xp 00000000 08:01 3155554 /usr/lib64/libnss_files-2.28.so -7f01b6d38000-7f01b6f37000 ---p 0000b000 08:01 3155554 /usr/lib64/libnss_files-2.28.so -7f01b6f37000-7f01b6f38000 r--p 0000a000 08:01 3155554 /usr/lib64/libnss_files-2.28.so -7f01b6f38000-7f01b6f39000 rw-p 0000b000 08:01 3155554 /usr/lib64/libnss_files-2.28.so -7f01b6f39000-7f01b6f3f000 rw-p 00000000 00:00 0 -7f01b6f3f000-7f01b6f46000 r-xp 00000000 08:01 3155596 /usr/lib64/librt-2.28.so -7f01b6f46000-7f01b7146000 ---p 00007000 08:01 3155596 /usr/lib64/librt-2.28.so -7f01b7146000-7f01b7147000 r--p 00007000 08:01 3155596 /usr/lib64/librt-2.28.so -7f01b7147000-7f01b7148000 rw-p 00008000 08:01 3155596 /usr/lib64/librt-2.28.so -7f01b7148000-7f01b72c9000 r-xp 00000000 08:01 3155521 /usr/lib64/libm-2.28.so -7f01b72c9000-7f01b74c8000 ---p 00181000 08:01 3155521 /usr/lib64/libm-2.28.so -7f01b74c8000-7f01b74c9000 r--p 00180000 08:01 3155521 /usr/lib64/libm-2.28.so -7f01b74c9000-7f01b74ca000 rw-p 00181000 08:01 3155521 /usr/lib64/libm-2.28.so -7f01b74ca000-7f01b84d9000 r-xp 00000000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so -7f01b84d9000-7f01b84da000 ---p 0100f000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so -7f01b84da000-7f01b857e000 r--p 0100f000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so -7f01b857e000-7f01b85b6000 rw-p 010b3000 08:01 3160996 /usr/java/openjdk-14/lib/server/libjvm.so -7f01b85b6000-7f01b8637000 rw-p 00000000 00:00 0 -7f01b8637000-7f01b87f0000 r-xp 00000000 08:01 3155424 /usr/lib64/libc-2.28.so -7f01b87f0000-7f01b89ef000 ---p 001b9000 08:01 3155424 /usr/lib64/libc-2.28.so -7f01b89ef000-7f01b89f3000 r--p 001b8000 08:01 3155424 /usr/lib64/libc-2.28.so -7f01b89f3000-7f01b89f5000 rw-p 001bc000 08:01 3155424 /usr/lib64/libc-2.28.so -7f01b89f5000-7f01b89f9000 rw-p 00000000 00:00 0 -7f01b89f9000-7f01b89fc000 r-xp 00000000 08:01 3155440 /usr/lib64/libdl-2.28.so -7f01b89fc000-7f01b8bfb000 ---p 00003000 08:01 3155440 /usr/lib64/libdl-2.28.so -7f01b8bfb000-7f01b8bfc000 r--p 00002000 08:01 3155440 /usr/lib64/libdl-2.28.so -7f01b8bfc000-7f01b8bfd000 rw-p 00003000 08:01 3155440 /usr/lib64/libdl-2.28.so -7f01b8bfd000-7f01b8c18000 r-xp 00000000 08:01 3155583 /usr/lib64/libpthread-2.28.so -7f01b8c18000-7f01b8e17000 ---p 0001b000 08:01 3155583 /usr/lib64/libpthread-2.28.so -7f01b8e17000-7f01b8e18000 r--p 0001a000 08:01 3155583 /usr/lib64/libpthread-2.28.so -7f01b8e18000-7f01b8e19000 rw-p 0001b000 08:01 3155583 /usr/lib64/libpthread-2.28.so -7f01b8e19000-7f01b8e1d000 rw-p 00000000 00:00 0 -7f01b8e1d000-7f01b8e33000 r-xp 00000000 08:01 3155650 /usr/lib64/libz.so.1.2.11 -7f01b8e33000-7f01b9032000 ---p 00016000 08:01 3155650 /usr/lib64/libz.so.1.2.11 -7f01b9032000-7f01b9033000 r--p 00015000 08:01 3155650 /usr/lib64/libz.so.1.2.11 -7f01b9033000-7f01b9034000 rw-p 00000000 00:00 0 -7f01b9034000-7f01b905d000 r-xp 00000000 08:01 3155395 /usr/lib64/ld-2.28.so -7f01b9061000-7f01b9072000 r-xp 00000000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so -7f01b9072000-7f01b9073000 ---p 00011000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so -7f01b9073000-7f01b9074000 r--p 00011000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so -7f01b9074000-7f01b9075000 rw-p 00012000 08:01 3160976 /usr/java/openjdk-14/lib/libnio.so -7f01b9075000-7f01b9076000 r--p 00000000 08:01 3154699 /usr/lib/locale/C.utf8/LC_NUMERIC -7f01b9076000-7f01b9077000 r--p 00000000 08:01 3154702 /usr/lib/locale/C.utf8/LC_TIME -7f01b9077000-7f01b9078000 r--p 00000000 08:01 3154697 /usr/lib/locale/C.utf8/LC_MONETARY -7f01b9078000-7f01b9079000 r--p 00000000 08:01 3154696 /usr/lib/locale/C.utf8/LC_MESSAGES/SYS_LC_MESSAGES -7f01b9079000-7f01b907a000 r--p 00000000 08:01 3154700 /usr/lib/locale/C.utf8/LC_PAPER -7f01b907a000-7f01b907b000 r--p 00000000 08:01 3154698 /usr/lib/locale/C.utf8/LC_NAME -7f01b907b000-7f01b907c000 r--p 00000000 08:01 3154690 /usr/lib/locale/C.utf8/LC_ADDRESS -7f01b907c000-7f01b907d000 r--p 00000000 08:01 3154701 /usr/lib/locale/C.utf8/LC_TELEPHONE -7f01b907d000-7f01b907e000 r--p 00000000 08:01 3154694 /usr/lib/locale/C.utf8/LC_MEASUREMENT -7f01b907e000-7f01b9085000 r--s 00000000 08:01 3155357 /usr/lib64/gconv/gconv-modules.cache -7f01b9085000-7f01b9086000 r--p 00000000 08:01 3154693 /usr/lib/locale/C.utf8/LC_IDENTIFICATION -7f01b9086000-7f01b90a0000 r--p 00000000 08:01 3154703 /usr/lib/locale/locale-archive -7f01b90a0000-7f01b90e6000 rw-p 00000000 00:00 0 -7f01b90e6000-7f01b90ed000 ---p 00000000 00:00 0 -7f01b90ed000-7f01b90f4000 r-xp 00000000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so -7f01b90f4000-7f01b90f5000 r--p 00006000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so -7f01b90f5000-7f01b90f6000 rw-p 00007000 08:01 3160984 /usr/java/openjdk-14/lib/libzip.so -7f01b90f6000-7f01b911a000 r-xp 00000000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so -7f01b911a000-7f01b911b000 r--p 00023000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so -7f01b911b000-7f01b911d000 rw-p 00024000 08:01 3160962 /usr/java/openjdk-14/lib/libjava.so -7f01b911d000-7f01b9125000 rw-s 00000000 08:01 3163742 /tmp/hsperfdata_root/98 -7f01b9125000-7f01b9140000 r-xp 00000000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so -7f01b9140000-7f01b9142000 r--p 0001a000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so -7f01b9142000-7f01b9143000 rw-p 0001c000 08:01 3160966 /usr/java/openjdk-14/lib/libjimage.so -7f01b9143000-7f01b9147000 ---p 00000000 00:00 0 -7f01b9147000-7f01b9246000 rw-p 00000000 00:00 0 -7f01b9246000-7f01b9254000 r-xp 00000000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so -7f01b9254000-7f01b9255000 ---p 0000e000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so -7f01b9255000-7f01b9256000 r--p 0000e000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so -7f01b9256000-7f01b9257000 rw-p 0000f000 08:01 3160967 /usr/java/openjdk-14/lib/libjli.so -7f01b9257000-7f01b9259000 rw-p 00000000 00:00 0 -7f01b9259000-7f01b925a000 ---p 00000000 00:00 0 -7f01b925a000-7f01b925b000 r--p 00000000 00:00 0 -7f01b925b000-7f01b925c000 ---p 00000000 00:00 0 -7f01b925c000-7f01b925d000 r--p 00028000 08:01 3155395 /usr/lib64/ld-2.28.so -7f01b925d000-7f01b925e000 rw-p 00029000 08:01 3155395 /usr/lib64/ld-2.28.so -7f01b925e000-7f01b925f000 rw-p 00000000 00:00 0 -7fff92d75000-7fff92d96000 rw-p 00000000 00:00 0 [stack] -7fff92da2000-7fff92da5000 r--p 00000000 00:00 0 [vvar] -7fff92da5000-7fff92da7000 r-xp 00000000 00:00 0 [vdso] -ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] - - -VM Arguments: -java_command: /project/java-native/target/surefire/surefirebooter255261521587421006.jar /project/java-native/target/surefire 2020-10-01T00-29-55_633-jvmRun3 surefire15563279322398545368tmp surefire_13579138375161683305tmp -java_class_path (initial): /project/java-native/target/surefire/surefirebooter255261521587421006.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 2 {product} {ergonomic} - size_t InitialHeapSize = 33554432 {product} {ergonomic} - size_t MaxHeapSize = 524288000 {product} {ergonomic} - size_t MaxNewSize = 174718976 {product} {ergonomic} - size_t MinHeapDeltaBytes = 196608 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - size_t NewSize = 11141120 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5826188 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122916026 {pd product} {ergonomic} - size_t OldSize = 22413312 {product} {ergonomic} - uintx ProfiledCodeHeapSize = 122916026 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 524288000 {manageable} {ergonomic} - bool UseCompressedClassPointers = true {lp64_product} {ergonomic} - bool UseCompressedOops = true {lp64_product} {ergonomic} - bool UseSerialGC = true {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags - #1: stderr all=off uptime,level,tags - -Environment Variables: -JAVA_HOME=/usr/java/openjdk-14 -PATH=/usr/java/openjdk-14/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - -Signal Handlers: -SIGSEGV: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGBUS: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGFPE: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGPIPE: [libjvm.so+0xb1bca0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGXFSZ: [libjvm.so+0xb1bca0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGILL: [libjvm.so+0xd30e60], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGUSR2: [libjvm.so+0xb1bb30], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO -SIGHUP: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGINT: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGTERM: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO -SIGQUIT: [libjvm.so+0xb1c2a0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO - - ---------------- S Y S T E M --------------- - -OS:Oracle Linux Server release 8.2 -uname:Linux 4.14.154-boot2docker #1 SMP Thu Nov 14 19:19:08 UTC 2019 x86_64 -OS uptime: 0 days 14:09 hours -libc:glibc 2.28 NPTL 2.28 -rlimit: STACK 8192k, CORE infinity, NPROC infinity, NOFILE 1048576, AS infinity, DATA infinity, FSIZE infinity -load average:3.31 1.71 0.93 - -/proc/meminfo: -MemTotal: 2045412 kB -MemFree: 1093300 kB -MemAvailable: 1371360 kB -Buffers: 84560 kB -Cached: 472628 kB -SwapCached: 0 kB -Active: 588744 kB -Inactive: 294936 kB -Active(anon): 402104 kB -Inactive(anon): 198736 kB -Active(file): 186640 kB -Inactive(file): 96200 kB -Unevictable: 0 kB -Mlocked: 0 kB -SwapTotal: 1415172 kB -SwapFree: 1415172 kB -Dirty: 676 kB -Writeback: 0 kB -AnonPages: 326512 kB -Mapped: 116960 kB -Shmem: 290620 kB -Slab: 42612 kB -SReclaimable: 27604 kB -SUnreclaim: 15008 kB -KernelStack: 4640 kB -PageTables: 2556 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -WritebackTmp: 0 kB -CommitLimit: 2437876 kB -Committed_AS: 1765096 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 0 kB -VmallocChunk: 0 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -HugePages_Surp: 0 -Hugepagesize: 2048 kB -DirectMap4k: 44992 kB -DirectMap2M: 2052096 kB - - -/proc/sys/kernel/threads-max (system-wide limit on the number of threads): -15537 - - -/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have): -65530 - - -/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers): -32768 - - - -container (cgroup) information: -container_type: cgroupv1 -cpu_cpuset_cpus: 0 -cpu_memory_nodes: 0 -active_processor_count: 1 -cpu_quota: no quota -cpu_period: 100000 -cpu_shares: no shares -memory_limit_in_bytes: unlimited -memory_and_swap_limit_in_bytes: unlimited -memory_soft_limit_in_bytes: unlimited -memory_usage_in_bytes: 348696576 -memory_max_usage_in_bytes: 387022848 - -KVM virtualization detected -Steal ticks since vm start: 0 -Steal ticks percentage since vm start: 0.000 - -CPU:total 1 (initial active 1) (1 cores per cpu, 1 threads per core) family 6 model 69 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, lzcnt, tsc, tscinvbit -CPU Model and flags from /proc/cpuinfo: -model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase avx2 invpcid md_clear flush_l1d - -Memory: 4k page, physical 2045412k(1093300k free), swap 1415172k(1415172k free) - -vm_info: OpenJDK 64-Bit Server VM (14.0.2+12-46) for linux-amd64 JRE (14.0.2+12-46), built on Jul 8 2020 23:30:21 by "mach5one" with gcc 8.3.0 - -END. From 3dddb550b63ab5725ad0ac0d588dd7f55bb87772 Mon Sep 17 00:00:00 2001 From: psevestre Date: Thu, 1 Oct 2020 17:13:15 -0300 Subject: [PATCH 053/302] [BAEL-4204] JNA (#10113) * [BAEL-4203] JNA * [BAEL-4203] JNA --- {jni => java-native}/README.md | 0 java-native/pom.xml | 39 +++++++++++++++ .../com_baeldung_jni_ExampleObjectsJNI.cpp | 0 .../cpp/com_baeldung_jni_ExampleObjectsJNI.h | 0 .../com_baeldung_jni_ExampleParametersJNI.cpp | 0 .../com_baeldung_jni_ExampleParametersJNI.h | 0 .../cpp/com_baeldung_jni_HelloWorldJNI.cpp | 0 .../main/cpp/com_baeldung_jni_HelloWorldJNI.h | 0 .../src/main/cpp/generateNativeLib.bat | 0 .../src/main/cpp/generateNativeLib.sh | 0 .../src/main/cpp/generateNativeLibMac.sh | 0 .../src/main/java/com/baeldung/jna/CMath.java | 10 ++++ .../src/main/java/com/baeldung/jna/Main.java | 8 +++ .../main/java/com/baeldung/jna/NativeFS.java | 46 +++++++++++++++++ .../src/main/java/com/baeldung/jna/StdC.java | 17 +++++++ .../com/baeldung/jni/ExampleObjectsJNI.java | 0 .../baeldung/jni/ExampleParametersJNI.java | 0 .../java/com/baeldung/jni/HelloWorldJNI.java | 0 .../main/java/com/baeldung/jni/UserData.java | 0 .../src/main/resources/logback.xml | 0 .../java/com/baeldung/jna/CMathUnitTest.java | 18 +++++++ .../com/baeldung/jna/NativeFSUnitTest.java | 38 ++++++++++++++ .../java/com/baeldung/jna/StdCUnitTest.java | 47 ++++++++++++++++++ .../com/baeldung/jni/JNINativeManualTest.java | 0 jni/native/linux_x86_64/libnative.so | Bin 19856 -> 0 bytes jni/native/macos/libnative.dylib | Bin 23056 -> 0 bytes jni/pom.xml | 14 ------ pom.xml | 4 +- 28 files changed, 225 insertions(+), 16 deletions(-) rename {jni => java-native}/README.md (100%) create mode 100644 java-native/pom.xml rename {jni => java-native}/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp (100%) rename {jni => java-native}/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h (100%) rename {jni => java-native}/src/main/cpp/generateNativeLib.bat (100%) rename {jni => java-native}/src/main/cpp/generateNativeLib.sh (100%) mode change 100755 => 100644 rename {jni => java-native}/src/main/cpp/generateNativeLibMac.sh (100%) mode change 100755 => 100644 create mode 100644 java-native/src/main/java/com/baeldung/jna/CMath.java create mode 100644 java-native/src/main/java/com/baeldung/jna/Main.java create mode 100644 java-native/src/main/java/com/baeldung/jna/NativeFS.java create mode 100644 java-native/src/main/java/com/baeldung/jna/StdC.java rename {jni => java-native}/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java (100%) rename {jni => java-native}/src/main/java/com/baeldung/jni/ExampleParametersJNI.java (100%) rename {jni => java-native}/src/main/java/com/baeldung/jni/HelloWorldJNI.java (100%) rename {jni => java-native}/src/main/java/com/baeldung/jni/UserData.java (100%) rename {jni => java-native}/src/main/resources/logback.xml (100%) create mode 100644 java-native/src/test/java/com/baeldung/jna/CMathUnitTest.java create mode 100644 java-native/src/test/java/com/baeldung/jna/NativeFSUnitTest.java create mode 100644 java-native/src/test/java/com/baeldung/jna/StdCUnitTest.java rename {jni => java-native}/src/test/java/com/baeldung/jni/JNINativeManualTest.java (100%) delete mode 100755 jni/native/linux_x86_64/libnative.so delete mode 100755 jni/native/macos/libnative.dylib delete mode 100644 jni/pom.xml diff --git a/jni/README.md b/java-native/README.md similarity index 100% rename from jni/README.md rename to java-native/README.md diff --git a/java-native/pom.xml b/java-native/pom.xml new file mode 100644 index 0000000000..29fc13b8d8 --- /dev/null +++ b/java-native/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + java-native + java-native + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + 5.6.0 + + + + + net.java.dev.jna + jna-platform + ${jna.version} + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + false + + + + + \ No newline at end of file diff --git a/jni/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp b/java-native/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp rename to java-native/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.cpp diff --git a/jni/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h b/java-native/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h rename to java-native/src/main/cpp/com_baeldung_jni_ExampleObjectsJNI.h diff --git a/jni/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp b/java-native/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp rename to java-native/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.cpp diff --git a/jni/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h b/java-native/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h rename to java-native/src/main/cpp/com_baeldung_jni_ExampleParametersJNI.h diff --git a/jni/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp b/java-native/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp rename to java-native/src/main/cpp/com_baeldung_jni_HelloWorldJNI.cpp diff --git a/jni/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h b/java-native/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h similarity index 100% rename from jni/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h rename to java-native/src/main/cpp/com_baeldung_jni_HelloWorldJNI.h diff --git a/jni/src/main/cpp/generateNativeLib.bat b/java-native/src/main/cpp/generateNativeLib.bat similarity index 100% rename from jni/src/main/cpp/generateNativeLib.bat rename to java-native/src/main/cpp/generateNativeLib.bat diff --git a/jni/src/main/cpp/generateNativeLib.sh b/java-native/src/main/cpp/generateNativeLib.sh old mode 100755 new mode 100644 similarity index 100% rename from jni/src/main/cpp/generateNativeLib.sh rename to java-native/src/main/cpp/generateNativeLib.sh diff --git a/jni/src/main/cpp/generateNativeLibMac.sh b/java-native/src/main/cpp/generateNativeLibMac.sh old mode 100755 new mode 100644 similarity index 100% rename from jni/src/main/cpp/generateNativeLibMac.sh rename to java-native/src/main/cpp/generateNativeLibMac.sh diff --git a/java-native/src/main/java/com/baeldung/jna/CMath.java b/java-native/src/main/java/com/baeldung/jna/CMath.java new file mode 100644 index 0000000000..3ab5bdf48b --- /dev/null +++ b/java-native/src/main/java/com/baeldung/jna/CMath.java @@ -0,0 +1,10 @@ +package com.baeldung.jna; + +import com.sun.jna.Library; +import com.sun.jna.Native; +import com.sun.jna.Platform; + +public interface CMath extends Library { + CMath INSTANCE = Native.load(Platform.isWindows() ? "msvcrt" : "c", CMath.class); + double cosh(double value); +} diff --git a/java-native/src/main/java/com/baeldung/jna/Main.java b/java-native/src/main/java/com/baeldung/jna/Main.java new file mode 100644 index 0000000000..a81c878cde --- /dev/null +++ b/java-native/src/main/java/com/baeldung/jna/Main.java @@ -0,0 +1,8 @@ +package com.baeldung.jna; + +public class Main { + + public static void main(String[] args) { + + } +} \ No newline at end of file diff --git a/java-native/src/main/java/com/baeldung/jna/NativeFS.java b/java-native/src/main/java/com/baeldung/jna/NativeFS.java new file mode 100644 index 0000000000..58f2bda035 --- /dev/null +++ b/java-native/src/main/java/com/baeldung/jna/NativeFS.java @@ -0,0 +1,46 @@ +package com.baeldung.jna; + +import java.util.Collections; +import java.util.Map; + +import com.sun.jna.FunctionMapper; +import com.sun.jna.LastErrorException; +import com.sun.jna.Library; +import com.sun.jna.Native; +import com.sun.jna.NativeLong; +import com.sun.jna.Platform; +import com.sun.jna.Structure; +import com.sun.jna.Structure.FieldOrder; + +public interface NativeFS extends Library { + + FunctionMapper mapper = (library,method) -> { + if (Platform.isWindows()) { + return "_" + method.getName(); + } + else { + return "__x" + method.getName(); // On Linux, stat is actually _xstat + } + }; + + public NativeFS INSTANCE = Native.load(Platform.isWindows() ? "msvcrt" : "c", + NativeFS.class, + Collections.singletonMap(Library.OPTION_FUNCTION_MAPPER, mapper)); + + int stat(String path, Stat stat) throws LastErrorException; + + @FieldOrder({"st_dev","st_ino","st_mode","st_nlink","st_uid","st_gid","st_rdev","st_size","st_atime","st_mtime","st_ctime"}) + public class Stat extends Structure { + public int st_dev; + public int st_ino; + public short st_mode; + public short st_nlink; + public short st_uid; + public short st_gid; + public int st_rdev; + public NativeLong st_size; + public NativeLong st_atime; + public NativeLong st_mtime; + public NativeLong st_ctime; + } +} diff --git a/java-native/src/main/java/com/baeldung/jna/StdC.java b/java-native/src/main/java/com/baeldung/jna/StdC.java new file mode 100644 index 0000000000..1adbe684c4 --- /dev/null +++ b/java-native/src/main/java/com/baeldung/jna/StdC.java @@ -0,0 +1,17 @@ +package com.baeldung.jna; + +import com.sun.jna.LastErrorException; +import com.sun.jna.Library; +import com.sun.jna.Native; +import com.sun.jna.Platform; +import com.sun.jna.Pointer; + +public interface StdC extends Library { + StdC INSTANCE = Native.load(Platform.isWindows() ? "msvcrt" : "c", StdC.class ); + Pointer malloc(long n); + void free(Pointer p); + Pointer memset(Pointer p, int c, long n); + int open(String path, int flags) throws LastErrorException; + int close(int fd) throws LastErrorException; +} + diff --git a/jni/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java b/java-native/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java similarity index 100% rename from jni/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java rename to java-native/src/main/java/com/baeldung/jni/ExampleObjectsJNI.java diff --git a/jni/src/main/java/com/baeldung/jni/ExampleParametersJNI.java b/java-native/src/main/java/com/baeldung/jni/ExampleParametersJNI.java similarity index 100% rename from jni/src/main/java/com/baeldung/jni/ExampleParametersJNI.java rename to java-native/src/main/java/com/baeldung/jni/ExampleParametersJNI.java diff --git a/jni/src/main/java/com/baeldung/jni/HelloWorldJNI.java b/java-native/src/main/java/com/baeldung/jni/HelloWorldJNI.java similarity index 100% rename from jni/src/main/java/com/baeldung/jni/HelloWorldJNI.java rename to java-native/src/main/java/com/baeldung/jni/HelloWorldJNI.java diff --git a/jni/src/main/java/com/baeldung/jni/UserData.java b/java-native/src/main/java/com/baeldung/jni/UserData.java similarity index 100% rename from jni/src/main/java/com/baeldung/jni/UserData.java rename to java-native/src/main/java/com/baeldung/jni/UserData.java diff --git a/jni/src/main/resources/logback.xml b/java-native/src/main/resources/logback.xml similarity index 100% rename from jni/src/main/resources/logback.xml rename to java-native/src/main/resources/logback.xml diff --git a/java-native/src/test/java/com/baeldung/jna/CMathUnitTest.java b/java-native/src/test/java/com/baeldung/jna/CMathUnitTest.java new file mode 100644 index 0000000000..a9cc6ed1c4 --- /dev/null +++ b/java-native/src/test/java/com/baeldung/jna/CMathUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.jna; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import com.sun.jna.Native; +import com.sun.jna.Platform; + +class CMathUnitTest { + @Test + void whenCallNative_thenSuccess() { + CMath lib = Native.load(Platform.isWindows() ? "msvcrt" : "c", CMath.class); + double result = lib.cosh(0); + assertEquals(1.0,result); + } + +} diff --git a/java-native/src/test/java/com/baeldung/jna/NativeFSUnitTest.java b/java-native/src/test/java/com/baeldung/jna/NativeFSUnitTest.java new file mode 100644 index 0000000000..d296f9e2ca --- /dev/null +++ b/java-native/src/test/java/com/baeldung/jna/NativeFSUnitTest.java @@ -0,0 +1,38 @@ +package com.baeldung.jna; + +import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +import org.junit.jupiter.api.Test; + +import com.baeldung.jna.NativeFS.Stat; +import com.sun.jna.LastErrorException; +import com.sun.jna.Platform; + +public class NativeFSUnitTest { + + + @Test + public void whenCallNative_thenSuccess() throws IOException { + NativeFS lib = NativeFS.INSTANCE; + + File f = Files.createTempFile("junit", ".bin").toFile(); + f.deleteOnExit(); + Stat stat = new Stat(); + try { + if (Platform.isWindows()) { + int rc = lib.stat(f.getAbsolutePath(), stat); + assertEquals(0, rc); + assertEquals(0,stat.st_size.longValue()); + } + } + catch(LastErrorException error) { + fail("stat failed: error code=" + error.getErrorCode()); + } + + } +} diff --git a/java-native/src/test/java/com/baeldung/jna/StdCUnitTest.java b/java-native/src/test/java/com/baeldung/jna/StdCUnitTest.java new file mode 100644 index 0000000000..c536fd63d5 --- /dev/null +++ b/java-native/src/test/java/com/baeldung/jna/StdCUnitTest.java @@ -0,0 +1,47 @@ +package com.baeldung.jna; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.BeforeClass; +import org.junit.jupiter.api.Test; + +import com.sun.jna.Native; +import com.sun.jna.Platform; +import com.sun.jna.Pointer; + +class StdCUnitTest { + + @BeforeClass + public static void setupProtectedMode() { + Native.setProtected(true); + } + + @Test + public void whenMalloc_thenSuccess() { + StdC lib = StdC.INSTANCE; + Pointer p = lib.malloc(1024); + p.setMemory(0l, 1024l, (byte) 0); + lib.free(p); + } + + @Test + public void whenAccessViolation_thenShouldThrowError() { + // Running this test on Linux requires additional setup using libjsig.so + // Details here: http://java-native-access.github.io/jna/5.6.0/javadoc/overview-summary.html#crash-protection + // IMPORTANT NOTICE: Code for illustration purposes only. DON'T DO THIS IN YOUR OWN CODE + if ( Platform.isWindows()) { + Error e = null; + Pointer p = new Pointer(0l); + + try { + p.setMemory(0, 100*1024, (byte) 0); + } + catch(Error err) { + e = err; + } + + assertNotNull(e, "Should throw Error"); + } + } + +} diff --git a/jni/src/test/java/com/baeldung/jni/JNINativeManualTest.java b/java-native/src/test/java/com/baeldung/jni/JNINativeManualTest.java similarity index 100% rename from jni/src/test/java/com/baeldung/jni/JNINativeManualTest.java rename to java-native/src/test/java/com/baeldung/jni/JNINativeManualTest.java diff --git a/jni/native/linux_x86_64/libnative.so b/jni/native/linux_x86_64/libnative.so deleted file mode 100755 index 213491e2688a87bdecd1fea411e578149f8e3f32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19856 zcmeHPe|%h3mA{iTZD>Oipe?0E7_fzg$~4m^ZD_ZWHkt5Jk`nSmBT!!_Gm~UOG81Rs zl(bq6hOmTe+Afvf)8NW(q2~8zDz_o@y$Qj7_pU zr*>(i20&6!R)^PZ5$M!h*KKcQ8(x|}G=0_6PrkY3&-1!mOJ90ppX*AJI}g{zxJb=B zTzAZ=>Yh`0|2gx|ec*=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IGzw~L8fm{cA9E=-Vre9Te(kq*eY z4zBp{o?~(K57xzz59;d@LLPZ!*{``=tRp9IQ5a_4FX^`na$GHLh;IDBtn$Mee>k&T zJmU}L#UI*vOfDyaakQI#e - - 4.0.0 - jni - jni - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index ab1c47361c..ac1a16a728 100644 --- a/pom.xml +++ b/pom.xml @@ -465,7 +465,7 @@ jjwt jmeter jmh - jni + java-native jooby jsf json @@ -1501,4 +1501,4 @@ 1.4.197 - \ No newline at end of file + From 76676ebfd86baa9960c2bb08d8547936de6fe8bc Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:05:41 +0800 Subject: [PATCH 054/302] Update README.md --- core-java-modules/core-java-collections-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-collections-3/README.md b/core-java-modules/core-java-collections-3/README.md index c80e493767..e21e3642f9 100644 --- a/core-java-modules/core-java-collections-3/README.md +++ b/core-java-modules/core-java-collections-3/README.md @@ -13,3 +13,4 @@ - [Quick Guide to the Java Stack](https://www.baeldung.com/java-stack) - [Convert an Array of Primitives to a List](https://www.baeldung.com/java-primitive-array-to-list) - [A Guide to BitSet in Java](https://www.baeldung.com/java-bitset) +- [Get the First Key and Value From a HashMap](https://www.baeldung.com/java-hashmap-get-first-entry) From ffe826a6b6123c16b0a7c2ce08a95e77c4d116f2 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:07:19 +0800 Subject: [PATCH 055/302] Update README.md --- spring-boot-modules/spring-boot-mvc-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-modules/spring-boot-mvc-3/README.md b/spring-boot-modules/spring-boot-mvc-3/README.md index 796ab72425..bc3eb9e496 100644 --- a/spring-boot-modules/spring-boot-mvc-3/README.md +++ b/spring-boot-modules/spring-boot-mvc-3/README.md @@ -8,4 +8,5 @@ This module contains articles about Spring Web MVC in Spring Boot projects. - [Download an Image or a File with Spring MVC](https://www.baeldung.com/spring-controller-return-image-file) - [Spring MVC Async vs Spring WebFlux](https://www.baeldung.com/spring-mvc-async-vs-webflux) - [Differences in @Valid and @Validated Annotations in Spring](https://www.baeldung.com/spring-valid-vs-validated) +- [CharacterEncodingFilter In SpringBoot](https://www.baeldung.com/spring-boot-characterencodingfilter) - More articles: [[prev -->]](/spring-boot-modules/spring-boot-mvc-2) From cfdbef76ba47f959a9848abfd03636664d5a3484 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:09:22 +0800 Subject: [PATCH 056/302] Update README.md --- core-java-modules/core-java-security-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-security-2/README.md b/core-java-modules/core-java-security-2/README.md index ba8cce46a0..11f0a34fa9 100644 --- a/core-java-modules/core-java-security-2/README.md +++ b/core-java-modules/core-java-security-2/README.md @@ -10,4 +10,5 @@ This module contains articles about core Java Security - [SHA-256 and SHA3-256 Hashing in Java](https://www.baeldung.com/sha-256-hashing-java) - [Checksums in Java](https://www.baeldung.com/java-checksums) - [How to Read PEM File to Get Public and Private Keys](https://www.baeldung.com/java-read-pem-file-keys) +- [Listing the Available Cipher Algorithms](https://www.baeldung.com/java-list-cipher-algorithms) - More articles: [[<-- prev]](/core-java-modules/core-java-security) From 92b4aba6b4c407f8843082d2b6fa56e8ca5dea54 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:13:08 +0800 Subject: [PATCH 057/302] Create README.md --- gradle/gradle-wrapper/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 gradle/gradle-wrapper/README.md diff --git a/gradle/gradle-wrapper/README.md b/gradle/gradle-wrapper/README.md new file mode 100644 index 0000000000..972ced46c8 --- /dev/null +++ b/gradle/gradle-wrapper/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Guide to the Gradle Wrapper](https://www.baeldung.com/gradle-wrapper) From 5bae06c7ff4319dcfd3e53d46e85e497a810ead5 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:15:04 +0800 Subject: [PATCH 058/302] Update README.md --- httpclient-2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpclient-2/README.md b/httpclient-2/README.md index 52d8b8fcff..dc0fb553b6 100644 --- a/httpclient-2/README.md +++ b/httpclient-2/README.md @@ -8,5 +8,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [How to Set TLS Version in Apache HttpClient](https://www.baeldung.com/TODO) +- [How to Set TLS Version in Apache HttpClient](https://www.baeldung.com/apache-httpclient-tls) - More articles: [[<-- prev]](../httpclient) From 39c0a4fa84e2a16da1e3580fa98a3c3a7ce599f1 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:16:46 +0800 Subject: [PATCH 059/302] Update README.md --- core-java-modules/core-java-io-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-io-3/README.md b/core-java-modules/core-java-io-3/README.md index 4b1a14ab3e..18caabc784 100644 --- a/core-java-modules/core-java-io-3/README.md +++ b/core-java-modules/core-java-io-3/README.md @@ -11,4 +11,5 @@ This module contains articles about core Java input and output (IO) - [Java Files Open Options](https://www.baeldung.com/java-file-options) - [Creating Temporary Directories in Java](https://www.baeldung.com/java-temp-directories) - [Reading a Line at a Given Line Number From a File in Java](https://www.baeldung.com/java-read-line-at-number) +- [Find the Last Modified File in a Directory with Java](https://www.baeldung.com/java-last-modified-file) - [[<-- Prev]](/core-java-modules/core-java-io-2) From f77d8a6b4e0315171c6ad89828a5f7d6e8ed2534 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:19:45 +0800 Subject: [PATCH 060/302] Update README.md --- core-java-modules/core-java-lang-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-lang-3/README.md b/core-java-modules/core-java-lang-3/README.md index 121d30f20f..598014bb92 100644 --- a/core-java-modules/core-java-lang-3/README.md +++ b/core-java-modules/core-java-lang-3/README.md @@ -6,4 +6,5 @@ This module contains articles about core features in the Java language - [Converting a Java String Into a Boolean](https://www.baeldung.com/java-string-to-boolean) - [When are Static Variables Initialized in Java?](https://www.baeldung.com/java-static-variables-initialization) - [Checking if a Class Exists in Java](https://www.baeldung.com/java-check-class-exists) +- [The Difference Between a.getClass() and A.class in Java](https://www.baeldung.com/java-getclass-vs-class) - [[<-- Prev]](/core-java-modules/core-java-lang-2) From d0f0e197e401325b595a6d3dc3c06cd9b29ee2e9 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:22:31 +0800 Subject: [PATCH 061/302] Update README.md --- algorithms-miscellaneous-6/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/algorithms-miscellaneous-6/README.md b/algorithms-miscellaneous-6/README.md index 6ddae75f43..e1841fced7 100644 --- a/algorithms-miscellaneous-6/README.md +++ b/algorithms-miscellaneous-6/README.md @@ -9,4 +9,5 @@ - [The Caesar Cipher in Java](https://www.baeldung.com/java-caesar-cipher) - [Implementing a 2048 Solver in Java](https://www.baeldung.com/2048-java-solver) - [Finding Top K Elements in an Array](https://www.baeldung.com/java-array-top-elements) +- [Reversing a Linked List in Java](https://www.baeldung.com/java-reverse-linked-list) - More articles: [[<-- prev]](/../algorithms-miscellaneous-5) From 511c0183cf0ba6e1226f1ad35dd24d691453f175 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:24:04 +0800 Subject: [PATCH 062/302] Update README.md --- spring-boot-modules/spring-boot-environment/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-environment/README.md b/spring-boot-modules/spring-boot-environment/README.md index e916c503bc..e7b0ace7a4 100644 --- a/spring-boot-modules/spring-boot-environment/README.md +++ b/spring-boot-modules/spring-boot-environment/README.md @@ -4,4 +4,5 @@ This module contains articles about configuring the Spring Boot `Environment` ### Relevant Articles: - [EnvironmentPostProcessor in Spring Boot](https://www.baeldung.com/spring-boot-environmentpostprocessor) - - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) \ No newline at end of file + - [Spring Properties File Outside jar](https://www.baeldung.com/spring-properties-file-outside-jar) + - [Get the Running Port in Spring Boot](https://www.baeldung.com/spring-boot-running-port) From c1c380094cca00b54d019e6cdaeb77bd98189828 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:26:20 +0800 Subject: [PATCH 063/302] Update README.md --- testing-modules/junit-4/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/testing-modules/junit-4/README.md b/testing-modules/junit-4/README.md index 6cc3981ed4..cf20c8da91 100644 --- a/testing-modules/junit-4/README.md +++ b/testing-modules/junit-4/README.md @@ -5,3 +5,4 @@ - [Introduction to JUnitParams](http://www.baeldung.com/junit-params) - [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java) - [Introduction to Lambda Behave](https://www.baeldung.com/lambda-behave) +- [Conditionally Run or Ignore Tests in JUnit 4](https://www.baeldung.com/junit-conditional-assume) From e9059bbb72c77664a14dbb7c42bc7b6608448ab9 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:29:42 +0800 Subject: [PATCH 064/302] Update README.md --- testing-modules/junit-5/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/testing-modules/junit-5/README.md b/testing-modules/junit-5/README.md index e62f2dd345..984b79c29d 100644 --- a/testing-modules/junit-5/README.md +++ b/testing-modules/junit-5/README.md @@ -7,3 +7,4 @@ - [Testing an Abstract Class With JUnit](https://www.baeldung.com/junit-test-abstract-class) - [Guide to Dynamic Tests in JUnit 5](https://www.baeldung.com/junit5-dynamic-tests) - [Determine the Execution Time of JUnit Tests](https://www.baeldung.com/junit-test-execution-time) +- [@BeforeAll and @AfterAll in Non-Static Methods](https://www.baeldung.com/java-beforeall-afterall-non-static) From c68b6f68b56e5fadb245054dd0726a372727f0a1 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:31:26 +0800 Subject: [PATCH 065/302] Update README.md --- core-java-modules/core-java-security-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-security-2/README.md b/core-java-modules/core-java-security-2/README.md index 11f0a34fa9..03a5a94acc 100644 --- a/core-java-modules/core-java-security-2/README.md +++ b/core-java-modules/core-java-security-2/README.md @@ -11,4 +11,5 @@ This module contains articles about core Java Security - [Checksums in Java](https://www.baeldung.com/java-checksums) - [How to Read PEM File to Get Public and Private Keys](https://www.baeldung.com/java-read-pem-file-keys) - [Listing the Available Cipher Algorithms](https://www.baeldung.com/java-list-cipher-algorithms) +- [Get a List of Trusted Certificates in Java](https://www.baeldung.com/java-list-trusted-certificates) - More articles: [[<-- prev]](/core-java-modules/core-java-security) From ea64a31131147d288046123a897e18cf71b407df Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:33:56 +0800 Subject: [PATCH 066/302] Update README.md --- httpclient-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/httpclient-2/README.md b/httpclient-2/README.md index dc0fb553b6..6fdd743fcc 100644 --- a/httpclient-2/README.md +++ b/httpclient-2/README.md @@ -9,4 +9,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: - [How to Set TLS Version in Apache HttpClient](https://www.baeldung.com/apache-httpclient-tls) +- [Reading an HTTP Response Body as a String in Java](https://www.baeldung.com/java-http-response-body-as-string) - More articles: [[<-- prev]](../httpclient) From 9ee2aee60f9f79584cb61301d9f8eab3ebe9de56 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:35:14 +0800 Subject: [PATCH 067/302] Update README.md --- httpclient-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/httpclient-2/README.md b/httpclient-2/README.md index 6fdd743fcc..9d7a9683cd 100644 --- a/httpclient-2/README.md +++ b/httpclient-2/README.md @@ -10,4 +10,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [How to Set TLS Version in Apache HttpClient](https://www.baeldung.com/apache-httpclient-tls) - [Reading an HTTP Response Body as a String in Java](https://www.baeldung.com/java-http-response-body-as-string) +- [How To Get Cookies From the Apache HttpClient Response](https://www.baeldung.com/java-apache-httpclient-cookies) - More articles: [[<-- prev]](../httpclient) From 99d35b68e37bf6adc1edf1bcc69df59011413193 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:36:59 +0800 Subject: [PATCH 068/302] Create README.md --- persistence-modules/jooq/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 persistence-modules/jooq/README.md diff --git a/persistence-modules/jooq/README.md b/persistence-modules/jooq/README.md new file mode 100644 index 0000000000..348baab50c --- /dev/null +++ b/persistence-modules/jooq/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Getting Started with jOOQ](https://www.baeldung.com/jooq-intro) From 67981e7cba0f746046088f3fd8e816fd1a131d7f Mon Sep 17 00:00:00 2001 From: Aaron Juarez Date: Fri, 2 Oct 2020 12:46:48 -0400 Subject: [PATCH 069/302] BAEL-3862: Spark differences DS, DF, RDD (#9976) --- apache-spark/data/Tourist.csv | 2247 +++++++++++++++++ .../dataframe/dataset/rdd/TouristData.java | 75 + .../differences/rdd/ActionsUnitTest.java | 67 + .../differences/rdd/DataFrameUnitTest.java | 74 + .../differences/rdd/DatasetUnitTest.java | 83 + .../rdd/TransformationsUnitTest.java | 63 + 6 files changed, 2609 insertions(+) create mode 100644 apache-spark/data/Tourist.csv create mode 100644 apache-spark/src/main/java/com/baeldung/differences/dataframe/dataset/rdd/TouristData.java create mode 100644 apache-spark/src/test/java/com/baeldung/differences/rdd/ActionsUnitTest.java create mode 100644 apache-spark/src/test/java/com/baeldung/differences/rdd/DataFrameUnitTest.java create mode 100644 apache-spark/src/test/java/com/baeldung/differences/rdd/DatasetUnitTest.java create mode 100644 apache-spark/src/test/java/com/baeldung/differences/rdd/TransformationsUnitTest.java diff --git a/apache-spark/data/Tourist.csv b/apache-spark/data/Tourist.csv new file mode 100644 index 0000000000..4970e8c2f0 --- /dev/null +++ b/apache-spark/data/Tourist.csv @@ -0,0 +1,2247 @@ +Region,Country,Year,Series,Series_Type,Series_Type_Footnote,Value,Footnotes,Source +4,Afghanistan,2010,Tourism expenditure (millions of US dollars),,,147.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +4,Afghanistan,2016,Tourism expenditure (millions of US dollars),,,62.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +4,Afghanistan,2017,Tourism expenditure (millions of US dollars),,,16.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +4,Afghanistan,2018,Tourism expenditure (millions of US dollars),,,50.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2010,Tourist/visitor arrivals (thousands),TF,,2191.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2016,Tourist/visitor arrivals (thousands),TF,,4070.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2017,Tourist/visitor arrivals (thousands),TF,,4643.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2018,Tourist/visitor arrivals (thousands),TF,,5340.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,1995,Tourism expenditure (millions of US dollars),,,70.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2005,Tourism expenditure (millions of US dollars),,,880.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2010,Tourism expenditure (millions of US dollars),,,1778.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2016,Tourism expenditure (millions of US dollars),,,1821.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2017,Tourism expenditure (millions of US dollars),,,2050.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +8,Albania,2018,Tourism expenditure (millions of US dollars),,,2306.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,1995,Tourist/visitor arrivals (thousands),VF,,520.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2005,Tourist/visitor arrivals (thousands),VF,,1443.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2010,Tourist/visitor arrivals (thousands),VF,,2070.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2016,Tourist/visitor arrivals (thousands),VF,,2039.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2017,Tourist/visitor arrivals (thousands),VF,,2451.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2018,Tourist/visitor arrivals (thousands),VF,,2657.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2005,Tourism expenditure (millions of US dollars),,,477.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2010,Tourism expenditure (millions of US dollars),,,324.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2016,Tourism expenditure (millions of US dollars),,,246.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +12,Algeria,2017,Tourism expenditure (millions of US dollars),,,172.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +16,American Samoa,1995,Tourist/visitor arrivals (thousands),TF,,34.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +16,American Samoa,2005,Tourist/visitor arrivals (thousands),TF,,24.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +16,American Samoa,2010,Tourist/visitor arrivals (thousands),TF,,23.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +16,American Samoa,2016,Tourist/visitor arrivals (thousands),TF,,20.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +16,American Samoa,2017,Tourist/visitor arrivals (thousands),TF,,20.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +16,American Samoa,2018,Tourist/visitor arrivals (thousands),TF,,20.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +16,American Samoa,2016,Tourism expenditure (millions of US dollars),,,22.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +16,American Samoa,2017,Tourism expenditure (millions of US dollars),,,22.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +20,Andorra,2005,Tourist/visitor arrivals (thousands),TF,,2418.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +20,Andorra,2010,Tourist/visitor arrivals (thousands),TF,,1808.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +20,Andorra,2016,Tourist/visitor arrivals (thousands),TF,,2819.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +20,Andorra,2017,Tourist/visitor arrivals (thousands),TF,,3003.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +20,Andorra,2018,Tourist/visitor arrivals (thousands),TF,,3042.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,1995,Tourist/visitor arrivals (thousands),TF,,9.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2005,Tourist/visitor arrivals (thousands),TF,,210.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2010,Tourist/visitor arrivals (thousands),TF,,425.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2016,Tourist/visitor arrivals (thousands),TF,,397.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2017,Tourist/visitor arrivals (thousands),TF,,261.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2018,Tourist/visitor arrivals (thousands),TF,,218.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,1995,Tourism expenditure (millions of US dollars),,,27.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2005,Tourism expenditure (millions of US dollars),,,103.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2010,Tourism expenditure (millions of US dollars),,,726.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2016,Tourism expenditure (millions of US dollars),,,628.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2017,Tourism expenditure (millions of US dollars),,,884.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +24,Angola,2018,Tourism expenditure (millions of US dollars),,,557.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,1995,Tourist/visitor arrivals (thousands),TF,,39.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2005,Tourist/visitor arrivals (thousands),TF,,62.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2010,Tourist/visitor arrivals (thousands),TF,,62.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2016,Tourist/visitor arrivals (thousands),TF,,79.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2017,Tourist/visitor arrivals (thousands),TF,,68.3000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2018,Tourist/visitor arrivals (thousands),TF,,55.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,1995,Tourism expenditure (millions of US dollars),,,50.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2005,Tourism expenditure (millions of US dollars),,,86.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2010,Tourism expenditure (millions of US dollars),,,99.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2016,Tourism expenditure (millions of US dollars),,,136.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2017,Tourism expenditure (millions of US dollars),,,141.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +660,Anguilla,2018,Tourism expenditure (millions of US dollars),,,102.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,1995,Tourist/visitor arrivals (thousands),TF,,220.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2005,Tourist/visitor arrivals (thousands),TF,,245.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2010,Tourist/visitor arrivals (thousands),TF,,230.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2016,Tourist/visitor arrivals (thousands),TF,,265.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2017,Tourist/visitor arrivals (thousands),TF,,247.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2018,Tourist/visitor arrivals (thousands),TF,,269.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,1995,Tourism expenditure (millions of US dollars),,,247.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2005,Tourism expenditure (millions of US dollars),,,309.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2010,Tourism expenditure (millions of US dollars),,,298.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2016,Tourism expenditure (millions of US dollars),,,753.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2017,Tourism expenditure (millions of US dollars),,,737.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +28,Antigua and Barbuda,2018,Tourism expenditure (millions of US dollars),,,881.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,1995,Tourist/visitor arrivals (thousands),TF,,2289.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2005,Tourist/visitor arrivals (thousands),TF,,3823.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2010,Tourist/visitor arrivals (thousands),TF,,6800.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2016,Tourist/visitor arrivals (thousands),TF,,6668.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2017,Tourist/visitor arrivals (thousands),TF,,6711.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2018,Tourist/visitor arrivals (thousands),TF,,6942.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,1995,Tourism expenditure (millions of US dollars),,,2550.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2005,Tourism expenditure (millions of US dollars),,,3209.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2010,Tourism expenditure (millions of US dollars),,,5605.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2016,Tourism expenditure (millions of US dollars),,,5466.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2017,Tourism expenditure (millions of US dollars),,,5835.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +32,Argentina,2018,Tourism expenditure (millions of US dollars),,,5999.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,1995,Tourist/visitor arrivals (thousands),TF,,12.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2005,Tourist/visitor arrivals (thousands),TF,,319.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2010,Tourist/visitor arrivals (thousands),TF,,684.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2016,Tourist/visitor arrivals (thousands),TF,,1260.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2017,Tourist/visitor arrivals (thousands),TF,,1495.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2018,Tourist/visitor arrivals (thousands),TF,,1652.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,1995,Tourism expenditure (millions of US dollars),,,14.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2005,Tourism expenditure (millions of US dollars),,,243.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2010,Tourism expenditure (millions of US dollars),,,694.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2016,Tourism expenditure (millions of US dollars),,,988.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2017,Tourism expenditure (millions of US dollars),,,1140.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +51,Armenia,2018,Tourism expenditure (millions of US dollars),,,1237.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,1995,Tourist/visitor arrivals (thousands),TF,,619.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2005,Tourist/visitor arrivals (thousands),TF,,733.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2010,Tourist/visitor arrivals (thousands),TF,,824.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2016,Tourist/visitor arrivals (thousands),TF,,1102.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2017,Tourist/visitor arrivals (thousands),TF,,1070.5000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2018,Tourist/visitor arrivals (thousands),TF,,1082.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,1995,Tourism expenditure (millions of US dollars),,,554.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2005,Tourism expenditure (millions of US dollars),,,1097.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2010,Tourism expenditure (millions of US dollars),,,1254.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2016,Tourism expenditure (millions of US dollars),,,1764.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2017,Tourism expenditure (millions of US dollars),,,1857.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +533,Aruba,2018,Tourism expenditure (millions of US dollars),,,2024.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,1995,Tourist/visitor arrivals (thousands),VF,,3726.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2005,Tourist/visitor arrivals (thousands),VF,,5499.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2010,Tourist/visitor arrivals (thousands),VF,,5790.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2016,Tourist/visitor arrivals (thousands),VF,,8269.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2017,Tourist/visitor arrivals (thousands),VF,,8815.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2018,Tourist/visitor arrivals (thousands),VF,,9246.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,1995,Tourism expenditure (millions of US dollars),,,10370.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2005,Tourism expenditure (millions of US dollars),,,19719.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2010,Tourism expenditure (millions of US dollars),,,31064.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2016,Tourism expenditure (millions of US dollars),,,39059.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2017,Tourism expenditure (millions of US dollars),,,43975.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +36,Australia,2018,Tourism expenditure (millions of US dollars),,,47327.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,1995,Tourist/visitor arrivals (thousands),TCE,,17173.0000,Only paid accommodation; excluding stays at friends and relatives and second homes.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2005,Tourist/visitor arrivals (thousands),TCE,,19952.0000,Only paid accommodation; excluding stays at friends and relatives and second homes.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2010,Tourist/visitor arrivals (thousands),TCE,,22004.0000,Only paid accommodation; excluding stays at friends and relatives and second homes.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2016,Tourist/visitor arrivals (thousands),TCE,,28121.0000,Only paid accommodation; excluding stays at friends and relatives and second homes.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2017,Tourist/visitor arrivals (thousands),TCE,,29460.0000,Only paid accommodation; excluding stays at friends and relatives and second homes.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2018,Tourist/visitor arrivals (thousands),TCE,,30816.0000,Only paid accommodation; excluding stays at friends and relatives and second homes.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,1995,Tourism expenditure (millions of US dollars),,,13435.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2005,Tourism expenditure (millions of US dollars),,,16243.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2010,Tourism expenditure (millions of US dollars),,,18751.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2016,Tourism expenditure (millions of US dollars),,,19244.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2017,Tourism expenditure (millions of US dollars),,,20333.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +40,Austria,2018,Tourism expenditure (millions of US dollars),,,23233.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2005,Tourist/visitor arrivals (thousands),TF,,693.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2010,Tourist/visitor arrivals (thousands),TF,,1280.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2016,Tourist/visitor arrivals (thousands),TF,,2044.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2017,Tourist/visitor arrivals (thousands),TF,,2454.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2018,Tourist/visitor arrivals (thousands),TF,,2633.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,1995,Tourism expenditure (millions of US dollars),,,87.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2005,Tourism expenditure (millions of US dollars),,,100.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2010,Tourism expenditure (millions of US dollars),,,792.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2016,Tourism expenditure (millions of US dollars),,,2855.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2017,Tourism expenditure (millions of US dollars),,,3214.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +31,Azerbaijan,2018,Tourism expenditure (millions of US dollars),,,2830.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,1995,Tourist/visitor arrivals (thousands),TF,,1598.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2005,Tourist/visitor arrivals (thousands),TF,,1608.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2010,Tourist/visitor arrivals (thousands),TF,,1370.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2016,Tourist/visitor arrivals (thousands),TF,,1500.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2017,Tourist/visitor arrivals (thousands),TF,,1442.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2018,Tourist/visitor arrivals (thousands),TF,,1633.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,1995,Tourism expenditure (millions of US dollars),,,1356.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2005,Tourism expenditure (millions of US dollars),,,2081.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2010,Tourism expenditure (millions of US dollars),,,2159.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2016,Tourism expenditure (millions of US dollars),,,3091.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2017,Tourism expenditure (millions of US dollars),,,3017.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +44,Bahamas,2018,Tourism expenditure (millions of US dollars),,,3383.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,1995,Tourist/visitor arrivals (thousands),VF,,2311.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2005,Tourist/visitor arrivals (thousands),VF,,6313.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2010,Tourist/visitor arrivals (thousands),VF,,11952.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2016,Tourist/visitor arrivals (thousands),VF,,10158.0000,Break in the time series.;Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2017,Tourist/visitor arrivals (thousands),VF,,11374.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2018,Tourist/visitor arrivals (thousands),VF,,12045.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,1995,Tourism expenditure (millions of US dollars),,,593.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2005,Tourism expenditure (millions of US dollars),,,1603.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2010,Tourism expenditure (millions of US dollars),,,2163.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2016,Tourism expenditure (millions of US dollars),,,4021.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2017,Tourism expenditure (millions of US dollars),,,4380.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +48,Bahrain,2018,Tourism expenditure (millions of US dollars),,,3834.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,1995,Tourist/visitor arrivals (thousands),TF,,156.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2005,Tourist/visitor arrivals (thousands),TF,,208.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2010,Tourist/visitor arrivals (thousands),TF,,303.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2016,Tourist/visitor arrivals (thousands),TF,,830.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2017,Tourist/visitor arrivals (thousands),TF,,1026.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2005,Tourism expenditure (millions of US dollars),,,82.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2010,Tourism expenditure (millions of US dollars),,,103.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2016,Tourism expenditure (millions of US dollars),,,214.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2017,Tourism expenditure (millions of US dollars),,,348.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +50,Bangladesh,2018,Tourism expenditure (millions of US dollars),,,357.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,1995,Tourist/visitor arrivals (thousands),TF,,442.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,2005,Tourist/visitor arrivals (thousands),TF,,548.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,2010,Tourist/visitor arrivals (thousands),TF,,532.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,2016,Tourist/visitor arrivals (thousands),TF,,632.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,2017,Tourist/visitor arrivals (thousands),TF,,664.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,2018,Tourist/visitor arrivals (thousands),TF,,680.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,1995,Tourism expenditure (millions of US dollars),,,630.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,2005,Tourism expenditure (millions of US dollars),,,1081.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +52,Barbados,2010,Tourism expenditure (millions of US dollars),,,1074.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,1995,Tourist/visitor arrivals (thousands),TF,,160.6000,Excludes the Belarusian-Russian border segment.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2005,Tourist/visitor arrivals (thousands),TF,,91.0000,Excludes the Belarusian-Russian border segment.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2010,Tourist/visitor arrivals (thousands),TF,,119.3000,Excludes the Belarusian-Russian border segment.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2016,Tourist/visitor arrivals (thousands),TF,,10935.4000,Includes estimation of the Belarusian-Russian border segment.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2017,Tourist/visitor arrivals (thousands),TF,,11060.2000,Includes estimation of the Belarusian-Russian border segment.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2018,Tourist/visitor arrivals (thousands),TF,,11501.6000,Includes estimation of the Belarusian-Russian border segment.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,1995,Tourism expenditure (millions of US dollars),,,28.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2005,Tourism expenditure (millions of US dollars),,,346.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2010,Tourism expenditure (millions of US dollars),,,665.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2016,Tourism expenditure (millions of US dollars),,,1019.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2017,Tourism expenditure (millions of US dollars),,,1124.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +112,Belarus,2018,Tourism expenditure (millions of US dollars),,,1221.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,1995,Tourist/visitor arrivals (thousands),TCE,,5560.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2005,Tourist/visitor arrivals (thousands),TCE,,6747.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2010,Tourist/visitor arrivals (thousands),TCE,,7186.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2016,Tourist/visitor arrivals (thousands),TCE,,7481.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2017,Tourist/visitor arrivals (thousands),TCE,,8385.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2018,Tourist/visitor arrivals (thousands),TCE,,9119.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2005,Tourism expenditure (millions of US dollars),,,10881.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2010,Tourism expenditure (millions of US dollars),,,12680.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2016,Tourism expenditure (millions of US dollars),,,8784.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2017,Tourism expenditure (millions of US dollars),,,9636.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +56,Belgium,2018,Tourism expenditure (millions of US dollars),,,10381.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,1995,Tourist/visitor arrivals (thousands),TF,,131.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2005,Tourist/visitor arrivals (thousands),TF,,237.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2010,Tourist/visitor arrivals (thousands),TF,,242.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2016,Tourist/visitor arrivals (thousands),TF,,386.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2017,Tourist/visitor arrivals (thousands),TF,,427.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2018,Tourist/visitor arrivals (thousands),TF,,489.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,1995,Tourism expenditure (millions of US dollars),,,78.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2005,Tourism expenditure (millions of US dollars),,,214.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2010,Tourism expenditure (millions of US dollars),,,264.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2016,Tourism expenditure (millions of US dollars),,,391.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2017,Tourism expenditure (millions of US dollars),,,427.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +84,Belize,2018,Tourism expenditure (millions of US dollars),,,487.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,1995,Tourist/visitor arrivals (thousands),TF,,138.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2005,Tourist/visitor arrivals (thousands),TF,,176.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2010,Tourist/visitor arrivals (thousands),TF,,199.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2016,Tourist/visitor arrivals (thousands),TF,,267.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2017,Tourist/visitor arrivals (thousands),TF,,281.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2018,Tourist/visitor arrivals (thousands),TF,,295.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2005,Tourism expenditure (millions of US dollars),,,107.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2010,Tourism expenditure (millions of US dollars),,,149.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2016,Tourism expenditure (millions of US dollars),,,129.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +204,Benin,2017,Tourism expenditure (millions of US dollars),,,160.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,1995,Tourist/visitor arrivals (thousands),TF,,387.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2005,Tourist/visitor arrivals (thousands),TF,,270.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2010,Tourist/visitor arrivals (thousands),TF,,232.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2016,Tourist/visitor arrivals (thousands),TF,,244.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2017,Tourist/visitor arrivals (thousands),TF,,270.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2018,Tourist/visitor arrivals (thousands),TF,,282.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,1995,Tourism expenditure (millions of US dollars),,,488.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2005,Tourism expenditure (millions of US dollars),,,429.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2010,Tourism expenditure (millions of US dollars),,,442.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2016,Tourism expenditure (millions of US dollars),,,441.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2017,Tourism expenditure (millions of US dollars),,,513.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +60,Bermuda,2018,Tourism expenditure (millions of US dollars),,,583.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,1995,Tourist/visitor arrivals (thousands),TF,,4.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2005,Tourist/visitor arrivals (thousands),TF,,13.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2010,Tourist/visitor arrivals (thousands),TF,,41.0000,Break in the time series.;Including regional high end tourists.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2016,Tourist/visitor arrivals (thousands),TF,,210.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2017,Tourist/visitor arrivals (thousands),TF,,255.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2018,Tourist/visitor arrivals (thousands),TF,,274.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,1995,Tourism expenditure (millions of US dollars),,,5.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2005,Tourism expenditure (millions of US dollars),,,19.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2010,Tourism expenditure (millions of US dollars),,,64.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2016,Tourism expenditure (millions of US dollars),,,139.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2017,Tourism expenditure (millions of US dollars),,,153.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +64,Bhutan,2018,Tourism expenditure (millions of US dollars),,,121.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),1995,Tourist/visitor arrivals (thousands),TF,,284.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2005,Tourist/visitor arrivals (thousands),TF,,524.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2010,Tourist/visitor arrivals (thousands),TF,,679.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2016,Tourist/visitor arrivals (thousands),TF,,961.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2017,Tourist/visitor arrivals (thousands),TF,,1109.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2018,Tourist/visitor arrivals (thousands),TF,,1142.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),1995,Tourism expenditure (millions of US dollars),,,92.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2005,Tourism expenditure (millions of US dollars),,,345.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2010,Tourism expenditure (millions of US dollars),,,339.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2016,Tourism expenditure (millions of US dollars),,,827.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2017,Tourism expenditure (millions of US dollars),,,912.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +68,Bolivia (Plurin. State of),2018,Tourism expenditure (millions of US dollars),,,970.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +669,Bonaire,1995,Tourist/visitor arrivals (thousands),TF,,59.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +669,Bonaire,2005,Tourist/visitor arrivals (thousands),TF,,63.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +669,Bonaire,2010,Tourist/visitor arrivals (thousands),TF,,71.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +669,Bonaire,1995,Tourism expenditure (millions of US dollars),,,37.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +669,Bonaire,2005,Tourism expenditure (millions of US dollars),,,87.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2005,Tourist/visitor arrivals (thousands),TCE,,217.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2010,Tourist/visitor arrivals (thousands),TCE,,365.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2016,Tourist/visitor arrivals (thousands),TCE,,778.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2017,Tourist/visitor arrivals (thousands),TCE,,923.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2018,Tourist/visitor arrivals (thousands),TCE,,1053.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2005,Tourism expenditure (millions of US dollars),,,557.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2010,Tourism expenditure (millions of US dollars),,,662.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2016,Tourism expenditure (millions of US dollars),,,876.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2017,Tourism expenditure (millions of US dollars),,,985.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +70,Bosnia and Herzegovina,2018,Tourism expenditure (millions of US dollars),,,1081.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,1995,Tourist/visitor arrivals (thousands),TF,,521.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2005,Tourist/visitor arrivals (thousands),TF,,1474.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2010,Tourist/visitor arrivals (thousands),TF,,1973.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2016,Tourist/visitor arrivals (thousands),TF,,1574.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2017,Tourist/visitor arrivals (thousands),TF,,1623.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,1995,Tourism expenditure (millions of US dollars),,,176.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2005,Tourism expenditure (millions of US dollars),,,563.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2010,Tourism expenditure (millions of US dollars),,,440.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2016,Tourism expenditure (millions of US dollars),,,505.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2017,Tourism expenditure (millions of US dollars),,,541.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +72,Botswana,2018,Tourism expenditure (millions of US dollars),,,575.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,1995,Tourist/visitor arrivals (thousands),TF,,1991.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2005,Tourist/visitor arrivals (thousands),TF,,5358.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2010,Tourist/visitor arrivals (thousands),TF,,5161.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2016,Tourist/visitor arrivals (thousands),TF,,6547.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2017,Tourist/visitor arrivals (thousands),TF,,6589.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2018,Tourist/visitor arrivals (thousands),TF,,6621.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,1995,Tourism expenditure (millions of US dollars),,,1085.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2005,Tourism expenditure (millions of US dollars),,,4168.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2010,Tourism expenditure (millions of US dollars),,,5522.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2016,Tourism expenditure (millions of US dollars),,,6613.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2017,Tourism expenditure (millions of US dollars),,,6175.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +76,Brazil,2018,Tourism expenditure (millions of US dollars),,,6324.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,1995,Tourist/visitor arrivals (thousands),TF,,219.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,2005,Tourist/visitor arrivals (thousands),TF,,337.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,2010,Tourist/visitor arrivals (thousands),TF,,330.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,2016,Tourist/visitor arrivals (thousands),TF,,408.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,2017,Tourist/visitor arrivals (thousands),TF,,335.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,2018,Tourist/visitor arrivals (thousands),TF,,192.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,1995,Tourism expenditure (millions of US dollars),,,211.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,2005,Tourism expenditure (millions of US dollars),,,412.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +92,British Virgin Islands,2010,Tourism expenditure (millions of US dollars),,,389.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2005,Tourist/visitor arrivals (thousands),TF,,126.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2010,Tourist/visitor arrivals (thousands),TF,,214.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2016,Tourist/visitor arrivals (thousands),TF,,219.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2017,Tourist/visitor arrivals (thousands),TF,,259.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2018,Tourist/visitor arrivals (thousands),TF,,278.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2005,Tourism expenditure (millions of US dollars),,,191.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2016,Tourism expenditure (millions of US dollars),,,144.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2017,Tourism expenditure (millions of US dollars),,,177.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +96,Brunei Darussalam,2018,Tourism expenditure (millions of US dollars),,,190.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,1995,Tourist/visitor arrivals (thousands),TF,,3466.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2005,Tourist/visitor arrivals (thousands),TF,,4837.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2010,Tourist/visitor arrivals (thousands),TF,,6047.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2016,Tourist/visitor arrivals (thousands),TF,,8252.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2017,Tourist/visitor arrivals (thousands),TF,,8883.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2018,Tourist/visitor arrivals (thousands),TF,,9273.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,1995,Tourism expenditure (millions of US dollars),,,662.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2005,Tourism expenditure (millions of US dollars),,,3063.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2010,Tourism expenditure (millions of US dollars),,,3807.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2016,Tourism expenditure (millions of US dollars),,,4164.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2017,Tourism expenditure (millions of US dollars),,,4678.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +100,Bulgaria,2018,Tourism expenditure (millions of US dollars),,,5072.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,1995,Tourist/visitor arrivals (thousands),THS,,124.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2005,Tourist/visitor arrivals (thousands),THS,,245.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2010,Tourist/visitor arrivals (thousands),THS,,274.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2016,Tourist/visitor arrivals (thousands),THS,,152.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2017,Tourist/visitor arrivals (thousands),THS,,143.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2018,Tourist/visitor arrivals (thousands),THS,,144.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2005,Tourism expenditure (millions of US dollars),,,46.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2010,Tourism expenditure (millions of US dollars),,,105.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2016,Tourism expenditure (millions of US dollars),,,172.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +854,Burkina Faso,2017,Tourism expenditure (millions of US dollars),,,172.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +108,Burundi,1995,Tourist/visitor arrivals (thousands),TF,,34.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +108,Burundi,2005,Tourist/visitor arrivals (thousands),TF,,148.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +108,Burundi,2010,Tourist/visitor arrivals (thousands),TF,,142.0000,Break in the time series.;Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +108,Burundi,2016,Tourist/visitor arrivals (thousands),TF,,187.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +108,Burundi,2017,Tourist/visitor arrivals (thousands),TF,,299.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +108,Burundi,1995,Tourism expenditure (millions of US dollars),,,2.4250,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +108,Burundi,2005,Tourism expenditure (millions of US dollars),,,1.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +108,Burundi,2010,Tourism expenditure (millions of US dollars),,,2.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,1995,Tourist/visitor arrivals (thousands),TF,,28.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2005,Tourist/visitor arrivals (thousands),TF,,198.0000,Non-resident tourists staying in hotels and similar establishments.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2010,Tourist/visitor arrivals (thousands),TF,,336.0000,Non-resident tourists staying in hotels and similar establishments.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2016,Tourist/visitor arrivals (thousands),TF,,598.0000,Non-resident tourists staying in hotels and similar establishments.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2017,Tourist/visitor arrivals (thousands),TF,,668.0000,Non-resident tourists staying in hotels and similar establishments.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2018,Tourist/visitor arrivals (thousands),TF,,710.0000,Non-resident tourists staying in hotels and similar establishments.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,1995,Tourism expenditure (millions of US dollars),,,29.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2005,Tourism expenditure (millions of US dollars),,,177.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2010,Tourism expenditure (millions of US dollars),,,387.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2016,Tourism expenditure (millions of US dollars),,,397.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2017,Tourism expenditure (millions of US dollars),,,450.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +132,Cabo Verde,2018,Tourism expenditure (millions of US dollars),,,524.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,1995,Tourist/visitor arrivals (thousands),TF,,220.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2005,Tourist/visitor arrivals (thousands),TF,,1422.0000,Arrivals by all means of transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2010,Tourist/visitor arrivals (thousands),TF,,2508.0000,Arrivals by all means of transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2016,Tourist/visitor arrivals (thousands),TF,,5012.0000,Arrivals by all means of transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2017,Tourist/visitor arrivals (thousands),TF,,5602.0000,Arrivals by all means of transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2018,Tourist/visitor arrivals (thousands),TF,,6201.0000,Arrivals by all means of transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,1995,Tourism expenditure (millions of US dollars),,,71.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2005,Tourism expenditure (millions of US dollars),,,929.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2010,Tourism expenditure (millions of US dollars),,,1671.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2016,Tourism expenditure (millions of US dollars),,,3523.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2017,Tourism expenditure (millions of US dollars),,,4024.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +116,Cambodia,2018,Tourism expenditure (millions of US dollars),,,4832.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,2010,Tourist/visitor arrivals (thousands),VF,,573.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,2016,Tourist/visitor arrivals (thousands),VF,,994.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,2017,Tourist/visitor arrivals (thousands),VF,,1081.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,1995,Tourism expenditure (millions of US dollars),,,75.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,2005,Tourism expenditure (millions of US dollars),,,229.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,2010,Tourism expenditure (millions of US dollars),,,171.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,2016,Tourism expenditure (millions of US dollars),,,508.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,2017,Tourism expenditure (millions of US dollars),,,543.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +120,Cameroon,2018,Tourism expenditure (millions of US dollars),,,633.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,1995,Tourist/visitor arrivals (thousands),TF,,16932.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,2005,Tourist/visitor arrivals (thousands),TF,,18771.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,2010,Tourist/visitor arrivals (thousands),TF,,16219.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,2016,Tourist/visitor arrivals (thousands),TF,,19971.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,2017,Tourist/visitor arrivals (thousands),TF,,20883.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,2018,Tourist/visitor arrivals (thousands),TF,,21134.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,1995,Tourism expenditure (millions of US dollars),,,9176.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,2005,Tourism expenditure (millions of US dollars),,,15887.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +124,Canada,2010,Tourism expenditure (millions of US dollars),,,18439.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,1995,Tourist/visitor arrivals (thousands),TF,,361.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2005,Tourist/visitor arrivals (thousands),TF,,168.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2010,Tourist/visitor arrivals (thousands),TF,,288.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2016,Tourist/visitor arrivals (thousands),TF,,385.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2017,Tourist/visitor arrivals (thousands),TF,,418.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2018,Tourist/visitor arrivals (thousands),TF,,463.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,1995,Tourism expenditure (millions of US dollars),,,394.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2005,Tourism expenditure (millions of US dollars),,,356.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2010,Tourism expenditure (millions of US dollars),,,465.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2016,Tourism expenditure (millions of US dollars),,,696.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2017,Tourism expenditure (millions of US dollars),,,782.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +136,Cayman Islands,2018,Tourism expenditure (millions of US dollars),,,880.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +140,Central African Republic,1995,Tourist/visitor arrivals (thousands),TF,,26.0000,Arrivals by air at Bangui only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +140,Central African Republic,2005,Tourist/visitor arrivals (thousands),TF,,12.0000,Arrivals by air at Bangui only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +140,Central African Republic,2010,Tourist/visitor arrivals (thousands),TF,,53.8000,Arrivals by air at Bangui only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +140,Central African Republic,2016,Tourist/visitor arrivals (thousands),TF,,82.0000,Arrivals by air at Bangui only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +140,Central African Republic,2017,Tourist/visitor arrivals (thousands),TF,,107.0000,Arrivals by air at Bangui only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +140,Central African Republic,1995,Tourism expenditure (millions of US dollars),,,4.0000,Arrivals by air at Bangui only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +140,Central African Republic,2005,Tourism expenditure (millions of US dollars),,,7.2000,Arrivals by air at Bangui only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +140,Central African Republic,2010,Tourism expenditure (millions of US dollars),,,14.4000,Arrivals by air at Bangui only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +148,Chad,2010,Tourist/visitor arrivals (thousands),TF,,71.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +148,Chad,2016,Tourist/visitor arrivals (thousands),TF,,98.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +148,Chad,2017,Tourist/visitor arrivals (thousands),TF,,87.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +148,Chad,1995,Tourism expenditure (millions of US dollars),,,43.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,1995,Tourist/visitor arrivals (thousands),TF,,1540.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2005,Tourist/visitor arrivals (thousands),TF,,2027.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2010,Tourist/visitor arrivals (thousands),TF,,2801.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2016,Tourist/visitor arrivals (thousands),TF,,5641.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2017,Tourist/visitor arrivals (thousands),TF,,6450.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2018,Tourist/visitor arrivals (thousands),TF,,5723.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,1995,Tourism expenditure (millions of US dollars),,,1186.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2005,Tourism expenditure (millions of US dollars),,,1608.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2010,Tourism expenditure (millions of US dollars),,,2362.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2016,Tourism expenditure (millions of US dollars),,,3744.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2017,Tourism expenditure (millions of US dollars),,,4372.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +152,Chile,2018,Tourism expenditure (millions of US dollars),,,3972.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,1995,Tourist/visitor arrivals (thousands),TF,,20034.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2005,Tourist/visitor arrivals (thousands),TF,,46809.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2010,Tourist/visitor arrivals (thousands),TF,,55664.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2016,Tourist/visitor arrivals (thousands),TF,,59270.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2017,Tourist/visitor arrivals (thousands),TF,,60740.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2018,Tourist/visitor arrivals (thousands),TF,,62900.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,1995,Tourism expenditure (millions of US dollars),,,8730.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.;Excluding passenger transport.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2005,Tourism expenditure (millions of US dollars),,,29296.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.;Excluding passenger transport.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2010,Tourism expenditure (millions of US dollars),,,45814.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.;Excluding passenger transport.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2016,Tourism expenditure (millions of US dollars),,,44432.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.;Excluding passenger transport.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2017,Tourism expenditure (millions of US dollars),,,38559.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.;Excluding passenger transport.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +156,China,2018,Tourism expenditure (millions of US dollars),,,40386.0000,"For statistical purposes, the data for China do not include those for the Hong Kong Special Administrative Region (Hong Kong SAR), Macao Special Administrative Region (Macao SAR) and Taiwan Province of China.;Excluding passenger transport.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2005,Tourist/visitor arrivals (thousands),TF,,14773.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2010,Tourist/visitor arrivals (thousands),TF,,20085.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2016,Tourist/visitor arrivals (thousands),TF,,26553.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2017,Tourist/visitor arrivals (thousands),TF,,27884.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2018,Tourist/visitor arrivals (thousands),TF,,29263.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2005,Tourism expenditure (millions of US dollars),,,13588.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2010,Tourism expenditure (millions of US dollars),,,27208.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2016,Tourism expenditure (millions of US dollars),,,37838.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2017,Tourism expenditure (millions of US dollars),,,38170.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +344,"China, Hong Kong SAR",2018,Tourism expenditure (millions of US dollars),,,41870.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",1995,Tourist/visitor arrivals (thousands),TF,,4202.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2005,Tourist/visitor arrivals (thousands),TF,,9014.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2010,Tourist/visitor arrivals (thousands),TF,,11926.0000,"Does not include other non-residents namely workers, students, etc.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2016,Tourist/visitor arrivals (thousands),TF,,15703.6000,"Does not include other non-residents namely workers, students, etc.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2017,Tourist/visitor arrivals (thousands),TF,,17255.0000,"Does not include other non-residents namely workers, students, etc.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2018,Tourist/visitor arrivals (thousands),TF,,18493.0000,"Does not include other non-residents namely workers, students, etc.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",1995,Tourism expenditure (millions of US dollars),,,3233.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2005,Tourism expenditure (millions of US dollars),,,7181.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2010,Tourism expenditure (millions of US dollars),,,22688.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2016,Tourism expenditure (millions of US dollars),,,31015.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2017,Tourism expenditure (millions of US dollars),,,36465.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +446,"China, Macao SAR",2018,Tourism expenditure (millions of US dollars),,,40358.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,1995,Tourist/visitor arrivals (thousands),TF,,1399.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2005,Tourist/visitor arrivals (thousands),TF,,933.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2010,Tourist/visitor arrivals (thousands),TF,,1405.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2016,Tourist/visitor arrivals (thousands),TF,,3254.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2017,Tourist/visitor arrivals (thousands),TF,,3631.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2018,Tourist/visitor arrivals (thousands),TF,,3904.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,1995,Tourism expenditure (millions of US dollars),,,887.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2005,Tourism expenditure (millions of US dollars),,,1891.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2010,Tourism expenditure (millions of US dollars),,,3441.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2016,Tourism expenditure (millions of US dollars),,,5584.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2017,Tourism expenditure (millions of US dollars),,,5882.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +170,Colombia,2018,Tourism expenditure (millions of US dollars),,,6617.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,1995,Tourist/visitor arrivals (thousands),TF,,23.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2005,Tourist/visitor arrivals (thousands),TF,,25.9000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2010,Tourist/visitor arrivals (thousands),TF,,15.3000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2016,Tourist/visitor arrivals (thousands),TF,,26.8000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2017,Tourist/visitor arrivals (thousands),TF,,28.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2018,Tourist/visitor arrivals (thousands),TF,,35.9000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,1995,Tourism expenditure (millions of US dollars),,,22.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2005,Tourism expenditure (millions of US dollars),,,24.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2010,Tourism expenditure (millions of US dollars),,,35.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2016,Tourism expenditure (millions of US dollars),,,50.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2017,Tourism expenditure (millions of US dollars),,,60.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +174,Comoros,2018,Tourism expenditure (millions of US dollars),,,76.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +178,Congo,2005,Tourist/visitor arrivals (thousands),TF,,35.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +178,Congo,2010,Tourist/visitor arrivals (thousands),TF,,194.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +178,Congo,2016,Tourist/visitor arrivals (thousands),TF,,211.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +178,Congo,2017,Tourist/visitor arrivals (thousands),TF,,149.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +178,Congo,2018,Tourist/visitor arrivals (thousands),TF,,156.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +178,Congo,1995,Tourism expenditure (millions of US dollars),,,14.6691,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +178,Congo,2010,Tourism expenditure (millions of US dollars),,,39.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +178,Congo,2016,Tourism expenditure (millions of US dollars),,,42.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,1995,Tourist/visitor arrivals (thousands),TF,,48.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2005,Tourist/visitor arrivals (thousands),TF,,88.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2010,Tourist/visitor arrivals (thousands),TF,,104.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2016,Tourist/visitor arrivals (thousands),TF,,146.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2017,Tourist/visitor arrivals (thousands),TF,,161.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2018,Tourist/visitor arrivals (thousands),TF,,169.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,1995,Tourism expenditure (millions of US dollars),,,28.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2005,Tourism expenditure (millions of US dollars),,,91.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2010,Tourism expenditure (millions of US dollars),,,111.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2016,Tourism expenditure (millions of US dollars),,,137.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +184,Cook Islands,2017,Tourism expenditure (millions of US dollars),,,153.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,1995,Tourist/visitor arrivals (thousands),TF,,785.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2005,Tourist/visitor arrivals (thousands),TF,,1679.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2010,Tourist/visitor arrivals (thousands),TF,,2100.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2016,Tourist/visitor arrivals (thousands),TF,,2925.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2017,Tourist/visitor arrivals (thousands),TF,,2960.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2018,Tourist/visitor arrivals (thousands),TF,,3017.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,1995,Tourism expenditure (millions of US dollars),,,763.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2005,Tourism expenditure (millions of US dollars),,,2008.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2010,Tourism expenditure (millions of US dollars),,,2426.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2016,Tourism expenditure (millions of US dollars),,,3776.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2017,Tourism expenditure (millions of US dollars),,,3826.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +188,Costa Rica,2018,Tourism expenditure (millions of US dollars),,,3995.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,2010,Tourist/visitor arrivals (thousands),VF,,252.0000,Arrivals to Félix Houphouët Boigny Airport only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,2016,Tourist/visitor arrivals (thousands),VF,,1583.0000,Arrivals to Félix Houphouët Boigny Airport only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,2017,Tourist/visitor arrivals (thousands),VF,,1800.0000,Arrivals to Félix Houphouët Boigny Airport only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,2018,Tourist/visitor arrivals (thousands),VF,,1965.0000,Arrivals to Félix Houphouët Boigny Airport only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,1995,Tourism expenditure (millions of US dollars),,,103.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,2005,Tourism expenditure (millions of US dollars),,,93.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,2010,Tourism expenditure (millions of US dollars),,,213.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,2016,Tourism expenditure (millions of US dollars),,,477.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +384,Côte d’Ivoire,2017,Tourism expenditure (millions of US dollars),,,508.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,1995,Tourist/visitor arrivals (thousands),TCE,,1485.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2005,Tourist/visitor arrivals (thousands),TCE,,7743.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2010,Tourist/visitor arrivals (thousands),TCE,,9111.0000,Excluding arrivals in ports of nautical tourism.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2016,Tourist/visitor arrivals (thousands),TCE,,13809.0000,Excluding arrivals in ports of nautical tourism.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2017,Tourist/visitor arrivals (thousands),TCE,,15593.0000,Excluding arrivals in ports of nautical tourism.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2018,Tourist/visitor arrivals (thousands),TCE,,16645.0000,Excluding arrivals in ports of nautical tourism.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2005,Tourism expenditure (millions of US dollars),,,7625.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2010,Tourism expenditure (millions of US dollars),,,8299.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2016,Tourism expenditure (millions of US dollars),,,9820.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2017,Tourism expenditure (millions of US dollars),,,11128.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +191,Croatia,2018,Tourism expenditure (millions of US dollars),,,12075.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,1995,Tourist/visitor arrivals (thousands),TF,,742.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2005,Tourist/visitor arrivals (thousands),TF,,2261.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2010,Tourist/visitor arrivals (thousands),TF,,2507.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2016,Tourist/visitor arrivals (thousands),TF,,3975.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2017,Tourist/visitor arrivals (thousands),TF,,4594.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2018,Tourist/visitor arrivals (thousands),TF,,4684.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,1995,Tourism expenditure (millions of US dollars),,,1100.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2005,Tourism expenditure (millions of US dollars),,,2591.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2010,Tourism expenditure (millions of US dollars),,,2396.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2016,Tourism expenditure (millions of US dollars),,,3069.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2017,Tourism expenditure (millions of US dollars),,,3302.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +192,Cuba,2018,Tourism expenditure (millions of US dollars),,,2969.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,1995,Tourist/visitor arrivals (thousands),TF,,224.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2005,Tourist/visitor arrivals (thousands),TF,,222.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2010,Tourist/visitor arrivals (thousands),TF,,342.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2016,Tourist/visitor arrivals (thousands),TF,,441.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2017,Tourist/visitor arrivals (thousands),TF,,399.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2018,Tourist/visitor arrivals (thousands),TF,,432.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,1995,Tourism expenditure (millions of US dollars),,,175.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2005,Tourism expenditure (millions of US dollars),,,244.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2010,Tourism expenditure (millions of US dollars),,,438.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2016,Tourism expenditure (millions of US dollars),,,644.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2017,Tourism expenditure (millions of US dollars),,,572.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +531,Curaçao,2018,Tourism expenditure (millions of US dollars),,,605.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,1995,Tourist/visitor arrivals (thousands),TF,,2100.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2005,Tourist/visitor arrivals (thousands),TF,,2470.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2010,Tourist/visitor arrivals (thousands),TF,,2173.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2016,Tourist/visitor arrivals (thousands),TF,,3187.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2017,Tourist/visitor arrivals (thousands),TF,,3652.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2018,Tourist/visitor arrivals (thousands),TF,,3939.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,1995,Tourism expenditure (millions of US dollars),,,2018.0443,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2005,Tourism expenditure (millions of US dollars),,,2644.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2010,Tourism expenditure (millions of US dollars),,,2137.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2016,Tourism expenditure (millions of US dollars),,,2870.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2017,Tourism expenditure (millions of US dollars),,,3274.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +196,Cyprus,2018,Tourism expenditure (millions of US dollars),,,3449.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2005,Tourist/visitor arrivals (thousands),TF,,9404.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2010,Tourist/visitor arrivals (thousands),TF,,8629.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2016,Tourist/visitor arrivals (thousands),TF,,12808.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2017,Tourist/visitor arrivals (thousands),TF,,13665.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2005,Tourism expenditure (millions of US dollars),,,5772.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2010,Tourism expenditure (millions of US dollars),,,8068.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2016,Tourism expenditure (millions of US dollars),,,7041.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2017,Tourism expenditure (millions of US dollars),,,7695.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +203,Czechia,2018,Tourism expenditure (millions of US dollars),,,8291.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,1995,Tourist/visitor arrivals (thousands),TF,,35.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,2005,Tourist/visitor arrivals (thousands),TF,,61.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,2010,Tourist/visitor arrivals (thousands),TF,,81.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,2016,Tourist/visitor arrivals (thousands),TF,,351.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,2005,Tourism expenditure (millions of US dollars),,,3.2000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,2010,Tourism expenditure (millions of US dollars),,,10.7000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,2016,Tourism expenditure (millions of US dollars),,,4.3000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,2017,Tourism expenditure (millions of US dollars),,,6.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +180,Dem. Rep. of the Congo,2018,Tourism expenditure (millions of US dollars),,,60.5000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2005,Tourist/visitor arrivals (thousands),TCE,,9587.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2010,Tourist/visitor arrivals (thousands),TCE,,9425.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2016,Tourist/visitor arrivals (thousands),TCE,,10781.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2017,Tourist/visitor arrivals (thousands),TCE,,12426.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2018,Tourist/visitor arrivals (thousands),TCE,,12749.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,1995,Tourism expenditure (millions of US dollars),,,3691.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2005,Tourism expenditure (millions of US dollars),,,5293.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2010,Tourism expenditure (millions of US dollars),,,5704.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2016,Tourism expenditure (millions of US dollars),,,7494.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2017,Tourism expenditure (millions of US dollars),,,8508.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +208,Denmark,2018,Tourism expenditure (millions of US dollars),,,9097.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,1995,Tourist/visitor arrivals (thousands),THS,,21.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,2005,Tourist/visitor arrivals (thousands),THS,,30.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,2010,Tourist/visitor arrivals (thousands),THS,,51.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,1995,Tourism expenditure (millions of US dollars),,,5.4000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,2005,Tourism expenditure (millions of US dollars),,,7.1000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,2010,Tourism expenditure (millions of US dollars),,,18.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,2016,Tourism expenditure (millions of US dollars),,,33.5000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,2017,Tourism expenditure (millions of US dollars),,,36.2000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +262,Djibouti,2018,Tourism expenditure (millions of US dollars),,,57.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,1995,Tourist/visitor arrivals (thousands),TF,,60.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2005,Tourist/visitor arrivals (thousands),TF,,79.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2010,Tourist/visitor arrivals (thousands),TF,,77.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2016,Tourist/visitor arrivals (thousands),TF,,78.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2017,Tourist/visitor arrivals (thousands),TF,,72.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2018,Tourist/visitor arrivals (thousands),TF,,63.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,1995,Tourism expenditure (millions of US dollars),,,42.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2005,Tourism expenditure (millions of US dollars),,,57.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2010,Tourism expenditure (millions of US dollars),,,94.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2016,Tourism expenditure (millions of US dollars),,,198.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2017,Tourism expenditure (millions of US dollars),,,161.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +212,Dominica,2018,Tourism expenditure (millions of US dollars),,,111.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,1995,Tourist/visitor arrivals (thousands),TF,,1776.0000,Including nationals residing abroad.;Arrivals by air.;Excluding the passengers at Herrera airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2005,Tourist/visitor arrivals (thousands),TF,,3691.0000,Including nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2010,Tourist/visitor arrivals (thousands),TF,,4125.0000,Including nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2016,Tourist/visitor arrivals (thousands),TF,,5959.3000,Including nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2017,Tourist/visitor arrivals (thousands),TF,,6188.0000,Including nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2018,Tourist/visitor arrivals (thousands),TF,,6569.0000,Including nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,1995,Tourism expenditure (millions of US dollars),,,1571.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2005,Tourism expenditure (millions of US dollars),,,3518.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2010,Tourism expenditure (millions of US dollars),,,4162.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2016,Tourism expenditure (millions of US dollars),,,6720.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2017,Tourism expenditure (millions of US dollars),,,7184.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +214,Dominican Republic,2018,Tourism expenditure (millions of US dollars),,,7561.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,1995,Tourist/visitor arrivals (thousands),VF,,440.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2005,Tourist/visitor arrivals (thousands),VF,,860.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2010,Tourist/visitor arrivals (thousands),VF,,1047.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2016,Tourist/visitor arrivals (thousands),VF,,1569.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2017,Tourist/visitor arrivals (thousands),VF,,1806.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2018,Tourist/visitor arrivals (thousands),VF,,2535.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,1995,Tourism expenditure (millions of US dollars),,,315.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2005,Tourism expenditure (millions of US dollars),,,488.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2010,Tourism expenditure (millions of US dollars),,,786.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2016,Tourism expenditure (millions of US dollars),,,1450.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2017,Tourism expenditure (millions of US dollars),,,1554.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +218,Ecuador,2018,Tourism expenditure (millions of US dollars),,,1878.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,1995,Tourist/visitor arrivals (thousands),TF,,2871.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2005,Tourist/visitor arrivals (thousands),TF,,8244.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2010,Tourist/visitor arrivals (thousands),TF,,14051.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2016,Tourist/visitor arrivals (thousands),TF,,5258.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2017,Tourist/visitor arrivals (thousands),TF,,8157.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2018,Tourist/visitor arrivals (thousands),TF,,11196.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,1995,Tourism expenditure (millions of US dollars),,,2954.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2005,Tourism expenditure (millions of US dollars),,,7206.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2010,Tourism expenditure (millions of US dollars),,,13633.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2016,Tourism expenditure (millions of US dollars),,,3306.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2017,Tourism expenditure (millions of US dollars),,,8636.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +818,Egypt,2018,Tourism expenditure (millions of US dollars),,,12704.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,1995,Tourist/visitor arrivals (thousands),TF,,235.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2005,Tourist/visitor arrivals (thousands),TF,,1127.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2010,Tourist/visitor arrivals (thousands),TF,,1150.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2016,Tourist/visitor arrivals (thousands),TF,,1434.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2017,Tourist/visitor arrivals (thousands),TF,,1556.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2018,Tourist/visitor arrivals (thousands),TF,,1677.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,1995,Tourism expenditure (millions of US dollars),,,152.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2005,Tourism expenditure (millions of US dollars),,,656.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2010,Tourism expenditure (millions of US dollars),,,646.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2016,Tourism expenditure (millions of US dollars),,,1161.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2017,Tourism expenditure (millions of US dollars),,,1227.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +222,El Salvador,2018,Tourism expenditure (millions of US dollars),,,1370.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +226,Equatorial Guinea,1995,Tourism expenditure (millions of US dollars),,,1.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +232,Eritrea,1995,Tourist/visitor arrivals (thousands),VF,,315.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +232,Eritrea,2005,Tourist/visitor arrivals (thousands),VF,,83.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +232,Eritrea,2010,Tourist/visitor arrivals (thousands),VF,,84.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +232,Eritrea,2016,Tourist/visitor arrivals (thousands),VF,,142.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +232,Eritrea,1995,Tourism expenditure (millions of US dollars),,,58.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +232,Eritrea,2005,Tourism expenditure (millions of US dollars),,,66.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +232,Eritrea,2016,Tourism expenditure (millions of US dollars),,,48.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,1995,Tourist/visitor arrivals (thousands),TF,,530.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2005,Tourist/visitor arrivals (thousands),TF,,1917.0000,"Border statistics are not collected any more, surveys used instead.;Calculated on the basis of accommodation statistics and “Foreign Visitor Survey” carried out by the Statistical Office of Estonia.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2010,Tourist/visitor arrivals (thousands),TF,,2511.0000,"Border statistics are not collected any more, surveys used instead.;Based on mobile positioning data.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2016,Tourist/visitor arrivals (thousands),TF,,3131.0000,"Border statistics are not collected any more, surveys used instead.;Based on mobile positioning data.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2017,Tourist/visitor arrivals (thousands),TF,,3244.0000,"Border statistics are not collected any more, surveys used instead.;Based on mobile positioning data.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2018,Tourist/visitor arrivals (thousands),TF,,3234.0000,"Border statistics are not collected any more, surveys used instead.;Based on mobile positioning data.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,1995,Tourism expenditure (millions of US dollars),,,452.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2005,Tourism expenditure (millions of US dollars),,,1229.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2016,Tourism expenditure (millions of US dollars),,,1916.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2017,Tourism expenditure (millions of US dollars),,,2126.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +233,Estonia,2018,Tourism expenditure (millions of US dollars),,,2332.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,1995,Tourist/visitor arrivals (thousands),TF,,300.0000,Arrivals in hotels only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2005,Tourist/visitor arrivals (thousands),TF,,837.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2010,Tourist/visitor arrivals (thousands),TF,,868.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2016,Tourist/visitor arrivals (thousands),TF,,947.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2017,Tourist/visitor arrivals (thousands),TF,,921.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2018,Tourist/visitor arrivals (thousands),TF,,782.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,1995,Tourism expenditure (millions of US dollars),,,54.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2005,Tourism expenditure (millions of US dollars),,,77.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2010,Tourism expenditure (millions of US dollars),,,51.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2016,Tourism expenditure (millions of US dollars),,,13.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2017,Tourism expenditure (millions of US dollars),,,13.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +748,Eswatini,2018,Tourism expenditure (millions of US dollars),,,16.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,1995,Tourist/visitor arrivals (thousands),TF,,103.0000,Arrivals to Bole airport only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2005,Tourist/visitor arrivals (thousands),TF,,227.0000,Including nationals residing abroad.;Arrivals through all ports of entry.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2010,Tourist/visitor arrivals (thousands),TF,,468.0000,Including nationals residing abroad.;Arrivals through all ports of entry.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2016,Tourist/visitor arrivals (thousands),TF,,871.0000,Including nationals residing abroad.;Arrivals through all ports of entry.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2017,Tourist/visitor arrivals (thousands),TF,,933.0000,Including nationals residing abroad.;Arrivals through all ports of entry.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2018,Tourist/visitor arrivals (thousands),TF,,849.0000,Including nationals residing abroad.;Arrivals through all ports of entry.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,1995,Tourism expenditure (millions of US dollars),,,177.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2005,Tourism expenditure (millions of US dollars),,,533.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2010,Tourism expenditure (millions of US dollars),,,1434.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2016,Tourism expenditure (millions of US dollars),,,2138.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2017,Tourism expenditure (millions of US dollars),,,2505.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +231,Ethiopia,2018,Tourism expenditure (millions of US dollars),,,3548.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,1995,Tourist/visitor arrivals (thousands),TF,,318.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2005,Tourist/visitor arrivals (thousands),TF,,545.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2010,Tourist/visitor arrivals (thousands),TF,,632.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2016,Tourist/visitor arrivals (thousands),TF,,792.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2017,Tourist/visitor arrivals (thousands),TF,,843.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2018,Tourist/visitor arrivals (thousands),TF,,870.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,1995,Tourism expenditure (millions of US dollars),,,369.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2005,Tourism expenditure (millions of US dollars),,,722.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2010,Tourism expenditure (millions of US dollars),,,825.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2016,Tourism expenditure (millions of US dollars),,,1149.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2017,Tourism expenditure (millions of US dollars),,,1243.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +242,Fiji,2018,Tourism expenditure (millions of US dollars),,,1370.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,1995,Tourist/visitor arrivals (thousands),TCE,,1779.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2005,Tourist/visitor arrivals (thousands),TCE,,2080.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2010,Tourist/visitor arrivals (thousands),TCE,,2319.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2016,Tourist/visitor arrivals (thousands),TCE,,2789.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2017,Tourist/visitor arrivals (thousands),TCE,,3180.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2018,Tourist/visitor arrivals (thousands),TCE,,3224.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,1995,Tourism expenditure (millions of US dollars),,,2383.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2005,Tourism expenditure (millions of US dollars),,,3069.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2010,Tourism expenditure (millions of US dollars),,,4497.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2016,Tourism expenditure (millions of US dollars),,,4016.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2017,Tourism expenditure (millions of US dollars),,,5207.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +246,Finland,2018,Tourism expenditure (millions of US dollars),,,5663.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,1995,Tourist/visitor arrivals (thousands),TF,,60033.0000,Estimated based on surveys at national borders.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2005,Tourist/visitor arrivals (thousands),TF,,74988.0000,Arrivals of non-resident visitors.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2010,Tourist/visitor arrivals (thousands),TF,,76647.0000,Arrivals of non-resident visitors.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2016,Tourist/visitor arrivals (thousands),TF,,82682.0000,Arrivals of non-resident visitors.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2017,Tourist/visitor arrivals (thousands),TF,,86758.0000,Arrivals of non-resident visitors.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2018,Tourist/visitor arrivals (thousands),TF,,89322.0000,Estimate.;Arrivals of non-resident visitors.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,1995,Tourism expenditure (millions of US dollars),,,31295.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2005,Tourism expenditure (millions of US dollars),,,52126.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2010,Tourism expenditure (millions of US dollars),,,56178.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2016,Tourism expenditure (millions of US dollars),,,63557.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2017,Tourism expenditure (millions of US dollars),,,67936.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +250,France,2018,Tourism expenditure (millions of US dollars),,,73125.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +254,French Guiana,2005,Tourist/visitor arrivals (thousands),TF,,95.0000,Survey at Cayenne-Rochambeau airport on departure.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +254,French Guiana,2016,Tourist/visitor arrivals (thousands),TF,,96.0000,Survey at Cayenne-Rochambeau airport on departure.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +254,French Guiana,2017,Tourist/visitor arrivals (thousands),TF,,111.0000,Survey at Cayenne-Rochambeau airport on departure.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +254,French Guiana,2005,Tourism expenditure (millions of US dollars),,,44.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,1995,Tourist/visitor arrivals (thousands),TF,,172.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,2005,Tourist/visitor arrivals (thousands),TF,,208.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,2010,Tourist/visitor arrivals (thousands),TF,,154.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,2016,Tourist/visitor arrivals (thousands),TF,,192.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,2017,Tourist/visitor arrivals (thousands),TF,,199.0000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,2018,Tourist/visitor arrivals (thousands),TF,,216.3000,Excluding nationals residing abroad.;Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,1995,Tourism expenditure (millions of US dollars),,,326.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,2005,Tourism expenditure (millions of US dollars),,,759.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,2010,Tourism expenditure (millions of US dollars),,,630.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +258,French Polynesia,2016,Tourism expenditure (millions of US dollars),,,782.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +266,Gabon,1995,Tourist/visitor arrivals (thousands),TF,,125.0000,Arrivals of non-resident tourists at Libreville airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +266,Gabon,2005,Tourist/visitor arrivals (thousands),TF,,269.0000,Arrivals of non-resident tourists at Libreville airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +266,Gabon,1995,Tourism expenditure (millions of US dollars),,,94.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +266,Gabon,2005,Tourism expenditure (millions of US dollars),,,13.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +266,Gabon,2010,Tourism expenditure (millions of US dollars),,,89.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +266,Gabon,2016,Tourism expenditure (millions of US dollars),,,28.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,1995,Tourist/visitor arrivals (thousands),TF,,45.0000,Including nationals residing abroad.;Arrivals by air only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2005,Tourist/visitor arrivals (thousands),TF,,108.0000,Including nationals residing abroad.;Arrivals by air only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2010,Tourist/visitor arrivals (thousands),TF,,91.0000,Including nationals residing abroad.;Arrivals by air only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2016,Tourist/visitor arrivals (thousands),TF,,450.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2017,Tourist/visitor arrivals (thousands),TF,,522.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2018,Tourist/visitor arrivals (thousands),TF,,552.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2005,Tourism expenditure (millions of US dollars),,,59.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2010,Tourism expenditure (millions of US dollars),,,80.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2016,Tourism expenditure (millions of US dollars),,,120.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2017,Tourism expenditure (millions of US dollars),,,116.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +270,Gambia,2018,Tourism expenditure (millions of US dollars),,,168.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2010,Tourist/visitor arrivals (thousands),TF,,1067.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2016,Tourist/visitor arrivals (thousands),TF,,3297.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2017,Tourist/visitor arrivals (thousands),TF,,4069.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2018,Tourist/visitor arrivals (thousands),TF,,4757.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2005,Tourism expenditure (millions of US dollars),,,287.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2010,Tourism expenditure (millions of US dollars),,,737.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2016,Tourism expenditure (millions of US dollars),,,2315.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2017,Tourism expenditure (millions of US dollars),,,2971.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +268,Georgia,2018,Tourism expenditure (millions of US dollars),,,3518.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,1995,Tourist/visitor arrivals (thousands),TCE,,14847.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2005,Tourist/visitor arrivals (thousands),TCE,,21500.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2010,Tourist/visitor arrivals (thousands),TCE,,26875.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2016,Tourist/visitor arrivals (thousands),TCE,,35555.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2017,Tourist/visitor arrivals (thousands),TCE,,37452.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2018,Tourist/visitor arrivals (thousands),TCE,,38881.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,1995,Tourism expenditure (millions of US dollars),,,24053.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2005,Tourism expenditure (millions of US dollars),,,40518.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2010,Tourism expenditure (millions of US dollars),,,49116.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2016,Tourism expenditure (millions of US dollars),,,52229.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2017,Tourism expenditure (millions of US dollars),,,56330.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +276,Germany,2018,Tourism expenditure (millions of US dollars),,,60260.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,1995,Tourist/visitor arrivals (thousands),TF,,286.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,2005,Tourist/visitor arrivals (thousands),TF,,429.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,2010,Tourist/visitor arrivals (thousands),TF,,931.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,1995,Tourism expenditure (millions of US dollars),,,30.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,2005,Tourism expenditure (millions of US dollars),,,867.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,2010,Tourism expenditure (millions of US dollars),,,706.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,2016,Tourism expenditure (millions of US dollars),,,952.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,2017,Tourism expenditure (millions of US dollars),,,919.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +288,Ghana,2018,Tourism expenditure (millions of US dollars),,,996.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,1995,Tourist/visitor arrivals (thousands),TF,,10130.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2005,Tourist/visitor arrivals (thousands),TF,,14765.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2010,Tourist/visitor arrivals (thousands),TF,,15007.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2016,Tourist/visitor arrivals (thousands),TF,,24799.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2017,Tourist/visitor arrivals (thousands),TF,,27194.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2018,Tourist/visitor arrivals (thousands),TF,,30123.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,1995,Tourism expenditure (millions of US dollars),,,4182.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2005,Tourism expenditure (millions of US dollars),,,13455.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2010,Tourism expenditure (millions of US dollars),,,13857.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2016,Tourism expenditure (millions of US dollars),,,16811.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2017,Tourism expenditure (millions of US dollars),,,19139.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +300,Greece,2018,Tourism expenditure (millions of US dollars),,,21594.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,1995,Tourist/visitor arrivals (thousands),TF,,108.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2005,Tourist/visitor arrivals (thousands),TF,,99.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2010,Tourist/visitor arrivals (thousands),TF,,110.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2016,Tourist/visitor arrivals (thousands),TF,,156.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2017,Tourist/visitor arrivals (thousands),TF,,168.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2018,Tourist/visitor arrivals (thousands),TF,,185.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,1995,Tourism expenditure (millions of US dollars),,,76.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2005,Tourism expenditure (millions of US dollars),,,71.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2010,Tourism expenditure (millions of US dollars),,,112.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2016,Tourism expenditure (millions of US dollars),,,437.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2017,Tourism expenditure (millions of US dollars),,,482.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +308,Grenada,2018,Tourism expenditure (millions of US dollars),,,548.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,1995,Tourist/visitor arrivals (thousands),TF,,640.0000,"Arrivals by air.;Excluding the north islands, Saint Barthélemy and Saint Martin (French part).;Non-resident tourists staying in all types of accommodation establishments.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,2005,Tourist/visitor arrivals (thousands),TF,,372.0000,"Arrivals by air.;Excluding the north islands, Saint Barthélemy and Saint Martin (French part).","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,2010,Tourist/visitor arrivals (thousands),TF,,392.0000,"Arrivals by air.;Excluding the north islands, Saint Barthélemy and Saint Martin (French part).","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,2016,Tourist/visitor arrivals (thousands),TF,,581.0000,"Arrivals by air.;Excluding the north islands, Saint Barthélemy and Saint Martin (French part).","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,2017,Tourist/visitor arrivals (thousands),TF,,650.0000,"Arrivals by air.;Excluding the north islands, Saint Barthélemy and Saint Martin (French part).","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,2018,Tourist/visitor arrivals (thousands),TF,,735.0000,"Arrivals by air.;Excluding the north islands, Saint Barthélemy and Saint Martin (French part).","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,1995,Tourism expenditure (millions of US dollars),,,458.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,2005,Tourism expenditure (millions of US dollars),,,306.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,2010,Tourism expenditure (millions of US dollars),,,510.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +312,Guadeloupe,2018,Tourism expenditure (millions of US dollars),,,860.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +316,Guam,1995,Tourist/visitor arrivals (thousands),TF,,1362.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +316,Guam,2005,Tourist/visitor arrivals (thousands),TF,,1228.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +316,Guam,2010,Tourist/visitor arrivals (thousands),TF,,1197.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +316,Guam,2016,Tourist/visitor arrivals (thousands),TF,,1536.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +316,Guam,2017,Tourist/visitor arrivals (thousands),TF,,1545.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +316,Guam,2018,Tourist/visitor arrivals (thousands),TF,,1549.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2010,Tourist/visitor arrivals (thousands),TF,,1119.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2016,Tourist/visitor arrivals (thousands),TF,,1585.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2017,Tourist/visitor arrivals (thousands),TF,,1660.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2018,Tourist/visitor arrivals (thousands),TF,,1781.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,1995,Tourism expenditure (millions of US dollars),,,213.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2005,Tourism expenditure (millions of US dollars),,,791.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2010,Tourism expenditure (millions of US dollars),,,1378.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2016,Tourism expenditure (millions of US dollars),,,1550.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2017,Tourism expenditure (millions of US dollars),,,1566.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +320,Guatemala,2018,Tourism expenditure (millions of US dollars),,,1549.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,2005,Tourist/visitor arrivals (thousands),TF,,45.0000,Arrivals by air at Conakry airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,2010,Tourist/visitor arrivals (thousands),TF,,12.4000,Arrivals by air at Conakry airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,2016,Tourist/visitor arrivals (thousands),TF,,63.0000,Arrivals by air at Conakry airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,2017,Tourist/visitor arrivals (thousands),TF,,99.0000,Arrivals by air at Conakry airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,1995,Tourism expenditure (millions of US dollars),,,0.9110,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,2010,Tourism expenditure (millions of US dollars),,,2.0400,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,2016,Tourism expenditure (millions of US dollars),,,16.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,2017,Tourism expenditure (millions of US dollars),,,16.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +324,Guinea,2018,Tourism expenditure (millions of US dollars),,,7.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +624,Guinea-Bissau,2005,Tourist/visitor arrivals (thousands),TF,,5.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +624,Guinea-Bissau,2010,Tourist/visitor arrivals (thousands),TF,,22.3000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +624,Guinea-Bissau,2016,Tourist/visitor arrivals (thousands),TF,,45.2000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +624,Guinea-Bissau,2005,Tourism expenditure (millions of US dollars),,,1.6000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +624,Guinea-Bissau,2010,Tourism expenditure (millions of US dollars),,,13.3000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +624,Guinea-Bissau,2016,Tourism expenditure (millions of US dollars),,,11.5000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +624,Guinea-Bissau,2017,Tourism expenditure (millions of US dollars),,,16.3000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +624,Guinea-Bissau,2018,Tourism expenditure (millions of US dollars),,,19.8000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,1995,Tourist/visitor arrivals (thousands),TF,,106.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2005,Tourist/visitor arrivals (thousands),TF,,117.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2010,Tourist/visitor arrivals (thousands),TF,,152.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2016,Tourist/visitor arrivals (thousands),TF,,235.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2017,Tourist/visitor arrivals (thousands),TF,,247.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2018,Tourist/visitor arrivals (thousands),TF,,287.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,1995,Tourism expenditure (millions of US dollars),,,33.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2005,Tourism expenditure (millions of US dollars),,,35.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2010,Tourism expenditure (millions of US dollars),,,80.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2016,Tourism expenditure (millions of US dollars),,,104.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2017,Tourism expenditure (millions of US dollars),,,95.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +328,Guyana,2018,Tourism expenditure (millions of US dollars),,,28.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,1995,Tourist/visitor arrivals (thousands),TF,,145.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2005,Tourist/visitor arrivals (thousands),TF,,112.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2010,Tourist/visitor arrivals (thousands),TF,,255.0000,Arrivals by air.;Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2016,Tourist/visitor arrivals (thousands),TF,,445.0000,Arrivals by air.;Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2017,Tourist/visitor arrivals (thousands),TF,,467.0000,Arrivals by air.;Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2018,Tourist/visitor arrivals (thousands),TF,,447.0000,Arrivals by air.;Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,1995,Tourism expenditure (millions of US dollars),,,90.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2005,Tourism expenditure (millions of US dollars),,,80.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2010,Tourism expenditure (millions of US dollars),,,383.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2016,Tourism expenditure (millions of US dollars),,,511.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2017,Tourism expenditure (millions of US dollars),,,460.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +332,Haiti,2018,Tourism expenditure (millions of US dollars),,,620.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,1995,Tourist/visitor arrivals (thousands),TF,,271.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2005,Tourist/visitor arrivals (thousands),TF,,673.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2010,Tourist/visitor arrivals (thousands),TF,,863.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2016,Tourist/visitor arrivals (thousands),TF,,838.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2017,Tourist/visitor arrivals (thousands),TF,,851.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,1995,Tourism expenditure (millions of US dollars),,,85.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2005,Tourism expenditure (millions of US dollars),,,465.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2010,Tourism expenditure (millions of US dollars),,,626.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2016,Tourism expenditure (millions of US dollars),,,700.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2017,Tourism expenditure (millions of US dollars),,,722.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +340,Honduras,2018,Tourism expenditure (millions of US dollars),,,745.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2005,Tourist/visitor arrivals (thousands),TF,,9979.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2010,Tourist/visitor arrivals (thousands),TF,,9510.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2016,Tourist/visitor arrivals (thousands),TF,,15255.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2017,Tourist/visitor arrivals (thousands),TF,,15785.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2018,Tourist/visitor arrivals (thousands),TF,,17552.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,1995,Tourism expenditure (millions of US dollars),,,2938.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2005,Tourism expenditure (millions of US dollars),,,4761.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2010,Tourism expenditure (millions of US dollars),,,6595.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2016,Tourism expenditure (millions of US dollars),,,7481.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2017,Tourism expenditure (millions of US dollars),,,8448.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +348,Hungary,2018,Tourism expenditure (millions of US dollars),,,9595.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,1995,Tourist/visitor arrivals (thousands),TF,,190.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2005,Tourist/visitor arrivals (thousands),TF,,374.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2010,Tourist/visitor arrivals (thousands),TF,,489.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2016,Tourist/visitor arrivals (thousands),TF,,1792.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2017,Tourist/visitor arrivals (thousands),TF,,2225.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2018,Tourist/visitor arrivals (thousands),TF,,2343.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,1995,Tourism expenditure (millions of US dollars),,,186.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2005,Tourism expenditure (millions of US dollars),,,413.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2010,Tourism expenditure (millions of US dollars),,,562.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2016,Tourism expenditure (millions of US dollars),,,2411.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2017,Tourism expenditure (millions of US dollars),,,3024.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +352,Iceland,2018,Tourism expenditure (millions of US dollars),,,3128.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,1995,Tourist/visitor arrivals (thousands),TF,,2124.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2005,Tourist/visitor arrivals (thousands),TF,,3919.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2010,Tourist/visitor arrivals (thousands),TF,,5776.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2016,Tourist/visitor arrivals (thousands),TF,,14570.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2017,Tourist/visitor arrivals (thousands),TF,,15543.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2018,Tourist/visitor arrivals (thousands),TF,,17423.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2005,Tourism expenditure (millions of US dollars),,,7659.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2016,Tourism expenditure (millions of US dollars),,,23111.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2017,Tourism expenditure (millions of US dollars),,,27878.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +356,India,2018,Tourism expenditure (millions of US dollars),,,29143.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,1995,Tourist/visitor arrivals (thousands),VF,,4324.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2005,Tourist/visitor arrivals (thousands),VF,,5002.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2010,Tourist/visitor arrivals (thousands),VF,,7003.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2016,Tourist/visitor arrivals (thousands),VF,,11519.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2017,Tourist/visitor arrivals (thousands),VF,,14040.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2018,Tourist/visitor arrivals (thousands),VF,,15810.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2005,Tourism expenditure (millions of US dollars),,,5094.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2010,Tourism expenditure (millions of US dollars),,,7618.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2016,Tourism expenditure (millions of US dollars),,,12566.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2017,Tourism expenditure (millions of US dollars),,,14691.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +360,Indonesia,2018,Tourism expenditure (millions of US dollars),,,15600.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),1995,Tourist/visitor arrivals (thousands),VF,,568.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),2010,Tourist/visitor arrivals (thousands),VF,,2938.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),2016,Tourist/visitor arrivals (thousands),VF,,4942.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),2017,Tourist/visitor arrivals (thousands),VF,,4867.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),2018,Tourist/visitor arrivals (thousands),VF,,7295.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),1995,Tourism expenditure (millions of US dollars),,,205.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),2005,Tourism expenditure (millions of US dollars),,,1025.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),2010,Tourism expenditure (millions of US dollars),,,2631.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),2016,Tourism expenditure (millions of US dollars),,,3914.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +364,Iran (Islamic Republic of),2017,Tourism expenditure (millions of US dollars),,,4632.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +368,Iraq,1995,Tourist/visitor arrivals (thousands),VF,,61.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +368,Iraq,2010,Tourist/visitor arrivals (thousands),VF,,1518.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +368,Iraq,2005,Tourism expenditure (millions of US dollars),,,186.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +368,Iraq,2010,Tourism expenditure (millions of US dollars),,,1736.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +368,Iraq,2016,Tourism expenditure (millions of US dollars),,,3120.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +368,Iraq,2017,Tourism expenditure (millions of US dollars),,,2959.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +368,Iraq,2018,Tourism expenditure (millions of US dollars),,,1986.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,1995,Tourist/visitor arrivals (thousands),TF,,4818.0000,Including tourists from Northern Ireland.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2005,Tourist/visitor arrivals (thousands),TF,,7333.0000,Including tourists from Northern Ireland.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2010,Tourist/visitor arrivals (thousands),TF,,7134.0000,Break in the time series.;Including tourists from Northern Ireland.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2016,Tourist/visitor arrivals (thousands),TF,,10100.0000,Including tourists from Northern Ireland.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2017,Tourist/visitor arrivals (thousands),TF,,10338.0000,Including tourists from Northern Ireland.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2018,Tourist/visitor arrivals (thousands),TF,,10926.0000,Including tourists from Northern Ireland.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,1995,Tourism expenditure (millions of US dollars),,,2697.7927,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2005,Tourism expenditure (millions of US dollars),,,6779.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2010,Tourism expenditure (millions of US dollars),,,8185.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2016,Tourism expenditure (millions of US dollars),,,11429.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2017,Tourism expenditure (millions of US dollars),,,14294.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +372,Ireland,2018,Tourism expenditure (millions of US dollars),,,14658.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,1995,Tourist/visitor arrivals (thousands),TF,,2215.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2005,Tourist/visitor arrivals (thousands),TF,,1903.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2010,Tourist/visitor arrivals (thousands),TF,,2803.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2016,Tourist/visitor arrivals (thousands),TF,,2900.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2017,Tourist/visitor arrivals (thousands),TF,,3613.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2018,Tourist/visitor arrivals (thousands),TF,,4121.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,1995,Tourism expenditure (millions of US dollars),,,3491.0000,Including the expenditures of foreign workers in Israel.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2005,Tourism expenditure (millions of US dollars),,,2750.0000,Including the expenditures of foreign workers in Israel.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2010,Tourism expenditure (millions of US dollars),,,5621.0000,Including the expenditures of foreign workers in Israel.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2016,Tourism expenditure (millions of US dollars),,,6587.0000,Including the expenditures of foreign workers in Israel.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2017,Tourism expenditure (millions of US dollars),,,7578.0000,Including the expenditures of foreign workers in Israel.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +376,Israel,2018,Tourism expenditure (millions of US dollars),,,8073.0000,Including the expenditures of foreign workers in Israel.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,1995,Tourist/visitor arrivals (thousands),TF,,31052.0000,Excluding seasonal and border workers.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2005,Tourist/visitor arrivals (thousands),TF,,36513.0000,Excluding seasonal and border workers.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2010,Tourist/visitor arrivals (thousands),TF,,43626.0000,Excluding seasonal and border workers.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2016,Tourist/visitor arrivals (thousands),TF,,52372.0000,Excluding seasonal and border workers.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2017,Tourist/visitor arrivals (thousands),TF,,58253.0000,Excluding seasonal and border workers.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2018,Tourist/visitor arrivals (thousands),TF,,61567.2000,Excluding seasonal and border workers.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,1995,Tourism expenditure (millions of US dollars),,,30411.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2005,Tourism expenditure (millions of US dollars),,,38364.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2016,Tourism expenditure (millions of US dollars),,,42423.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2017,Tourism expenditure (millions of US dollars),,,46719.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +380,Italy,2018,Tourism expenditure (millions of US dollars),,,51602.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,1995,Tourist/visitor arrivals (thousands),TF,,1147.0000,Including nationals residing abroad; E/D cards.;Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2005,Tourist/visitor arrivals (thousands),TF,,1479.0000,Including nationals residing abroad; E/D cards.;Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2010,Tourist/visitor arrivals (thousands),TF,,1922.0000,Including nationals residing abroad; E/D cards.;Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2016,Tourist/visitor arrivals (thousands),TF,,2182.0000,Including nationals residing abroad; E/D cards.;Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2017,Tourist/visitor arrivals (thousands),TF,,2353.0000,Including nationals residing abroad; E/D cards.;Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2018,Tourist/visitor arrivals (thousands),TF,,2473.0000,Including nationals residing abroad; E/D cards.;Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,1995,Tourism expenditure (millions of US dollars),,,1069.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2005,Tourism expenditure (millions of US dollars),,,1545.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2010,Tourism expenditure (millions of US dollars),,,2001.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2016,Tourism expenditure (millions of US dollars),,,2539.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2017,Tourism expenditure (millions of US dollars),,,2809.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +388,Jamaica,2018,Tourism expenditure (millions of US dollars),,,3099.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,1995,Tourist/visitor arrivals (thousands),VF,,3345.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2005,Tourist/visitor arrivals (thousands),VF,,6728.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2010,Tourist/visitor arrivals (thousands),VF,,8611.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2016,Tourist/visitor arrivals (thousands),VF,,24040.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2017,Tourist/visitor arrivals (thousands),VF,,28691.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2018,Tourist/visitor arrivals (thousands),VF,,31192.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,1995,Tourism expenditure (millions of US dollars),,,4894.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2005,Tourism expenditure (millions of US dollars),,,15554.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2010,Tourism expenditure (millions of US dollars),,,15356.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2016,Tourism expenditure (millions of US dollars),,,33456.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2017,Tourism expenditure (millions of US dollars),,,36978.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +392,Japan,2018,Tourism expenditure (millions of US dollars),,,45276.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,1995,Tourist/visitor arrivals (thousands),TF,,1075.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2005,Tourist/visitor arrivals (thousands),TF,,2987.0000,Break in the time series.;Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2010,Tourist/visitor arrivals (thousands),TF,,4207.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2016,Tourist/visitor arrivals (thousands),TF,,3567.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2017,Tourist/visitor arrivals (thousands),TF,,3843.5000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2018,Tourist/visitor arrivals (thousands),TF,,4150.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,1995,Tourism expenditure (millions of US dollars),,,973.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2005,Tourism expenditure (millions of US dollars),,,1759.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2010,Tourism expenditure (millions of US dollars),,,4390.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2016,Tourism expenditure (millions of US dollars),,,4943.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2017,Tourism expenditure (millions of US dollars),,,5549.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +400,Jordan,2018,Tourism expenditure (millions of US dollars),,,6221.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +398,Kazakhstan,2005,Tourist/visitor arrivals (thousands),TF,,3143.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +398,Kazakhstan,2010,Tourist/visitor arrivals (thousands),TF,,2991.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +398,Kazakhstan,1995,Tourism expenditure (millions of US dollars),,,155.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +398,Kazakhstan,2005,Tourism expenditure (millions of US dollars),,,801.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +398,Kazakhstan,2010,Tourism expenditure (millions of US dollars),,,1236.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +398,Kazakhstan,2016,Tourism expenditure (millions of US dollars),,,2038.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +398,Kazakhstan,2017,Tourism expenditure (millions of US dollars),,,2356.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +398,Kazakhstan,2018,Tourism expenditure (millions of US dollars),,,2651.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,1995,Tourist/visitor arrivals (thousands),TF,,918.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,2005,Tourist/visitor arrivals (thousands),TF,,1399.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,2010,Tourist/visitor arrivals (thousands),TF,,1470.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,2016,Tourist/visitor arrivals (thousands),TF,,1268.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,2017,Tourist/visitor arrivals (thousands),TF,,1364.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,1995,Tourism expenditure (millions of US dollars),,,785.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,2005,Tourism expenditure (millions of US dollars),,,969.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,2010,Tourism expenditure (millions of US dollars),,,1620.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,2016,Tourism expenditure (millions of US dollars),,,1471.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +404,Kenya,2017,Tourism expenditure (millions of US dollars),,,1564.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,1995,Tourist/visitor arrivals (thousands),TF,,3.9000,Air arrivals. Tarawa and Christmas Island.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,2005,Tourist/visitor arrivals (thousands),TF,,4.1000,Air arrivals. Tarawa and Christmas Island.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,2010,Tourist/visitor arrivals (thousands),TF,,4.7000,Air arrivals. Tarawa and Christmas Island.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,2016,Tourist/visitor arrivals (thousands),TF,,5.7000,Air arrivals. Tarawa and Christmas Island.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,2017,Tourist/visitor arrivals (thousands),TF,,5.8000,Air arrivals. Tarawa and Christmas Island.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,2018,Tourist/visitor arrivals (thousands),TF,,7.1000,Air arrivals. Tarawa and Christmas Island.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,2010,Tourism expenditure (millions of US dollars),,,4.3000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,2016,Tourism expenditure (millions of US dollars),,,2.8000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +296,Kiribati,2017,Tourism expenditure (millions of US dollars),,,4.1000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,1995,Tourist/visitor arrivals (thousands),VF,,1443.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2005,Tourist/visitor arrivals (thousands),VF,,3474.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2010,Tourist/visitor arrivals (thousands),VF,,5208.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2016,Tourist/visitor arrivals (thousands),VF,,7055.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2017,Tourist/visitor arrivals (thousands),VF,,7407.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2018,Tourist/visitor arrivals (thousands),VF,,8508.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,1995,Tourism expenditure (millions of US dollars),,,307.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2005,Tourism expenditure (millions of US dollars),,,413.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2010,Tourism expenditure (millions of US dollars),,,574.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2016,Tourism expenditure (millions of US dollars),,,831.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2017,Tourism expenditure (millions of US dollars),,,643.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +414,Kuwait,2018,Tourism expenditure (millions of US dollars),,,919.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2005,Tourist/visitor arrivals (thousands),VF,,319.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2010,Tourist/visitor arrivals (thousands),VF,,1224.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2016,Tourist/visitor arrivals (thousands),VF,,3853.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2017,Tourist/visitor arrivals (thousands),VF,,4568.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2018,Tourist/visitor arrivals (thousands),VF,,6947.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2005,Tourism expenditure (millions of US dollars),,,94.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2010,Tourism expenditure (millions of US dollars),,,212.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2016,Tourism expenditure (millions of US dollars),,,477.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2017,Tourism expenditure (millions of US dollars),,,480.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +417,Kyrgyzstan,2018,Tourism expenditure (millions of US dollars),,,487.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,1995,Tourist/visitor arrivals (thousands),TF,,60.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2005,Tourist/visitor arrivals (thousands),TF,,672.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2010,Tourist/visitor arrivals (thousands),TF,,1670.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2016,Tourist/visitor arrivals (thousands),TF,,3315.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2017,Tourist/visitor arrivals (thousands),TF,,3257.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2018,Tourist/visitor arrivals (thousands),TF,,3770.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,1995,Tourism expenditure (millions of US dollars),,,52.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2005,Tourism expenditure (millions of US dollars),,,143.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2010,Tourism expenditure (millions of US dollars),,,385.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2016,Tourism expenditure (millions of US dollars),,,717.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2017,Tourism expenditure (millions of US dollars),,,655.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +418,Lao People's Dem. Rep.,2018,Tourism expenditure (millions of US dollars),,,757.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +428,Latvia,1995,Tourist/visitor arrivals (thousands),TF,,539.0000,Non-resident departures. Survey of persons crossing the state border.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +428,Latvia,2005,Tourist/visitor arrivals (thousands),TF,,1116.0000,Non-resident departures. Survey of persons crossing the state border.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +428,Latvia,2010,Tourist/visitor arrivals (thousands),TF,,1373.0000,Non-resident departures. Survey of persons crossing the state border.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +428,Latvia,2016,Tourist/visitor arrivals (thousands),TF,,1793.0000,Non-resident departures. Survey of persons crossing the state border.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +428,Latvia,2017,Tourist/visitor arrivals (thousands),TF,,1949.0000,Non-resident departures. Survey of persons crossing the state border.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +428,Latvia,2018,Tourist/visitor arrivals (thousands),TF,,1946.0000,Non-resident departures. Survey of persons crossing the state border.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +428,Latvia,1995,Tourism expenditure (millions of US dollars),,,37.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +428,Latvia,2005,Tourism expenditure (millions of US dollars),,,446.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,1995,Tourist/visitor arrivals (thousands),TF,,450.0000,"Excluding the Lebanon, Syria and Palestine nationalities.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2005,Tourist/visitor arrivals (thousands),TF,,1140.0000,"Excluding the Lebanon, Syria and Palestine nationalities.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2010,Tourist/visitor arrivals (thousands),TF,,2168.0000,"Excluding the Lebanon, Syria and Palestine nationalities.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2016,Tourist/visitor arrivals (thousands),TF,,1688.0000,"Excluding the Lebanon, Syria and Palestine nationalities.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2017,Tourist/visitor arrivals (thousands),TF,,1857.0000,"Excluding the Lebanon, Syria and Palestine nationalities.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2018,Tourist/visitor arrivals (thousands),TF,,1964.0000,"Excluding the Lebanon, Syria and Palestine nationalities.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,1995,Tourism expenditure (millions of US dollars),,,710.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2005,Tourism expenditure (millions of US dollars),,,5969.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2010,Tourism expenditure (millions of US dollars),,,8026.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2016,Tourism expenditure (millions of US dollars),,,7373.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2017,Tourism expenditure (millions of US dollars),,,8086.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +422,Lebanon,2018,Tourism expenditure (millions of US dollars),,,8694.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,1995,Tourist/visitor arrivals (thousands),VF,,209.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2005,Tourist/visitor arrivals (thousands),VF,,304.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2010,Tourist/visitor arrivals (thousands),VF,,426.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2016,Tourist/visitor arrivals (thousands),VF,,1196.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2017,Tourist/visitor arrivals (thousands),VF,,1137.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2018,Tourist/visitor arrivals (thousands),VF,,1173.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,1995,Tourism expenditure (millions of US dollars),,,27.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2005,Tourism expenditure (millions of US dollars),,,27.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2010,Tourism expenditure (millions of US dollars),,,23.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2016,Tourism expenditure (millions of US dollars),,,48.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2017,Tourism expenditure (millions of US dollars),,,23.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +426,Lesotho,2018,Tourism expenditure (millions of US dollars),,,24.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +430,Liberia,2005,Tourism expenditure (millions of US dollars),,,67.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +434,Libya,2005,Tourist/visitor arrivals (thousands),THS,,81.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +434,Libya,1995,Tourism expenditure (millions of US dollars),,,4.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +434,Libya,2005,Tourism expenditure (millions of US dollars),,,301.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +434,Libya,2010,Tourism expenditure (millions of US dollars),,,170.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +438,Liechtenstein,2010,Tourist/visitor arrivals (thousands),TCE,,64.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +438,Liechtenstein,2016,Tourist/visitor arrivals (thousands),TCE,,69.1000,Excluding long term tourists on campgrounds and in holiday flats.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +438,Liechtenstein,2017,Tourist/visitor arrivals (thousands),TCE,,79.3000,Excluding long term tourists on campgrounds and in holiday flats.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +438,Liechtenstein,2018,Tourist/visitor arrivals (thousands),TCE,,85.3000,Excluding long term tourists on campgrounds and in holiday flats.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,1995,Tourist/visitor arrivals (thousands),TF,,650.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2005,Tourist/visitor arrivals (thousands),TF,,2000.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2010,Tourist/visitor arrivals (thousands),TF,,1507.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2016,Tourist/visitor arrivals (thousands),TF,,2296.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2017,Tourist/visitor arrivals (thousands),TF,,2523.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2018,Tourist/visitor arrivals (thousands),TF,,2825.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,1995,Tourism expenditure (millions of US dollars),,,77.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2005,Tourism expenditure (millions of US dollars),,,920.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2010,Tourism expenditure (millions of US dollars),,,958.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2016,Tourism expenditure (millions of US dollars),,,1210.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2017,Tourism expenditure (millions of US dollars),,,1325.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +440,Lithuania,2018,Tourism expenditure (millions of US dollars),,,1419.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,1995,Tourist/visitor arrivals (thousands),TCE,,768.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2005,Tourist/visitor arrivals (thousands),TCE,,913.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2010,Tourist/visitor arrivals (thousands),TCE,,805.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2016,Tourist/visitor arrivals (thousands),TCE,,1054.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2017,Tourist/visitor arrivals (thousands),TCE,,1046.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2018,Tourist/visitor arrivals (thousands),TCE,,1018.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2005,Tourism expenditure (millions of US dollars),,,3770.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2010,Tourism expenditure (millions of US dollars),,,4519.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2016,Tourism expenditure (millions of US dollars),,,4766.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2017,Tourism expenditure (millions of US dollars),,,4993.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +442,Luxembourg,2018,Tourism expenditure (millions of US dollars),,,5537.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,1995,Tourist/visitor arrivals (thousands),TF,,75.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2005,Tourist/visitor arrivals (thousands),TF,,277.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2010,Tourist/visitor arrivals (thousands),TF,,196.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2016,Tourist/visitor arrivals (thousands),TF,,293.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2017,Tourist/visitor arrivals (thousands),TF,,255.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2018,Tourist/visitor arrivals (thousands),TF,,291.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,1995,Tourism expenditure (millions of US dollars),,,106.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2005,Tourism expenditure (millions of US dollars),,,275.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2010,Tourism expenditure (millions of US dollars),,,425.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2016,Tourism expenditure (millions of US dollars),,,913.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2017,Tourism expenditure (millions of US dollars),,,849.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +450,Madagascar,2018,Tourism expenditure (millions of US dollars),,,879.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,1995,Tourist/visitor arrivals (thousands),TF,,192.0000,Departures.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2005,Tourist/visitor arrivals (thousands),TF,,438.0000,Departures.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2010,Tourist/visitor arrivals (thousands),TF,,746.0000,Departures.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2016,Tourist/visitor arrivals (thousands),TF,,849.0000,Departures.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2017,Tourist/visitor arrivals (thousands),TF,,837.0000,Departures.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2018,Tourist/visitor arrivals (thousands),TF,,871.0000,Departures.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,1995,Tourism expenditure (millions of US dollars),,,22.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2005,Tourism expenditure (millions of US dollars),,,48.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2010,Tourism expenditure (millions of US dollars),,,45.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2016,Tourism expenditure (millions of US dollars),,,30.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2017,Tourism expenditure (millions of US dollars),,,35.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +454,Malawi,2018,Tourism expenditure (millions of US dollars),,,43.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,1995,Tourist/visitor arrivals (thousands),TF,,7469.0000,Including Singapore residents crossing the frontier by road through Johore Causeway.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2005,Tourist/visitor arrivals (thousands),TF,,16431.0000,Including Singapore residents crossing the frontier by road through Johore Causeway.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2010,Tourist/visitor arrivals (thousands),TF,,24577.0000,Including Singapore residents crossing the frontier by road through Johore Causeway.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2016,Tourist/visitor arrivals (thousands),TF,,26757.0000,Including Singapore residents crossing the frontier by road through Johore Causeway.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2017,Tourist/visitor arrivals (thousands),TF,,25948.0000,Including Singapore residents crossing the frontier by road through Johore Causeway.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2018,Tourist/visitor arrivals (thousands),TF,,25832.0000,Including Singapore residents crossing the frontier by road through Johore Causeway.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,1995,Tourism expenditure (millions of US dollars),,,5044.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2005,Tourism expenditure (millions of US dollars),,,10389.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2010,Tourism expenditure (millions of US dollars),,,19619.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2016,Tourism expenditure (millions of US dollars),,,19682.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2017,Tourism expenditure (millions of US dollars),,,20311.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +458,Malaysia,2018,Tourism expenditure (millions of US dollars),,,21774.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,1995,Tourist/visitor arrivals (thousands),TF,,315.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,2005,Tourist/visitor arrivals (thousands),TF,,395.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,2010,Tourist/visitor arrivals (thousands),TF,,792.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,2016,Tourist/visitor arrivals (thousands),TF,,1286.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,2017,Tourist/visitor arrivals (thousands),TF,,1390.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,2018,Tourist/visitor arrivals (thousands),TF,,1484.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,2016,Tourism expenditure (millions of US dollars),,,2640.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,2017,Tourism expenditure (millions of US dollars),,,2771.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +462,Maldives,2018,Tourism expenditure (millions of US dollars),,,3054.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +466,Mali,2010,Tourist/visitor arrivals (thousands),TF,,169.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +466,Mali,2016,Tourist/visitor arrivals (thousands),TF,,173.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +466,Mali,2017,Tourist/visitor arrivals (thousands),TF,,193.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +466,Mali,1995,Tourism expenditure (millions of US dollars),,,26.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +466,Mali,2005,Tourism expenditure (millions of US dollars),,,149.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +466,Mali,2010,Tourism expenditure (millions of US dollars),,,208.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +466,Mali,2016,Tourism expenditure (millions of US dollars),,,201.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +466,Mali,2017,Tourism expenditure (millions of US dollars),,,206.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,1995,Tourist/visitor arrivals (thousands),TF,,1116.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2005,Tourist/visitor arrivals (thousands),TF,,1171.0000,Departures by air and by sea.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2010,Tourist/visitor arrivals (thousands),TF,,1339.0000,Departures by air and by sea.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2016,Tourist/visitor arrivals (thousands),TF,,1966.0000,Departures by air and by sea.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2017,Tourist/visitor arrivals (thousands),TF,,2274.0000,Departures by air and by sea.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2018,Tourist/visitor arrivals (thousands),TF,,2599.0000,Departures by air and by sea.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,1995,Tourism expenditure (millions of US dollars),,,656.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2005,Tourism expenditure (millions of US dollars),,,755.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2010,Tourism expenditure (millions of US dollars),,,1066.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2016,Tourism expenditure (millions of US dollars),,,1451.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2017,Tourism expenditure (millions of US dollars),,,1746.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +470,Malta,2018,Tourism expenditure (millions of US dollars),,,1845.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,1995,Tourist/visitor arrivals (thousands),TF,,5.5000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2005,Tourist/visitor arrivals (thousands),TF,,9.2000,Air and sea arrivals.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2010,Tourist/visitor arrivals (thousands),TF,,4.6000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2016,Tourist/visitor arrivals (thousands),TF,,5.4000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2017,Tourist/visitor arrivals (thousands),TF,,6.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2018,Tourist/visitor arrivals (thousands),TF,,6.8000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,1995,Tourism expenditure (millions of US dollars),,,2.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2005,Tourism expenditure (millions of US dollars),,,3.6900,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2010,Tourism expenditure (millions of US dollars),,,3.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2016,Tourism expenditure (millions of US dollars),,,30.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2017,Tourism expenditure (millions of US dollars),,,18.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +584,Marshall Islands,2018,Tourism expenditure (millions of US dollars),,,20.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,1995,Tourist/visitor arrivals (thousands),TF,,457.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2005,Tourist/visitor arrivals (thousands),TF,,484.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2010,Tourist/visitor arrivals (thousands),TF,,478.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2016,Tourist/visitor arrivals (thousands),TF,,519.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2017,Tourist/visitor arrivals (thousands),TF,,536.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2018,Tourist/visitor arrivals (thousands),TF,,537.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,1995,Tourism expenditure (millions of US dollars),,,384.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2005,Tourism expenditure (millions of US dollars),,,280.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2010,Tourism expenditure (millions of US dollars),,,472.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2016,Tourism expenditure (millions of US dollars),,,348.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2017,Tourism expenditure (millions of US dollars),,,510.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +474,Martinique,2018,Tourism expenditure (millions of US dollars),,,530.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +478,Mauritania,2016,Tourism expenditure (millions of US dollars),,,33.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +478,Mauritania,2017,Tourism expenditure (millions of US dollars),,,24.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +478,Mauritania,2018,Tourism expenditure (millions of US dollars),,,6.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,1995,Tourist/visitor arrivals (thousands),TF,,422.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2005,Tourist/visitor arrivals (thousands),TF,,761.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2010,Tourist/visitor arrivals (thousands),TF,,935.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2016,Tourist/visitor arrivals (thousands),TF,,1275.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2017,Tourist/visitor arrivals (thousands),TF,,1342.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2018,Tourist/visitor arrivals (thousands),TF,,1399.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,1995,Tourism expenditure (millions of US dollars),,,616.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2005,Tourism expenditure (millions of US dollars),,,1189.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2010,Tourism expenditure (millions of US dollars),,,1585.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2016,Tourism expenditure (millions of US dollars),,,1824.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2017,Tourism expenditure (millions of US dollars),,,2005.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +480,Mauritius,2018,Tourism expenditure (millions of US dollars),,,2161.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,1995,Tourist/visitor arrivals (thousands),TF,,20241.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2005,Tourist/visitor arrivals (thousands),TF,,21915.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2010,Tourist/visitor arrivals (thousands),TF,,23290.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2016,Tourist/visitor arrivals (thousands),TF,,35079.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2017,Tourist/visitor arrivals (thousands),TF,,39291.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2018,Tourist/visitor arrivals (thousands),TF,,41313.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,1995,Tourism expenditure (millions of US dollars),,,6847.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2005,Tourism expenditure (millions of US dollars),,,12801.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2010,Tourism expenditure (millions of US dollars),,,12628.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2016,Tourism expenditure (millions of US dollars),,,20619.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2017,Tourism expenditure (millions of US dollars),,,22467.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +484,Mexico,2018,Tourism expenditure (millions of US dollars),,,23802.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +583,Micronesia (Fed. States of),2005,Tourist/visitor arrivals (thousands),TF,,19.0000,"Arrivals in the States of Kosrae, Chuuk, Pohnpei and Yap; excluding FSM citizens.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +583,Micronesia (Fed. States of),2010,Tourist/visitor arrivals (thousands),TF,,44.7000,"Arrivals in the States of Kosrae, Chuuk, Pohnpei and Yap; excluding FSM citizens.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +583,Micronesia (Fed. States of),2016,Tourist/visitor arrivals (thousands),TF,,29.6000,"Arrivals in the States of Kosrae, Chuuk, Pohnpei and Yap; excluding FSM citizens.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +583,Micronesia (Fed. States of),2018,Tourist/visitor arrivals (thousands),TF,,19.2000,"Arrivals in the States of Kosrae, Chuuk, Pohnpei and Yap; excluding FSM citizens.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +583,Micronesia (Fed. States of),2010,Tourism expenditure (millions of US dollars),,,24.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +492,Monaco,1995,Tourist/visitor arrivals (thousands),THS,,233.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +492,Monaco,2005,Tourist/visitor arrivals (thousands),THS,,286.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +492,Monaco,2010,Tourist/visitor arrivals (thousands),THS,,279.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +492,Monaco,2016,Tourist/visitor arrivals (thousands),THS,,336.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +492,Monaco,2017,Tourist/visitor arrivals (thousands),THS,,355.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +492,Monaco,2018,Tourist/visitor arrivals (thousands),THS,,347.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2005,Tourist/visitor arrivals (thousands),TF,,339.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2010,Tourist/visitor arrivals (thousands),TF,,456.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2016,Tourist/visitor arrivals (thousands),TF,,404.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2017,Tourist/visitor arrivals (thousands),TF,,469.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2018,Tourist/visitor arrivals (thousands),TF,,529.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,1995,Tourism expenditure (millions of US dollars),,,33.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2005,Tourism expenditure (millions of US dollars),,,203.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2010,Tourism expenditure (millions of US dollars),,,288.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2016,Tourism expenditure (millions of US dollars),,,379.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2017,Tourism expenditure (millions of US dollars),,,462.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +496,Mongolia,2018,Tourism expenditure (millions of US dollars),,,526.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2005,Tourist/visitor arrivals (thousands),TCE,,272.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2010,Tourist/visitor arrivals (thousands),TCE,,1088.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2016,Tourist/visitor arrivals (thousands),TCE,,1662.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2017,Tourist/visitor arrivals (thousands),TCE,,1877.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2018,Tourist/visitor arrivals (thousands),TCE,,2077.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2010,Tourism expenditure (millions of US dollars),,,765.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2016,Tourism expenditure (millions of US dollars),,,978.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2017,Tourism expenditure (millions of US dollars),,,1110.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +499,Montenegro,2018,Tourism expenditure (millions of US dollars),,,1224.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,1995,Tourist/visitor arrivals (thousands),TF,,17.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2005,Tourist/visitor arrivals (thousands),TF,,9.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2010,Tourist/visitor arrivals (thousands),TF,,6.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2016,Tourist/visitor arrivals (thousands),TF,,8.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2017,Tourist/visitor arrivals (thousands),TF,,8.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2018,Tourist/visitor arrivals (thousands),TF,,8.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,1995,Tourism expenditure (millions of US dollars),,,17.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2005,Tourism expenditure (millions of US dollars),,,9.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2010,Tourism expenditure (millions of US dollars),,,5.9000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2016,Tourism expenditure (millions of US dollars),,,8.6000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2017,Tourism expenditure (millions of US dollars),,,8.4000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +500,Montserrat,2018,Tourism expenditure (millions of US dollars),,,11.1000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,1995,Tourist/visitor arrivals (thousands),TF,,2602.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2005,Tourist/visitor arrivals (thousands),TF,,5843.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2010,Tourist/visitor arrivals (thousands),TF,,9288.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2016,Tourist/visitor arrivals (thousands),TF,,10332.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2017,Tourist/visitor arrivals (thousands),TF,,11349.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2018,Tourist/visitor arrivals (thousands),TF,,12289.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,1995,Tourism expenditure (millions of US dollars),,,1469.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2005,Tourism expenditure (millions of US dollars),,,5426.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2010,Tourism expenditure (millions of US dollars),,,8176.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2016,Tourism expenditure (millions of US dollars),,,7922.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2017,Tourism expenditure (millions of US dollars),,,9086.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +504,Morocco,2018,Tourism expenditure (millions of US dollars),,,9523.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2005,Tourist/visitor arrivals (thousands),TF,,578.0000,The data correspond only to 12 border posts.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2010,Tourist/visitor arrivals (thousands),TF,,1718.0000,Break in the time series.;The data of all the border posts of the country are used.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2016,Tourist/visitor arrivals (thousands),TF,,1639.0000,The data of all the border posts of the country are used.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2017,Tourist/visitor arrivals (thousands),TF,,1447.0000,The data of all the border posts of the country are used.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2018,Tourist/visitor arrivals (thousands),TF,,2743.0000,The data of all the border posts of the country are used.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2005,Tourism expenditure (millions of US dollars),,,138.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2010,Tourism expenditure (millions of US dollars),,,135.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2016,Tourism expenditure (millions of US dollars),,,114.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2017,Tourism expenditure (millions of US dollars),,,164.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +508,Mozambique,2018,Tourism expenditure (millions of US dollars),,,331.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,1995,Tourist/visitor arrivals (thousands),TF,,194.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2005,Tourist/visitor arrivals (thousands),TF,,660.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2010,Tourist/visitor arrivals (thousands),TF,,792.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2016,Tourist/visitor arrivals (thousands),TF,,2907.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2017,Tourist/visitor arrivals (thousands),TF,,3443.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2018,Tourist/visitor arrivals (thousands),TF,,3551.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,1995,Tourism expenditure (millions of US dollars),,,169.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2005,Tourism expenditure (millions of US dollars),,,83.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2010,Tourism expenditure (millions of US dollars),,,91.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2016,Tourism expenditure (millions of US dollars),,,2289.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2017,Tourism expenditure (millions of US dollars),,,1988.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +104,Myanmar,2018,Tourism expenditure (millions of US dollars),,,1670.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,1995,Tourist/visitor arrivals (thousands),TF,,272.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2005,Tourist/visitor arrivals (thousands),TF,,778.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2010,Tourist/visitor arrivals (thousands),TF,,984.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2016,Tourist/visitor arrivals (thousands),TF,,1469.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2017,Tourist/visitor arrivals (thousands),TF,,1499.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2005,Tourism expenditure (millions of US dollars),,,363.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2010,Tourism expenditure (millions of US dollars),,,473.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2016,Tourism expenditure (millions of US dollars),,,349.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2017,Tourism expenditure (millions of US dollars),,,449.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +516,Namibia,2018,Tourism expenditure (millions of US dollars),,,488.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +520,Nauru,2010,Tourism expenditure (millions of US dollars),,,0.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +520,Nauru,2016,Tourism expenditure (millions of US dollars),,,3.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +520,Nauru,2017,Tourism expenditure (millions of US dollars),,,3.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +520,Nauru,2018,Tourism expenditure (millions of US dollars),,,1.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,1995,Tourist/visitor arrivals (thousands),TF,,363.0000,Including arrivals from India.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2005,Tourist/visitor arrivals (thousands),TF,,375.0000,Including arrivals from India.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2010,Tourist/visitor arrivals (thousands),TF,,603.0000,Including arrivals from India.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2016,Tourist/visitor arrivals (thousands),TF,,753.0000,Including arrivals from India.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2017,Tourist/visitor arrivals (thousands),TF,,940.0000,Including arrivals from India.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2018,Tourist/visitor arrivals (thousands),TF,,1173.0000,Including arrivals from India.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,1995,Tourism expenditure (millions of US dollars),,,232.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2005,Tourism expenditure (millions of US dollars),,,160.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2010,Tourism expenditure (millions of US dollars),,,378.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2016,Tourism expenditure (millions of US dollars),,,498.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2017,Tourism expenditure (millions of US dollars),,,712.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +524,Nepal,2018,Tourism expenditure (millions of US dollars),,,744.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,1995,Tourist/visitor arrivals (thousands),TCE,,6574.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,2005,Tourist/visitor arrivals (thousands),TCE,,10012.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,2010,Tourist/visitor arrivals (thousands),TCE,,10883.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,2016,Tourist/visitor arrivals (thousands),TCE,,15828.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,2017,Tourist/visitor arrivals (thousands),TCE,,17924.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,2018,Tourist/visitor arrivals (thousands),TCE,,18780.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,1995,Tourism expenditure (millions of US dollars),,,10611.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,2016,Tourism expenditure (millions of US dollars),,,21151.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,2017,Tourism expenditure (millions of US dollars),,,23414.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +528,Netherlands,2018,Tourism expenditure (millions of US dollars),,,25850.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,1995,Tourist/visitor arrivals (thousands),TF,,86.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,2005,Tourist/visitor arrivals (thousands),TF,,101.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,2010,Tourist/visitor arrivals (thousands),TF,,99.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,2016,Tourist/visitor arrivals (thousands),TF,,116.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,2017,Tourist/visitor arrivals (thousands),TF,,121.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,2018,Tourist/visitor arrivals (thousands),TF,,120.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,1995,Tourism expenditure (millions of US dollars),,,108.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,2005,Tourism expenditure (millions of US dollars),,,149.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,2010,Tourism expenditure (millions of US dollars),,,129.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +540,New Caledonia,2016,Tourism expenditure (millions of US dollars),,,159.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2005,Tourist/visitor arrivals (thousands),TF,,2353.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2010,Tourist/visitor arrivals (thousands),TF,,2435.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2016,Tourist/visitor arrivals (thousands),TF,,3370.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2017,Tourist/visitor arrivals (thousands),TF,,3555.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2018,Tourist/visitor arrivals (thousands),TF,,3686.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,1995,Tourism expenditure (millions of US dollars),,,2318.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2005,Tourism expenditure (millions of US dollars),,,6486.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2010,Tourism expenditure (millions of US dollars),,,6523.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2016,Tourism expenditure (millions of US dollars),,,9773.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2017,Tourism expenditure (millions of US dollars),,,10594.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +554,New Zealand,2018,Tourism expenditure (millions of US dollars),,,10961.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,1995,Tourist/visitor arrivals (thousands),TF,,281.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2005,Tourist/visitor arrivals (thousands),TF,,712.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2010,Tourist/visitor arrivals (thousands),TF,,1011.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2016,Tourist/visitor arrivals (thousands),TF,,1504.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2017,Tourist/visitor arrivals (thousands),TF,,1787.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2018,Tourist/visitor arrivals (thousands),TF,,1256.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,1995,Tourism expenditure (millions of US dollars),,,50.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2005,Tourism expenditure (millions of US dollars),,,206.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2010,Tourism expenditure (millions of US dollars),,,314.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2016,Tourism expenditure (millions of US dollars),,,642.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2017,Tourism expenditure (millions of US dollars),,,841.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +558,Nicaragua,2018,Tourism expenditure (millions of US dollars),,,544.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,1995,Tourist/visitor arrivals (thousands),TF,,35.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2005,Tourist/visitor arrivals (thousands),TF,,58.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2010,Tourist/visitor arrivals (thousands),TF,,74.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2016,Tourist/visitor arrivals (thousands),TF,,152.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2017,Tourist/visitor arrivals (thousands),TF,,164.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2018,Tourist/visitor arrivals (thousands),TF,,157.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2005,Tourism expenditure (millions of US dollars),,,43.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2010,Tourism expenditure (millions of US dollars),,,105.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2016,Tourism expenditure (millions of US dollars),,,84.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +562,Niger,2017,Tourism expenditure (millions of US dollars),,,91.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,1995,Tourist/visitor arrivals (thousands),TF,,656.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,2005,Tourist/visitor arrivals (thousands),TF,,1010.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,2010,Tourist/visitor arrivals (thousands),TF,,1555.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,2016,Tourist/visitor arrivals (thousands),TF,,1889.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,1995,Tourism expenditure (millions of US dollars),,,47.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,2005,Tourism expenditure (millions of US dollars),,,139.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,2010,Tourism expenditure (millions of US dollars),,,736.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,2016,Tourism expenditure (millions of US dollars),,,1088.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,2017,Tourism expenditure (millions of US dollars),,,2615.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +566,Nigeria,2018,Tourism expenditure (millions of US dollars),,,1977.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +570,Niue,1995,Tourist/visitor arrivals (thousands),TF,,2.2000,Including Niueans residing usually in New Zealand.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +570,Niue,2005,Tourist/visitor arrivals (thousands),TF,,2.8000,Including Niueans residing usually in New Zealand.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +570,Niue,2010,Tourist/visitor arrivals (thousands),TF,,6.2000,Including Niueans residing usually in New Zealand.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +570,Niue,2016,Tourist/visitor arrivals (thousands),TF,,8.9000,Including Niueans residing usually in New Zealand.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +570,Niue,2017,Tourist/visitor arrivals (thousands),TF,,9.8000,Including Niueans residing usually in New Zealand.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +570,Niue,1995,Tourism expenditure (millions of US dollars),,,2.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +570,Niue,2005,Tourism expenditure (millions of US dollars),,,1.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +570,Niue,2010,Tourism expenditure (millions of US dollars),,,2.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,1995,Tourist/visitor arrivals (thousands),TCE,,147.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2005,Tourist/visitor arrivals (thousands),TCE,,197.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2010,Tourist/visitor arrivals (thousands),TCE,,262.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2016,Tourist/visitor arrivals (thousands),TCE,,510.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2017,Tourist/visitor arrivals (thousands),TCE,,631.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2018,Tourist/visitor arrivals (thousands),TCE,,707.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2005,Tourism expenditure (millions of US dollars),,,116.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2010,Tourism expenditure (millions of US dollars),,,199.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2016,Tourism expenditure (millions of US dollars),,,283.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2017,Tourism expenditure (millions of US dollars),,,331.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +807,North Macedonia,2018,Tourism expenditure (millions of US dollars),,,387.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +580,Northern Mariana Islands,1995,Tourist/visitor arrivals (thousands),TF,,669.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +580,Northern Mariana Islands,2005,Tourist/visitor arrivals (thousands),TF,,498.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +580,Northern Mariana Islands,2010,Tourist/visitor arrivals (thousands),TF,,375.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +580,Northern Mariana Islands,2016,Tourist/visitor arrivals (thousands),TF,,526.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +580,Northern Mariana Islands,2017,Tourist/visitor arrivals (thousands),TF,,656.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +580,Northern Mariana Islands,2018,Tourist/visitor arrivals (thousands),TF,,517.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +580,Northern Mariana Islands,1995,Tourism expenditure (millions of US dollars),,,655.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,1995,Tourist/visitor arrivals (thousands),TF,,2880.0000,Non-resident tourists staying in registered hotels.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2005,Tourist/visitor arrivals (thousands),TF,,3824.0000,Arrivals of non-resident tourists at national borders.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2010,Tourist/visitor arrivals (thousands),TF,,4767.0000,Arrivals of non-resident tourists at national borders.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2016,Tourist/visitor arrivals (thousands),TF,,5960.0000,Non-resident tourists staying in all types of accommodation establishments.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2017,Tourist/visitor arrivals (thousands),TF,,6252.0000,Non-resident tourists staying in all types of accommodation establishments.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2018,Tourist/visitor arrivals (thousands),TF,,5688.0000,Non-resident tourists staying in all types of accommodation establishments.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,1995,Tourism expenditure (millions of US dollars),,,2730.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2005,Tourism expenditure (millions of US dollars),,,4243.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2010,Tourism expenditure (millions of US dollars),,,5299.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2016,Tourism expenditure (millions of US dollars),,,6285.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2017,Tourism expenditure (millions of US dollars),,,6840.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +578,Norway,2018,Tourism expenditure (millions of US dollars),,,7096.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2005,Tourist/visitor arrivals (thousands),TF,,891.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2010,Tourist/visitor arrivals (thousands),TF,,1441.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2016,Tourist/visitor arrivals (thousands),TF,,2335.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2017,Tourist/visitor arrivals (thousands),TF,,2316.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2018,Tourist/visitor arrivals (thousands),TF,,2301.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2005,Tourism expenditure (millions of US dollars),,,627.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2010,Tourism expenditure (millions of US dollars),,,1072.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2016,Tourism expenditure (millions of US dollars),,,2390.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2017,Tourism expenditure (millions of US dollars),,,2717.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +512,Oman,2018,Tourism expenditure (millions of US dollars),,,2975.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,1995,Tourist/visitor arrivals (thousands),VF,,2332.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2005,Tourist/visitor arrivals (thousands),VF,,3378.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2010,Tourist/visitor arrivals (thousands),VF,,5567.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2016,Tourist/visitor arrivals (thousands),VF,,10690.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2017,Tourist/visitor arrivals (thousands),VF,,10740.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2018,Tourist/visitor arrivals (thousands),VF,,11067.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,1995,Tourism expenditure (millions of US dollars),,,3985.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2005,Tourism expenditure (millions of US dollars),,,5740.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2010,Tourism expenditure (millions of US dollars),,,10387.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2016,Tourism expenditure (millions of US dollars),,,15825.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2017,Tourism expenditure (millions of US dollars),,,14847.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +158,Other non-specified areas,2018,Tourism expenditure (millions of US dollars),,,16366.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,1995,Tourist/visitor arrivals (thousands),TF,,378.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,2005,Tourist/visitor arrivals (thousands),TF,,798.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,2010,Tourist/visitor arrivals (thousands),TF,,907.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,1995,Tourism expenditure (millions of US dollars),,,582.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,2005,Tourism expenditure (millions of US dollars),,,828.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,2010,Tourism expenditure (millions of US dollars),,,998.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,2016,Tourism expenditure (millions of US dollars),,,791.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,2017,Tourism expenditure (millions of US dollars),,,866.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +586,Pakistan,2018,Tourism expenditure (millions of US dollars),,,818.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,1995,Tourist/visitor arrivals (thousands),TF,,53.0000,Air arrivals (Palau International Airport).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2005,Tourist/visitor arrivals (thousands),TF,,81.0000,Air arrivals (Palau International Airport).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2010,Tourist/visitor arrivals (thousands),TF,,85.0000,Air arrivals (Palau International Airport).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2016,Tourist/visitor arrivals (thousands),TF,,138.0000,Air arrivals (Palau International Airport).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2017,Tourist/visitor arrivals (thousands),TF,,123.0000,Air arrivals (Palau International Airport).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2018,Tourist/visitor arrivals (thousands),TF,,106.0000,Air arrivals (Palau International Airport).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2005,Tourism expenditure (millions of US dollars),,,63.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2010,Tourism expenditure (millions of US dollars),,,76.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2016,Tourism expenditure (millions of US dollars),,,148.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +585,Palau,2017,Tourism expenditure (millions of US dollars),,,123.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,1995,Tourist/visitor arrivals (thousands),TF,,345.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2005,Tourist/visitor arrivals (thousands),TF,,702.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2010,Tourist/visitor arrivals (thousands),TF,,1324.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2016,Tourist/visitor arrivals (thousands),TF,,1921.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2017,Tourist/visitor arrivals (thousands),TF,,1843.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2018,Tourist/visitor arrivals (thousands),TF,,1785.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,1995,Tourism expenditure (millions of US dollars),,,372.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2005,Tourism expenditure (millions of US dollars),,,1108.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2010,Tourism expenditure (millions of US dollars),,,2621.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2016,Tourism expenditure (millions of US dollars),,,6280.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2017,Tourism expenditure (millions of US dollars),,,6824.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +591,Panama,2018,Tourism expenditure (millions of US dollars),,,5615.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,1995,Tourist/visitor arrivals (thousands),TF,,42.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2005,Tourist/visitor arrivals (thousands),TF,,69.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2010,Tourist/visitor arrivals (thousands),TF,,140.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2016,Tourist/visitor arrivals (thousands),TF,,179.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2017,Tourist/visitor arrivals (thousands),TF,,139.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2018,Tourist/visitor arrivals (thousands),TF,,140.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2005,Tourism expenditure (millions of US dollars),,,9.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2010,Tourism expenditure (millions of US dollars),,,2.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2016,Tourism expenditure (millions of US dollars),,,1.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +598,Papua New Guinea,2017,Tourism expenditure (millions of US dollars),,,15.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,1995,Tourist/visitor arrivals (thousands),TF,,438.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2005,Tourist/visitor arrivals (thousands),TF,,341.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2010,Tourist/visitor arrivals (thousands),TF,,465.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2016,Tourist/visitor arrivals (thousands),TF,,1308.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2017,Tourist/visitor arrivals (thousands),TF,,1584.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2018,Tourist/visitor arrivals (thousands),TF,,1181.0000,Excluding nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,1995,Tourism expenditure (millions of US dollars),,,162.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2005,Tourism expenditure (millions of US dollars),,,96.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2010,Tourism expenditure (millions of US dollars),,,243.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2016,Tourism expenditure (millions of US dollars),,,356.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2017,Tourism expenditure (millions of US dollars),,,399.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +600,Paraguay,2018,Tourism expenditure (millions of US dollars),,,393.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,1995,Tourist/visitor arrivals (thousands),TF,,479.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2005,Tourist/visitor arrivals (thousands),TF,,1571.0000,Including nationals residing abroad.;Including tourists with identity document other than a passport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2010,Tourist/visitor arrivals (thousands),TF,,2299.0000,Including nationals residing abroad.;Including tourists with identity document other than a passport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2016,Tourist/visitor arrivals (thousands),TF,,3744.0000,Including nationals residing abroad.;Including tourists with identity document other than a passport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2017,Tourist/visitor arrivals (thousands),TF,,4032.0000,Including nationals residing abroad.;Including tourists with identity document other than a passport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2018,Tourist/visitor arrivals (thousands),TF,,4419.0000,Including nationals residing abroad.;Including tourists with identity document other than a passport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,1995,Tourism expenditure (millions of US dollars),,,521.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2005,Tourism expenditure (millions of US dollars),,,1438.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2010,Tourism expenditure (millions of US dollars),,,2475.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2016,Tourism expenditure (millions of US dollars),,,4288.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2017,Tourism expenditure (millions of US dollars),,,4573.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +604,Peru,2018,Tourism expenditure (millions of US dollars),,,4894.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,1995,Tourist/visitor arrivals (thousands),TF,,1760.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2005,Tourist/visitor arrivals (thousands),TF,,2623.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2010,Tourist/visitor arrivals (thousands),TF,,3520.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2016,Tourist/visitor arrivals (thousands),TF,,5967.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2017,Tourist/visitor arrivals (thousands),TF,,6621.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2018,Tourist/visitor arrivals (thousands),TF,,7168.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,1995,Tourism expenditure (millions of US dollars),,,1141.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2005,Tourism expenditure (millions of US dollars),,,2863.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2010,Tourism expenditure (millions of US dollars),,,3441.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2016,Tourism expenditure (millions of US dollars),,,6289.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2017,Tourism expenditure (millions of US dollars),,,8349.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +608,Philippines,2018,Tourism expenditure (millions of US dollars),,,9730.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,1995,Tourist/visitor arrivals (thousands),TF,,19215.0000,"Border statistics are not collected any more, surveys used instead.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2005,Tourist/visitor arrivals (thousands),TF,,15200.0000,"Border statistics are not collected any more, surveys used instead.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2010,Tourist/visitor arrivals (thousands),TF,,12470.0000,"Border statistics are not collected any more, surveys used instead.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2016,Tourist/visitor arrivals (thousands),TF,,17471.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2017,Tourist/visitor arrivals (thousands),TF,,18258.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2018,Tourist/visitor arrivals (thousands),TF,,19622.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,1995,Tourism expenditure (millions of US dollars),,,6927.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2005,Tourism expenditure (millions of US dollars),,,7161.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2010,Tourism expenditure (millions of US dollars),,,10036.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2016,Tourism expenditure (millions of US dollars),,,12052.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2017,Tourism expenditure (millions of US dollars),,,14083.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +616,Poland,2018,Tourism expenditure (millions of US dollars),,,15748.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,1995,Tourist/visitor arrivals (thousands),TCE,,4572.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2005,Tourist/visitor arrivals (thousands),TCE,,5769.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2010,Tourist/visitor arrivals (thousands),TCE,,6756.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2016,Tourist/visitor arrivals (thousands),TCE,,13359.0000,"Include hotels, apartment hotels, “pousadas”, tourist apartments, tourist villages, camping sites, recreation centres, tourism in rural areas and local accommodation.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2017,Tourist/visitor arrivals (thousands),TCE,,15432.0000,"Include hotels, apartment hotels, “pousadas”, tourist apartments, tourist villages, camping sites, recreation centres, tourism in rural areas and local accommodation.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2018,Tourist/visitor arrivals (thousands),TCE,,16186.0000,"Include hotels, apartment hotels, “pousadas”, tourist apartments, tourist villages, camping sites, recreation centres, tourism in rural areas and local accommodation.","World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,1995,Tourism expenditure (millions of US dollars),,,5646.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2005,Tourism expenditure (millions of US dollars),,,9038.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2010,Tourism expenditure (millions of US dollars),,,12984.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2016,Tourism expenditure (millions of US dollars),,,17347.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2017,Tourism expenditure (millions of US dollars),,,21586.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +620,Portugal,2018,Tourism expenditure (millions of US dollars),,,24105.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,1995,Tourist/visitor arrivals (thousands),TF,,3131.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2005,Tourist/visitor arrivals (thousands),TF,,3686.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2010,Tourist/visitor arrivals (thousands),TF,,3186.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2016,Tourist/visitor arrivals (thousands),TF,,3736.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2017,Tourist/visitor arrivals (thousands),TF,,3513.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2018,Tourist/visitor arrivals (thousands),TF,,3068.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,1995,Tourism expenditure (millions of US dollars),,,1828.0000,Data refer to fiscal years beginning 1 July.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2005,Tourism expenditure (millions of US dollars),,,3239.0000,Data refer to fiscal years beginning 1 July.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2010,Tourism expenditure (millions of US dollars),,,3211.0000,Data refer to fiscal years beginning 1 July.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2016,Tourism expenditure (millions of US dollars),,,3974.0000,Data refer to fiscal years beginning 1 July.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2017,Tourism expenditure (millions of US dollars),,,3848.0000,Data refer to fiscal years beginning 1 July.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +630,Puerto Rico,2018,Tourism expenditure (millions of US dollars),,,3282.0000,Data refer to fiscal years beginning 1 July.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +634,Qatar,2010,Tourist/visitor arrivals (thousands),TF,,1699.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +634,Qatar,2016,Tourist/visitor arrivals (thousands),TF,,2938.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +634,Qatar,2017,Tourist/visitor arrivals (thousands),TF,,2256.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +634,Qatar,2018,Tourist/visitor arrivals (thousands),TF,,1819.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +634,Qatar,2016,Tourism expenditure (millions of US dollars),,,12593.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +634,Qatar,2017,Tourism expenditure (millions of US dollars),,,15757.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +634,Qatar,2018,Tourism expenditure (millions of US dollars),,,15239.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,1995,Tourist/visitor arrivals (thousands),VF,,3753.0000,Including nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2005,Tourist/visitor arrivals (thousands),VF,,6023.0000,Including nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2010,Tourist/visitor arrivals (thousands),VF,,8798.0000,Including nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2016,Tourist/visitor arrivals (thousands),VF,,17242.0000,Including nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2017,Tourist/visitor arrivals (thousands),VF,,13336.0000,Including nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2018,Tourist/visitor arrivals (thousands),VF,,15347.0000,Including nationals residing abroad and crew members.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,1995,Tourism expenditure (millions of US dollars),,,6670.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2005,Tourism expenditure (millions of US dollars),,,8282.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2010,Tourism expenditure (millions of US dollars),,,14315.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2016,Tourism expenditure (millions of US dollars),,,20924.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2017,Tourism expenditure (millions of US dollars),,,17173.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +410,Republic of Korea,2018,Tourism expenditure (millions of US dollars),,,19856.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2005,Tourist/visitor arrivals (thousands),TCE,,67.0000,Excluding the left side of the river Nistru and the municipality of Bender.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2010,Tourist/visitor arrivals (thousands),TCE,,64.0000,Excluding the left side of the river Nistru and the municipality of Bender.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2016,Tourist/visitor arrivals (thousands),TCE,,121.0000,Excluding the left side of the river Nistru and the municipality of Bender.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2017,Tourist/visitor arrivals (thousands),TCE,,145.0000,Excluding the left side of the river Nistru and the municipality of Bender.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2018,Tourist/visitor arrivals (thousands),TCE,,160.0000,Excluding the left side of the river Nistru and the municipality of Bender.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,1995,Tourism expenditure (millions of US dollars),,,71.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2005,Tourism expenditure (millions of US dollars),,,138.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2010,Tourism expenditure (millions of US dollars),,,222.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2016,Tourism expenditure (millions of US dollars),,,344.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2017,Tourism expenditure (millions of US dollars),,,443.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +498,Republic of Moldova,2018,Tourism expenditure (millions of US dollars),,,500.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,1995,Tourist/visitor arrivals (thousands),TF,,304.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2005,Tourist/visitor arrivals (thousands),TF,,409.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2010,Tourist/visitor arrivals (thousands),TF,,420.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2016,Tourist/visitor arrivals (thousands),TF,,458.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2017,Tourist/visitor arrivals (thousands),TF,,508.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2018,Tourist/visitor arrivals (thousands),TF,,535.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,1995,Tourism expenditure (millions of US dollars),,,216.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2005,Tourism expenditure (millions of US dollars),,,364.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2010,Tourism expenditure (millions of US dollars),,,392.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2016,Tourism expenditure (millions of US dollars),,,343.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2017,Tourism expenditure (millions of US dollars),,,427.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +638,Réunion,2018,Tourism expenditure (millions of US dollars),,,495.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,1995,Tourist/visitor arrivals (thousands),VF,,5445.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2005,Tourist/visitor arrivals (thousands),VF,,5839.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2010,Tourist/visitor arrivals (thousands),VF,,7498.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2016,Tourist/visitor arrivals (thousands),VF,,10223.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2017,Tourist/visitor arrivals (thousands),VF,,10926.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2018,Tourist/visitor arrivals (thousands),VF,,11720.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,1995,Tourism expenditure (millions of US dollars),,,689.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2005,Tourism expenditure (millions of US dollars),,,1324.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2010,Tourism expenditure (millions of US dollars),,,1631.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2016,Tourism expenditure (millions of US dollars),,,2172.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2017,Tourism expenditure (millions of US dollars),,,3008.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +642,Romania,2018,Tourism expenditure (millions of US dollars),,,3261.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,1995,Tourist/visitor arrivals (thousands),VF,,10290.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2005,Tourist/visitor arrivals (thousands),VF,,22201.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2010,Tourist/visitor arrivals (thousands),VF,,22281.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2016,Tourist/visitor arrivals (thousands),VF,,24571.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2017,Tourist/visitor arrivals (thousands),VF,,24390.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2018,Tourist/visitor arrivals (thousands),VF,,24551.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2005,Tourism expenditure (millions of US dollars),,,7805.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2010,Tourism expenditure (millions of US dollars),,,13239.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2016,Tourism expenditure (millions of US dollars),,,12822.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2017,Tourism expenditure (millions of US dollars),,,14983.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +643,Russian Federation,2018,Tourism expenditure (millions of US dollars),,,18670.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +646,Rwanda,2010,Tourist/visitor arrivals (thousands),TF,,504.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +646,Rwanda,2016,Tourist/visitor arrivals (thousands),TF,,932.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +646,Rwanda,1995,Tourism expenditure (millions of US dollars),,,4.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +646,Rwanda,2005,Tourism expenditure (millions of US dollars),,,67.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +646,Rwanda,2010,Tourism expenditure (millions of US dollars),,,224.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +646,Rwanda,2016,Tourism expenditure (millions of US dollars),,,443.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +646,Rwanda,2017,Tourism expenditure (millions of US dollars),,,548.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +646,Rwanda,2018,Tourism expenditure (millions of US dollars),,,528.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +667,Saba,1995,Tourist/visitor arrivals (thousands),TF,,10.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +667,Saba,2005,Tourist/visitor arrivals (thousands),TF,,11.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +667,Saba,2010,Tourist/visitor arrivals (thousands),TF,,12.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,1995,Tourist/visitor arrivals (thousands),TF,,79.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2005,Tourist/visitor arrivals (thousands),TF,,141.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2010,Tourist/visitor arrivals (thousands),TF,,98.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2016,Tourist/visitor arrivals (thousands),TF,,116.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2017,Tourist/visitor arrivals (thousands),TF,,115.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2018,Tourist/visitor arrivals (thousands),TF,,125.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,1995,Tourism expenditure (millions of US dollars),,,63.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2005,Tourism expenditure (millions of US dollars),,,121.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2010,Tourism expenditure (millions of US dollars),,,90.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2016,Tourism expenditure (millions of US dollars),,,332.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2017,Tourism expenditure (millions of US dollars),,,355.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +659,Saint Kitts and Nevis,2018,Tourism expenditure (millions of US dollars),,,367.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,1995,Tourist/visitor arrivals (thousands),TF,,231.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2005,Tourist/visitor arrivals (thousands),TF,,318.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2010,Tourist/visitor arrivals (thousands),TF,,306.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2016,Tourist/visitor arrivals (thousands),TF,,348.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2017,Tourist/visitor arrivals (thousands),TF,,386.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2018,Tourist/visitor arrivals (thousands),TF,,395.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,1995,Tourism expenditure (millions of US dollars),,,230.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2005,Tourism expenditure (millions of US dollars),,,382.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2010,Tourism expenditure (millions of US dollars),,,309.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2016,Tourism expenditure (millions of US dollars),,,776.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2017,Tourism expenditure (millions of US dollars),,,875.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +662,Saint Lucia,2018,Tourism expenditure (millions of US dollars),,,989.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,1995,Tourist/visitor arrivals (thousands),TF,,60.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2005,Tourist/visitor arrivals (thousands),TF,,96.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2010,Tourist/visitor arrivals (thousands),TF,,72.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2016,Tourist/visitor arrivals (thousands),TF,,79.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2017,Tourist/visitor arrivals (thousands),TF,,76.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2018,Tourist/visitor arrivals (thousands),TF,,80.0000,Arrivals of non-resident tourists by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,1995,Tourism expenditure (millions of US dollars),,,53.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2005,Tourism expenditure (millions of US dollars),,,104.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2010,Tourism expenditure (millions of US dollars),,,86.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2016,Tourism expenditure (millions of US dollars),,,216.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2017,Tourism expenditure (millions of US dollars),,,211.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +670,Saint Vincent & Grenadines,2018,Tourism expenditure (millions of US dollars),,,235.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,1995,Tourist/visitor arrivals (thousands),TF,,68.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2005,Tourist/visitor arrivals (thousands),TF,,102.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2010,Tourist/visitor arrivals (thousands),TF,,122.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2016,Tourist/visitor arrivals (thousands),TF,,134.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2017,Tourist/visitor arrivals (thousands),TF,,146.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2018,Tourist/visitor arrivals (thousands),TF,,164.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,1995,Tourism expenditure (millions of US dollars),,,35.6994,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2005,Tourism expenditure (millions of US dollars),,,73.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2010,Tourism expenditure (millions of US dollars),,,123.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2016,Tourism expenditure (millions of US dollars),,,148.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2017,Tourism expenditure (millions of US dollars),,,167.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +882,Samoa,2018,Tourism expenditure (millions of US dollars),,,191.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +674,San Marino,1995,Tourist/visitor arrivals (thousands),THS,,28.0000,Including Italian tourists.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +674,San Marino,2005,Tourist/visitor arrivals (thousands),THS,,50.0000,Including Italian tourists.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +674,San Marino,2010,Tourist/visitor arrivals (thousands),THS,,120.0000,Including Italian tourists.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +674,San Marino,2016,Tourist/visitor arrivals (thousands),THS,,60.0000,Including Italian tourists.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +674,San Marino,2017,Tourist/visitor arrivals (thousands),THS,,78.0000,Including Italian tourists.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +674,San Marino,2018,Tourist/visitor arrivals (thousands),THS,,84.0000,Including Italian tourists.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,1995,Tourist/visitor arrivals (thousands),TF,,6.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,2005,Tourist/visitor arrivals (thousands),TF,,15.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,2010,Tourist/visitor arrivals (thousands),TF,,8.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,2016,Tourist/visitor arrivals (thousands),TF,,28.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,2017,Tourist/visitor arrivals (thousands),TF,,28.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,2018,Tourist/visitor arrivals (thousands),TF,,33.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,2016,Tourism expenditure (millions of US dollars),,,69.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,2017,Tourism expenditure (millions of US dollars),,,65.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +678,Sao Tome and Principe,2018,Tourism expenditure (millions of US dollars),,,71.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,1995,Tourist/visitor arrivals (thousands),TF,,3325.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2005,Tourist/visitor arrivals (thousands),TF,,8037.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2010,Tourist/visitor arrivals (thousands),TF,,10850.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2016,Tourist/visitor arrivals (thousands),TF,,18044.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2017,Tourist/visitor arrivals (thousands),TF,,16109.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2018,Tourist/visitor arrivals (thousands),TF,,15334.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2010,Tourism expenditure (millions of US dollars),,,7536.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2016,Tourism expenditure (millions of US dollars),,,13438.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2017,Tourism expenditure (millions of US dollars),,,15020.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +682,Saudi Arabia,2018,Tourism expenditure (millions of US dollars),,,16975.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,2005,Tourist/visitor arrivals (thousands),TF,,769.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,2010,Tourist/visitor arrivals (thousands),TF,,900.0000,Estimate.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,2016,Tourist/visitor arrivals (thousands),TF,,1210.0000,Estimate.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,2017,Tourist/visitor arrivals (thousands),TF,,1365.0000,Estimate.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,1995,Tourism expenditure (millions of US dollars),,,168.1803,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,2005,Tourism expenditure (millions of US dollars),,,334.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,2010,Tourism expenditure (millions of US dollars),,,464.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,2016,Tourism expenditure (millions of US dollars),,,438.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +686,Senegal,2017,Tourism expenditure (millions of US dollars),,,468.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2005,Tourist/visitor arrivals (thousands),TCE,,453.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2010,Tourist/visitor arrivals (thousands),TCE,,683.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2016,Tourist/visitor arrivals (thousands),TCE,,1281.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2017,Tourist/visitor arrivals (thousands),TCE,,1497.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2018,Tourist/visitor arrivals (thousands),TCE,,1711.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2005,Tourism expenditure (millions of US dollars),,,308.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2010,Tourism expenditure (millions of US dollars),,,950.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2016,Tourism expenditure (millions of US dollars),,,1461.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2017,Tourism expenditure (millions of US dollars),,,1706.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +688,Serbia,2018,Tourism expenditure (millions of US dollars),,,1921.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,1995,Tourist/visitor arrivals (thousands),TF,,121.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2005,Tourist/visitor arrivals (thousands),TF,,129.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2010,Tourist/visitor arrivals (thousands),TF,,175.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2016,Tourist/visitor arrivals (thousands),TF,,303.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2017,Tourist/visitor arrivals (thousands),TF,,350.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2018,Tourist/visitor arrivals (thousands),TF,,362.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,1995,Tourism expenditure (millions of US dollars),,,224.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2005,Tourism expenditure (millions of US dollars),,,269.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2010,Tourism expenditure (millions of US dollars),,,352.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2016,Tourism expenditure (millions of US dollars),,,505.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2017,Tourism expenditure (millions of US dollars),,,585.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +690,Seychelles,2018,Tourism expenditure (millions of US dollars),,,611.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,1995,Tourist/visitor arrivals (thousands),TF,,13.8000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2005,Tourist/visitor arrivals (thousands),TF,,40.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2010,Tourist/visitor arrivals (thousands),TF,,39.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2016,Tourist/visitor arrivals (thousands),TF,,55.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2017,Tourist/visitor arrivals (thousands),TF,,51.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2018,Tourist/visitor arrivals (thousands),TF,,57.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,1995,Tourism expenditure (millions of US dollars),,,57.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2005,Tourism expenditure (millions of US dollars),,,64.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2010,Tourism expenditure (millions of US dollars),,,26.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2016,Tourism expenditure (millions of US dollars),,,41.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2017,Tourism expenditure (millions of US dollars),,,39.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +694,Sierra Leone,2018,Tourism expenditure (millions of US dollars),,,39.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,1995,Tourist/visitor arrivals (thousands),TF,,6070.0000,Excluding Malaysian citizens arriving by land.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2005,Tourist/visitor arrivals (thousands),TF,,7079.0000,Excluding Malaysian citizens arriving by land.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2010,Tourist/visitor arrivals (thousands),TF,,9161.0000,Excluding Malaysian citizens arriving by land.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2016,Tourist/visitor arrivals (thousands),TF,,12913.0000,Excluding Malaysian citizens arriving by land.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2017,Tourist/visitor arrivals (thousands),TF,,13903.0000,Excluding Malaysian citizens arriving by land.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2018,Tourist/visitor arrivals (thousands),TF,,14673.0000,Excluding Malaysian citizens arriving by land.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,1995,Tourism expenditure (millions of US dollars),,,7611.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2005,Tourism expenditure (millions of US dollars),,,6209.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2010,Tourism expenditure (millions of US dollars),,,14178.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2016,Tourism expenditure (millions of US dollars),,,18944.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2017,Tourism expenditure (millions of US dollars),,,19891.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +702,Singapore,2018,Tourism expenditure (millions of US dollars),,,20416.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +668,Sint Eustatius,1995,Tourist/visitor arrivals (thousands),TF,,8.8000,Excluding Netherlands Antillean residents.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +668,Sint Eustatius,2005,Tourist/visitor arrivals (thousands),TF,,10.4000,Excluding Netherlands Antillean residents.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +668,Sint Eustatius,2010,Tourist/visitor arrivals (thousands),TF,,11.4000,Excluding Netherlands Antillean residents.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),1995,Tourist/visitor arrivals (thousands),TF,,460.0000,Arrivals by air. Including arrivals to Saint Martin (French part).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2005,Tourist/visitor arrivals (thousands),TF,,468.0000,Arrivals by air. Including arrivals to Saint Martin (French part).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2010,Tourist/visitor arrivals (thousands),TF,,443.0000,Arrivals by air. Including arrivals to Saint Martin (French part).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2016,Tourist/visitor arrivals (thousands),TF,,528.0000,Arrivals by air. Including arrivals to Saint Martin (French part).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2017,Tourist/visitor arrivals (thousands),TF,,402.0000,Arrivals by air. Including arrivals to Saint Martin (French part).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2018,Tourist/visitor arrivals (thousands),TF,,178.0000,Arrivals by air. Including arrivals to Saint Martin (French part).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2010,Tourism expenditure (millions of US dollars),,,681.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2016,Tourism expenditure (millions of US dollars),,,871.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2017,Tourism expenditure (millions of US dollars),,,646.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +534,Sint Maarten (Dutch part),2018,Tourism expenditure (millions of US dollars),,,468.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,1995,Tourist/visitor arrivals (thousands),TCE,,903.0000,Non-resident tourists staying in commercial accommodation only (representing approximately 25% of all tourists).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2005,Tourist/visitor arrivals (thousands),TCE,,1515.0000,Non-resident tourists staying in commercial accommodation only (representing approximately 25% of all tourists).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2010,Tourist/visitor arrivals (thousands),TCE,,1327.0000,Non-resident tourists staying in commercial accommodation only (representing approximately 25% of all tourists).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2016,Tourist/visitor arrivals (thousands),TCE,,2027.0000,Non-resident tourists staying in commercial accommodation only (representing approximately 25% of all tourists).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2017,Tourist/visitor arrivals (thousands),TCE,,2162.0000,Non-resident tourists staying in commercial accommodation only (representing approximately 25% of all tourists).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2018,Tourist/visitor arrivals (thousands),TCE,,2256.0000,Non-resident tourists staying in commercial accommodation only (representing approximately 25% of all tourists).,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,1995,Tourism expenditure (millions of US dollars),,,630.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2005,Tourism expenditure (millions of US dollars),,,1282.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2010,Tourism expenditure (millions of US dollars),,,2334.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2016,Tourism expenditure (millions of US dollars),,,2812.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2017,Tourism expenditure (millions of US dollars),,,3024.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +703,Slovakia,2018,Tourism expenditure (millions of US dollars),,,3318.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,1995,Tourist/visitor arrivals (thousands),TCE,,732.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2005,Tourist/visitor arrivals (thousands),TCE,,1555.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2010,Tourist/visitor arrivals (thousands),TCE,,2049.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2016,Tourist/visitor arrivals (thousands),TCE,,3397.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2017,Tourist/visitor arrivals (thousands),TCE,,3991.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2018,Tourist/visitor arrivals (thousands),TCE,,4425.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,1995,Tourism expenditure (millions of US dollars),,,1128.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2005,Tourism expenditure (millions of US dollars),,,1894.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2010,Tourism expenditure (millions of US dollars),,,2808.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2016,Tourism expenditure (millions of US dollars),,,2717.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2017,Tourism expenditure (millions of US dollars),,,3057.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +705,Slovenia,2018,Tourism expenditure (millions of US dollars),,,3378.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,1995,Tourist/visitor arrivals (thousands),TF,,11.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2005,Tourist/visitor arrivals (thousands),TF,,9.4000,Without first quarter.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2010,Tourist/visitor arrivals (thousands),TF,,20.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2016,Tourist/visitor arrivals (thousands),TF,,23.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2017,Tourist/visitor arrivals (thousands),TF,,25.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2018,Tourist/visitor arrivals (thousands),TF,,27.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,1995,Tourism expenditure (millions of US dollars),,,17.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2005,Tourism expenditure (millions of US dollars),,,6.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2010,Tourism expenditure (millions of US dollars),,,50.8000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2016,Tourism expenditure (millions of US dollars),,,71.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2017,Tourism expenditure (millions of US dollars),,,79.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +90,Solomon Islands,2018,Tourism expenditure (millions of US dollars),,,92.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,1995,Tourist/visitor arrivals (thousands),TF,,4488.0000,Excluding arrivals for work and contract workers.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2005,Tourist/visitor arrivals (thousands),TF,,7369.0000,Excluding arrivals for work and contract workers.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2010,Tourist/visitor arrivals (thousands),TF,,8074.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2016,Tourist/visitor arrivals (thousands),TF,,10044.0000,Break in the time series.;Excluding transit.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2017,Tourist/visitor arrivals (thousands),TF,,10285.0000,Excluding transit.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2018,Tourist/visitor arrivals (thousands),TF,,10472.0000,Excluding transit.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,1995,Tourism expenditure (millions of US dollars),,,2654.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2005,Tourism expenditure (millions of US dollars),,,8629.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2010,Tourism expenditure (millions of US dollars),,,10309.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2016,Tourism expenditure (millions of US dollars),,,8807.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2017,Tourism expenditure (millions of US dollars),,,9706.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +710,South Africa,2018,Tourism expenditure (millions of US dollars),,,9789.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +728,South Sudan,2016,Tourism expenditure (millions of US dollars),,,23.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +728,South Sudan,2017,Tourism expenditure (millions of US dollars),,,26.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +728,South Sudan,2018,Tourism expenditure (millions of US dollars),,,12.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,1995,Tourist/visitor arrivals (thousands),TF,,32971.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2005,Tourist/visitor arrivals (thousands),TF,,55914.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2010,Tourist/visitor arrivals (thousands),TF,,52677.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2016,Tourist/visitor arrivals (thousands),TF,,75315.0000,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2017,Tourist/visitor arrivals (thousands),TF,,81869.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2018,Tourist/visitor arrivals (thousands),TF,,82773.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,1995,Tourism expenditure (millions of US dollars),,,25368.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2005,Tourism expenditure (millions of US dollars),,,51959.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2010,Tourism expenditure (millions of US dollars),,,58348.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2016,Tourism expenditure (millions of US dollars),,,66982.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2017,Tourism expenditure (millions of US dollars),,,75906.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +724,Spain,2018,Tourism expenditure (millions of US dollars),,,81250.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,1995,Tourist/visitor arrivals (thousands),TF,,403.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2005,Tourist/visitor arrivals (thousands),TF,,549.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2010,Tourist/visitor arrivals (thousands),TF,,654.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2016,Tourist/visitor arrivals (thousands),TF,,2051.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2017,Tourist/visitor arrivals (thousands),TF,,2116.4000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2018,Tourist/visitor arrivals (thousands),TF,,2334.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,1995,Tourism expenditure (millions of US dollars),,,367.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2005,Tourism expenditure (millions of US dollars),,,729.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2010,Tourism expenditure (millions of US dollars),,,1044.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2016,Tourism expenditure (millions of US dollars),,,4591.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2017,Tourism expenditure (millions of US dollars),,,5083.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +144,Sri Lanka,2018,Tourism expenditure (millions of US dollars),,,5608.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2005,Tourist/visitor arrivals (thousands),THS,,88.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2010,Tourist/visitor arrivals (thousands),THS,,522.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2016,Tourist/visitor arrivals (thousands),THS,,400.0000,West Bank only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2017,Tourist/visitor arrivals (thousands),THS,,503.0000,West Bank only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2018,Tourist/visitor arrivals (thousands),THS,,606.0000,West Bank only.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,1995,Tourism expenditure (millions of US dollars),,,255.0000,Excluding passenger transport.;West Bank and Gaza.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2005,Tourism expenditure (millions of US dollars),,,52.0000,Excluding passenger transport.;West Bank and Gaza.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2010,Tourism expenditure (millions of US dollars),,,409.0000,Excluding passenger transport.;West Bank and Gaza.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2016,Tourism expenditure (millions of US dollars),,,235.0000,Excluding passenger transport.;West Bank and Gaza.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2017,Tourism expenditure (millions of US dollars),,,225.0000,Excluding passenger transport.;West Bank and Gaza.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +275,State of Palestine,2018,Tourism expenditure (millions of US dollars),,,245.0000,Excluding passenger transport.;West Bank and Gaza.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,1995,Tourist/visitor arrivals (thousands),TF,,29.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2005,Tourist/visitor arrivals (thousands),TF,,246.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2010,Tourist/visitor arrivals (thousands),TF,,495.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2016,Tourist/visitor arrivals (thousands),TF,,800.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2017,Tourist/visitor arrivals (thousands),TF,,813.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2018,Tourist/visitor arrivals (thousands),TF,,836.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,1995,Tourism expenditure (millions of US dollars),,,8.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2005,Tourism expenditure (millions of US dollars),,,114.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2010,Tourism expenditure (millions of US dollars),,,82.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2016,Tourism expenditure (millions of US dollars),,,1009.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2017,Tourism expenditure (millions of US dollars),,,1029.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +729,Sudan,2018,Tourism expenditure (millions of US dollars),,,1043.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,1995,Tourist/visitor arrivals (thousands),TF,,43.0000,Arrivals at Zanderij Airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2005,Tourist/visitor arrivals (thousands),TF,,161.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2010,Tourist/visitor arrivals (thousands),TF,,205.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2016,Tourist/visitor arrivals (thousands),TF,,256.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2017,Tourist/visitor arrivals (thousands),TF,,278.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,1995,Tourism expenditure (millions of US dollars),,,52.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2005,Tourism expenditure (millions of US dollars),,,96.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2010,Tourism expenditure (millions of US dollars),,,69.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2016,Tourism expenditure (millions of US dollars),,,74.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2017,Tourism expenditure (millions of US dollars),,,61.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +740,Suriname,2018,Tourism expenditure (millions of US dollars),,,73.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,1995,Tourist/visitor arrivals (thousands),TCE,,2310.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2005,Tourist/visitor arrivals (thousands),TCE,,4883.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2010,Tourist/visitor arrivals (thousands),TCE,,5183.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2016,Tourist/visitor arrivals (thousands),TCE,,6782.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2017,Tourist/visitor arrivals (thousands),TCE,,7054.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2018,Tourist/visitor arrivals (thousands),TCE,,7440.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,1995,Tourism expenditure (millions of US dollars),,,3471.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2005,Tourism expenditure (millions of US dollars),,,6554.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2010,Tourism expenditure (millions of US dollars),,,8336.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2016,Tourism expenditure (millions of US dollars),,,12764.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2017,Tourism expenditure (millions of US dollars),,,14168.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +752,Sweden,2018,Tourism expenditure (millions of US dollars),,,14926.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,1995,Tourist/visitor arrivals (thousands),THS,,6946.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2005,Tourist/visitor arrivals (thousands),THS,,7229.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2010,Tourist/visitor arrivals (thousands),THS,,8628.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2016,Tourist/visitor arrivals (thousands),THS,,9205.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2017,Tourist/visitor arrivals (thousands),THS,,9889.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2018,Tourist/visitor arrivals (thousands),THS,,10362.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,1995,Tourism expenditure (millions of US dollars),,,11354.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2005,Tourism expenditure (millions of US dollars),,,11952.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2010,Tourism expenditure (millions of US dollars),,,17614.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2016,Tourism expenditure (millions of US dollars),,,19042.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2017,Tourism expenditure (millions of US dollars),,,19654.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +756,Switzerland,2018,Tourism expenditure (millions of US dollars),,,20276.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +760,Syrian Arab Republic,1995,Tourist/visitor arrivals (thousands),TCE,,815.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +760,Syrian Arab Republic,2005,Tourist/visitor arrivals (thousands),TCE,,3571.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +760,Syrian Arab Republic,2010,Tourist/visitor arrivals (thousands),TCE,,8546.0000,Including nationals residing abroad.;Including Iraqi nationals.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +760,Syrian Arab Republic,2005,Tourism expenditure (millions of US dollars),,,2035.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +760,Syrian Arab Republic,2010,Tourism expenditure (millions of US dollars),,,6308.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2010,Tourist/visitor arrivals (thousands),VF,,160.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2016,Tourist/visitor arrivals (thousands),VF,,344.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2017,Tourist/visitor arrivals (thousands),VF,,431.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2018,Tourist/visitor arrivals (thousands),VF,,1035.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2005,Tourism expenditure (millions of US dollars),,,9.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2010,Tourism expenditure (millions of US dollars),,,141.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2016,Tourism expenditure (millions of US dollars),,,149.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2017,Tourism expenditure (millions of US dollars),,,171.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +762,Tajikistan,2018,Tourism expenditure (millions of US dollars),,,170.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,1995,Tourist/visitor arrivals (thousands),TF,,6952.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2005,Tourist/visitor arrivals (thousands),TF,,11567.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2010,Tourist/visitor arrivals (thousands),TF,,15936.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2016,Tourist/visitor arrivals (thousands),TF,,32530.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2017,Tourist/visitor arrivals (thousands),TF,,35592.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2018,Tourist/visitor arrivals (thousands),TF,,38178.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,1995,Tourism expenditure (millions of US dollars),,,9257.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2005,Tourism expenditure (millions of US dollars),,,12103.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2010,Tourism expenditure (millions of US dollars),,,23796.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2016,Tourism expenditure (millions of US dollars),,,48459.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2017,Tourism expenditure (millions of US dollars),,,57057.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +764,Thailand,2018,Tourism expenditure (millions of US dollars),,,65242.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +626,Timor-Leste,2010,Tourist/visitor arrivals (thousands),TF,,40.0000,Arrivals by air at Dili Airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +626,Timor-Leste,2016,Tourist/visitor arrivals (thousands),TF,,66.0000,Arrivals by air at Dili Airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +626,Timor-Leste,2017,Tourist/visitor arrivals (thousands),TF,,74.0000,Arrivals by air at Dili Airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +626,Timor-Leste,2018,Tourist/visitor arrivals (thousands),TF,,75.0000,Arrivals by air at Dili Airport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +626,Timor-Leste,2010,Tourism expenditure (millions of US dollars),,,24.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +626,Timor-Leste,2016,Tourism expenditure (millions of US dollars),,,58.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +626,Timor-Leste,2017,Tourism expenditure (millions of US dollars),,,73.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +626,Timor-Leste,2018,Tourism expenditure (millions of US dollars),,,78.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,1995,Tourist/visitor arrivals (thousands),THS,,53.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2005,Tourist/visitor arrivals (thousands),THS,,81.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2010,Tourist/visitor arrivals (thousands),THS,,202.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2016,Tourist/visitor arrivals (thousands),THS,,338.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2017,Tourist/visitor arrivals (thousands),THS,,514.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2018,Tourist/visitor arrivals (thousands),THS,,573.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2005,Tourism expenditure (millions of US dollars),,,27.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2010,Tourism expenditure (millions of US dollars),,,105.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2016,Tourism expenditure (millions of US dollars),,,223.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +768,Togo,2017,Tourism expenditure (millions of US dollars),,,245.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,1995,Tourist/visitor arrivals (thousands),TF,,29.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2005,Tourist/visitor arrivals (thousands),TF,,42.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2010,Tourist/visitor arrivals (thousands),TF,,47.1000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2016,Tourist/visitor arrivals (thousands),TF,,59.1000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2017,Tourist/visitor arrivals (thousands),TF,,62.5000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2018,Tourist/visitor arrivals (thousands),TF,,54.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2005,Tourism expenditure (millions of US dollars),,,15.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2010,Tourism expenditure (millions of US dollars),,,17.3000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2016,Tourism expenditure (millions of US dollars),,,52.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2017,Tourism expenditure (millions of US dollars),,,48.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +776,Tonga,2018,Tourism expenditure (millions of US dollars),,,48.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,1995,Tourist/visitor arrivals (thousands),TF,,260.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2005,Tourist/visitor arrivals (thousands),TF,,463.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2010,Tourist/visitor arrivals (thousands),TF,,388.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2016,Tourist/visitor arrivals (thousands),TF,,409.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2017,Tourist/visitor arrivals (thousands),TF,,395.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2018,Tourist/visitor arrivals (thousands),TF,,375.0000,Arrivals by air.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,1995,Tourism expenditure (millions of US dollars),,,232.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2005,Tourism expenditure (millions of US dollars),,,593.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2010,Tourism expenditure (millions of US dollars),,,630.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2016,Tourism expenditure (millions of US dollars),,,708.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2017,Tourism expenditure (millions of US dollars),,,717.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +780,Trinidad and Tobago,2018,Tourism expenditure (millions of US dollars),,,541.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,1995,Tourist/visitor arrivals (thousands),TF,,4120.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2005,Tourist/visitor arrivals (thousands),TF,,6378.0000,Excluding nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2010,Tourist/visitor arrivals (thousands),TF,,7828.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2016,Tourist/visitor arrivals (thousands),TF,,5724.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2017,Tourist/visitor arrivals (thousands),TF,,7052.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2018,Tourist/visitor arrivals (thousands),TF,,8299.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,1995,Tourism expenditure (millions of US dollars),,,1838.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2005,Tourism expenditure (millions of US dollars),,,2800.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2010,Tourism expenditure (millions of US dollars),,,3477.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2016,Tourism expenditure (millions of US dollars),,,1706.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2017,Tourism expenditure (millions of US dollars),,,1782.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +788,Tunisia,2018,Tourism expenditure (millions of US dollars),,,2320.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,1995,Tourist/visitor arrivals (thousands),TF,,7083.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2005,Tourist/visitor arrivals (thousands),TF,,20273.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2010,Tourist/visitor arrivals (thousands),TF,,31364.0000,Turkish citizens resident abroad are included.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2016,Tourist/visitor arrivals (thousands),TF,,30289.0000,Turkish citizens resident abroad are included.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2017,Tourist/visitor arrivals (thousands),TF,,37601.0000,Turkish citizens resident abroad are included.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2018,Tourist/visitor arrivals (thousands),TF,,45768.0000,Turkish citizens resident abroad are included.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2005,Tourism expenditure (millions of US dollars),,,20760.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2010,Tourism expenditure (millions of US dollars),,,26318.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2016,Tourism expenditure (millions of US dollars),,,26788.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2017,Tourism expenditure (millions of US dollars),,,31870.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +792,Turkey,2018,Tourism expenditure (millions of US dollars),,,37140.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +795,Turkmenistan,1995,Tourist/visitor arrivals (thousands),TF,,218.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +795,Turkmenistan,2005,Tourist/visitor arrivals (thousands),TF,,11.6000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +796,Turks and Caicos Islands,1995,Tourist/visitor arrivals (thousands),TF,,79.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +796,Turks and Caicos Islands,2005,Tourist/visitor arrivals (thousands),TF,,176.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +796,Turks and Caicos Islands,2010,Tourist/visitor arrivals (thousands),TF,,281.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +796,Turks and Caicos Islands,2016,Tourist/visitor arrivals (thousands),TF,,449.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +796,Turks and Caicos Islands,2017,Tourist/visitor arrivals (thousands),TF,,416.4000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +796,Turks and Caicos Islands,2018,Tourist/visitor arrivals (thousands),TF,,441.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +796,Turks and Caicos Islands,1995,Tourism expenditure (millions of US dollars),,,53.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +798,Tuvalu,1995,Tourist/visitor arrivals (thousands),TF,,0.9000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +798,Tuvalu,2005,Tourist/visitor arrivals (thousands),TF,,1.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +798,Tuvalu,2010,Tourist/visitor arrivals (thousands),TF,,1.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +798,Tuvalu,2016,Tourist/visitor arrivals (thousands),TF,,2.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +798,Tuvalu,2017,Tourist/visitor arrivals (thousands),TF,,2.5000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +798,Tuvalu,2018,Tourist/visitor arrivals (thousands),TF,,2.7000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +798,Tuvalu,2005,Tourism expenditure (millions of US dollars),,,1.2000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +798,Tuvalu,2010,Tourism expenditure (millions of US dollars),,,2.4000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,1995,Tourist/visitor arrivals (thousands),TF,,160.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2005,Tourist/visitor arrivals (thousands),TF,,468.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2010,Tourist/visitor arrivals (thousands),TF,,946.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2016,Tourist/visitor arrivals (thousands),TF,,1323.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2017,Tourist/visitor arrivals (thousands),TF,,1402.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2005,Tourism expenditure (millions of US dollars),,,382.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2010,Tourism expenditure (millions of US dollars),,,802.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2016,Tourism expenditure (millions of US dollars),,,1118.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2017,Tourism expenditure (millions of US dollars),,,957.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +800,Uganda,2018,Tourism expenditure (millions of US dollars),,,1044.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,1995,Tourist/visitor arrivals (thousands),TF,,3716.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2005,Tourist/visitor arrivals (thousands),TF,,17631.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2010,Tourist/visitor arrivals (thousands),TF,,21203.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2016,Tourist/visitor arrivals (thousands),TF,,13333.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2017,Tourist/visitor arrivals (thousands),TF,,14230.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2018,Tourist/visitor arrivals (thousands),TF,,14104.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2005,Tourism expenditure (millions of US dollars),,,3542.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2010,Tourism expenditure (millions of US dollars),,,4696.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2016,Tourism expenditure (millions of US dollars),,,1723.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2017,Tourism expenditure (millions of US dollars),,,2019.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +804,Ukraine,2018,Tourism expenditure (millions of US dollars),,,2269.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,1995,Tourist/visitor arrivals (thousands),THS,,2315.0000,Arrivals in hotels only. Including domestic tourism and nationals of the country residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2005,Tourist/visitor arrivals (thousands),THS,,7126.0000,Arrivals in hotels only. Including domestic tourism and nationals of the country residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2016,Tourist/visitor arrivals (thousands),THS,,18967.0000,Arrivals in hotels only. Including domestic tourism and nationals of the country residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2017,Tourist/visitor arrivals (thousands),THS,,20394.0000,Arrivals in hotels only. Including domestic tourism and nationals of the country residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2018,Tourist/visitor arrivals (thousands),THS,,21286.0000,Arrivals in hotels only. Including domestic tourism and nationals of the country residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,1995,Tourism expenditure (millions of US dollars),,,632.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2005,Tourism expenditure (millions of US dollars),,,3218.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2010,Tourism expenditure (millions of US dollars),,,8577.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2016,Tourism expenditure (millions of US dollars),,,19496.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2017,Tourism expenditure (millions of US dollars),,,21048.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +784,United Arab Emirates,2018,Tourism expenditure (millions of US dollars),,,21390.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,1995,Tourist/visitor arrivals (thousands),TF,,21719.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2005,Tourist/visitor arrivals (thousands),TF,,28039.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2010,Tourist/visitor arrivals (thousands),TF,,28295.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2016,Tourist/visitor arrivals (thousands),TF,,35814.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2017,Tourist/visitor arrivals (thousands),TF,,37651.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2018,Tourist/visitor arrivals (thousands),TF,,36316.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,1995,Tourism expenditure (millions of US dollars),,,27577.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2005,Tourism expenditure (millions of US dollars),,,32948.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2010,Tourism expenditure (millions of US dollars),,,34715.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2016,Tourism expenditure (millions of US dollars),,,47777.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2017,Tourism expenditure (millions of US dollars),,,47719.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +826,United Kingdom,2018,Tourism expenditure (millions of US dollars),,,48515.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,1995,Tourist/visitor arrivals (thousands),TF,,285.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2005,Tourist/visitor arrivals (thousands),TF,,590.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2010,Tourist/visitor arrivals (thousands),TF,,754.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2016,Tourist/visitor arrivals (thousands),TF,,1233.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2017,Tourist/visitor arrivals (thousands),TF,,1275.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2018,Tourist/visitor arrivals (thousands),TF,,1378.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2005,Tourism expenditure (millions of US dollars),,,835.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2010,Tourism expenditure (millions of US dollars),,,1279.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2016,Tourism expenditure (millions of US dollars),,,2149.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2017,Tourism expenditure (millions of US dollars),,,2265.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +834,United Rep. of Tanzania,2018,Tourism expenditure (millions of US dollars),,,2465.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,1995,Tourist/visitor arrivals (thousands),TF,,43318.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2005,Tourist/visitor arrivals (thousands),TF,,49206.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2010,Tourist/visitor arrivals (thousands),TF,,60010.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2016,Tourist/visitor arrivals (thousands),TF,,76407.4880,Break in the time series.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2017,Tourist/visitor arrivals (thousands),TF,,77186.7460,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2018,Tourist/visitor arrivals (thousands),TF,,79745.9180,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,1995,Tourism expenditure (millions of US dollars),,,93743.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2005,Tourism expenditure (millions of US dollars),,,122077.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2010,Tourism expenditure (millions of US dollars),,,167996.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2016,Tourism expenditure (millions of US dollars),,,245991.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2017,Tourism expenditure (millions of US dollars),,,251544.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +840,United States of America,2018,Tourism expenditure (millions of US dollars),,,256145.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,1995,Tourist/visitor arrivals (thousands),TF,,454.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2005,Tourist/visitor arrivals (thousands),TF,,594.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2010,Tourist/visitor arrivals (thousands),TF,,572.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2016,Tourist/visitor arrivals (thousands),TF,,667.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2017,Tourist/visitor arrivals (thousands),TF,,535.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2018,Tourist/visitor arrivals (thousands),TF,,381.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,1995,Tourism expenditure (millions of US dollars),,,822.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2005,Tourism expenditure (millions of US dollars),,,1432.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2010,Tourism expenditure (millions of US dollars),,,1223.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2016,Tourism expenditure (millions of US dollars),,,1343.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2017,Tourism expenditure (millions of US dollars),,,1202.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +850,United States Virgin Islands,2018,Tourism expenditure (millions of US dollars),,,1046.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,1995,Tourist/visitor arrivals (thousands),TF,,2022.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2005,Tourist/visitor arrivals (thousands),TF,,1808.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2010,Tourist/visitor arrivals (thousands),TF,,2353.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2016,Tourist/visitor arrivals (thousands),TF,,3037.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2017,Tourist/visitor arrivals (thousands),TF,,3674.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2018,Tourist/visitor arrivals (thousands),TF,,3469.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,1995,Tourism expenditure (millions of US dollars),,,725.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2005,Tourism expenditure (millions of US dollars),,,699.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2010,Tourism expenditure (millions of US dollars),,,1669.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2016,Tourism expenditure (millions of US dollars),,,2182.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2017,Tourism expenditure (millions of US dollars),,,2660.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +858,Uruguay,2018,Tourism expenditure (millions of US dollars),,,2439.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,1995,Tourist/visitor arrivals (thousands),TF,,92.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2005,Tourist/visitor arrivals (thousands),TF,,242.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2010,Tourist/visitor arrivals (thousands),TF,,975.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2016,Tourist/visitor arrivals (thousands),TF,,2027.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2017,Tourist/visitor arrivals (thousands),TF,,2690.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2018,Tourist/visitor arrivals (thousands),TF,,5346.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2005,Tourism expenditure (millions of US dollars),,,28.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2010,Tourism expenditure (millions of US dollars),,,121.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2016,Tourism expenditure (millions of US dollars),,,458.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2017,Tourism expenditure (millions of US dollars),,,689.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +860,Uzbekistan,2018,Tourism expenditure (millions of US dollars),,,1144.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,1995,Tourist/visitor arrivals (thousands),TF,,44.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2005,Tourist/visitor arrivals (thousands),TF,,62.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2010,Tourist/visitor arrivals (thousands),TF,,97.2000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2016,Tourist/visitor arrivals (thousands),TF,,95.1000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2017,Tourist/visitor arrivals (thousands),TF,,109.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2018,Tourist/visitor arrivals (thousands),TF,,116.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2005,Tourism expenditure (millions of US dollars),,,104.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2010,Tourism expenditure (millions of US dollars),,,242.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2016,Tourism expenditure (millions of US dollars),,,275.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2017,Tourism expenditure (millions of US dollars),,,289.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +548,Vanuatu,2018,Tourism expenditure (millions of US dollars),,,325.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),1995,Tourist/visitor arrivals (thousands),TF,,700.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),2005,Tourist/visitor arrivals (thousands),TF,,706.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),2010,Tourist/visitor arrivals (thousands),TF,,526.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),2016,Tourist/visitor arrivals (thousands),TF,,601.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),2017,Tourist/visitor arrivals (thousands),TF,,427.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),1995,Tourism expenditure (millions of US dollars),,,995.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),2005,Tourism expenditure (millions of US dollars),,,722.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),2010,Tourism expenditure (millions of US dollars),,,885.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +862,Venezuela (Boliv. Rep. of),2016,Tourism expenditure (millions of US dollars),,,546.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,1995,Tourist/visitor arrivals (thousands),VF,,1351.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2005,Tourist/visitor arrivals (thousands),VF,,3477.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2010,Tourist/visitor arrivals (thousands),VF,,5050.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2016,Tourist/visitor arrivals (thousands),VF,,10013.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2017,Tourist/visitor arrivals (thousands),VF,,12922.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2018,Tourist/visitor arrivals (thousands),VF,,15498.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2005,Tourism expenditure (millions of US dollars),,,2300.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2010,Tourism expenditure (millions of US dollars),,,4450.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2016,Tourism expenditure (millions of US dollars),,,8500.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2017,Tourism expenditure (millions of US dollars),,,8890.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +704,Viet Nam,2018,Tourism expenditure (millions of US dollars),,,10080.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +887,Yemen,1995,Tourist/visitor arrivals (thousands),TF,,61.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +887,Yemen,2005,Tourist/visitor arrivals (thousands),TF,,336.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +887,Yemen,2010,Tourist/visitor arrivals (thousands),TF,,1025.0000,Including nationals residing abroad.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +887,Yemen,2010,Tourism expenditure (millions of US dollars),,,1291.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +887,Yemen,2016,Tourism expenditure (millions of US dollars),,,116.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,1995,Tourist/visitor arrivals (thousands),TF,,163.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2005,Tourist/visitor arrivals (thousands),TF,,669.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2010,Tourist/visitor arrivals (thousands),TF,,815.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2016,Tourist/visitor arrivals (thousands),TF,,956.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2017,Tourist/visitor arrivals (thousands),TF,,1083.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2018,Tourist/visitor arrivals (thousands),TF,,1072.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2005,Tourism expenditure (millions of US dollars),,,447.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2010,Tourism expenditure (millions of US dollars),,,492.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2016,Tourism expenditure (millions of US dollars),,,683.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2017,Tourism expenditure (millions of US dollars),,,653.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +894,Zambia,2018,Tourism expenditure (millions of US dollars),,,742.0000,Excluding passenger transport.,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,1995,Tourist/visitor arrivals (thousands),VF,,1416.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2005,Tourist/visitor arrivals (thousands),VF,,1559.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2010,Tourist/visitor arrivals (thousands),VF,,2239.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2016,Tourist/visitor arrivals (thousands),VF,,2168.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2017,Tourist/visitor arrivals (thousands),VF,,2423.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2018,Tourist/visitor arrivals (thousands),VF,,2580.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,1995,Tourism expenditure (millions of US dollars),,,145.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2005,Tourism expenditure (millions of US dollars),,,99.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2010,Tourism expenditure (millions of US dollars),,,135.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2016,Tourism expenditure (millions of US dollars),,,194.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." +716,Zimbabwe,2017,Tourism expenditure (millions of US dollars),,,158.0000,,"World Tourism Organization (UNWTO), Madrid, the UNWTO Statistics Database, last accessed January 2020." diff --git a/apache-spark/src/main/java/com/baeldung/differences/dataframe/dataset/rdd/TouristData.java b/apache-spark/src/main/java/com/baeldung/differences/dataframe/dataset/rdd/TouristData.java new file mode 100644 index 0000000000..fbeef4283a --- /dev/null +++ b/apache-spark/src/main/java/com/baeldung/differences/dataframe/dataset/rdd/TouristData.java @@ -0,0 +1,75 @@ +package com.baeldung.differences.dataframe.dataset.rdd; + + +public class TouristData { + + private String region; + private String country; + private String year; + private String series; + private Double value; + private String footnotes; + private String source; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getYear() { + return year; + } + + public void setYear(String year) { + this.year = year; + } + + public String getSeries() { + return series; + } + + public void setSeries(String series) { + this.series = series; + } + + public Double getValue() { + return value; + } + + public void setValue(Double value) { + this.value = value; + } + + public String getFootnotes() { + return footnotes; + } + + public void setFootnotes(String footnotes) { + this.footnotes = footnotes; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + @Override + public String toString() { + return "TouristData [region=" + region + ", country=" + country + ", year=" + year + ", series=" + series + ", value=" + value + ", footnotes=" + footnotes + ", source=" + source + "]"; + } + +} diff --git a/apache-spark/src/test/java/com/baeldung/differences/rdd/ActionsUnitTest.java b/apache-spark/src/test/java/com/baeldung/differences/rdd/ActionsUnitTest.java new file mode 100644 index 0000000000..a3e1811e6f --- /dev/null +++ b/apache-spark/src/test/java/com/baeldung/differences/rdd/ActionsUnitTest.java @@ -0,0 +1,67 @@ +package com.baeldung.differences.rdd; + +import static org.junit.Assert.assertEquals; + +import java.util.List; + +import org.apache.spark.SparkConf; +import org.apache.spark.api.java.JavaPairRDD; +import org.apache.spark.api.java.JavaRDD; +import org.apache.spark.api.java.JavaSparkContext; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import scala.Tuple2; + +public class ActionsUnitTest { + private static JavaRDD tourists; + private static JavaSparkContext sc; + public static final String COMMA_DELIMITER = ",(?=([^\"]*\"[^\"]*\")*[^\"]*$)"; + + @BeforeClass + public static void init() { + SparkConf conf = new SparkConf().setAppName("reduce") + .setMaster("local[*]"); + sc = new JavaSparkContext(conf); + tourists = sc.textFile("data/Tourist.csv").filter(line -> !line.startsWith("Region")); + } + + @AfterClass + public static void cleanup() { + sc.close(); + } + + @Test + public void whenDistinctCount_thenReturnDistinctNumRecords() { + JavaRDD countries = tourists.map(line -> { + String[] columns = line.split(COMMA_DELIMITER); + return columns[1]; + }) + .distinct(); + Long numberOfCountries = countries.count(); + System.out.println("Count: " + numberOfCountries); + + assertEquals(Long.valueOf(220), numberOfCountries); + } + + @Test + public void whenReduceByKeySum_thenTotalValuePerKey() { + JavaRDD touristsExpenditure = tourists.filter(line -> line.split(COMMA_DELIMITER)[3].contains("expenditure")); + + JavaPairRDD expenditurePairRdd = touristsExpenditure.mapToPair(line -> { + String[] columns = line.split(COMMA_DELIMITER); + return new Tuple2<>(columns[1], Double.valueOf(columns[6])); + }); + List> totalByCountry = expenditurePairRdd.reduceByKey((x, y) -> x + y) + .collect(); + System.out.println("Total per Country: " + totalByCountry); + + for(Tuple2 tuple : totalByCountry) { + if (tuple._1.equals("Mexico")) { + assertEquals(Double.valueOf(99164), tuple._2); + } + } + } + +} diff --git a/apache-spark/src/test/java/com/baeldung/differences/rdd/DataFrameUnitTest.java b/apache-spark/src/test/java/com/baeldung/differences/rdd/DataFrameUnitTest.java new file mode 100644 index 0000000000..f294e5bc66 --- /dev/null +++ b/apache-spark/src/test/java/com/baeldung/differences/rdd/DataFrameUnitTest.java @@ -0,0 +1,74 @@ +package com.baeldung.differences.rdd; + +import static org.apache.spark.sql.functions.col; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; + +import org.apache.spark.sql.DataFrameReader; +import org.apache.spark.sql.Dataset; +import org.apache.spark.sql.Row; +import org.apache.spark.sql.SparkSession; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class DataFrameUnitTest { + private static SparkSession session; + private static Dataset data; + + @BeforeClass + public static void init() { + session = SparkSession.builder() + .appName("TouristDataFrameExample") + .master("local[*]") + .getOrCreate(); + DataFrameReader dataFrameReader = session.read(); + data = dataFrameReader.option("header", "true") + .csv("data/Tourist.csv"); + } + + @AfterClass + public static void cleanup() { + session.stop(); + } + + @Test + public void whenSelectSpecificColumns_thenColumnsFiltered() { + Dataset selectedData = data.select(col("country"), col("year"), col("value")); + selectedData.show(); + + List resultList = Arrays.asList(selectedData.columns()); + assertTrue(resultList.contains("country")); + assertTrue(resultList.contains("year")); + assertTrue(resultList.contains("value")); + assertFalse(resultList.contains("Series")); + + } + + @Test + public void whenFilteringByCountry_thenCountryRecordsSelected() { + Dataset filteredData = data.filter(col("country").equalTo("Mexico")); + filteredData.show(); + + filteredData.foreach(record -> { + assertEquals("Mexico", record.get(1)); + }); + + } + + @Test + public void whenGroupCountByCountry_thenContryTotalRecords() { + Dataset recordsPerCountry = data.groupBy(col("country")) + .count(); + recordsPerCountry.show(); + + Dataset filteredData = recordsPerCountry.filter(col("country").equalTo("Sweden")); + assertEquals(new Long(12), filteredData.first() + .get(1)); + } + +} diff --git a/apache-spark/src/test/java/com/baeldung/differences/rdd/DatasetUnitTest.java b/apache-spark/src/test/java/com/baeldung/differences/rdd/DatasetUnitTest.java new file mode 100644 index 0000000000..1d83505812 --- /dev/null +++ b/apache-spark/src/test/java/com/baeldung/differences/rdd/DatasetUnitTest.java @@ -0,0 +1,83 @@ +package com.baeldung.differences.rdd; + +import static org.apache.spark.sql.functions.col; +import static org.apache.spark.sql.functions.sum; +import static org.junit.Assert.assertEquals; + +import org.apache.spark.api.java.function.FilterFunction; +import org.apache.spark.sql.DataFrameReader; +import org.apache.spark.sql.Dataset; +import org.apache.spark.sql.Encoders; +import org.apache.spark.sql.Row; +import org.apache.spark.sql.SparkSession; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.baeldung.differences.dataframe.dataset.rdd.TouristData; + +public class DatasetUnitTest { + private static SparkSession session; + private static Dataset typedDataset; + + @BeforeClass + public static void init() { + session = SparkSession.builder() + .appName("TouristDatasetExample") + .master("local[*]") + .getOrCreate(); + DataFrameReader dataFrameReader = session.read(); + Dataset data = dataFrameReader.option("header", "true") + .csv("data/Tourist.csv"); + Dataset responseWithSelectedColumns = data.select(col("region"), + col("country"), col("year"), col("series"), col("value").cast("double"), + col("footnotes"), col("source")); + typedDataset = responseWithSelectedColumns.as(Encoders.bean(TouristData.class)); + } + + @AfterClass + public static void cleanup() { + session.stop(); + } + + @Test + public void whenFilteringByCountry_thenCountryRecordsSelected() { + Dataset selectedData = typedDataset + .filter((FilterFunction) record -> record.getCountry() + .equals("Norway")); + selectedData.show(); + + selectedData.foreach(record -> { + assertEquals("Norway", record.getCountry()); + }); + } + + @Test + public void whenGroupCountByCountry_thenContryTotalRecords() { + Dataset countriesCount = typedDataset.groupBy(typedDataset.col("country")) + .count(); + countriesCount.show(); + + assertEquals(Long.valueOf(220), Long.valueOf(countriesCount.count())); + } + + @Test + public void whenFilteredByPropertyRange_thenRetreiveValidRecords() { + // Filter records with existing data for years between 2010 and 2017 + typedDataset.filter((FilterFunction) record -> record.getYear() != null + && (Long.valueOf(record.getYear()) > 2010 && Long.valueOf(record.getYear()) < 2017)) + .show(); + } + + @Test + public void whenSumValue_thenRetreiveTotalValue() { + // Total tourist expenditure by country + typedDataset.filter((FilterFunction) record -> record.getValue() != null + && record.getSeries() + .contains("expenditure")) + .groupBy("country") + .agg(sum("value")) + .show(); + } + +} diff --git a/apache-spark/src/test/java/com/baeldung/differences/rdd/TransformationsUnitTest.java b/apache-spark/src/test/java/com/baeldung/differences/rdd/TransformationsUnitTest.java new file mode 100644 index 0000000000..4b2d9e1127 --- /dev/null +++ b/apache-spark/src/test/java/com/baeldung/differences/rdd/TransformationsUnitTest.java @@ -0,0 +1,63 @@ +package com.baeldung.differences.rdd; + + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.apache.commons.lang3.StringUtils; +import org.apache.spark.SparkConf; +import org.apache.spark.api.java.JavaRDD; +import org.apache.spark.api.java.JavaSparkContext; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TransformationsUnitTest { + + public static final String COMMA_DELIMITER = ",(?=([^\"]*\"[^\"]*\")*[^\"]*$)"; + private static JavaSparkContext sc; + private static JavaRDD tourists; + + @BeforeClass + public static void init() { + SparkConf conf = new SparkConf().setAppName("uppercaseCountries") + .setMaster("local[*]"); + sc = new JavaSparkContext(conf); + tourists = sc.textFile("data/Tourist.csv") + .filter(line -> !line.startsWith("Region")); //filter header row + } + + @AfterClass + public static void cleanup() { + sc.close(); + } + + @Test + public void whenMapUpperCase_thenCountryNameUppercased() { + JavaRDD upperCaseCountries = tourists.map(line -> { + String[] columns = line.split(COMMA_DELIMITER); + return columns[1].toUpperCase(); + }) + .distinct(); + + upperCaseCountries.saveAsTextFile("data/output/uppercase.txt"); + + upperCaseCountries.foreach(country -> { + //replace non alphanumerical characters + country = country.replaceAll("[^a-zA-Z]", ""); + assertTrue(StringUtils.isAllUpperCase(country)); + }); + } + + @Test + public void whenFilterByCountry_thenShowRequestedCountryRecords() { + JavaRDD touristsInMexico = tourists.filter(line -> line.split(COMMA_DELIMITER)[1].equals("Mexico")); + + touristsInMexico.saveAsTextFile("data/output/touristInMexico.txt"); + + touristsInMexico.foreach(record -> { + assertEquals("Mexico", record.split(COMMA_DELIMITER)[1]); + }); + } + +} From b9dbeb6c58d19e7ca88e56086136678cc2883a66 Mon Sep 17 00:00:00 2001 From: andrebrowne <42154231+andrebrowne@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:21:18 -0400 Subject: [PATCH 070/302] BAEL-4012 Add Netflix Feign (#10110) * BAEL-4012 Add Netflix Feign * BAEL-4012 Cleanup pom --- .../spring-cloud-netflix-feign/pom.xml | 71 +++++++++++++++++++ .../netflix/feign/ExampleApplication.java | 16 +++++ .../feign/client/JSONPlaceHolderClient.java | 25 +++++++ .../feign/config/ClientConfiguration.java | 38 ++++++++++ .../feign/config/CustomErrorDecoder.java | 21 ++++++ .../feign/exception/BadRequestException.java | 21 ++++++ .../feign/exception/NotFoundException.java | 21 ++++++ .../hystrix/JSONPlaceHolderFallback.java | 22 ++++++ .../cloud/netflix/feign/model/Post.java | 41 +++++++++++ .../feign/service/JSONPlaceHolderService.java | 12 ++++ .../impl/JSONPlaceHolderServiceImpl.java | 26 +++++++ .../src/main/resources/application.properties | 3 + .../netflix/feign/ExampleTestApplication.java | 21 ++++++ .../netflix/feign/NetflixFeignUnitTest.java | 43 +++++++++++ 14 files changed, 381 insertions(+) create mode 100644 spring-cloud/spring-cloud-netflix-feign/pom.xml create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/ExampleApplication.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/client/JSONPlaceHolderClient.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/config/ClientConfiguration.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/config/CustomErrorDecoder.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/exception/BadRequestException.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/exception/NotFoundException.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/hystrix/JSONPlaceHolderFallback.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/model/Post.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/service/JSONPlaceHolderService.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/service/impl/JSONPlaceHolderServiceImpl.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/main/resources/application.properties create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/test/java/com/baeldung/cloud/netflix/feign/ExampleTestApplication.java create mode 100644 spring-cloud/spring-cloud-netflix-feign/src/test/java/com/baeldung/cloud/netflix/feign/NetflixFeignUnitTest.java diff --git a/spring-cloud/spring-cloud-netflix-feign/pom.xml b/spring-cloud/spring-cloud-netflix-feign/pom.xml new file mode 100644 index 0000000000..aa5ba5dbdb --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/pom.xml @@ -0,0 +1,71 @@ + + + 4.0.0 + com.baeldung.cloud + spring-cloud-netlix-feign + 0.0.1-SNAPSHOT + spring-cloud-netflix-feign + Netflix Feign project for Spring Boot + + + com.baeldung + parent-boot-1 + 0.0.1-SNAPSHOT + ../../parent-boot-1 + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + org.springframework.cloud + spring-cloud-starter-feign + + + + com.netflix.feign + feign-okhttp + ${feign-ok.version} + + + + org.springframework.boot + spring-boot-starter-web + + + + org.apache.httpcomponents + httpcore + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + Camden.SR7 + 8.18.0 + + + + + diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/ExampleApplication.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/ExampleApplication.java new file mode 100644 index 0000000000..e5ed9cbecf --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/ExampleApplication.java @@ -0,0 +1,16 @@ +package com.baeldung.cloud.netflix.feign; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.feign.EnableFeignClients; + +@SpringBootApplication +@EnableFeignClients +public class ExampleApplication { + + public static void main(String[] args) { + SpringApplication.run(ExampleApplication.class, args); + } + +} + diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/client/JSONPlaceHolderClient.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/client/JSONPlaceHolderClient.java new file mode 100644 index 0000000000..80a455a4c4 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/client/JSONPlaceHolderClient.java @@ -0,0 +1,25 @@ +package com.baeldung.cloud.netflix.feign.client; + +import com.baeldung.cloud.netflix.feign.config.ClientConfiguration; +import com.baeldung.cloud.netflix.feign.hystrix.JSONPlaceHolderFallback; +import com.baeldung.cloud.netflix.feign.model.Post; +import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import java.util.List; + +@FeignClient(value = "jplaceholder", + url = "https://jsonplaceholder.typicode.com/", + configuration = ClientConfiguration.class, + fallback = JSONPlaceHolderFallback.class) +public interface JSONPlaceHolderClient { + + @RequestMapping(method = RequestMethod.GET, value = "/posts") + List getPosts(); + + + @RequestMapping(method = RequestMethod.GET, value = "/posts/{postId}", produces = "application/json") + Post getPostById(@PathVariable("postId") Long postId); +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/config/ClientConfiguration.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/config/ClientConfiguration.java new file mode 100644 index 0000000000..bc211b181e --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/config/ClientConfiguration.java @@ -0,0 +1,38 @@ +package com.baeldung.cloud.netflix.feign.config; + +import feign.Logger; +import feign.RequestInterceptor; +import feign.codec.ErrorDecoder; +import feign.okhttp.OkHttpClient; + +import org.apache.http.entity.ContentType; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ClientConfiguration { + + @Bean + public Logger.Level feignLoggerLevel() { + return Logger.Level.FULL; + } + + @Bean + public ErrorDecoder errorDecoder() { + return new ErrorDecoder.Default(); + } + + @Bean + public OkHttpClient client() { + return new OkHttpClient(); + } + + @Bean + public RequestInterceptor requestInterceptor() { + return requestTemplate -> { + requestTemplate.header("user", "ajeje"); + requestTemplate.header("password", "brazof"); + requestTemplate.header("Accept", ContentType.APPLICATION_JSON.getMimeType()); + }; + } +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/config/CustomErrorDecoder.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/config/CustomErrorDecoder.java new file mode 100644 index 0000000000..3e0e80f6d5 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/config/CustomErrorDecoder.java @@ -0,0 +1,21 @@ +package com.baeldung.cloud.netflix.feign.config; + +import com.baeldung.cloud.netflix.feign.exception.BadRequestException; +import com.baeldung.cloud.netflix.feign.exception.NotFoundException; +import feign.Response; +import feign.codec.ErrorDecoder; + +public class CustomErrorDecoder implements ErrorDecoder { + @Override + public Exception decode(String methodKey, Response response) { + + switch (response.status()){ + case 400: + return new BadRequestException(); + case 404: + return new NotFoundException(); + default: + return new Exception("Generic error"); + } + } +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/exception/BadRequestException.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/exception/BadRequestException.java new file mode 100644 index 0000000000..6a5f60f7c0 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/exception/BadRequestException.java @@ -0,0 +1,21 @@ +package com.baeldung.cloud.netflix.feign.exception; + +public class BadRequestException extends Exception { + + public BadRequestException() { + } + + public BadRequestException(String message) { + super(message); + } + + public BadRequestException(Throwable cause) { + super(cause); + } + + @Override + public String toString() { + return "BadRequestException: "+getMessage(); + } + +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/exception/NotFoundException.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/exception/NotFoundException.java new file mode 100644 index 0000000000..a8d89049fd --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/exception/NotFoundException.java @@ -0,0 +1,21 @@ +package com.baeldung.cloud.netflix.feign.exception; + +public class NotFoundException extends Exception { + + public NotFoundException() { + } + + public NotFoundException(String message) { + super(message); + } + + public NotFoundException(Throwable cause) { + super(cause); + } + + @Override + public String toString() { + return "NotFoundException: "+getMessage(); + } + +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/hystrix/JSONPlaceHolderFallback.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/hystrix/JSONPlaceHolderFallback.java new file mode 100644 index 0000000000..ab1aa6bf50 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/hystrix/JSONPlaceHolderFallback.java @@ -0,0 +1,22 @@ +package com.baeldung.cloud.netflix.feign.hystrix; + +import com.baeldung.cloud.netflix.feign.client.JSONPlaceHolderClient; +import com.baeldung.cloud.netflix.feign.model.Post; +import org.springframework.stereotype.Component; + +import java.util.Collections; +import java.util.List; + +@Component +public class JSONPlaceHolderFallback implements JSONPlaceHolderClient { + + @Override + public List getPosts() { + return Collections.emptyList(); + } + + @Override + public Post getPostById(Long postId) { + return null; + } +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/model/Post.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/model/Post.java new file mode 100644 index 0000000000..73dd2bc198 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/model/Post.java @@ -0,0 +1,41 @@ +package com.baeldung.cloud.netflix.feign.model; + +public class Post { + + private String userId; + private Long id; + private String title; + private String body; + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/service/JSONPlaceHolderService.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/service/JSONPlaceHolderService.java new file mode 100644 index 0000000000..d2e174a1f0 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/service/JSONPlaceHolderService.java @@ -0,0 +1,12 @@ +package com.baeldung.cloud.netflix.feign.service; + +import com.baeldung.cloud.netflix.feign.model.Post; + +import java.util.List; + +public interface JSONPlaceHolderService { + + List getPosts(); + + Post getPostById(Long id); +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/service/impl/JSONPlaceHolderServiceImpl.java b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/service/impl/JSONPlaceHolderServiceImpl.java new file mode 100644 index 0000000000..0cc8d296f0 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/java/com/baeldung/cloud/netflix/feign/service/impl/JSONPlaceHolderServiceImpl.java @@ -0,0 +1,26 @@ +package com.baeldung.cloud.netflix.feign.service.impl; + +import com.baeldung.cloud.netflix.feign.client.JSONPlaceHolderClient; +import com.baeldung.cloud.netflix.feign.model.Post; +import com.baeldung.cloud.netflix.feign.service.JSONPlaceHolderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class JSONPlaceHolderServiceImpl implements JSONPlaceHolderService { + + @Autowired + private JSONPlaceHolderClient jsonPlaceHolderClient; + + @Override + public List getPosts() { + return jsonPlaceHolderClient.getPosts(); + } + + @Override + public Post getPostById(Long id) { + return jsonPlaceHolderClient.getPostById(id); + } +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/main/resources/application.properties b/spring-cloud/spring-cloud-netflix-feign/src/main/resources/application.properties new file mode 100644 index 0000000000..5927ccb9c1 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/main/resources/application.properties @@ -0,0 +1,3 @@ +spring.application.name=netflix-feign +logging.level.com.baeldung.cloud.netflix.feign.client=DEBUG +feign.hystrix.enabled=true diff --git a/spring-cloud/spring-cloud-netflix-feign/src/test/java/com/baeldung/cloud/netflix/feign/ExampleTestApplication.java b/spring-cloud/spring-cloud-netflix-feign/src/test/java/com/baeldung/cloud/netflix/feign/ExampleTestApplication.java new file mode 100644 index 0000000000..f3c8459f87 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/test/java/com/baeldung/cloud/netflix/feign/ExampleTestApplication.java @@ -0,0 +1,21 @@ +package com.baeldung.cloud.netflix.feign; + +import com.baeldung.cloud.netflix.feign.config.ClientConfiguration; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +@EnableAutoConfiguration +@ContextConfiguration(classes = { ClientConfiguration.class }) +public class ExampleTestApplication { + + @Test + public void whenSpringContextIsBootstrapped_thenNoExceptions() { + } +} diff --git a/spring-cloud/spring-cloud-netflix-feign/src/test/java/com/baeldung/cloud/netflix/feign/NetflixFeignUnitTest.java b/spring-cloud/spring-cloud-netflix-feign/src/test/java/com/baeldung/cloud/netflix/feign/NetflixFeignUnitTest.java new file mode 100644 index 0000000000..880948d6d1 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/src/test/java/com/baeldung/cloud/netflix/feign/NetflixFeignUnitTest.java @@ -0,0 +1,43 @@ +package com.baeldung.cloud.netflix.feign; + +import com.baeldung.cloud.netflix.feign.model.Post; +import com.baeldung.cloud.netflix.feign.service.JSONPlaceHolderService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class NetflixFeignUnitTest { + + @Autowired + private JSONPlaceHolderService jsonPlaceHolderService; + + @Test + public void whenSpringContextIsBootstrapped_thenNoExceptions() { + } + + @Test + public void whenGetPosts_thenListPostSizeGreaterThanZero() { + + List posts = jsonPlaceHolderService.getPosts(); + + assertFalse(posts.isEmpty()); + } + + @Test + public void whenGetPostWithId_thenPostExist() { + + Post post = jsonPlaceHolderService.getPostById(1L); + + assertNotNull(post); + } + +} From d3744f76947a78fb5ed6595b0a6530c37bab85e0 Mon Sep 17 00:00:00 2001 From: majajoksovic Date: Fri, 2 Oct 2020 19:23:50 +0200 Subject: [PATCH 071/302] BAEL-4505 (#10119) * initial commit * fixed formatting * formatting changes * test fix --- .../application-persistent-on.properties | 10 ++++ .../persistent/FilesLocationUnitTest.java | 52 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 persistence-modules/spring-boot-persistence-h2/src/main/resources/application-persistent-on.properties create mode 100644 persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/persistent/FilesLocationUnitTest.java diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-persistent-on.properties b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-persistent-on.properties new file mode 100644 index 0000000000..be939ffa69 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-persistent-on.properties @@ -0,0 +1,10 @@ +#spring.datasource.url=jdbc:h2:file:C:/data/demodb +#spring.datasource.url=jdbc:h2:file:~/demodb +spring.datasource.url=jdbc:h2:file:./src/main/resources/db/demodb +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= +spring.h2.console.enabled=true +spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.h2.console.path=/h2-console diff --git a/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/persistent/FilesLocationUnitTest.java b/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/persistent/FilesLocationUnitTest.java new file mode 100644 index 0000000000..63f195e88d --- /dev/null +++ b/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/persistent/FilesLocationUnitTest.java @@ -0,0 +1,52 @@ +package com.baeldung.persistent; + +import static org.junit.Assert.assertTrue; + +import java.io.File; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.h2db.auto.configuration.AutoConfigurationDemo; + +@ActiveProfiles("persistent-on") +@RunWith(SpringRunner.class) +@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD) +@SpringBootTest(classes = AutoConfigurationDemo.class) +public class FilesLocationUnitTest { + + @BeforeClass + public static void beforeClass() { + + } + + @Test(expected = Test.None.class) + public void whenApplicationStarted_thenEmbeddedDbSubfolderCreated() { + File subdirectory = new File("src/main/resources/db"); + System.out.println(subdirectory.getAbsolutePath()); + assertTrue(subdirectory.exists()); + assertTrue(subdirectory.isDirectory()); + } + + @Test(expected = Test.None.class) + public void whenApplicationStarted_thenEmbeddedDbFilesCreated() { + File dbFile = new File("src/main/resources/db/demodb.mv.db"); + System.out.println(dbFile.getAbsolutePath()); + + assertTrue(dbFile.exists()); + assertTrue(dbFile.isFile()); + } + + @AfterClass + public static void cleanUp() { + File dbFile = new File("src/main/resources/db/demodb.mv.db"); + dbFile.deleteOnExit(); + } +} From 67e2165bb6d35707a05dc18f477f342a732afec3 Mon Sep 17 00:00:00 2001 From: kwoyke Date: Fri, 2 Oct 2020 19:26:00 +0200 Subject: [PATCH 072/302] BAEL-4658: Upgrade to Cucumber 6.8.0 (#10121) --- spring-cucumber/pom.xml | 18 +++++++++--------- .../java/com/baeldung/BaeldungController.java | 6 ++---- .../java/com/baeldung/VersionController.java | 5 ++--- .../com/baeldung/CucumberIntegrationTest.java | 6 +++--- .../com/baeldung/SpringIntegrationTest.java | 4 ++-- .../com/baeldung/StepDefsIntegrationTest.java | 12 ++++++------ 6 files changed, 24 insertions(+), 27 deletions(-) diff --git a/spring-cucumber/pom.xml b/spring-cucumber/pom.xml index 245d10e77b..a945797ee1 100644 --- a/spring-cucumber/pom.xml +++ b/spring-cucumber/pom.xml @@ -21,27 +21,27 @@ spring-boot-starter-web - info.cukes + io.cucumber cucumber-core - ${cucumber.java.version} + ${cucumber.version} test - info.cukes + io.cucumber cucumber-java - ${cucumber.java.version} + ${cucumber.version} test - info.cukes + io.cucumber cucumber-junit - ${cucumber.java.version} + ${cucumber.version} test - info.cukes + io.cucumber cucumber-spring - ${cucumber.java.version} + ${cucumber.version} test @@ -53,7 +53,7 @@ - 1.2.5 + 6.8.0 1.3.2 diff --git a/spring-cucumber/src/main/java/com/baeldung/BaeldungController.java b/spring-cucumber/src/main/java/com/baeldung/BaeldungController.java index e74e773106..713c1022c5 100644 --- a/spring-cucumber/src/main/java/com/baeldung/BaeldungController.java +++ b/spring-cucumber/src/main/java/com/baeldung/BaeldungController.java @@ -4,18 +4,16 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletResponse; - @RestController public class BaeldungController { @GetMapping("/hello") - public String sayHello(HttpServletResponse response) { + public String sayHello() { return "hello"; } @PostMapping("/baeldung") - public String sayHelloPost(HttpServletResponse response) { + public String sayHelloPost() { return "hello"; } } diff --git a/spring-cucumber/src/main/java/com/baeldung/VersionController.java b/spring-cucumber/src/main/java/com/baeldung/VersionController.java index f673f0e31f..e46ca64a01 100644 --- a/spring-cucumber/src/main/java/com/baeldung/VersionController.java +++ b/spring-cucumber/src/main/java/com/baeldung/VersionController.java @@ -1,13 +1,12 @@ package com.baeldung; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class VersionController { - @RequestMapping(method = { RequestMethod.GET }, value = { "/version" }) + @GetMapping("/version") public String getVersion() { return "1.0"; } diff --git a/spring-cucumber/src/test/java/com/baeldung/CucumberIntegrationTest.java b/spring-cucumber/src/test/java/com/baeldung/CucumberIntegrationTest.java index f48ab410ca..2077a28146 100644 --- a/spring-cucumber/src/test/java/com/baeldung/CucumberIntegrationTest.java +++ b/spring-cucumber/src/test/java/com/baeldung/CucumberIntegrationTest.java @@ -1,11 +1,11 @@ package com.baeldung; +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; import org.junit.runner.RunWith; -import cucumber.api.CucumberOptions; -import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions(features = "src/test/resources") -public class CucumberIntegrationTest extends SpringIntegrationTest{ +public class CucumberIntegrationTest extends SpringIntegrationTest { } \ No newline at end of file diff --git a/spring-cucumber/src/test/java/com/baeldung/SpringIntegrationTest.java b/spring-cucumber/src/test/java/com/baeldung/SpringIntegrationTest.java index 8655a02469..7b5c4e21ff 100644 --- a/spring-cucumber/src/test/java/com/baeldung/SpringIntegrationTest.java +++ b/spring-cucumber/src/test/java/com/baeldung/SpringIntegrationTest.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import io.cucumber.spring.CucumberContextConfiguration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -13,9 +14,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.web.client.ResponseErrorHandler; import org.springframework.web.client.RestTemplate; -//@RunWith(SpringJUnit4ClassRunner.class) +@CucumberContextConfiguration @SpringBootTest(classes = SpringDemoApplication.class, webEnvironment = WebEnvironment.DEFINED_PORT) -@ContextConfiguration public class SpringIntegrationTest { static ResponseResults latestResponse = null; diff --git a/spring-cucumber/src/test/java/com/baeldung/StepDefsIntegrationTest.java b/spring-cucumber/src/test/java/com/baeldung/StepDefsIntegrationTest.java index e1b6e370c7..9611e95dcf 100644 --- a/spring-cucumber/src/test/java/com/baeldung/StepDefsIntegrationTest.java +++ b/spring-cucumber/src/test/java/com/baeldung/StepDefsIntegrationTest.java @@ -1,14 +1,14 @@ package com.baeldung; +import io.cucumber.java.en.And; +import io.cucumber.java.en.Given; +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; +import org.springframework.http.HttpStatus; + import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import cucumber.api.java.en.Given; -import org.springframework.http.HttpStatus; - -import cucumber.api.java.en.And; -import cucumber.api.java.en.Then; -import cucumber.api.java.en.When; public class StepDefsIntegrationTest extends SpringIntegrationTest { From be481348409fb7b5b24f36417ffb9d3818f9c6f8 Mon Sep 17 00:00:00 2001 From: kwoyke Date: Fri, 2 Oct 2020 19:28:05 +0200 Subject: [PATCH 073/302] BAEL-4659: Upgrade Cucumber to 6.8.0 (#10115) --- testing-modules/rest-testing/pom.xml | 76 ++++++++----------- .../main/resources/karate/cucumber.feature | 10 --- .../cucumber/CucumberIntegrationTest.java | 4 +- .../rest/cucumber/StepDefinition.java | 11 +-- .../test/resources/Feature/cucumber.feature | 2 +- 5 files changed, 41 insertions(+), 62 deletions(-) delete mode 100644 testing-modules/rest-testing/src/main/resources/karate/cucumber.feature diff --git a/testing-modules/rest-testing/pom.xml b/testing-modules/rest-testing/pom.xml index 1e8a27afa5..b3966c1b6a 100644 --- a/testing-modules/rest-testing/pom.xml +++ b/testing-modules/rest-testing/pom.xml @@ -65,13 +65,13 @@ - info.cukes + io.cucumber cucumber-java ${cucumber.version} test - info.cukes + io.cucumber cucumber-junit ${cucumber.version} @@ -105,56 +105,44 @@ true - - - - maven-failsafe-plugin - ${maven-failsafe-plugin.version} - - classes - 4 - - - - - integration-test - verify - - - - - - com.github.temyers - cucumber-jvm-parallel-plugin - 5.0.0 - - - generateRunners - generate-test-sources - - generateRunners - - - - com.baeldung.rest.cucumber - - src/test/resources/Feature/ - SCENARIO - - - - - - + + + parallel + + + + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + CucumberIntegrationTest.java + + methods + 2 + + + + + integration-test + verify + + + + + + + + + 19.0 2.9.0 - 1.2.5 + 6.8.0 2.21.0 0.6.1 diff --git a/testing-modules/rest-testing/src/main/resources/karate/cucumber.feature b/testing-modules/rest-testing/src/main/resources/karate/cucumber.feature deleted file mode 100644 index 99dd8249fe..0000000000 --- a/testing-modules/rest-testing/src/main/resources/karate/cucumber.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Testing a REST API - Users should be able to submit GET and POST requests to a web service, represented by WireMock - - Scenario: Data Upload to a web service - When users upload data on a project - Then the server should handle it and return a success status - - Scenario: Data retrieval from a web service - When users want to get information on the Cucumber project - Then the requested data is returned \ No newline at end of file diff --git a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/CucumberIntegrationTest.java b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/CucumberIntegrationTest.java index f80178a43d..33e2c62301 100644 --- a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/CucumberIntegrationTest.java +++ b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/CucumberIntegrationTest.java @@ -1,8 +1,8 @@ package com.baeldung.rest.cucumber; +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; import org.junit.runner.RunWith; -import cucumber.api.CucumberOptions; -import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions(features = "classpath:Feature") diff --git a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/StepDefinition.java b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/StepDefinition.java index 35a913ae25..f1fcb48f01 100644 --- a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/StepDefinition.java +++ b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/StepDefinition.java @@ -20,6 +20,8 @@ import java.io.IOException; import java.io.InputStream; import java.util.Scanner; +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; @@ -29,8 +31,6 @@ import org.apache.http.impl.client.HttpClients; import com.github.tomakehurst.wiremock.WireMockServer; -import cucumber.api.java.en.Then; -import cucumber.api.java.en.When; public class StepDefinition { @@ -66,7 +66,8 @@ public class StepDefinition { wireMockServer.stop(); } - @When("^users want to get information on the (.+) project$") +// @When("^users want to get information on the '(.+)' project$") + @When("users want to get information on the {string} project") public void usersGetInformationOnAProject(String projectName) throws IOException { wireMockServer.start(); @@ -86,11 +87,11 @@ public class StepDefinition { wireMockServer.stop(); } - @Then("^the server should handle it and return a success status$") + @Then("the server should handle it and return a success status") public void theServerShouldReturnASuccessStatus() { } - @Then("^the requested data is returned$") + @Then("the requested data is returned") public void theRequestedDataIsReturned() { } diff --git a/testing-modules/rest-testing/src/test/resources/Feature/cucumber.feature b/testing-modules/rest-testing/src/test/resources/Feature/cucumber.feature index 99dd8249fe..f8bbd809de 100644 --- a/testing-modules/rest-testing/src/test/resources/Feature/cucumber.feature +++ b/testing-modules/rest-testing/src/test/resources/Feature/cucumber.feature @@ -6,5 +6,5 @@ Feature: Testing a REST API Then the server should handle it and return a success status Scenario: Data retrieval from a web service - When users want to get information on the Cucumber project + When users want to get information on the 'Cucumber' project Then the requested data is returned \ No newline at end of file From d48defc3e223c176e41e6f8b7b161ac313b9db8d Mon Sep 17 00:00:00 2001 From: Umang Budhwar Date: Sat, 3 Oct 2020 08:28:12 +0530 Subject: [PATCH 074/302] BAEL-4531 (#10093) * Added code for checking if a class is abstract or not. * Renamed test name as per review comments. --- .../check/abstractclass/AbstractExample.java | 15 +++++++++++++++ .../abstractclass/AbstractExampleUnitTest.java | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/check/abstractclass/AbstractExample.java create mode 100644 core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/check/abstractclass/AbstractExampleUnitTest.java diff --git a/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/check/abstractclass/AbstractExample.java b/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/check/abstractclass/AbstractExample.java new file mode 100644 index 0000000000..e8ad3bc3bd --- /dev/null +++ b/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/check/abstractclass/AbstractExample.java @@ -0,0 +1,15 @@ +package com.baeldung.reflection.check.abstractclass; + +import java.time.LocalDate; +import java.time.LocalTime; + +public abstract class AbstractExample { + + public static String getAuthorName() { + return "Umang Budhwar"; + } + + public abstract LocalDate getLocalDate(); + + public abstract LocalTime getLocalTime(); +} diff --git a/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/check/abstractclass/AbstractExampleUnitTest.java b/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/check/abstractclass/AbstractExampleUnitTest.java new file mode 100644 index 0000000000..cb5d927c23 --- /dev/null +++ b/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/check/abstractclass/AbstractExampleUnitTest.java @@ -0,0 +1,16 @@ +package com.baeldung.reflection.check.abstractclass; + +import java.lang.reflect.Modifier; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +class AbstractExampleUnitTest { + + @Test + void givenAbstractClass_whenCheckModifierIsAbstract_thenTrue() throws Exception { + Class clazz = AbstractExample.class; + Assertions.assertTrue(Modifier.isAbstract(clazz.getModifiers())); + } + +} From 43ad7afa07acd43c177ac09c81befd01ed79d508 Mon Sep 17 00:00:00 2001 From: Jordan Simpson Date: Sat, 3 Oct 2020 00:42:54 -0500 Subject: [PATCH 075/302] Added code examples from the article. --- .../TransactionalDetectionTest.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java diff --git a/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java b/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java new file mode 100644 index 0000000000..304704a0a6 --- /dev/null +++ b/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java @@ -0,0 +1,28 @@ +package com.baeldung.transactional; + +import com.baeldung.persistence.service.transactional.PersistenceTransactionalTestConfig; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.support.TransactionSynchronizationManager; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +@ContextConfiguration(classes = PersistenceTransactionalTestConfig.class) +@RunWith(SpringJUnit4ClassRunner.class) +public class TransactionalDetectionTest { + + @Test + @Transactional + public void givenTransactional_whenCheckingForActiveTransaction_thenReceiveTrue() { + assertTrue(TransactionSynchronizationManager.isActualTransactionActive()); + } + + @Test + public void givenNoTransactional_whenCheckingForActiveTransaction_thenReceiveFalse() { + assertFalse(TransactionSynchronizationManager.isActualTransactionActive()); + } +} From b5e0e559e370178199efda67e5509d60bdecac64 Mon Sep 17 00:00:00 2001 From: sharifi Date: Sat, 3 Oct 2020 11:32:38 +0330 Subject: [PATCH 076/302] add new module to parent pom --- spring-boot-modules/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index fa70a9f058..19dfcbb962 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -26,6 +26,7 @@ spring-boot-artifacts spring-boot-autoconfiguration spring-boot-basic-customization + spring-boot-basic-customization-2 spring-boot-bootstrap spring-boot-client spring-boot-config-jpa-error From 7e56ea33036c8748faa9748244cc7a01ba7c9e24 Mon Sep 17 00:00:00 2001 From: sharifi Date: Sat, 3 Oct 2020 11:33:33 +0330 Subject: [PATCH 077/302] add README file --- .../spring-boot-basic-customization-2/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/README.md diff --git a/spring-boot-modules/spring-boot-basic-customization-2/README.md b/spring-boot-modules/spring-boot-basic-customization-2/README.md new file mode 100644 index 0000000000..faaee0962e --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/README.md @@ -0,0 +1,7 @@ +## Spring Boot Basic Customization 2 + +This module contains articles about Spring Boot customization 2 + +### Relevant Articles: + + - [DispatcherServlet and web.xml in Spring Boot](https://www.baeldung.com/) From 7ffa8ce6a521c5570b305469f8fd7220f1f3e089 Mon Sep 17 00:00:00 2001 From: sharifi Date: Sat, 3 Oct 2020 11:33:57 +0330 Subject: [PATCH 078/302] add gitignore file --- .../.gitignore | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/.gitignore diff --git a/spring-boot-modules/spring-boot-basic-customization-2/.gitignore b/spring-boot-modules/spring-boot-basic-customization-2/.gitignore new file mode 100644 index 0000000000..2af7cefb0a --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/.gitignore @@ -0,0 +1,24 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ \ No newline at end of file From 17d3411f7c61ef40446e397b55a6f2cd4ed9dc55 Mon Sep 17 00:00:00 2001 From: sharifi Date: Sat, 3 Oct 2020 11:35:16 +0330 Subject: [PATCH 079/302] add main source --- .../spring-boot-basic-customization-2/pom.xml | 33 +++++++++++++++++++ .../com.baeldung.demo/DemoApplication.java | 15 +++++++++ .../java/com.baeldung.demo/conf/WebConf.java | 29 ++++++++++++++++ .../controller/Controller.java | 15 +++++++++ .../filter/CustomFilter.java | 30 +++++++++++++++++ .../listener/CustomListener.java | 22 +++++++++++++ .../servlet/CustomServlet.java | 29 ++++++++++++++++ .../src/main/resources/application.properties | 2 ++ 8 files changed, 175 insertions(+) create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/pom.xml create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/DemoApplication.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/conf/WebConf.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/controller/Controller.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/filter/CustomFilter.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/listener/CustomListener.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/servlet/CustomServlet.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties diff --git a/spring-boot-modules/spring-boot-basic-customization-2/pom.xml b/spring-boot-modules/spring-boot-basic-customization-2/pom.xml new file mode 100644 index 0000000000..3ce9266ebe --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + + + spring-boot-basic-customization-2 + jar + + spring-boot-basic-customization-2 + Module For Spring Boot Basic Customization 2 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/DemoApplication.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/DemoApplication.java new file mode 100644 index 0000000000..9e8148f043 --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/DemoApplication.java @@ -0,0 +1,15 @@ +package com.baeldung.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.context.annotation.Configuration; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/conf/WebConf.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/conf/WebConf.java new file mode 100644 index 0000000000..02fcf152f1 --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/conf/WebConf.java @@ -0,0 +1,29 @@ +package com.baeldung.demo.conf; + +import com.baeldung.demo.listener.CustomListener; +import com.baeldung.demo.servlet.CustomServlet; +import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.ServletContextListener; + +@Configuration +public class WebConf { + + @Bean + public ServletRegistrationBean customServletBean() { + ServletRegistrationBean bean = + new ServletRegistrationBean(new CustomServlet(), "/servlet"); + return bean; + } + + @Bean + public ServletListenerRegistrationBean customListenerBean() { + ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean(); + bean.setListener(new CustomListener()); + return bean; + } + +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/controller/Controller.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/controller/Controller.java new file mode 100644 index 0000000000..a6d1812511 --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/controller/Controller.java @@ -0,0 +1,15 @@ +package com.baeldung.demo.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = "/") +public class Controller { + + @GetMapping + public String getRequest(){ + return "Baeldung DispatcherServlet"; + } +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/filter/CustomFilter.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/filter/CustomFilter.java new file mode 100644 index 0000000000..c661aecf6d --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/filter/CustomFilter.java @@ -0,0 +1,30 @@ +package com.baeldung.demo.filter; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import javax.servlet.*; +import java.io.IOException; + +@Component +public class CustomFilter implements Filter { + + Logger logger = LoggerFactory.getLogger(CustomFilter.class); + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + logger.info("CustomFilter is invoked"); + chain.doFilter(request, response); + } + + @Override + public void destroy() { + + } +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/listener/CustomListener.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/listener/CustomListener.java new file mode 100644 index 0000000000..a9e3ad680f --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/listener/CustomListener.java @@ -0,0 +1,22 @@ +package com.baeldung.demo.listener; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +public class CustomListener implements ServletContextListener { + + Logger logger = LoggerFactory.getLogger(CustomListener.class); + + @Override + public void contextInitialized(ServletContextEvent sce) { + logger.info("CustomListener is initialized"); + } + + @Override + public void contextDestroyed(ServletContextEvent sce) { + logger.info("CustomListener is destroyed"); + } +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/servlet/CustomServlet.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/servlet/CustomServlet.java new file mode 100644 index 0000000000..fd3e92bedc --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/servlet/CustomServlet.java @@ -0,0 +1,29 @@ +package com.baeldung.demo.servlet; + +import com.baeldung.demo.filter.CustomFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class CustomServlet extends HttpServlet { + + Logger logger = LoggerFactory.getLogger(CustomServlet.class); + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + logger.info("CustomServlet doGet() method is invoked"); + super.doGet(req, resp); + } + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + logger.info("CustomServlet doPost() method is invoked"); + super.doPost(req, resp); + } +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties new file mode 100644 index 0000000000..8c4690dedc --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties @@ -0,0 +1,2 @@ +server.servlet.context-path=/demo +spring.mvc.servlet.path=/baeldung \ No newline at end of file From b37b135504bd5893ac657cced2434f3621b4c256 Mon Sep 17 00:00:00 2001 From: Thibauld Dujardin <22295595+ThibDujardin@users.noreply.github.com> Date: Sat, 3 Oct 2020 16:25:03 +0200 Subject: [PATCH 080/302] Add Vavr.Tuple example --- .../java/com/baeldung/vavr/VavrUnitTest.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java b/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java index 7beb75632e..b1a9405605 100644 --- a/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java +++ b/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java @@ -93,6 +93,37 @@ public class VavrUnitTest { assertEquals("JavaVavr 4", transformed); } + @Test + public void editTupleValueForNewTupleInstance(){ + final Tuple2 java9 = Tuple.of("Java", 8); + final Tuple2 transformed = java9.update2(9); + int num = transformed._2(); + assertEquals(9,num); + } + + @Test + public void editTupleValueForSameInstance(){ + Tuple2 java9 = Tuple.of("Java", 8); + java9 = java9.update2(9); + final int num = java9._2(); + assertEquals(9,num); + } + + @Test + public void getNumberOfElementTuple(){ + Tuple2 java8 = Tuple.of("Java", 8); + Tuple3 java8Triple = Tuple.of("Java", 8, 1.8); + Tuple3 java8TripleWnull = Tuple.of("Java", null, 1.8); + + int num = java8.arity(); + int numTriple = java8Triple.arity(); + int numTripleWnull = java8TripleWnull.arity(); + assertEquals(2,num); + assertEquals(3,numTriple); + assertEquals(3,numTripleWnull); + } + + /* * Functions */ From 23c667077b3d8f6e4e8f74d332be25247accf17e Mon Sep 17 00:00:00 2001 From: Gerardo Roza Date: Sat, 3 Oct 2020 15:59:34 -0300 Subject: [PATCH 081/302] updated Keycloak dependencies version to 11.0.2 --- spring-boot-modules/spring-boot-keycloak/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-keycloak/pom.xml b/spring-boot-modules/spring-boot-keycloak/pom.xml index 5049cc3651..cfcdcf2c37 100644 --- a/spring-boot-modules/spring-boot-keycloak/pom.xml +++ b/spring-boot-modules/spring-boot-keycloak/pom.xml @@ -76,7 +76,7 @@ - 10.0.2 + 11.0.2 From 9735c8c093ab13f69d00edef5eac84ca27909ea2 Mon Sep 17 00:00:00 2001 From: amdegregorio Date: Sat, 3 Oct 2020 17:07:52 -0400 Subject: [PATCH 082/302] BAEL-4503 --- .../constantspatterns/Calculator.java | 37 +++++++++++++++++++ .../CalculatorConstants.java | 10 +++++ .../constantspatterns/GeometryCalculator.java | 32 ++++++++++++++++ .../calculations/MathConstants.java | 16 ++++++++ .../ConstantPatternUnitTest.java | 23 ++++++++++++ 5 files changed, 118 insertions(+) create mode 100644 core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/Calculator.java create mode 100644 core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/CalculatorConstants.java create mode 100644 core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/GeometryCalculator.java create mode 100644 core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/calculations/MathConstants.java create mode 100644 core-java-modules/core-java-lang-3/src/test/java/com/baeldung/constantspatterns/ConstantPatternUnitTest.java diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/Calculator.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/Calculator.java new file mode 100644 index 0000000000..78b51c1c93 --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/Calculator.java @@ -0,0 +1,37 @@ +package com.baeldung.constantspatterns; + +public class Calculator { + public static final double PI = 3.14159265359; + private static final double UPPER_LIMIT = 0x1.fffffffffffffP+1023; + + public enum Operation { + ADD, SUBTRACT, DIVIDE, MULTIPLY + } + + public double operateOnTwoNumbers(double numberOne, double numberTwo, Operation operation) { + if (numberOne > UPPER_LIMIT) { + throw new IllegalArgumentException("'numberOne' is too large"); + } + if (numberTwo > UPPER_LIMIT) { + throw new IllegalArgumentException("'numberTwo' is too large"); + } + double answer = 0; + + switch (operation) { + case ADD: + answer = numberOne + numberTwo; + break; + case SUBTRACT: + answer = numberOne - numberTwo; + break; + case DIVIDE: + answer = numberOne / numberTwo; + break; + case MULTIPLY: + answer = numberOne * numberTwo; + break; + } + + return answer; + } +} diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/CalculatorConstants.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/CalculatorConstants.java new file mode 100644 index 0000000000..2237782b00 --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/CalculatorConstants.java @@ -0,0 +1,10 @@ +package com.baeldung.constantspatterns; + +public interface CalculatorConstants { + double PI = 3.14159265359; + double UPPER_LIMIT = 0x1.fffffffffffffP+1023; + + enum Operation { + ADD, SUBTRACT, MULTIPLY, DIVIDE + }; +} diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/GeometryCalculator.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/GeometryCalculator.java new file mode 100644 index 0000000000..47a0dc5233 --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/GeometryCalculator.java @@ -0,0 +1,32 @@ +package com.baeldung.constantspatterns; + +public class GeometryCalculator implements CalculatorConstants { + public static final double UPPER_LIMIT = 100000000000000000000.0; + + public double operateOnTwoNumbers(double numberOne, double numberTwo, Operation operation) { + if (numberOne > UPPER_LIMIT) { + throw new IllegalArgumentException("'numberOne' is too large"); + } + if (numberTwo > UPPER_LIMIT) { + throw new IllegalArgumentException("'numberTwo' is too large"); + } + double answer = 0; + + switch (operation) { + case ADD: + answer = numberOne + numberTwo; + break; + case SUBTRACT: + answer = numberOne - numberTwo; + break; + case DIVIDE: + answer = numberOne / numberTwo; + break; + case MULTIPLY: + answer = numberOne * numberTwo; + break; + } + + return answer; + } +} diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/calculations/MathConstants.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/calculations/MathConstants.java new file mode 100644 index 0000000000..a7ecf7aabe --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/calculations/MathConstants.java @@ -0,0 +1,16 @@ +package com.baeldung.constantspatterns.calculations; + +public final class MathConstants { + public static final double PI = 3.14159265359; + public static final double GOLDEN_RATIO = 1.6180; + public static final double GRAVITATIONAL_ACCELERATION = 9.8; + public static final double EULERS_NUMBER = 2.7182818284590452353602874713527; + + public enum Operation { + ADD, SUBTRACT, DIVIDE, MULTIPLY + } + + private MathConstants() { + + } +} diff --git a/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/constantspatterns/ConstantPatternUnitTest.java b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/constantspatterns/ConstantPatternUnitTest.java new file mode 100644 index 0000000000..39cb8f82f9 --- /dev/null +++ b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/constantspatterns/ConstantPatternUnitTest.java @@ -0,0 +1,23 @@ +package com.baeldung.constantspatterns; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.Test; + +public class ConstantPatternUnitTest { + @Test + public void givenTwoNumbersAndAdd_whenCallingCalculatorOperatOneTwoNumbers_correctAnswerReturned() { + Calculator calculator = new Calculator(); + double expected = 4; + double answer = calculator.operateOnTwoNumbers(2, 2, Calculator.Operation.ADD); + assertEquals(expected, answer); + } + + @Test + public void givenTwoNumbersAndAdd_whenCallingGeometryCalculatorOperatOneTwoNumbers_correctAnswerReturned() { + GeometryCalculator calculator = new GeometryCalculator(); + double expected = 4; + double answer = calculator.operateOnTwoNumbers(2, 2, GeometryCalculator.Operation.ADD); + assertEquals(expected, answer); + } +} From 969cedfecd6801d2b97a507664802ef0862e6c8a Mon Sep 17 00:00:00 2001 From: Adrian Maghear Date: Sat, 3 Oct 2020 21:28:40 +0200 Subject: [PATCH 083/302] [BAEL-3600] setup initial mantis job --- netflix-modules/mantis/pom.xml | 64 +++++++++++++++++++ .../netflix/mantis/MantisApplication.java | 24 +++++++ .../netflix/mantis/job/LogAggregationJob.java | 30 +++++++++ .../netflix/mantis/job/LogCollectingJob.java | 31 +++++++++ .../netflix/mantis/model/LogAggregate.java | 27 ++++++++ .../netflix/mantis/model/LogEvent.java | 36 +++++++++++ .../baeldung/netflix/mantis/sink/LogSink.java | 37 +++++++++++ .../mantis/source/RandomLogSource.java | 46 +++++++++++++ .../netflix/mantis/stage/CountLogStage.java | 58 +++++++++++++++++ .../netflix/mantis/stage/GroupLogStage.java | 25 ++++++++ .../mantis/stage/TransformLogStage.java | 24 +++++++ netflix-modules/pom.xml | 1 + 12 files changed, 403 insertions(+) create mode 100644 netflix-modules/mantis/pom.xml create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/MantisApplication.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogAggregationJob.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogEvent.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/sink/LogSink.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/source/RandomLogSource.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/CountLogStage.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/GroupLogStage.java create mode 100644 netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/TransformLogStage.java diff --git a/netflix-modules/mantis/pom.xml b/netflix-modules/mantis/pom.xml new file mode 100644 index 0000000000..48151c142f --- /dev/null +++ b/netflix-modules/mantis/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + mantis + Mantis + jar + Sample project for Netflix Mantis + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + + + org.springframework.boot + spring-boot-starter + 2.1.3.RELEASE + + + + io.mantisrx + mantis-runtime + 1.2.63 + + + org.slf4j + slf4j-log4j12 + + + + + + com.fasterxml.jackson.core + jackson-databind + 2.10.2 + + + + net.andreinc.mockneat + mockneat + 0.3.8 + + + + org.projectlombok + lombok + 1.18.12 + + + + + + + SpringLibReleaseRepo + https://repo.spring.io/libs-release/ + + + + diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/MantisApplication.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/MantisApplication.java new file mode 100644 index 0000000000..ad2b7f9aed --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/MantisApplication.java @@ -0,0 +1,24 @@ +package com.baeldung.netflix.mantis; + +import com.baeldung.netflix.mantis.job.LogAggregationJob; +import com.baeldung.netflix.mantis.job.LogCollectingJob; +import io.mantisrx.runtime.executor.LocalJobExecutorNetworked; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@Slf4j +@SpringBootApplication +public class MantisApplication implements CommandLineRunner { + + public static void main(String[] args) { + SpringApplication.run(MantisApplication.class, args); + } + + @Override + public void run(String... args) { + LocalJobExecutorNetworked.execute(new LogAggregationJob().getJobInstance()); + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogAggregationJob.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogAggregationJob.java new file mode 100644 index 0000000000..229d11d39d --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogAggregationJob.java @@ -0,0 +1,30 @@ +package com.baeldung.netflix.mantis.job; + +import com.baeldung.netflix.mantis.model.LogAggregate; +import com.baeldung.netflix.mantis.source.RandomLogSource; +import com.baeldung.netflix.mantis.stage.CountLogStage; +import com.baeldung.netflix.mantis.stage.GroupLogStage; +import com.baeldung.netflix.mantis.stage.TransformLogStage; +import io.mantisrx.runtime.Job; +import io.mantisrx.runtime.MantisJob; +import io.mantisrx.runtime.MantisJobProvider; +import io.mantisrx.runtime.Metadata; +import io.mantisrx.runtime.sink.Sinks; + +public class LogAggregationJob extends MantisJobProvider { + + @Override + public Job getJobInstance() { + + return MantisJob + .source(new RandomLogSource()) + .stage(new TransformLogStage(), TransformLogStage.stageConfig()) + .stage(new GroupLogStage(), GroupLogStage.config()) + .stage(new CountLogStage(), CountLogStage.config()) + .sink(Sinks.eagerSubscribe(Sinks.sse(LogAggregate::toJsonString))) + .metadata(new Metadata.Builder().build()) + .create(); + + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java new file mode 100644 index 0000000000..9bb6ae7f6d --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java @@ -0,0 +1,31 @@ +package com.baeldung.netflix.mantis.job; + +import com.baeldung.netflix.mantis.model.LogEvent; +import com.baeldung.netflix.mantis.sink.LogSink; +import com.baeldung.netflix.mantis.source.RandomLogSource; +import com.baeldung.netflix.mantis.stage.TransformLogStage; +import io.mantisrx.runtime.Job; +import io.mantisrx.runtime.MantisJob; +import io.mantisrx.runtime.MantisJobProvider; +import io.mantisrx.runtime.Metadata; +import io.mantisrx.runtime.ScalarToScalar; +import io.mantisrx.runtime.sink.Sinks; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class LogCollectingJob extends MantisJobProvider { + + @Override + public Job getJobInstance() { + + return MantisJob + .source(new RandomLogSource()) + .stage(new TransformLogStage(), new ScalarToScalar.Config<>()) +// .sink(Sinks.eagerSubscribe(Sinks.sse(LogEvent::toJsonString))) + .sink(new LogSink()) + .metadata(new Metadata.Builder().build()) + .create(); + + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java new file mode 100644 index 0000000000..a9f1818b9a --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java @@ -0,0 +1,27 @@ +package com.baeldung.netflix.mantis.model; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.mantisrx.runtime.codec.JsonType; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class LogAggregate implements JsonType { + + private static final ObjectMapper mapper = new ObjectMapper(); + + private final Integer count; + private final String level; + + public String toJsonString() { + try { + return mapper.writeValueAsString(this); + } catch (JsonProcessingException e) { + e.printStackTrace(); + return null; + } + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogEvent.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogEvent.java new file mode 100644 index 0000000000..36665b0264 --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogEvent.java @@ -0,0 +1,36 @@ +package com.baeldung.netflix.mantis.model; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.mantisrx.runtime.codec.JsonType; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +public class LogEvent implements JsonType { + + private static final ObjectMapper mapper = new ObjectMapper(); + + private Long index; + private String level; + private String message; + + public LogEvent(String[] parts) { + this.index = Long.valueOf(parts[0]); + this.level = parts[1]; + this.message = parts[2]; + } + + public String toJsonString() { + try { + return mapper.writeValueAsString(this); + } catch (JsonProcessingException e) { + e.printStackTrace(); + return null; + } + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/sink/LogSink.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/sink/LogSink.java new file mode 100644 index 0000000000..ae2177bf87 --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/sink/LogSink.java @@ -0,0 +1,37 @@ +package com.baeldung.netflix.mantis.sink; + +import com.baeldung.netflix.mantis.model.LogEvent; +import io.mantisrx.runtime.Context; +import io.mantisrx.runtime.PortRequest; +import io.mantisrx.runtime.sink.SelfDocumentingSink; +import io.mantisrx.runtime.sink.ServerSentEventsSink; +import io.mantisrx.runtime.sink.Sink; +import io.mantisrx.runtime.sink.predicate.Predicate; +import rx.Observable; + +public class LogSink implements Sink { + + @Override + public void call(Context context, PortRequest portRequest, Observable logEventObservable) { + + SelfDocumentingSink sink = new ServerSentEventsSink.Builder() + .withEncoder(LogEvent::toJsonString) + .withPredicate(filterByLogMessage()) + .build(); + + logEventObservable.subscribe(); + + sink.call(context, portRequest, logEventObservable); + } + + private Predicate filterByLogMessage() { + return new Predicate<>("filter by message", + parameters -> { + if (parameters != null && parameters.containsKey("filter")) { + return logEvent -> logEvent.getMessage().contains(parameters.get("filter").get(0)); + } + return logEvent -> true; + }); + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/source/RandomLogSource.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/source/RandomLogSource.java new file mode 100644 index 0000000000..fe607d9866 --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/source/RandomLogSource.java @@ -0,0 +1,46 @@ +package com.baeldung.netflix.mantis.source; + +import io.mantisrx.runtime.Context; +import io.mantisrx.runtime.source.Index; +import io.mantisrx.runtime.source.Source; +import lombok.extern.slf4j.Slf4j; +import net.andreinc.mockneat.MockNeat; +import rx.Observable; + +import java.util.Date; +import java.util.concurrent.TimeUnit; + +@Slf4j +public class RandomLogSource implements Source { + + private MockNeat mockDataGenerator; + + @Override + public void init(Context context, Index index) { + mockDataGenerator = MockNeat.threadLocal(); + } + + @Override + public Observable> call(Context context, Index index) { + return Observable.just( + Observable + .interval(250, TimeUnit.MILLISECONDS) + .map(this::createRandomLogEvent)); + } + + private String createRandomLogEvent(Long tick) { + String level = mockDataGenerator.probabilites(String.class) + .add(0.5, "INFO") + .add(0.3, "WARN") + .add(0.2, "ERROR") + .get(); + + String message = mockDataGenerator.probabilites(String.class) + .add(0.5, "login attempt") + .add(0.5, "user created") + .get(); + + return tick + "#" + level + "#" + message; + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/CountLogStage.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/CountLogStage.java new file mode 100644 index 0000000000..5f02d783d0 --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/CountLogStage.java @@ -0,0 +1,58 @@ +package com.baeldung.netflix.mantis.stage; + +import com.baeldung.netflix.mantis.model.LogAggregate; +import com.baeldung.netflix.mantis.model.LogEvent; +import io.mantisrx.common.MantisGroup; +import io.mantisrx.runtime.Context; +import io.mantisrx.runtime.GroupToScalar; +import io.mantisrx.runtime.codec.JacksonCodecs; +import io.mantisrx.runtime.computation.GroupToScalarComputation; +import io.mantisrx.runtime.parameter.ParameterDefinition; +import io.mantisrx.runtime.parameter.type.IntParameter; +import io.mantisrx.runtime.parameter.validator.Validators; +import rx.Observable; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +public class CountLogStage implements GroupToScalarComputation { + + private int duration; + + @Override + public void init(Context context) { + duration = (int)context.getParameters().get("LogAggregationDuration", 1000); + } + + @Override + public Observable call(Context context, Observable> mantisGroup) { + return mantisGroup + .window(duration, TimeUnit.MILLISECONDS) + .flatMap(o -> o.groupBy(MantisGroup::getKeyValue) + .flatMap(group -> group.reduce(0, (count, value) -> count = count + 1) + .map((count) -> new LogAggregate(count, group.getKey())) + )); + } + + public static GroupToScalar.Config config(){ + return new GroupToScalar.Config() + .description("sum events for a log level") + .codec(JacksonCodecs.pojo(LogAggregate.class)) + .withParameters(getParameters()); + } + + public static List> getParameters() { + List> params = new ArrayList<>(); + + params.add(new IntParameter() + .name("LogAggregationDuration") + .description("window size for aggregation in milliseconds") + .validator(Validators.range(100, 10000)) + .defaultValue(5000) + .build()) ; + + return params; + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/GroupLogStage.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/GroupLogStage.java new file mode 100644 index 0000000000..f21c4aba7d --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/GroupLogStage.java @@ -0,0 +1,25 @@ +package com.baeldung.netflix.mantis.stage; + +import com.baeldung.netflix.mantis.model.LogEvent; +import io.mantisrx.common.MantisGroup; +import io.mantisrx.runtime.Context; +import io.mantisrx.runtime.ScalarToGroup; +import io.mantisrx.runtime.codec.JacksonCodecs; +import io.mantisrx.runtime.computation.ToGroupComputation; +import rx.Observable; + +public class GroupLogStage implements ToGroupComputation { + + @Override + public Observable> call(Context context, Observable logEvent) { + return logEvent.map(log -> new MantisGroup<>(log.getLevel(), log)); + } + + public static ScalarToGroup.Config config(){ + return new ScalarToGroup.Config() + .description("Group event data by level") + .codec(JacksonCodecs.pojo(LogEvent.class)) + .concurrentInput(); + } + +} diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/TransformLogStage.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/TransformLogStage.java new file mode 100644 index 0000000000..33e6567d13 --- /dev/null +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/stage/TransformLogStage.java @@ -0,0 +1,24 @@ +package com.baeldung.netflix.mantis.stage; + +import com.baeldung.netflix.mantis.model.LogEvent; +import io.mantisrx.runtime.Context; +import io.mantisrx.runtime.ScalarToScalar; +import io.mantisrx.runtime.codec.JacksonCodecs; +import io.mantisrx.runtime.computation.ScalarComputation; +import rx.Observable; + +public class TransformLogStage implements ScalarComputation { + + @Override + public Observable call(Context context, Observable logEntry) { + return logEntry + .map(log -> log.split("#")) + .filter(parts -> parts.length == 3) + .map(LogEvent::new); + } + + public static ScalarToScalar.Config stageConfig() { + return new ScalarToScalar.Config() + .codec(JacksonCodecs.pojo(LogEvent.class)); + } +} diff --git a/netflix-modules/pom.xml b/netflix-modules/pom.xml index 9ed22498d8..538126fb34 100644 --- a/netflix-modules/pom.xml +++ b/netflix-modules/pom.xml @@ -15,6 +15,7 @@ genie + mantis \ No newline at end of file From 795bcbe2b78213abcda781536e7d9a3a0b7d8ece Mon Sep 17 00:00:00 2001 From: Adrian Maghear Date: Sun, 4 Oct 2020 12:53:41 +0200 Subject: [PATCH 084/302] [BAEL-3600] small fixes --- .../java/com/baeldung/netflix/mantis/MantisApplication.java | 1 - .../java/com/baeldung/netflix/mantis/job/LogCollectingJob.java | 2 -- .../java/com/baeldung/netflix/mantis/model/LogAggregate.java | 1 - .../main/java/com/baeldung/netflix/mantis/model/LogEvent.java | 1 - 4 files changed, 5 deletions(-) diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/MantisApplication.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/MantisApplication.java index ad2b7f9aed..d5ffe977c3 100644 --- a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/MantisApplication.java +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/MantisApplication.java @@ -1,7 +1,6 @@ package com.baeldung.netflix.mantis; import com.baeldung.netflix.mantis.job.LogAggregationJob; -import com.baeldung.netflix.mantis.job.LogCollectingJob; import io.mantisrx.runtime.executor.LocalJobExecutorNetworked; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.CommandLineRunner; diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java index 9bb6ae7f6d..492f30c43a 100644 --- a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java @@ -9,7 +9,6 @@ import io.mantisrx.runtime.MantisJob; import io.mantisrx.runtime.MantisJobProvider; import io.mantisrx.runtime.Metadata; import io.mantisrx.runtime.ScalarToScalar; -import io.mantisrx.runtime.sink.Sinks; import lombok.extern.slf4j.Slf4j; @Slf4j @@ -21,7 +20,6 @@ public class LogCollectingJob extends MantisJobProvider { return MantisJob .source(new RandomLogSource()) .stage(new TransformLogStage(), new ScalarToScalar.Config<>()) -// .sink(Sinks.eagerSubscribe(Sinks.sse(LogEvent::toJsonString))) .sink(new LogSink()) .metadata(new Metadata.Builder().build()) .create(); diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java index a9f1818b9a..0eeb7ea086 100644 --- a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java @@ -19,7 +19,6 @@ public class LogAggregate implements JsonType { try { return mapper.writeValueAsString(this); } catch (JsonProcessingException e) { - e.printStackTrace(); return null; } } diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogEvent.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogEvent.java index 36665b0264..a48dfcd5dd 100644 --- a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogEvent.java +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogEvent.java @@ -28,7 +28,6 @@ public class LogEvent implements JsonType { try { return mapper.writeValueAsString(this); } catch (JsonProcessingException e) { - e.printStackTrace(); return null; } } From 14593ca02a9a316657a929c1cda6cf664d4beab8 Mon Sep 17 00:00:00 2001 From: Anirban Chatterjee Date: Sun, 4 Oct 2020 12:55:22 +0200 Subject: [PATCH 085/302] Refined bean methods --- .../EmployeeApplication.java | 9 +++++---- .../componentscanautoconfigure/doctor/Doctor.java | 7 ------- .../employee/SeniorEmployee.java | 2 +- .../healthcare/Doctor.java | 9 +++++++++ .../healthcare/Hospital.java | 13 +++++++++++++ 5 files changed, 28 insertions(+), 12 deletions(-) delete mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/doctor/Doctor.java create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/healthcare/Doctor.java create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/healthcare/Hospital.java diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java index d429b0cdc9..578479a81c 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java @@ -8,18 +8,19 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -@Configuration -@ComponentScan(basePackages = {"com.baeldung.annotations.componentscanautoconfigure.doctor", "com.baeldung.annotations.componentscanautoconfigure.employee"}, +//@Configuration +@ComponentScan(basePackages = {"com.baeldung.annotations.componentscanautoconfigure.healthcare", "com.baeldung.annotations.componentscanautoconfigure.employee"}, basePackageClasses = Teacher.class) -@EnableAutoConfiguration(exclude={JdbcTemplateAutoConfiguration.class}) +@EnableAutoConfiguration(exclude = {JdbcTemplateAutoConfiguration.class}) //@EnableAutoConfiguration(excludeName = {"org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration"}) public class EmployeeApplication { public static void main(String[] args) { ApplicationContext context = SpringApplication.run(EmployeeApplication.class, args); - System.out.println("Configures Doctor: " + context.containsBeanDefinition("doctor")); System.out.println("Configures Employee: " + context.containsBeanDefinition("employee")); System.out.println("Configures Senior Employee: " + context.containsBeanDefinition("seniorEmployee")); + System.out.println("Configures Doctor: " + context.containsBeanDefinition("doctor")); + System.out.println("Configures Hospital: " + context.containsBeanDefinition("hospital")); System.out.println("Configures Student: " + context.containsBeanDefinition("student")); System.out.println("Configures Teacher: " + context.containsBeanDefinition("teacher")); } diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/doctor/Doctor.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/doctor/Doctor.java deleted file mode 100644 index 40bb68259a..0000000000 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/doctor/Doctor.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.baeldung.annotations.componentscanautoconfigure.doctor; - -import org.springframework.stereotype.Component; - -@Component("doctor") -public class Doctor { -} diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java index fc02a17df6..ef75b4af0a 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java @@ -2,6 +2,6 @@ package com.baeldung.annotations.componentscanautoconfigure.employee; import org.springframework.stereotype.Component; -@Component("seniorEmployee") +@Component public class SeniorEmployee { } diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/healthcare/Doctor.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/healthcare/Doctor.java new file mode 100644 index 0000000000..7e7e6cb03b --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/healthcare/Doctor.java @@ -0,0 +1,9 @@ +package com.baeldung.annotations.componentscanautoconfigure.healthcare; + +public class Doctor { + + @Override + public String toString() { + return "Doctor" + this.hashCode(); + } +} diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/healthcare/Hospital.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/healthcare/Hospital.java new file mode 100644 index 0000000000..0711544060 --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/healthcare/Hospital.java @@ -0,0 +1,13 @@ +package com.baeldung.annotations.componentscanautoconfigure.healthcare; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class Hospital { + + @Bean("doctor") + public Doctor getDoctor() { + return new Doctor(); + } +} From b63aad504835aced570714e85aedfb45c1d5a49b Mon Sep 17 00:00:00 2001 From: Benjamin Caure Date: Mon, 5 Oct 2020 09:50:54 +0200 Subject: [PATCH 086/302] BAEL-4436 : move template dir to main/resources (#10100) + configure location from application.properties --- .../configuration/EmailConfiguration.java | 93 +++++++++++++------ .../spring/mail/EmailServiceImpl.java | 2 +- .../src/main/resources/application.properties | 14 ++- .../mail-templates}/template-freemarker.ftl | 0 .../mail-templates}/template-thymeleaf.html | 0 5 files changed, 78 insertions(+), 31 deletions(-) rename spring-mvc-basics-2/src/main/{webapp/WEB-INF/views/mail => resources/mail-templates}/template-freemarker.ftl (100%) rename spring-mvc-basics-2/src/main/{webapp/WEB-INF/views/mail => resources/mail-templates}/template-thymeleaf.html (100%) diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/EmailConfiguration.java b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/EmailConfiguration.java index 4bd692f609..86a7f1162c 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/EmailConfiguration.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/EmailConfiguration.java @@ -1,37 +1,61 @@ package com.baeldung.spring.configuration; +import freemarker.cache.ClassTemplateLoader; +import freemarker.cache.TemplateLoader; +import freemarker.template.Configuration; import java.util.Properties; - +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.JavaMailSenderImpl; import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; -import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver; import org.thymeleaf.spring5.SpringTemplateEngine; -import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; +import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver; +import org.thymeleaf.templateresolver.ITemplateResolver; -@Configuration @ComponentScan(basePackages = { "com.baeldung.spring.mail" }) +@PropertySource(value={"classpath:application.properties"}) public class EmailConfiguration { + + @Value("${spring.mail.host}") + private String mailServerHost; + + @Value("${spring.mail.port}") + private Integer mailServerPort; + + @Value("${spring.mail.username}") + private String mailServerUsername; + + @Value("${spring.mail.password}") + private String mailServerPassword; + + @Value("${spring.mail.properties.mail.smtp.auth}") + private String mailServerAuth; + + @Value("${spring.mail.properties.mail.smtp.starttls.enable}") + private String mailServerStartTls; + + @Value("${spring.mail.templates.path}") + private String mailTemplatesPath; @Bean public JavaMailSender getJavaMailSender() { JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); - mailSender.setHost("smtp.gmail.com"); - mailSender.setPort(587); + mailSender.setHost(mailServerHost); + mailSender.setPort(mailServerPort); - mailSender.setUsername("my.gmail@gmail.com"); - mailSender.setPassword("password"); + mailSender.setUsername(mailServerUsername); + mailSender.setPassword(mailServerPassword); Properties props = mailSender.getJavaMailProperties(); props.put("mail.transport.protocol", "smtp"); - props.put("mail.smtp.auth", "true"); - props.put("mail.smtp.starttls.enable", "false"); + props.put("mail.smtp.auth", mailServerAuth); + props.put("mail.smtp.starttls.enable", mailServerStartTls); props.put("mail.debug", "true"); return mailSender; @@ -45,39 +69,52 @@ public class EmailConfiguration { } @Bean - public SpringTemplateEngine thymeleafTemplateEngine() { + public SpringTemplateEngine thymeleafTemplateEngine(ITemplateResolver templateResolver) { SpringTemplateEngine templateEngine = new SpringTemplateEngine(); - templateEngine.setTemplateResolver(thymeleafTemplateResolver()); + templateEngine.setTemplateResolver(templateResolver); templateEngine.setTemplateEngineMessageSource(emailMessageSource()); return templateEngine; } @Bean - public SpringResourceTemplateResolver thymeleafTemplateResolver() { - SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver(); - templateResolver.setPrefix("/WEB-INF/views/mail/"); + public ITemplateResolver thymeleafClassLoaderTemplateResolver() { + ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver(); + templateResolver.setPrefix(mailTemplatesPath + "/"); templateResolver.setSuffix(".html"); templateResolver.setTemplateMode("HTML"); templateResolver.setCharacterEncoding("UTF-8"); return templateResolver; } + +// @Bean +// public ITemplateResolver thymeleafFilesystemTemplateResolver() { +// FileTemplateResolver templateResolver = new FileTemplateResolver(); +// templateResolver.setPrefix(mailTemplatesPath + "/"); +// templateResolver.setSuffix(".html"); +// templateResolver.setTemplateMode("HTML"); +// templateResolver.setCharacterEncoding("UTF-8"); +// return templateResolver; +// } @Bean - public FreeMarkerConfigurer freemarkerConfig() { - FreeMarkerConfigurer freeMarkerConfigurer = new FreeMarkerConfigurer(); - freeMarkerConfigurer.setTemplateLoaderPath("/WEB-INF/views/mail"); + public FreeMarkerConfigurer freemarkerClassLoaderConfig() { + Configuration configuration = new Configuration(Configuration.VERSION_2_3_27); + TemplateLoader templateLoader = new ClassTemplateLoader(this.getClass(), "/" + mailTemplatesPath); + configuration.setTemplateLoader(templateLoader); + FreeMarkerConfigurer freeMarkerConfigurer = new FreeMarkerConfigurer(); + freeMarkerConfigurer.setConfiguration(configuration); return freeMarkerConfigurer; } - @Bean - public FreeMarkerViewResolver freemarkerViewResolver() { - FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); - resolver.setCache(true); - resolver.setPrefix(""); - resolver.setSuffix(".ftl"); - return resolver; - } - +// @Bean +// public FreeMarkerConfigurer freemarkerFilesystemConfig() throws IOException { +// Configuration configuration = new Configuration(Configuration.VERSION_2_3_27); +// TemplateLoader templateLoader = new FileTemplateLoader(new File(mailTemplatesPath)); +// configuration.setTemplateLoader(templateLoader); +// FreeMarkerConfigurer freeMarkerConfigurer = new FreeMarkerConfigurer(); +// freeMarkerConfigurer.setConfiguration(configuration); +// return freeMarkerConfigurer; +// } @Bean public ResourceBundleMessageSource emailMessageSource() { diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/mail/EmailServiceImpl.java b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/mail/EmailServiceImpl.java index 1eb7a5f8b4..a0c8907a87 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/mail/EmailServiceImpl.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/mail/EmailServiceImpl.java @@ -112,7 +112,7 @@ public class EmailServiceImpl implements EmailService { String to, String subject, Map templateModel) throws IOException, TemplateException, MessagingException { - Template freemarkerTemplate = freemarkerConfigurer.createConfiguration().getTemplate("template-freemarker.ftl"); + Template freemarkerTemplate = freemarkerConfigurer.getConfiguration().getTemplate("template-freemarker.ftl"); String htmlBody = FreeMarkerTemplateUtils.processTemplateIntoString(freemarkerTemplate, templateModel); sendHtmlMessage(to, subject, htmlBody); diff --git a/spring-mvc-basics-2/src/main/resources/application.properties b/spring-mvc-basics-2/src/main/resources/application.properties index 9a804c07d8..7ca8d33d5c 100644 --- a/spring-mvc-basics-2/src/main/resources/application.properties +++ b/spring-mvc-basics-2/src/main/resources/application.properties @@ -6,7 +6,7 @@ spring.mail.port=587 spring.mail.username=username spring.mail.password=password spring.mail.properties.mail.smtp.auth=true -spring.mail.properties.mail.smtp.starttls.enable=true +spring.mail.properties.mail.smtp.starttls.enable=false # Amazon SES SMTP #spring.mail.host=email-smtp.us-west-2.amazonaws.com @@ -19,4 +19,14 @@ spring.mail.properties.mail.smtp.starttls.enable=true #spring.mail.properties.mail.smtp.starttls.required=true # path to attachment file -attachment.invoice=path_to_file \ No newline at end of file +attachment.invoice=path_to_file + + +# +# Mail templates +# + +# Templates directory inside main/resources or absolute filesystem path +spring.mail.templates.path=mail-templates +#spring.mail.templates.path=/path/to/templates + diff --git a/spring-mvc-basics-2/src/main/webapp/WEB-INF/views/mail/template-freemarker.ftl b/spring-mvc-basics-2/src/main/resources/mail-templates/template-freemarker.ftl similarity index 100% rename from spring-mvc-basics-2/src/main/webapp/WEB-INF/views/mail/template-freemarker.ftl rename to spring-mvc-basics-2/src/main/resources/mail-templates/template-freemarker.ftl diff --git a/spring-mvc-basics-2/src/main/webapp/WEB-INF/views/mail/template-thymeleaf.html b/spring-mvc-basics-2/src/main/resources/mail-templates/template-thymeleaf.html similarity index 100% rename from spring-mvc-basics-2/src/main/webapp/WEB-INF/views/mail/template-thymeleaf.html rename to spring-mvc-basics-2/src/main/resources/mail-templates/template-thymeleaf.html From 2d128104d4c6463d7e1481e3faec441ac4474912 Mon Sep 17 00:00:00 2001 From: rdevarakonda Date: Mon, 5 Oct 2020 18:45:51 +0100 Subject: [PATCH 087/302] KTLN-153 | Examples for article + Upgrade Kotlin version to 1.4.0 (#10108) * KTLN-153 | Examples for article + Upgrade Kotlin version to 1.4.0 * KTLN-153 | UNDO Upgrade to Kotlin 1.4.0 * KTLN-153 | Update examples to match the article edits * KTLN-153 | Update examples to match the article edits - 2 Co-authored-by: tpurdeva --- .../baeldung/arguments/DefaultArguments.kt | 37 +++++++++++++++++++ .../com/baeldung/arguments/NamedArguments.kt | 28 ++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/arguments/DefaultArguments.kt create mode 100644 core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/arguments/NamedArguments.kt diff --git a/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/arguments/DefaultArguments.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/arguments/DefaultArguments.kt new file mode 100644 index 0000000000..691b3475b4 --- /dev/null +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/arguments/DefaultArguments.kt @@ -0,0 +1,37 @@ +package com.baeldung.arguments + +fun main() { + + // Skip both the connectTimeout and enableRetry arguments + connect("http://www.baeldung.com") + + // Skip only the enableRetry argument: + connect("http://www.baeldung.com", 5000) + + // Skip only the middle argument connectTimeout + // connect("http://www.baeldung.com", false) // This results in a compiler error + + // Because we skipped the connectTimeout argument, we must pass the enableRetry as a named argument + connect("http://www.baeldung.com", enableRetry = false) + + // Overriding Functions and Default Arguments + val realConnector = RealConnector() + realConnector.connect("www.baeldung.com") + realConnector.connect() +} + +fun connect(url: String, connectTimeout: Int = 1000, enableRetry: Boolean = true) { + println("The parameters are url = $url, connectTimeout = $connectTimeout, enableRetry = $enableRetry") +} + +open class AbstractConnector { + open fun connect(url: String = "localhost") { + // function implementation + } +} + +class RealConnector : AbstractConnector() { + override fun connect(url: String) { + println("The parameter is url = $url") + } +} \ No newline at end of file diff --git a/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/arguments/NamedArguments.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/arguments/NamedArguments.kt new file mode 100644 index 0000000000..0cbf6f158a --- /dev/null +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/arguments/NamedArguments.kt @@ -0,0 +1,28 @@ +package com.baeldung.arguments + +fun main() { + resizePane(newSize = 10, forceResize = true, noAnimation = false) + + // Swap the order of last two named arguments + resizePane(newSize = 11, noAnimation = false, forceResize = true) + + // Named arguments can be passed in any order + resizePane(forceResize = true, newSize = 12, noAnimation = false) + + // Mixing Named and Positional Arguments + // Kotlin 1.3 would allow us to name only the arguments after the positional ones + resizePane(20, true, noAnimation = false) + + // Using a positional argument in the middle of named arguments (supported from Kotlin 1.4.0) + // resizePane(newSize = 20, true, noAnimation = false) + + // Only the last argument as a positional argument (supported from Kotlin 1.4.0) + // resizePane(newSize = 30, forceResize = true, false) + + // Use a named argument in the middle of positional arguments (supported from Kotlin 1.4.0) + // resizePane(40, forceResize = true, false) +} + +fun resizePane(newSize: Int, forceResize: Boolean, noAnimation: Boolean) { + println("The parameters are newSize = $newSize, forceResize = $forceResize, noAnimation = $noAnimation") +} \ No newline at end of file From 90382576f6aeac397a968e28b167e6cdd1bda81b Mon Sep 17 00:00:00 2001 From: kwoyke Date: Tue, 6 Oct 2020 08:08:09 +0200 Subject: [PATCH 088/302] BAEL-4661: Add an example of creating a file using FileOutputStream (#10131) --- .../java/com/baeldung/createfile/CreateFileUnitTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core-java-modules/core-java-io-3/src/test/java/com/baeldung/createfile/CreateFileUnitTest.java b/core-java-modules/core-java-io-3/src/test/java/com/baeldung/createfile/CreateFileUnitTest.java index f3cdb22f4d..f26a1ab3ad 100644 --- a/core-java-modules/core-java-io-3/src/test/java/com/baeldung/createfile/CreateFileUnitTest.java +++ b/core-java-modules/core-java-io-3/src/test/java/com/baeldung/createfile/CreateFileUnitTest.java @@ -6,6 +6,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -37,6 +38,12 @@ public class CreateFileUnitTest { assertTrue(success); } + @Test + void givenUsingFileOutputStream_whenCreatingFile_thenCorrect() throws IOException { + try(FileOutputStream fileOutputStream = new FileOutputStream(FILE_NAME)){ + } + } + @Test public void givenUsingGuava_whenCreatingFile_thenCorrect() throws IOException { com.google.common.io.Files.touch(new File(FILE_NAME)); From 542c52081bea594deac649f2925dc30099e2394c Mon Sep 17 00:00:00 2001 From: Philippe Date: Tue, 6 Oct 2020 17:03:49 -0300 Subject: [PATCH 089/302] [BAEL-4203] Rename jni module to java-native --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ac1a16a728..cba7e33b03 100644 --- a/pom.xml +++ b/pom.xml @@ -977,7 +977,7 @@ jjwt jmeter jmh - jni + java-native jooby jsf json From bd53673e2b175f9450829b20e5e81394ab7b0ac3 Mon Sep 17 00:00:00 2001 From: Anirban Chatterjee Date: Tue, 6 Oct 2020 22:33:24 +0200 Subject: [PATCH 090/302] Added unit test --- .../EmployeeApplication.java | 8 +++---- .../EmployeeApplicationTest.java | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) rename spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/{componentscanautoconfigure => }/EmployeeApplication.java (86%) create mode 100644 spring-boot-modules/spring-boot-annotations/src/main/test/com.baeldung.annotations/EmployeeApplicationTest.java diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/EmployeeApplication.java similarity index 86% rename from spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java rename to spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/EmployeeApplication.java index 578479a81c..263df30e16 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/EmployeeApplication.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/EmployeeApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.annotations.componentscanautoconfigure; +package com.baeldung.annotations; import com.baeldung.annotations.componentscanautoconfigure.teacher.Teacher; import org.springframework.boot.SpringApplication; @@ -6,15 +6,13 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -//@Configuration -@ComponentScan(basePackages = {"com.baeldung.annotations.componentscanautoconfigure.healthcare", "com.baeldung.annotations.componentscanautoconfigure.employee"}, +@ComponentScan(basePackages = {"com.baeldung.annotations.componentscanautoconfigure.healthcare", + "com.baeldung.annotations.componentscanautoconfigure.employee"}, basePackageClasses = Teacher.class) @EnableAutoConfiguration(exclude = {JdbcTemplateAutoConfiguration.class}) //@EnableAutoConfiguration(excludeName = {"org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration"}) public class EmployeeApplication { - public static void main(String[] args) { ApplicationContext context = SpringApplication.run(EmployeeApplication.class, args); System.out.println("Configures Employee: " + context.containsBeanDefinition("employee")); diff --git a/spring-boot-modules/spring-boot-annotations/src/main/test/com.baeldung.annotations/EmployeeApplicationTest.java b/spring-boot-modules/spring-boot-annotations/src/main/test/com.baeldung.annotations/EmployeeApplicationTest.java new file mode 100644 index 0000000000..66700cf781 --- /dev/null +++ b/spring-boot-modules/spring-boot-annotations/src/main/test/com.baeldung.annotations/EmployeeApplicationTest.java @@ -0,0 +1,23 @@ +package com.baeldung.annotations; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertAll; + +public class EmployeeApplicationTest { + private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() + .withUserConfiguration(EmployeeApplication.class); + + @Test + void whenApplicationContextRuns_thenContainAllDefinedBeans() { + contextRunner.run(context -> assertAll( + () -> assertTrue(context.containsBeanDefinition("employee")), + () -> assertTrue(context.containsBeanDefinition("seniorEmployee")), + () -> assertTrue(context.containsBeanDefinition("doctor")), + () -> assertTrue(context.containsBeanDefinition("hospital")), + () -> assertFalse(context.containsBeanDefinition("student")), + () -> assertTrue(context.containsBeanDefinition("teacher")))); + } +} From d27cbbc4a6507d3ba0a76057c34cd6cdf4b21e8c Mon Sep 17 00:00:00 2001 From: Anirban Chatterjee Date: Wed, 7 Oct 2020 09:32:33 +0200 Subject: [PATCH 091/302] Removed boilerplate code --- .../com/baeldung/annotations/EmployeeApplication.java | 8 +------- .../componentscanautoconfigure/employee/Employee.java | 5 +++++ .../employee/SeniorEmployee.java | 5 +++++ .../componentscanautoconfigure/student/Student.java | 5 +++++ .../componentscanautoconfigure/teacher/Teacher.java | 5 +++++ 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/EmployeeApplication.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/EmployeeApplication.java index 263df30e16..17c7af858b 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/EmployeeApplication.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/EmployeeApplication.java @@ -14,12 +14,6 @@ import org.springframework.context.annotation.ComponentScan; //@EnableAutoConfiguration(excludeName = {"org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration"}) public class EmployeeApplication { public static void main(String[] args) { - ApplicationContext context = SpringApplication.run(EmployeeApplication.class, args); - System.out.println("Configures Employee: " + context.containsBeanDefinition("employee")); - System.out.println("Configures Senior Employee: " + context.containsBeanDefinition("seniorEmployee")); - System.out.println("Configures Doctor: " + context.containsBeanDefinition("doctor")); - System.out.println("Configures Hospital: " + context.containsBeanDefinition("hospital")); - System.out.println("Configures Student: " + context.containsBeanDefinition("student")); - System.out.println("Configures Teacher: " + context.containsBeanDefinition("teacher")); + SpringApplication.run(EmployeeApplication.class, args); } } diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/Employee.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/Employee.java index bdc0b3f2d9..9be3388046 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/Employee.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/Employee.java @@ -4,4 +4,9 @@ import org.springframework.stereotype.Component; @Component("employee") public class Employee { + + @Override + public String toString() { + return "Employee" + this.hashCode(); + } } diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java index ef75b4af0a..242e84f887 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/employee/SeniorEmployee.java @@ -4,4 +4,9 @@ import org.springframework.stereotype.Component; @Component public class SeniorEmployee { + + @Override + public String toString() { + return "Senior Employee" + this.hashCode(); + } } diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/student/Student.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/student/Student.java index 820d0bea10..56f2ac9830 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/student/Student.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/student/Student.java @@ -4,4 +4,9 @@ import org.springframework.stereotype.Component; @Component("student") public class Student { + + @Override + public String toString() { + return "Student" + this.hashCode(); + } } diff --git a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/teacher/Teacher.java b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/teacher/Teacher.java index 699b8ccfb4..e2c653204d 100644 --- a/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/teacher/Teacher.java +++ b/spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/componentscanautoconfigure/teacher/Teacher.java @@ -4,4 +4,9 @@ import org.springframework.stereotype.Component; @Component("teacher") public class Teacher { + + @Override + public String toString() { + return "Teacher" + this.hashCode(); + } } From cfa4438c78f0b1a02321955d1b2e8448537a06f6 Mon Sep 17 00:00:00 2001 From: catull Date: Wed, 7 Oct 2020 10:21:11 +0200 Subject: [PATCH 092/302] Eliminate duplicate dependency spring-boot-starter-web --- persistence-modules/spring-data-jpa-crud/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/persistence-modules/spring-data-jpa-crud/pom.xml b/persistence-modules/spring-data-jpa-crud/pom.xml index 44944298e0..7af5b38a38 100644 --- a/persistence-modules/spring-data-jpa-crud/pom.xml +++ b/persistence-modules/spring-data-jpa-crud/pom.xml @@ -16,10 +16,6 @@ - - org.springframework.boot - spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa From a1229f66e4096650853326c9ac1ee0bd73fe1e68 Mon Sep 17 00:00:00 2001 From: Nikolaos Themelis <29039541+tjrbrom@users.noreply.github.com> Date: Wed, 7 Oct 2020 11:41:31 +0300 Subject: [PATCH 093/302] Pass unused "millis" argument to lock.tryLock method, line 76. --- .../java/com/baeldung/deadlockAndLivelock/LivelockExample.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-java-modules/core-java-concurrency-advanced-3/src/main/java/com/baeldung/deadlockAndLivelock/LivelockExample.java b/core-java-modules/core-java-concurrency-advanced-3/src/main/java/com/baeldung/deadlockAndLivelock/LivelockExample.java index b0d66a92c2..7c3ea6f94e 100644 --- a/core-java-modules/core-java-concurrency-advanced-3/src/main/java/com/baeldung/deadlockAndLivelock/LivelockExample.java +++ b/core-java-modules/core-java-concurrency-advanced-3/src/main/java/com/baeldung/deadlockAndLivelock/LivelockExample.java @@ -73,7 +73,7 @@ public class LivelockExample { public void tryLock(Lock lock, long millis) { try { - lock.tryLock(10, TimeUnit.MILLISECONDS); + lock.tryLock(millis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { e.printStackTrace(); } From d970484275700d9ffc9d83e30ad80d4e09b598be Mon Sep 17 00:00:00 2001 From: Krzysztof Woyke Date: Wed, 7 Oct 2020 10:47:15 +0200 Subject: [PATCH 094/302] BAEL-4657: Add BasicAuthRequestInterceptor example --- .../cloud/openfeign/config/ClientConfiguration.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-cloud/spring-cloud-openfeign/src/main/java/com/baeldung/cloud/openfeign/config/ClientConfiguration.java b/spring-cloud/spring-cloud-openfeign/src/main/java/com/baeldung/cloud/openfeign/config/ClientConfiguration.java index 0b16134e92..55c27dde2f 100644 --- a/spring-cloud/spring-cloud-openfeign/src/main/java/com/baeldung/cloud/openfeign/config/ClientConfiguration.java +++ b/spring-cloud/spring-cloud-openfeign/src/main/java/com/baeldung/cloud/openfeign/config/ClientConfiguration.java @@ -2,6 +2,7 @@ package com.baeldung.cloud.openfeign.config; import feign.Logger; import feign.RequestInterceptor; +import feign.auth.BasicAuthRequestInterceptor; import feign.codec.ErrorDecoder; import feign.okhttp.OkHttpClient; import org.apache.http.entity.ContentType; @@ -34,4 +35,9 @@ public class ClientConfiguration { requestTemplate.header("Accept", ContentType.APPLICATION_JSON.getMimeType()); }; } + + // @Bean - uncomment to use this interceptor and remove @Bean from the requestInterceptor() + public BasicAuthRequestInterceptor basicAuthRequestInterceptor() { + return new BasicAuthRequestInterceptor("ajeje", "brazof"); + } } From 4947f541ea5cc77650a61163b7b5499ca844ca24 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:15:44 +0800 Subject: [PATCH 095/302] Update README.md --- libraries-6/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries-6/README.md b/libraries-6/README.md index 3748522b9d..5be600f50e 100644 --- a/libraries-6/README.md +++ b/libraries-6/README.md @@ -16,4 +16,5 @@ Remember, for advanced libraries like [Jackson](/jackson) and [JUnit](/testing-m - [Exactly Once Processing in Kafka](https://www.baeldung.com/kafka-exactly-once) - [Introduction to Protonpack](https://www.baeldung.com/java-protonpack) - [Java-R Integration](https://www.baeldung.com/java-r-integration) +- [Using libphonenumber to Validate Phone Numbers](https://www.baeldung.com/java-libphonenumber) - More articles [[<-- prev]](/libraries-5) From b1cdcff9c17e1fb4bcd43e09b8afc899ace4851a Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:17:12 +0800 Subject: [PATCH 096/302] Update README.md --- java-native/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/java-native/README.md b/java-native/README.md index 6b984e6590..2e2047924b 100644 --- a/java-native/README.md +++ b/java-native/README.md @@ -5,3 +5,4 @@ This module contains articles about the Java Native Interface (JNI). ### Relevant Articles: - [Guide to JNI (Java Native Interface)](https://www.baeldung.com/jni) +- [Using JNA to Access Native Dynamic Libraries](https://www.baeldung.com/java-jna-dynamic-libraries) From 9d8d8a6587c1fc8efbf9d16ac9b8f0b87f136f7e Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:18:48 +0800 Subject: [PATCH 097/302] Update README.md --- core-java-modules/core-java-reflection-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-reflection-2/README.md b/core-java-modules/core-java-reflection-2/README.md index 1668eeade3..9ed14f08dc 100644 --- a/core-java-modules/core-java-reflection-2/README.md +++ b/core-java-modules/core-java-reflection-2/README.md @@ -3,3 +3,4 @@ - [Reading the Value of ‘private’ Fields from a Different Class in Java](https://www.baeldung.com/java-reflection-read-private-field-value) - [Set Field Value With Reflection](https://www.baeldung.com/java-set-private-field-value) - [Checking If a Method is Static Using Reflection in Java](https://www.baeldung.com/java-check-method-is-static) +- [Checking if a Java Class is ‘abstract’ Using Reflection](https://www.baeldung.com/java-reflection-is-class-abstract) From 3ebd90bfd762b5d6cbf70aa1e3236047c7f576f0 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:21:34 +0800 Subject: [PATCH 098/302] Update README.md --- spring-cloud/spring-cloud-openfeign/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud/spring-cloud-openfeign/README.md b/spring-cloud/spring-cloud-openfeign/README.md index e5777732e4..735903db72 100644 --- a/spring-cloud/spring-cloud-openfeign/README.md +++ b/spring-cloud/spring-cloud-openfeign/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: - [Introduction to Spring Cloud OpenFeign](https://www.baeldung.com/spring-cloud-openfeign) - +- [Differences Between Netflix Feign and OpenFeign](https://www.baeldung.com/netflix-feign-vs-openfeign) From 962063264a958a1878f9d2689a0f99bb87c0ae79 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:22:49 +0800 Subject: [PATCH 099/302] Create README.md --- spring-cloud/spring-cloud-netflix-feign/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 spring-cloud/spring-cloud-netflix-feign/README.md diff --git a/spring-cloud/spring-cloud-netflix-feign/README.md b/spring-cloud/spring-cloud-netflix-feign/README.md new file mode 100644 index 0000000000..28dfc88a43 --- /dev/null +++ b/spring-cloud/spring-cloud-netflix-feign/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [https://www.baeldung.com/netflix-feign-vs-openfeign](https://www.baeldung.com/netflix-feign-vs-openfeign) From c1238eec639af814f79297b45b86a1ba86b15204 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:23:20 +0800 Subject: [PATCH 100/302] Update README.md --- spring-cloud/spring-cloud-netflix-feign/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud/spring-cloud-netflix-feign/README.md b/spring-cloud/spring-cloud-netflix-feign/README.md index 28dfc88a43..2e96a0045d 100644 --- a/spring-cloud/spring-cloud-netflix-feign/README.md +++ b/spring-cloud/spring-cloud-netflix-feign/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [https://www.baeldung.com/netflix-feign-vs-openfeign](https://www.baeldung.com/netflix-feign-vs-openfeign) +- [Differences Between Netflix Feign and OpenFeign](https://www.baeldung.com/netflix-feign-vs-openfeign) From b24db3ed9986b220d08d82354b481b25a472b358 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:27:34 +0800 Subject: [PATCH 101/302] Update README.md --- spring-boot-modules/spring-boot-libraries-2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-libraries-2/README.md b/spring-boot-modules/spring-boot-libraries-2/README.md index b0840798e3..4218dfc1be 100644 --- a/spring-boot-modules/spring-boot-libraries-2/README.md +++ b/spring-boot-modules/spring-boot-libraries-2/README.md @@ -4,4 +4,4 @@ This module contains articles about various Spring Boot libraries ### Relevant Articles: -- Running background jobs in Spring with JobRunr +- [Background Jobs in Spring with JobRunr](https://www.baeldung.com/java-jobrunr-spring) From ac480ad0cc18a6c07c7c943806189f42c8758439 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:29:57 +0800 Subject: [PATCH 102/302] Update README.md --- core-java-modules/core-java-concurrency-basic-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-concurrency-basic-2/README.md b/core-java-modules/core-java-concurrency-basic-2/README.md index a8daf14ea9..bf973f7036 100644 --- a/core-java-modules/core-java-concurrency-basic-2/README.md +++ b/core-java-modules/core-java-concurrency-basic-2/README.md @@ -11,4 +11,5 @@ This module contains articles about basic Java concurrency - [Life Cycle of a Thread in Java](https://www.baeldung.com/java-thread-lifecycle) - [Guide to AtomicMarkableReference](https://www.baeldung.com/java-atomicmarkablereference) - [Why are Local Variables Thread-Safe in Java](https://www.baeldung.com/java-local-variables-thread-safe) +- [How to Stop Execution After a Certain Time in Java](https://www.baeldung.com/java-stop-execution-after-certain-time) - [[<-- Prev]](/core-java-modules/core-java-concurrency-basic) From 539324181f8be0bd88324b347a0eb12cf0f45207 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:32:44 +0800 Subject: [PATCH 103/302] Update README.md --- persistence-modules/spring-boot-persistence-h2/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/persistence-modules/spring-boot-persistence-h2/README.md b/persistence-modules/spring-boot-persistence-h2/README.md index d11ec1f409..1d47907a98 100644 --- a/persistence-modules/spring-boot-persistence-h2/README.md +++ b/persistence-modules/spring-boot-persistence-h2/README.md @@ -1,5 +1,7 @@ ### Relevant Articles: + - [Access the Same In-Memory H2 Database in Multiple Spring Boot Applications](https://www.baeldung.com/spring-boot-access-h2-database-multiple-apps) - [Spring Boot With H2 Database](https://www.baeldung.com/spring-boot-h2-database) - [Hibernate @NotNull vs @Column(nullable = false)](https://www.baeldung.com/hibernate-notnull-vs-nullable) - [Quick Guide to Hibernate enable_lazy_load_no_trans Property](https://www.baeldung.com/hibernate-lazy-loading-workaround) +- [Where Does H2’s Embedded Database Store The Data?](https://www.baeldung.com/h2-embedded-db-data-storage) From b69c36f2d6577a939046b2c60bec3cf204888d55 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:41:09 +0800 Subject: [PATCH 104/302] Update README.md --- core-kotlin-modules/core-kotlin/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-kotlin-modules/core-kotlin/README.md b/core-kotlin-modules/core-kotlin/README.md index 33f8745937..a890658e95 100644 --- a/core-kotlin-modules/core-kotlin/README.md +++ b/core-kotlin-modules/core-kotlin/README.md @@ -12,3 +12,4 @@ This module contains articles about Kotlin core features. - [Sequences in Kotlin](https://www.baeldung.com/kotlin/sequences) - [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) - [Exception Handling in Kotlin](https://www.baeldung.com/kotlin/exception-handling) +- [Quick Guide to Kotlin Default and Named Arguments](https://www.baeldung.com/kotlin/default-named-arguments) From 9ee0ab2af0b68a2341962c5e8d9dce0e91ea2d26 Mon Sep 17 00:00:00 2001 From: Jordan Simpson Date: Wed, 7 Oct 2020 23:13:14 -0500 Subject: [PATCH 105/302] Fixed test code after merge from master. --- persistence-modules/spring-persistence-simple/pom.xml | 6 ++++++ .../baeldung/transactional/TransactionalDetectionTest.java | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/persistence-modules/spring-persistence-simple/pom.xml b/persistence-modules/spring-persistence-simple/pom.xml index a069f70994..13898d01e7 100644 --- a/persistence-modules/spring-persistence-simple/pom.xml +++ b/persistence-modules/spring-persistence-simple/pom.xml @@ -72,6 +72,12 @@ ${org.springframework.version} test + + org.springframework.boot + spring-boot-starter-test + test + ${spring-boot-starter.version} + org.mockito mockito-core diff --git a/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java b/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java index 304704a0a6..d82aed86b8 100644 --- a/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java +++ b/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java @@ -1,9 +1,8 @@ package com.baeldung.transactional; -import com.baeldung.persistence.service.transactional.PersistenceTransactionalTestConfig; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.TransactionSynchronizationManager; @@ -11,7 +10,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -@ContextConfiguration(classes = PersistenceTransactionalTestConfig.class) +@SpringBootApplication @RunWith(SpringJUnit4ClassRunner.class) public class TransactionalDetectionTest { From e126cc2287831e32fd9d3681b42bb1f8259b2682 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:12:45 +0800 Subject: [PATCH 106/302] Update README.md --- persistence-modules/spring-jpa-2/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/persistence-modules/spring-jpa-2/README.md b/persistence-modules/spring-jpa-2/README.md index fe661c2f28..59543cade7 100644 --- a/persistence-modules/spring-jpa-2/README.md +++ b/persistence-modules/spring-jpa-2/README.md @@ -3,8 +3,7 @@ ### Relevant Articles: - [Many-To-Many Relationship in JPA](https://www.baeldung.com/jpa-many-to-many) - [A Guide to JPA with Spring](https://www.baeldung.com/the-persistence-layer-with-spring-and-jpa) -- [Bootstrapping Hibernate 5 with Spring](https://www.baeldung.com/hibernate-5-spring) - [Transactions with Spring and JPA](https://www.baeldung.com/transaction-configuration-with-jpa-and-spring) - [The DAO with Spring and Hibernate](https://www.baeldung.com/persistence-layer-with-spring-and-hibernate) - [Simplify the DAO with Spring and Java Generics](https://www.baeldung.com/simplifying-the-data-access-layer-with-spring-and-java-generics) -- More articles: [[<-- prev]](/spring-jpa) \ No newline at end of file +- More articles: [[<-- prev]](/spring-jpa) From d4ccef2d443fd8c11cbbd899f62754217883eaa4 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:14:07 +0800 Subject: [PATCH 107/302] Update README.md --- persistence-modules/spring-hibernate-5/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-hibernate-5/README.md b/persistence-modules/spring-hibernate-5/README.md index cb227592f6..eff59a0362 100644 --- a/persistence-modules/spring-hibernate-5/README.md +++ b/persistence-modules/spring-hibernate-5/README.md @@ -13,3 +13,4 @@ This module contains articles about Hibernate 5 with Spring. - [Deleting Objects with Hibernate](http://www.baeldung.com/delete-with-hibernate) - [Spring, Hibernate and a JNDI Datasource](http://www.baeldung.com/spring-persistence-jpa-jndi-datasource) - [@Immutable in Hibernate](http://www.baeldung.com/hibernate-immutable) +- [Bootstrapping Hibernate 5 with Spring](https://www.baeldung.com/hibernate-5-spring) From b67de9d7a24d88d6f2e16d6f46e1ec1187a51a76 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:27:59 +0800 Subject: [PATCH 108/302] Update README.md --- spring-security-modules/spring-security-web-login/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-security-modules/spring-security-web-login/README.md b/spring-security-modules/spring-security-web-login/README.md index 5d92a8e1b4..9521a430c2 100644 --- a/spring-security-modules/spring-security-web-login/README.md +++ b/spring-security-modules/spring-security-web-login/README.md @@ -8,7 +8,6 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com ### Relevant Articles: - [Spring Security Form Login](https://www.baeldung.com/spring-security-login) - [Spring Security Logout](https://www.baeldung.com/spring-security-logout) -- [Spring Security Expressions – hasRole Example](https://www.baeldung.com/spring-security-expressions-basic) - [Spring HTTP/HTTPS Channel Security](https://www.baeldung.com/spring-channel-security-https) - [Spring Security – Customize the 403 Forbidden/Access Denied Page](https://www.baeldung.com/spring-security-custom-access-denied-page) - [Spring Security – Redirect to the Previous URL After Login](https://www.baeldung.com/spring-security-redirect-login) From 5774d7526656cb9fe26496576e97ca0e77437b0b Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:38:49 +0800 Subject: [PATCH 109/302] Update README.md --- spring-security-modules/spring-security-web-rest/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-security-modules/spring-security-web-rest/README.md b/spring-security-modules/spring-security-web-rest/README.md index c13668798d..fd1f86f6b8 100644 --- a/spring-security-modules/spring-security-web-rest/README.md +++ b/spring-security-modules/spring-security-web-rest/README.md @@ -14,5 +14,4 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com - [Spring Security Context Propagation with @Async](https://www.baeldung.com/spring-security-async-principal-propagation) - [Servlet 3 Async Support with Spring MVC and Spring Security](https://www.baeldung.com/spring-mvc-async-security) - [Intro to Spring Security Expressions](https://www.baeldung.com/spring-security-expressions) -- [Spring Security Expressions - hasRole Example](https://www.baeldung.com/spring-security-expressions-basic) - [Error Handling for REST with Spring](https://www.baeldung.com/exception-handling-for-rest-with-spring) From 8b3b51c8c12bc23ba35c0f00be2bc90a2fb777bb Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:56:50 +0800 Subject: [PATCH 110/302] Update README.md --- persistence-modules/spring-persistence-simple/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persistence-modules/spring-persistence-simple/README.md b/persistence-modules/spring-persistence-simple/README.md index baa9107f4e..8bef16868d 100644 --- a/persistence-modules/spring-persistence-simple/README.md +++ b/persistence-modules/spring-persistence-simple/README.md @@ -6,7 +6,7 @@ ### Relevant Articles: - [Transaction Propagation and Isolation in Spring @Transactional](https://www.baeldung.com/spring-transactional-propagation-isolation) - [JTA Transaction with Spring](https://www.baeldung.com/spring-vs-jta-transactional) -- [Mock JNDI Datasource](https://www.baeldung.com/spring-mock-jndi-datasource) +- [Test a Mock JNDI Datasource with Spring](https://www.baeldung.com/spring-mock-jndi-datasource) ### Eclipse Config After importing the project into Eclipse, you may see the following error: From dc2fb66c6e2c2ca0db46546e34892b7e0d814c45 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 8 Oct 2020 18:23:11 +0800 Subject: [PATCH 111/302] Create README.md --- docker/docker-spring-boot/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docker/docker-spring-boot/README.md diff --git a/docker/docker-spring-boot/README.md b/docker/docker-spring-boot/README.md new file mode 100644 index 0000000000..4af9378290 --- /dev/null +++ b/docker/docker-spring-boot/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Creating Docker Images with Spring Boot](https://www.baeldung.com/spring-boot-docker-images) From 9f5144ce3329091170e632f5007065b1aed75c7f Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 8 Oct 2020 18:23:49 +0800 Subject: [PATCH 112/302] Update README.md --- docker/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 8e5cc2b621..7948b3d663 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,4 +1,3 @@ ## Relevant Articles: - [Introduction to Docker Compose](https://www.baeldung.com/docker-compose) -- [Creating Docker Images with Spring Boot](https://www.baeldung.com/spring-boot-docker-images) From 7afe0a51ca08a4b4809c4dd53c1cd34a1dba306e Mon Sep 17 00:00:00 2001 From: Jordan Simpson Date: Thu, 8 Oct 2020 08:42:56 -0500 Subject: [PATCH 113/302] Added "Unit" to the class name to satisfy the pmd.xml violation. --- ...alDetectionTest.java => TransactionalDetectionUnitTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/{TransactionalDetectionTest.java => TransactionalDetectionUnitTest.java} (95%) diff --git a/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java b/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionUnitTest.java similarity index 95% rename from persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java rename to persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionUnitTest.java index d82aed86b8..db4dbd630a 100644 --- a/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionTest.java +++ b/persistence-modules/spring-persistence-simple/src/test/java/com/baeldung/transactional/TransactionalDetectionUnitTest.java @@ -12,7 +12,7 @@ import static org.junit.Assert.assertTrue; @SpringBootApplication @RunWith(SpringJUnit4ClassRunner.class) -public class TransactionalDetectionTest { +public class TransactionalDetectionUnitTest { @Test @Transactional From 53609d6594c8c6888b64572ac2c1c40c3b379bc6 Mon Sep 17 00:00:00 2001 From: mdabrowski-eu <57441874+mdabrowski-eu@users.noreply.github.com> Date: Fri, 9 Oct 2020 06:59:51 +0200 Subject: [PATCH 114/302] BAEL-4565 Object States in Hibernate's Session (#10107) --- .../java/com/baeldung/states/Application.java | 12 ++ .../java/com/baeldung/states/UserEntity.java | 27 ++++ .../states/UserEntityWithCascade.java | 28 ++++ .../states/UserEntityIntegrationTest.java | 136 ++++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/Application.java create mode 100644 persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/UserEntity.java create mode 100644 persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/UserEntityWithCascade.java create mode 100644 persistence-modules/spring-boot-persistence-2/src/test/java/com/baeldung/states/UserEntityIntegrationTest.java diff --git a/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/Application.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/Application.java new file mode 100644 index 0000000000..38118354e0 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/Application.java @@ -0,0 +1,12 @@ +package com.baeldung.states; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/UserEntity.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/UserEntity.java new file mode 100644 index 0000000000..90bd275240 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/UserEntity.java @@ -0,0 +1,27 @@ +package com.baeldung.states; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.ManyToOne; + +@Entity +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter +public class UserEntity { + @Id + private String name; + + @ManyToOne + private UserEntity manager; + + public UserEntity(String name) { + this.name = name; + } +} diff --git a/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/UserEntityWithCascade.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/UserEntityWithCascade.java new file mode 100644 index 0000000000..de0d62bfe2 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/states/UserEntityWithCascade.java @@ -0,0 +1,28 @@ +package com.baeldung.states; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.ManyToOne; + +@Entity +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter +public class UserEntityWithCascade { + @Id + private String name; + + @ManyToOne(cascade = CascadeType.PERSIST) + private UserEntityWithCascade manager; + + public UserEntityWithCascade(String name) { + this.name = name; + } +} diff --git a/persistence-modules/spring-boot-persistence-2/src/test/java/com/baeldung/states/UserEntityIntegrationTest.java b/persistence-modules/spring-boot-persistence-2/src/test/java/com/baeldung/states/UserEntityIntegrationTest.java new file mode 100644 index 0000000000..5d0dc99ad7 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-2/src/test/java/com/baeldung/states/UserEntityIntegrationTest.java @@ -0,0 +1,136 @@ +package com.baeldung.states; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.Transaction; +import org.junit.jupiter.api.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.persistence.EntityManagerFactory; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +@RunWith(SpringRunner.class) +@SpringBootTest +class UserEntityIntegrationTest { + @Autowired + private EntityManagerFactory entityManagerFactory; + + @Test + void givenName_thenShouldCreateDetachedUserEntity() { + // given + Session session = openSession(); + UserEntity userEntity = new UserEntity("John"); + + // then + assertThat(session.contains(userEntity)).isFalse(); + session.close(); + } + + @Test + void givenName_whenPersisted_thenShouldCreatePersistentUserEntity() { + // given + Session session = openSession(); + UserEntity userEntity = new UserEntity("John"); + + // when + session.persist(userEntity); + + // then + assertThat(session.contains(userEntity)).isTrue(); + session.close(); + } + + @Test + void givenPersistentEntity_whenSessionClosed_thenShouldDetachEntity() { + // given + Session session = openSession(); + UserEntity userEntity = new UserEntity("John"); + session.persist(userEntity); + assertThat(session.contains(userEntity)).isTrue(); + + // when + session.close(); + + // then + assertThat(session.isOpen()).isFalse(); + assertThatThrownBy(() -> session.contains(userEntity)); + } + + @Test + void givenPersistentEntity_whenAddedTransientManager_thenShouldThrowException() { + // given + Session session = openSession(); + Transaction transaction = session.beginTransaction(); + UserEntity userEntity = new UserEntity("John"); + session.persist(userEntity); + UserEntity manager = new UserEntity("Adam"); + + // when + userEntity.setManager(manager); + + + // then + assertThatThrownBy(() -> { + session.saveOrUpdate(userEntity); + transaction.commit(); + }); + session.close(); + } + + @Test + void givenPersistentEntity_whenAddedPersistentManager_thenShouldSave() { + // given + Session session = openSession(); + Transaction transaction = session.beginTransaction(); + UserEntity userEntity = new UserEntity("John"); + session.persist(userEntity); + UserEntity manager = new UserEntity("Adam"); + session.persist(manager); + + // when + userEntity.setManager(manager); + + + // then + session.saveOrUpdate(userEntity); + transaction.commit(); + session.close(); + + Session otherSession = openSession(); + UserEntity savedUser = otherSession.get(UserEntity.class, "John"); + assertThat(savedUser.getManager().getName()).isEqualTo("Adam"); + } + + @Test + void givenPersistentEntityWithCascade_whenAddedTransientManager_thenShouldSave() { + // given + Session session = openSession(); + Transaction transaction = session.beginTransaction(); + UserEntityWithCascade userEntity = new UserEntityWithCascade("John"); + session.persist(userEntity); + UserEntityWithCascade manager = new UserEntityWithCascade("Adam"); + + // when + userEntity.setManager(manager); + + + // then + session.saveOrUpdate(userEntity); + transaction.commit(); + session.close(); + + Session otherSession = openSession(); + UserEntityWithCascade savedUser = otherSession.get(UserEntityWithCascade.class, "John"); + assertThat(savedUser.getManager().getName()).isEqualTo("Adam"); + } + + + private Session openSession() { + return entityManagerFactory.unwrap(SessionFactory.class).openSession(); + } +} \ No newline at end of file From da6fb652fbf0c732dd7a0a4d34736a15d06aa343 Mon Sep 17 00:00:00 2001 From: sharifi Date: Fri, 9 Oct 2020 11:36:07 +0330 Subject: [PATCH 115/302] remove gitignore file --- .../.gitignore | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 spring-boot-modules/spring-boot-basic-customization-2/.gitignore diff --git a/spring-boot-modules/spring-boot-basic-customization-2/.gitignore b/spring-boot-modules/spring-boot-basic-customization-2/.gitignore deleted file mode 100644 index 2af7cefb0a..0000000000 --- a/spring-boot-modules/spring-boot-basic-customization-2/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -target/ -!.mvn/wrapper/maven-wrapper.jar - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -nbproject/private/ -build/ -nbbuild/ -dist/ -nbdist/ -.nb-gradle/ \ No newline at end of file From 5cb3bc85bea94ab6414df0e218ec0c7898f27d55 Mon Sep 17 00:00:00 2001 From: sharifi Date: Fri, 9 Oct 2020 11:48:10 +0330 Subject: [PATCH 116/302] change package name and main class's name --- .../DispatchServletApplication.java} | 6 +++--- .../conf/WebConf.java | 6 +++--- .../controller/Controller.java | 2 +- .../filter/CustomFilter.java | 2 +- .../listener/CustomListener.java | 2 +- .../servlet/CustomServlet.java | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) rename spring-boot-modules/spring-boot-basic-customization-2/src/main/java/{com.baeldung.demo/DemoApplication.java => com.baeldung.dispatchservlet/DispatchServletApplication.java} (68%) rename spring-boot-modules/spring-boot-basic-customization-2/src/main/java/{com.baeldung.demo => com.baeldung.dispatchservlet}/conf/WebConf.java (83%) rename spring-boot-modules/spring-boot-basic-customization-2/src/main/java/{com.baeldung.demo => com.baeldung.dispatchservlet}/controller/Controller.java (88%) rename spring-boot-modules/spring-boot-basic-customization-2/src/main/java/{com.baeldung.demo => com.baeldung.dispatchservlet}/filter/CustomFilter.java (93%) rename spring-boot-modules/spring-boot-basic-customization-2/src/main/java/{com.baeldung.demo => com.baeldung.dispatchservlet}/listener/CustomListener.java (92%) rename spring-boot-modules/spring-boot-basic-customization-2/src/main/java/{com.baeldung.demo => com.baeldung.dispatchservlet}/servlet/CustomServlet.java (89%) diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/DemoApplication.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/DispatchServletApplication.java similarity index 68% rename from spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/DemoApplication.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/DispatchServletApplication.java index 9e8148f043..4d58715d88 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/DemoApplication.java +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/DispatchServletApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.demo; +package com.baeldung.dispatchservlet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -6,10 +6,10 @@ import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.context.annotation.Configuration; @SpringBootApplication -public class DemoApplication { +public class DispatchServletApplication { public static void main(String[] args) { - SpringApplication.run(DemoApplication.class, args); + SpringApplication.run(DispatchServletApplication.class, args); } } diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/conf/WebConf.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/conf/WebConf.java similarity index 83% rename from spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/conf/WebConf.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/conf/WebConf.java index 02fcf152f1..9a1170ca34 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/conf/WebConf.java +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/conf/WebConf.java @@ -1,7 +1,7 @@ -package com.baeldung.demo.conf; +package com.baeldung.dispatchservlet.conf; -import com.baeldung.demo.listener.CustomListener; -import com.baeldung.demo.servlet.CustomServlet; +import com.baeldung.dispatchservlet.listener.CustomListener; +import com.baeldung.dispatchservlet.servlet.CustomServlet; import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/controller/Controller.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/controller/Controller.java similarity index 88% rename from spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/controller/Controller.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/controller/Controller.java index a6d1812511..14d71c60fb 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/controller/Controller.java +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/controller/Controller.java @@ -1,4 +1,4 @@ -package com.baeldung.demo.controller; +package com.baeldung.dispatchservlet.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/filter/CustomFilter.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/filter/CustomFilter.java similarity index 93% rename from spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/filter/CustomFilter.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/filter/CustomFilter.java index c661aecf6d..8429fc855f 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/filter/CustomFilter.java +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/filter/CustomFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.demo.filter; +package com.baeldung.dispatchservlet.filter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/listener/CustomListener.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/listener/CustomListener.java similarity index 92% rename from spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/listener/CustomListener.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/listener/CustomListener.java index a9e3ad680f..62b316c012 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/listener/CustomListener.java +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/listener/CustomListener.java @@ -1,4 +1,4 @@ -package com.baeldung.demo.listener; +package com.baeldung.dispatchservlet.listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/servlet/CustomServlet.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/servlet/CustomServlet.java similarity index 89% rename from spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/servlet/CustomServlet.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/servlet/CustomServlet.java index fd3e92bedc..2a99e797ce 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.demo/servlet/CustomServlet.java +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/servlet/CustomServlet.java @@ -1,6 +1,6 @@ -package com.baeldung.demo.servlet; +package com.baeldung.dispatchservlet.servlet; -import com.baeldung.demo.filter.CustomFilter; +import com.baeldung.dispatchservlet.filter.CustomFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; From 271ad4e3c7224b1ea65fe66146767622598832fe Mon Sep 17 00:00:00 2001 From: sharifi Date: Fri, 9 Oct 2020 11:48:57 +0330 Subject: [PATCH 117/302] remove context-path and path --- .../src/main/resources/application.properties | 2 -- 1 file changed, 2 deletions(-) diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties index 8c4690dedc..e69de29bb2 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties @@ -1,2 +0,0 @@ -server.servlet.context-path=/demo -spring.mvc.servlet.path=/baeldung \ No newline at end of file From 4260a798d11a749c2f987ef2ebc318d863b68c2d Mon Sep 17 00:00:00 2001 From: Simone Cusimano Date: Fri, 9 Oct 2020 12:41:53 +0200 Subject: [PATCH 118/302] Update dependencies --- .../gradle-dependency-management/build.gradle | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/gradle/gradle-dependency-management/build.gradle b/gradle/gradle-dependency-management/build.gradle index db908b6457..88ed84f4b1 100644 --- a/gradle/gradle-dependency-management/build.gradle +++ b/gradle/gradle-dependency-management/build.gradle @@ -1,44 +1,30 @@ plugins { - id 'org.springframework.boot' version '2.3.4.RELEASE' - id 'io.spring.dependency-management' version '1.0.10.RELEASE' id 'java' + id 'org.springframework.boot' version '2.3.4.RELEASE' } group = 'com.gradle' version = '1.0.0' sourceCompatibility = '14' -configurations { - compileOnly { - extendsFrom annotationProcessor - } -} - repositories { mavenCentral() } -ext { - set('testcontainersVersion', "1.14.3") -} - dependencies { - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-webflux' - developmentOnly 'org.springframework.boot:spring-boot-devtools' - annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' - testImplementation('org.springframework.boot:spring-boot-starter-test') { - exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' - } - testImplementation 'io.projectreactor:reactor-test' - testImplementation 'org.springframework.security:spring-security-test' - testImplementation 'org.testcontainers:junit-jupiter' -} + implementation 'org.springframework.boot:spring-boot-starter:2.3.4.RELEASE' -dependencyManagement { - imports { - mavenBom "org.testcontainers:testcontainers-bom:${testcontainersVersion}" - } + testImplementation 'org.springframework.boot:spring-boot-starter-test:2.3.4.RELEASE' + + compileOnly 'org.projectlombok:lombok:1.18.14' + + testCompileOnly 'org.projectlombok:lombok:1.18.14' + + runtimeOnly files('libs/sampleOne.jar', 'libs/sampleTwo.jar') + + runtimeOnly fileTree('libs') { include '*.jar' } + +// implementation gradleApi() } test { From 565d4f32c2b8e8b9b24308f49b774b7b48aac5cc Mon Sep 17 00:00:00 2001 From: Benjamin Caure Date: Fri, 9 Oct 2020 12:53:19 +0200 Subject: [PATCH 119/302] BAEL-4328 --- .../RestTemplateConfigurationApplication.java | 1 - .../RestTemplateConfigurationApplication.java | 14 ---------- .../logging/LoggingInterceptor.java | 14 +++++----- .../logging/RestTemplateLoggingLiveTest.java | 26 ++++++++++++++----- .../src/test/resources/application.properties | 2 +- 5 files changed, 29 insertions(+), 28 deletions(-) delete mode 100644 spring-resttemplate-2/src/main/java/com/baeldung/resttemplate/logging/RestTemplateConfigurationApplication.java diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java b/spring-resttemplate-2/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java index 8df3c13d7b..a7e65fc96c 100644 --- a/spring-resttemplate-2/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java +++ b/spring-resttemplate-2/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java @@ -1,7 +1,6 @@ package com.baeldung.resttemplate; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/resttemplate/logging/RestTemplateConfigurationApplication.java b/spring-resttemplate-2/src/main/java/com/baeldung/resttemplate/logging/RestTemplateConfigurationApplication.java deleted file mode 100644 index 4fa14edda1..0000000000 --- a/spring-resttemplate-2/src/main/java/com/baeldung/resttemplate/logging/RestTemplateConfigurationApplication.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.resttemplate.logging; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -@EnableAutoConfiguration -public class RestTemplateConfigurationApplication { - - public static void main(String[] args) { - SpringApplication.run(RestTemplateConfigurationApplication.class, args); - } -} diff --git a/spring-resttemplate-2/src/test/java/com/baeldung/resttemplate/logging/LoggingInterceptor.java b/spring-resttemplate-2/src/test/java/com/baeldung/resttemplate/logging/LoggingInterceptor.java index 17ce390d8a..c699d9d9dc 100644 --- a/spring-resttemplate-2/src/test/java/com/baeldung/resttemplate/logging/LoggingInterceptor.java +++ b/spring-resttemplate-2/src/test/java/com/baeldung/resttemplate/logging/LoggingInterceptor.java @@ -14,16 +14,18 @@ import org.springframework.http.client.ClientHttpResponse; public class LoggingInterceptor implements ClientHttpRequestInterceptor { - final static Logger log = LoggerFactory.getLogger(LoggingInterceptor.class); + final static Logger LOGGER = LoggerFactory.getLogger(LoggingInterceptor.class); @Override public ClientHttpResponse intercept(HttpRequest req, byte[] reqBody, ClientHttpRequestExecution ex) throws IOException { - log.debug("Request body: {}", new String(reqBody, StandardCharsets.UTF_8)); + LOGGER.debug("Request body: {}", new String(reqBody, StandardCharsets.UTF_8)); ClientHttpResponse response = ex.execute(req, reqBody); - InputStreamReader isr = new InputStreamReader(response.getBody(), StandardCharsets.UTF_8); - String body = new BufferedReader(isr).lines() - .collect(Collectors.joining("\n")); - log.debug("Response body: {}", body); + if (LOGGER.isDebugEnabled()) { + InputStreamReader isr = new InputStreamReader(response.getBody(), StandardCharsets.UTF_8); + String body = new BufferedReader(isr).lines() + .collect(Collectors.joining("\n")); + LOGGER.debug("Response body: {}", body); + } return response; } } diff --git a/spring-resttemplate-2/src/test/java/com/baeldung/resttemplate/logging/RestTemplateLoggingLiveTest.java b/spring-resttemplate-2/src/test/java/com/baeldung/resttemplate/logging/RestTemplateLoggingLiveTest.java index 99d0201eff..86ffa574a0 100644 --- a/spring-resttemplate-2/src/test/java/com/baeldung/resttemplate/logging/RestTemplateLoggingLiveTest.java +++ b/spring-resttemplate-2/src/test/java/com/baeldung/resttemplate/logging/RestTemplateLoggingLiveTest.java @@ -1,18 +1,21 @@ package com.baeldung.resttemplate.logging; -import static org.hamcrest.CoreMatchers.equalTo; - -import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.http.client.SimpleClientHttpRequestFactory; +import org.springframework.http.client.BufferingClientHttpRequestFactory; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.CollectionUtils; import org.springframework.web.client.RestTemplate; @@ -22,6 +25,7 @@ import org.springframework.web.client.RestTemplate; public class RestTemplateLoggingLiveTest { private static final String baseUrl = "http://localhost:8080/spring-rest"; + private static final Logger LOGGER = LoggerFactory.getLogger(RestTemplateLoggingLiveTest.class); @Test public void givenHttpClientConfiguration_whenSendGetForRequestEntity_thenRequestResponseFullLog() { @@ -30,13 +34,22 @@ public class RestTemplateLoggingLiveTest { restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory()); final ResponseEntity response = restTemplate.postForEntity(baseUrl + "/persons", "my request body", String.class); - assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("[\"Lucie\",\"Jackie\",\"Danesh\",\"Tao\"]", response.getBody()); } @Test public void givenLoggingInterceptorConfiguration_whenSendGetForRequestEntity_thenRequestResponseCustomLog() { - RestTemplate restTemplate = new RestTemplate(); + RestTemplate restTemplate = null; + if (LOGGER.isDebugEnabled()) { + ClientHttpRequestFactory factory = new BufferingClientHttpRequestFactory( + new SimpleClientHttpRequestFactory()); + restTemplate = new RestTemplate(factory); + } else { + restTemplate = new RestTemplate(); + } + List interceptors = restTemplate.getInterceptors(); if (CollectionUtils.isEmpty(interceptors)) { interceptors = new ArrayList<>(); @@ -45,6 +58,7 @@ public class RestTemplateLoggingLiveTest { restTemplate.setInterceptors(interceptors); final ResponseEntity response = restTemplate.postForEntity(baseUrl + "/persons", "my request body", String.class); - assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("[\"Lucie\",\"Jackie\",\"Danesh\",\"Tao\"]", response.getBody()); } } diff --git a/spring-resttemplate-2/src/test/resources/application.properties b/spring-resttemplate-2/src/test/resources/application.properties index 7bc9e56041..286ea95a4f 100644 --- a/spring-resttemplate-2/src/test/resources/application.properties +++ b/spring-resttemplate-2/src/test/resources/application.properties @@ -1,5 +1,5 @@ logging.level.org.springframework.web.client.RestTemplate=DEBUG -logging.level.com.baeldung.resttemplate.logging.LoggingInterceptor=DEBUG +logging.level.com.baeldung.resttemplate.logging=DEBUG logging.level.org.apache.http=DEBUG logging.level.httpclient.wire=DEBUG logging.pattern.console=%20logger{20} - %msg%n From 6cf54b019aecfc09a0f37b279a5a5e8b8aaae762 Mon Sep 17 00:00:00 2001 From: Simone Cusimano Date: Fri, 9 Oct 2020 12:53:49 +0200 Subject: [PATCH 120/302] Add article to README --- gradle/README.md | 1 + gradle/gradle-dependency-management/README.md | 3 +++ ...ests.java => DependencyManagementApplicationUnitTests.java} | 0 3 files changed, 4 insertions(+) create mode 100644 gradle/gradle-dependency-management/README.md rename gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/{DependencyManagementApplicationTests.java => DependencyManagementApplicationUnitTests.java} (100%) diff --git a/gradle/README.md b/gradle/README.md index 84a8508e2c..422bc0fcc5 100644 --- a/gradle/README.md +++ b/gradle/README.md @@ -8,3 +8,4 @@ This module contains articles about Gradle - [Creating a Fat Jar in Gradle](https://www.baeldung.com/gradle-fat-jar) - [A Custom Task in Gradle](https://www.baeldung.com/gradle-custom-task) - [Using JUnit 5 with Gradle](https://www.baeldung.com/junit-5-gradle) +- [Dependency Management in Gradle](https://www.baeldung.com/TBD) diff --git a/gradle/gradle-dependency-management/README.md b/gradle/gradle-dependency-management/README.md new file mode 100644 index 0000000000..b46ae5b596 --- /dev/null +++ b/gradle/gradle-dependency-management/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Dependency Management in Gradle](https://www.baeldung.com/TBD) diff --git a/gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/DependencyManagementApplicationTests.java b/gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/DependencyManagementApplicationUnitTests.java similarity index 100% rename from gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/DependencyManagementApplicationTests.java rename to gradle/gradle-dependency-management/src/test/java/com/gradle/dependencymanagement/DependencyManagementApplicationUnitTests.java From 68f35280c3e394f5ba0ae5a5666853454b6b9d77 Mon Sep 17 00:00:00 2001 From: Loredana Date: Fri, 9 Oct 2020 15:48:30 +0300 Subject: [PATCH 121/302] remove lombok, update scripts threads --- .../load-testing-comparison/pom.xml | 5 --- .../loadtesting/TransactionController.java | 26 --------------- .../model/CustomerRewardsAccount.java | 17 ++++++++-- .../loadtesting/model/Transaction.java | 33 +++++++++++++++++-- .../src/main/resources/application.properties | 7 ++++ .../scripts/Gatling/GatlingScenario.scala | 9 ++--- .../resources/scripts/JMeter/Test Plan.jmx | 2 +- .../scripts/The Grinder/grinder.properties | 2 +- .../resources/scripts/The Grinder/grinder.py | 8 +++-- 9 files changed, 64 insertions(+), 45 deletions(-) delete mode 100644 testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/TransactionController.java create mode 100644 testing-modules/load-testing-comparison/src/main/resources/application.properties diff --git a/testing-modules/load-testing-comparison/pom.xml b/testing-modules/load-testing-comparison/pom.xml index 1143ecb9ac..adc768b563 100644 --- a/testing-modules/load-testing-comparison/pom.xml +++ b/testing-modules/load-testing-comparison/pom.xml @@ -55,11 +55,6 @@ com.h2database h2 - - org.projectlombok - lombok - compile - diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/TransactionController.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/TransactionController.java deleted file mode 100644 index 2ea2c06a41..0000000000 --- a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/TransactionController.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.baeldung.loadtesting; - -import com.baeldung.loadtesting.model.Transaction; -import com.baeldung.loadtesting.repository.TransactionRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -@RestController -@Deprecated -public class TransactionController { - - @Autowired - private TransactionRepository transactionRepository; - - @PostMapping(path="/addTransaction") - public @ResponseBody - String saveTransactions(@RequestBody Transaction trnsctn){ - transactionRepository.save(trnsctn); - return "Saved Transaction."; - } - - @GetMapping(path="/findAll/{rewardId}") - public @ResponseBody Iterable getTransactions(@RequestParam Integer id){ - return transactionRepository.findByCustomerRewardsId(id); - } -} diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java index 2c6742fbaf..0599020700 100644 --- a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java @@ -5,10 +5,7 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import lombok.Data; - @Entity -@Data public class CustomerRewardsAccount { @Id @@ -19,4 +16,18 @@ public class CustomerRewardsAccount { public Integer getCustomerId(){ return this.customerId; } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public void setCustomerId(Integer customerId) { + this.customerId = customerId; + } + + } diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java index 312f52f4ab..1a6e0d4360 100644 --- a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java @@ -1,7 +1,5 @@ package com.baeldung.loadtesting.model; -import lombok.Data; - import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @@ -10,7 +8,6 @@ import java.util.Date; import java.util.Calendar; @Entity -@Data public class Transaction { @Id @@ -27,4 +24,34 @@ public class Transaction { public void setTransactionDate(Date transactionDate){ this.transactionDate = transactionDate; } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getCustomerRewardsId() { + return customerRewardsId; + } + + public void setCustomerRewardsId(Integer customerRewardsId) { + this.customerRewardsId = customerRewardsId; + } + + public Integer getCustomerId() { + return customerId; + } + + public void setCustomerId(Integer customerId) { + this.customerId = customerId; + } + + public Date getTransactionDate() { + return transactionDate; + } + + } diff --git a/testing-modules/load-testing-comparison/src/main/resources/application.properties b/testing-modules/load-testing-comparison/src/main/resources/application.properties new file mode 100644 index 0000000000..424d3d0290 --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/resources/application.properties @@ -0,0 +1,7 @@ +spring.h2.console.enabled=true +spring.datasource.url=jdbc:h2:mem:testdb +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password=password +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect + diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index f17f5f6124..6904d838cb 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -17,7 +17,8 @@ class RewardsScenario extends Simulation { .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0") val scn = scenario("RewardsScenario") - .repeat(10){ + .repeat(100){ + exec(http("transactions_add") .post("/transactions/add/") .body(StringBody(_ => s"""{ "customerRewardsId":null,"customerId":"${randCustId()}","transactionDate":null }""")).asJson @@ -36,14 +37,14 @@ class RewardsScenario extends Simulation { .check(jsonPath("$.id").saveAs("rwdId"))) } - .exec(http("transactions_add") + .exec(http("transactions_update") .post("/transactions/add/") .body(StringBody("""{ "customerRewardsId":"${rwdId}","customerId":"${custId}","transactionDate":"${txtDate}" }""")).asJson) - .exec(http("get_reward") + .exec(http("get_transactions") .get("/transactions/findAll/${rwdId}")) } setUp( scn.inject(atOnceUsers(100)) ).protocols(httpProtocol) -} \ No newline at end of file +} diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx b/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx index 97640dfac7..413a8d3387 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx @@ -16,7 +16,7 @@ continue false - 10 + 100 100 0 diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties index 68adf90856..f256f5a7dd 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties @@ -1,5 +1,5 @@ grinder.script = grinder.py grinder.threads = 100 grinder.processes = 1 -grinder.runs = 10 +grinder.runs = 100 grinder.logDirectory = /logs diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py index 025f90d38b..bbb253c220 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py @@ -21,20 +21,24 @@ request1.setHeaders(headers) utilities = HTTPPluginControl.getHTTPUtilities() test1.record(request1) random=java.util.Random() +log = grinder.logger.info class TestRunner: def __call__(self): - customerId = str(random.nextInt()); + + customerId = str(random.nextInt()); result = request1.POST("http://localhost:8080/transactions/add", "{"'"customerRewardsId"'":null,"'"customerId"'":"+ customerId + ","'"transactionDate"'":null}") txnId = parseJsonString(result.getText(), "id") result = request1.GET("http://localhost:8080/rewards/find/"+ customerId) rwdId = parseJsonString(result.getText(), "id") + log("rwdid %s" % rwdId) if rwdId == "": result = request1.POST("http://localhost:8080/rewards/add", "{"'"customerId"'":"+ customerId + "}") rwdId = parseJsonString(result.getText(), "id") result = request1.POST("http://localhost:8080/transactions/add", "{"'"id"'":" + txnId + ","'"customerRewardsId"'":" + rwdId + ","'"customerId"'":"+ customerId + ","'"transactionDate"'":null}") - result = request1.GET("http://localhost:8080/transactions/findAll/" + rwdId) \ No newline at end of file + result = request1.GET("http://localhost:8080/transactions/findAll/" + rwdId) + From f3aee7ea037cce604329755732e38e754865db89 Mon Sep 17 00:00:00 2001 From: Loredana Date: Fri, 9 Oct 2020 15:50:27 +0300 Subject: [PATCH 122/302] remove log, formatting --- .../src/main/resources/scripts/The Grinder/grinder.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py index bbb253c220..a71f101b41 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py @@ -21,19 +21,17 @@ request1.setHeaders(headers) utilities = HTTPPluginControl.getHTTPUtilities() test1.record(request1) random=java.util.Random() -log = grinder.logger.info class TestRunner: def __call__(self): - customerId = str(random.nextInt()); + customerId = str(random.nextInt()); result = request1.POST("http://localhost:8080/transactions/add", "{"'"customerRewardsId"'":null,"'"customerId"'":"+ customerId + ","'"transactionDate"'":null}") txnId = parseJsonString(result.getText(), "id") result = request1.GET("http://localhost:8080/rewards/find/"+ customerId) rwdId = parseJsonString(result.getText(), "id") - log("rwdid %s" % rwdId) if rwdId == "": result = request1.POST("http://localhost:8080/rewards/add", "{"'"customerId"'":"+ customerId + "}") From eea42f2289e3264420728c702a75966c4b160b1c Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Fri, 9 Oct 2020 21:05:09 +0200 Subject: [PATCH 123/302] Reset Gatling user state on each iteration --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index 6904d838cb..15d86ebedb 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -43,6 +43,8 @@ class RewardsScenario extends Simulation { .exec(http("get_transactions") .get("/transactions/findAll/${rwdId}")) + + .exec(_.removeAll("txnId", "txtDate", "custId", "rwdId")) } setUp( scn.inject(atOnceUsers(100)) From 4cd2feed942af0f1189620c8ce037581fb111511 Mon Sep 17 00:00:00 2001 From: Maiklins Date: Sat, 10 Oct 2020 09:17:35 +0200 Subject: [PATCH 124/302] Java-82 Correctly configure Netty server and security (#10034) * Java-82 Correctly configure netty server and security * Java-82 Align WebSecurity with article * Java-82 Change port Co-authored-by: mikr --- .../reactive/actuator/FeaturesEndpoint.java | 2 +- .../actuator/Spring5ReactiveApplication.java | 2 +- .../reactive/actuator/WebSecurityConfig.java | 19 +++++++------------ .../reactive/security/SecurityConfig.java | 4 ++-- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java index b2bc1e037f..d6cf1eb781 100644 --- a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/FeaturesEndpoint.java @@ -7,7 +7,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @Component -@Endpoint(id = "features", enableByDefault = true) +@Endpoint(id = "features") public class FeaturesEndpoint { private Map features = new ConcurrentHashMap<>(); diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java index 03943d436d..600bff5948 100644 --- a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/Spring5ReactiveApplication.java @@ -4,7 +4,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class Spring5ReactiveApplication{ +public class Spring5ReactiveApplication { public static void main(String[] args) { SpringApplication.run(Spring5ReactiveApplication.class, args); diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/WebSecurityConfig.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/WebSecurityConfig.java index 07f805fea4..384e26ac8c 100644 --- a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/WebSecurityConfig.java +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/actuator/WebSecurityConfig.java @@ -1,10 +1,7 @@ package com.baeldung.reactive.actuator; -import org.springframework.boot.actuate.autoconfigure.security.reactive.EndpointRequest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.web.server.SecurityWebFilterChain; @@ -12,17 +9,15 @@ import org.springframework.security.web.server.SecurityWebFilterChain; @Configuration @EnableWebFluxSecurity public class WebSecurityConfig { - - + @Bean public SecurityWebFilterChain securitygWebFilterChain( ServerHttpSecurity http) { - return http - - .authorizeExchange() - .matchers(EndpointRequest.to( - FeaturesEndpoint.class - )).permitAll().anyExchange().permitAll().and().csrf().disable().build(); + + return http.authorizeExchange() + .pathMatchers("/actuator/**").permitAll() + .anyExchange().authenticated() + .and().build(); } - + } diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SecurityConfig.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SecurityConfig.java index 225f78b3f7..64e96ddae1 100644 --- a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SecurityConfig.java +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SecurityConfig.java @@ -21,12 +21,12 @@ public class SecurityConfig { @Bean public SecurityWebFilterChain securitygWebFilterChain(ServerHttpSecurity http) { return http.authorizeExchange() - .pathMatchers("/", "/admin") + .pathMatchers("/admin") .hasAuthority("ROLE_ADMIN") .matchers(EndpointRequest.to(FeaturesEndpoint.class)) .permitAll() .anyExchange() - .permitAll() + .authenticated() .and() .formLogin() .and() From 2fb06fdcdd3c7827a2d67c04e80dc615d6fb4b83 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 10 Oct 2020 13:38:26 +0300 Subject: [PATCH 125/302] remove explicit version overrides JAVA-1671 --- spring-cloud/pom.xml | 6 ------ spring-cloud/spring-cloud-aws/pom.xml | 4 ---- spring-cloud/spring-cloud-bootstrap/config/pom.xml | 11 ----------- .../spring-cloud-bootstrap/customer-service/pom.xml | 12 ------------ .../spring-cloud-bootstrap/discovery/pom.xml | 4 ---- spring-cloud/spring-cloud-bootstrap/gateway/pom.xml | 4 ---- .../spring-cloud-bootstrap/order-service/pom.xml | 11 ----------- spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml | 4 ---- .../spring-cloud-bootstrap/svc-rating/pom.xml | 4 ---- spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml | 11 ----------- spring-cloud/spring-cloud-config/pom.xml | 11 ----------- spring-cloud/spring-cloud-connectors-heroku/pom.xml | 4 ---- spring-cloud/spring-cloud-functions/pom.xml | 4 ---- .../spring/cloudfunction/aws/functions/Greeter.java | 2 +- spring-cloud/spring-cloud-kubernetes/pom.xml | 4 ---- .../spring-cloud-rest-books-api/pom.xml | 4 ---- .../spring-cloud-rest-config-server/pom.xml | 4 ---- .../spring-cloud-rest-discovery-server/pom.xml | 4 ---- .../spring-cloud-rest-reviews-api/pom.xml | 4 ---- spring-cloud/spring-cloud-ribbon-client/pom.xml | 5 ----- spring-cloud/spring-cloud-ribbon-retry/pom.xml | 4 ---- spring-cloud/spring-cloud-security/pom.xml | 4 ---- .../spring-cloud-stream-kafka/pom.xml | 4 ---- .../spring-cloud-stream-kinesis/pom.xml | 5 ----- spring-cloud/spring-cloud-task/pom.xml | 4 ---- spring-cloud/spring-cloud-vault/pom.xml | 5 ----- spring-cloud/spring-cloud-zuul/pom.xml | 4 ---- 27 files changed, 1 insertion(+), 146 deletions(-) diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index 928db8adb7..7894365a41 100644 --- a/spring-cloud/pom.xml +++ b/spring-cloud/pom.xml @@ -85,13 +85,7 @@ 1.4.7.RELEASE 1.4.7.RELEASE 3.0.6.RELEASE - 2.3.1.RELEASE - 2.3.1.RELEASE - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index 3952ffdec1..f65db6a2fe 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -68,10 +68,6 @@ Dalston.SR4 2.2.1.RELEASE - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-bootstrap/config/pom.xml b/spring-cloud/spring-cloud-bootstrap/config/pom.xml index 65a9830495..6ebf23637e 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/config/pom.xml @@ -30,13 +30,6 @@ - - org.junit - junit-bom - ${junit-jupiter.version} - pom - import - org.springframework.cloud spring-cloud-dependencies @@ -50,10 +43,6 @@ Brixton.SR7 - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml b/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml index 026a7a1841..729abb4f05 100644 --- a/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml @@ -17,13 +17,6 @@ - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - org.springframework.boot spring-boot-starter-web @@ -78,10 +71,5 @@ 1.8 1.8 - - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml index eaebaacc4d..d77e29768f 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml @@ -52,10 +52,6 @@ Edgware.SR5 - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml index aacd2cdbf7..34b7af7c0a 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml @@ -101,10 +101,6 @@ Dalston.RELEASE - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml index 04901f9936..a32bd5a2d3 100644 --- a/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml @@ -23,13 +23,6 @@ - - org.junit - junit-bom - ${junit-jupiter.version} - pom - import - org.springframework.boot spring-boot-dependencies @@ -126,9 +119,5 @@ 1.8 com.baeldung.orderservice.OrderApplication - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml index cf34e44f24..de0785bd45 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml @@ -74,10 +74,6 @@ Dalston.RELEASE - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml index a232861cad..0cce78276a 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml @@ -83,10 +83,6 @@ Dalston.RELEASE - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml index 134038b94a..b83c5a2aaa 100644 --- a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml @@ -38,13 +38,6 @@ - - org.junit - junit-bom - ${junit-jupiter.version} - pom - import - org.springframework.cloud spring-cloud-dependencies @@ -58,10 +51,6 @@ Brixton.SR7 - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-config/pom.xml b/spring-cloud/spring-cloud-config/pom.xml index e693bc7a29..7fb0c1fd68 100644 --- a/spring-cloud/spring-cloud-config/pom.xml +++ b/spring-cloud/spring-cloud-config/pom.xml @@ -22,13 +22,6 @@ - - org.junit - junit-bom - ${junit-jupiter.version} - pom - import - org.springframework.cloud spring-cloud-dependencies @@ -42,10 +35,6 @@ Hoxton.SR4 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-connectors-heroku/pom.xml b/spring-cloud/spring-cloud-connectors-heroku/pom.xml index 2e84061be9..e71e1350a2 100644 --- a/spring-cloud/spring-cloud-connectors-heroku/pom.xml +++ b/spring-cloud/spring-cloud-connectors-heroku/pom.xml @@ -65,10 +65,6 @@ 42.2.10 1.10.10 - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-functions/pom.xml b/spring-cloud/spring-cloud-functions/pom.xml index 19b5e3cd8d..0be3941db1 100644 --- a/spring-cloud/spring-cloud-functions/pom.xml +++ b/spring-cloud/spring-cloud-functions/pom.xml @@ -87,10 +87,6 @@ 1.1.0 1.0.10.RELEASE - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-functions/src/main/java/com/baeldung/spring/cloudfunction/aws/functions/Greeter.java b/spring-cloud/spring-cloud-functions/src/main/java/com/baeldung/spring/cloudfunction/aws/functions/Greeter.java index c443b98c18..bbc87a4ae2 100644 --- a/spring-cloud/spring-cloud-functions/src/main/java/com/baeldung/spring/cloudfunction/aws/functions/Greeter.java +++ b/spring-cloud/spring-cloud-functions/src/main/java/com/baeldung/spring/cloudfunction/aws/functions/Greeter.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.cloudfunction.functions.aws; +package com.baeldung.spring.cloudfunction.aws.functions; import java.util.function.Function; diff --git a/spring-cloud/spring-cloud-kubernetes/pom.xml b/spring-cloud/spring-cloud-kubernetes/pom.xml index c936024753..a3669d2d55 100644 --- a/spring-cloud/spring-cloud-kubernetes/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/pom.xml @@ -25,9 +25,5 @@ - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml index 1dcf14f104..8ba0fc5cad 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml @@ -75,9 +75,5 @@ - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml index 736b8bdf78..c64341f652 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml @@ -53,10 +53,6 @@ Camden.SR4 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml index 12f8b6ae6a..85790bf895 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml @@ -61,10 +61,6 @@ Edgware.SR4 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml index 0e7aed7f6a..35d0e79543 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml @@ -83,10 +83,6 @@ 3.0.1 0.6 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-ribbon-client/pom.xml b/spring-cloud/spring-cloud-ribbon-client/pom.xml index ce57cfd7d3..fa9cee29a2 100644 --- a/spring-cloud/spring-cloud-ribbon-client/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-client/pom.xml @@ -46,11 +46,6 @@ Hoxton.SR4 - - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-ribbon-retry/pom.xml b/spring-cloud/spring-cloud-ribbon-retry/pom.xml index 198473d5e5..99eb882421 100644 --- a/spring-cloud/spring-cloud-ribbon-retry/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-retry/pom.xml @@ -56,9 +56,5 @@ Hoxton.SR3 - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-security/pom.xml b/spring-cloud/spring-cloud-security/pom.xml index 0997b1f3aa..3a007c8df1 100644 --- a/spring-cloud/spring-cloud-security/pom.xml +++ b/spring-cloud/spring-cloud-security/pom.xml @@ -21,9 +21,5 @@ - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml index 3283d4d07c..52230dd1c1 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml @@ -106,10 +106,6 @@ 4.0.0 1.8.2 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml index d3182433e9..9e706cc239 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml @@ -43,11 +43,6 @@ 1.11.632 2.0.2.RELEASE 2.2.1.RELEASE - - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-task/pom.xml b/spring-cloud/spring-cloud-task/pom.xml index bb18c1390b..21d8a4e42b 100644 --- a/spring-cloud/spring-cloud-task/pom.xml +++ b/spring-cloud/spring-cloud-task/pom.xml @@ -50,10 +50,6 @@ Hoxton.SR4 2.2.3.RELEASE - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-vault/pom.xml b/spring-cloud/spring-cloud-vault/pom.xml index a713e47fe2..d9ae6b515f 100644 --- a/spring-cloud/spring-cloud-vault/pom.xml +++ b/spring-cloud/spring-cloud-vault/pom.xml @@ -83,11 +83,6 @@ Greenwich.RELEASE - - - 2.22.2 - 5.6.2 - 4.13 diff --git a/spring-cloud/spring-cloud-zuul/pom.xml b/spring-cloud/spring-cloud-zuul/pom.xml index 3884e67388..b8db1f2fc7 100644 --- a/spring-cloud/spring-cloud-zuul/pom.xml +++ b/spring-cloud/spring-cloud-zuul/pom.xml @@ -81,10 +81,6 @@ Hoxton.SR4 - - 2.22.2 - 5.6.2 - 4.13 From 6f4ec4704fa9a127bca7344c9abc65b08fde4bf7 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 10 Oct 2020 13:49:25 +0300 Subject: [PATCH 126/302] fix unknown version --- spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml | 1 - spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml | 4 ---- spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml | 2 -- .../bin/eureka-client/pom.xml | 1 - .../eureka-client/pom.xml | 4 ++-- .../eureka-server/pom.xml | 2 +- .../spring-cloud-zuul-eureka-integration/zuul-server/pom.xml | 1 - 7 files changed, 3 insertions(+), 12 deletions(-) diff --git a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml index 9b43542f02..204cb8765c 100644 --- a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml @@ -58,7 +58,6 @@ org.springframework.boot spring-boot-starter-web - ${spring-boot-starter-web.version} org.springframework.boot diff --git a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml index 7989b09ed4..44e5bf2501 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml @@ -47,24 +47,20 @@ org.springframework.boot spring-boot-starter-web - ${spring-boot-starter-web.version} org.springframework.boot spring-boot-starter-thymeleaf - ${spring-boot-starter-web.version} org.springframework.boot spring-boot-starter-actuator - ${spring-boot-starter-web.version} org.springframework.boot spring-boot-starter-test test - ${spring-boot-starter-web.version} diff --git a/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml index cb7377d705..e7be8f2c58 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml @@ -18,13 +18,11 @@ org.springframework.boot spring-boot-starter-web - ${spring-boot-starter-web.version} org.springframework.boot spring-boot-starter-test - ${spring-boot-starter-web.version} test diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml index 118a9e2c11..321da7527a 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml @@ -35,7 +35,6 @@ org.springframework.boot spring-boot-starter-web - ${spring-boot-starter-web.version} diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml index 9cf96df60e..77e8ef7c20 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml @@ -35,13 +35,13 @@ org.springframework.boot spring-boot-starter-web - ${spring-boot-starter-web.version} + ${spring-boot.version} org.springframework.boot spring-boot-starter-test - ${spring-boot-starter-web.version} + ${spring-boot.version} test diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml index cd25f5f294..c3f6642351 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml @@ -41,7 +41,7 @@ org.springframework.boot spring-boot-starter-test - ${spring-boot-starter-web.version} + ${spring-boot.version} test diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml index 3d238d5d5f..ddffe540c5 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml @@ -50,7 +50,6 @@ org.springframework.boot spring-boot-starter-test - ${spring-boot-starter-web.version} test From 5792db85bd0b2900aab6426d59f63a56d42583c7 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 10 Oct 2020 13:56:42 +0300 Subject: [PATCH 127/302] fix unknown version --- spring-cloud/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index 7894365a41..c0e452afaf 100644 --- a/spring-cloud/pom.xml +++ b/spring-cloud/pom.xml @@ -52,7 +52,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} From e4007b9b98fa716acee458e6b2dc3244287185ff Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 10 Oct 2020 14:18:20 +0300 Subject: [PATCH 128/302] fix test --- .../src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud/spring-cloud-functions/src/main/resources/application.properties b/spring-cloud/spring-cloud-functions/src/main/resources/application.properties index b445bfa4ed..2cb479879c 100644 --- a/spring-cloud/spring-cloud-functions/src/main/resources/application.properties +++ b/spring-cloud/spring-cloud-functions/src/main/resources/application.properties @@ -1 +1 @@ -spring.cloud.function.scan.packages: com.baeldung.spring.cloudfunction.functions.aws \ No newline at end of file +spring.cloud.function.scan.packages: com.baeldung.spring.cloudfunction.aws.functions \ No newline at end of file From 103bd4cf6500b8a4b943697981f0180d9a9e5ba1 Mon Sep 17 00:00:00 2001 From: dgcd Date: Sun, 11 Oct 2020 01:23:32 +0300 Subject: [PATCH 129/302] Fixed typos in core-java-9-jigsaw module --- .../com/baeldung/student/service/dbimpl/StudentDbService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service.dbimpl/com/baeldung/student/service/dbimpl/StudentDbService.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service.dbimpl/com/baeldung/student/service/dbimpl/StudentDbService.java index 2519da085b..617a0a7e70 100644 --- a/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service.dbimpl/com/baeldung/student/service/dbimpl/StudentDbService.java +++ b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service.dbimpl/com/baeldung/student/service/dbimpl/StudentDbService.java @@ -19,12 +19,12 @@ public class StudentDbService implements StudentService { } public Student update(Student student) { - logger.log(Level.INFO, "Updating sutdent in DB..."); + logger.log(Level.INFO, "Updating student in DB..."); return student; } public String delete(String registrationId) { - logger.log(Level.INFO, "Deleteing sutdent in DB..."); + logger.log(Level.INFO, "Deleting student in DB..."); return registrationId; } } \ No newline at end of file From b447b94b5037f2c9078d2104d4b92e7759eefbfc Mon Sep 17 00:00:00 2001 From: "amit.pandey" Date: Sun, 11 Oct 2020 16:26:31 +0530 Subject: [PATCH 130/302] moved spring-rest-compress module to spring-resttemplate-2 module --- spring-resttemplate-2/README.md | 1 + spring-resttemplate-2/pom.xml | 23 ++++++++ ...mpressingClientHttpRequestInterceptor.java | 38 +++++++++++++ .../java/com/baeldung/compress/GzipUtils.java | 52 +++++++++++++++++ .../compress/JettyWebServerConfiguration.java | 38 +++++++++++++ .../java/com/baeldung/compress/Message.java | 29 ++++++++++ .../baeldung/compress/MessageController.java | 38 +++++++++++++ .../compress/RestTemplateConfiguration.java | 21 +++++++ .../SpringCompressRequestApplication.java | 15 +++++ .../baeldung/compress/GzipUtilsUnitTest.java | 19 +++++++ .../compress/MessageControllerUnitTest.java | 56 +++++++++++++++++++ 11 files changed, 330 insertions(+) create mode 100644 spring-resttemplate-2/src/main/java/com/baeldung/compress/CompressingClientHttpRequestInterceptor.java create mode 100644 spring-resttemplate-2/src/main/java/com/baeldung/compress/GzipUtils.java create mode 100644 spring-resttemplate-2/src/main/java/com/baeldung/compress/JettyWebServerConfiguration.java create mode 100644 spring-resttemplate-2/src/main/java/com/baeldung/compress/Message.java create mode 100644 spring-resttemplate-2/src/main/java/com/baeldung/compress/MessageController.java create mode 100644 spring-resttemplate-2/src/main/java/com/baeldung/compress/RestTemplateConfiguration.java create mode 100644 spring-resttemplate-2/src/main/java/com/baeldung/compress/SpringCompressRequestApplication.java create mode 100644 spring-resttemplate-2/src/test/java/com/baeldung/compress/GzipUtilsUnitTest.java create mode 100644 spring-resttemplate-2/src/test/java/com/baeldung/compress/MessageControllerUnitTest.java diff --git a/spring-resttemplate-2/README.md b/spring-resttemplate-2/README.md index e1e0ba40b0..37d8ac9740 100644 --- a/spring-resttemplate-2/README.md +++ b/spring-resttemplate-2/README.md @@ -8,3 +8,4 @@ This module contains articles about Spring RestTemplate - [Proxies With RestTemplate](https://www.baeldung.com/java-resttemplate-proxy) - [A Custom Media Type for a Spring REST API](https://www.baeldung.com/spring-rest-custom-media-type) - [RestTemplate Post Request with JSON](https://www.baeldung.com/spring-resttemplate-post-json) +- [How to compress requests using the Spring RestTemplate](https://www.baeldung.com/spring-resttemplate-compressing-requests) diff --git a/spring-resttemplate-2/pom.xml b/spring-resttemplate-2/pom.xml index b1d6f60c53..2aed154be6 100644 --- a/spring-resttemplate-2/pom.xml +++ b/spring-resttemplate-2/pom.xml @@ -20,7 +20,30 @@ org.springframework.boot spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-jetty + + + + org.apache.httpcomponents + httpclient + + + + commons-io + commons-io + ${commons-io.version} + + org.springframework.boot spring-boot-starter-test diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/compress/CompressingClientHttpRequestInterceptor.java b/spring-resttemplate-2/src/main/java/com/baeldung/compress/CompressingClientHttpRequestInterceptor.java new file mode 100644 index 0000000000..e880e8f915 --- /dev/null +++ b/spring-resttemplate-2/src/main/java/com/baeldung/compress/CompressingClientHttpRequestInterceptor.java @@ -0,0 +1,38 @@ +package com.baeldung.compress; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpRequest; +import org.springframework.http.client.ClientHttpRequestExecution; +import org.springframework.http.client.ClientHttpRequestInterceptor; +import org.springframework.http.client.ClientHttpResponse; + +import java.io.IOException; + +public class CompressingClientHttpRequestInterceptor implements ClientHttpRequestInterceptor { + + private static final Logger LOG = LoggerFactory.getLogger(CompressingClientHttpRequestInterceptor.class); + + private static final String GZIP_ENCODING = "gzip"; + + /** + * Compress a request body using Gzip and add Http headers. + * + * @param req + * @param body + * @param exec + * @return + * @throws IOException + */ + @Override + public ClientHttpResponse intercept(HttpRequest req, byte[] body, ClientHttpRequestExecution exec) + throws IOException { + LOG.info("Compressing request..."); + HttpHeaders httpHeaders = req.getHeaders(); + httpHeaders.add(HttpHeaders.CONTENT_ENCODING, GZIP_ENCODING); + httpHeaders.add(HttpHeaders.ACCEPT_ENCODING, GZIP_ENCODING); + return exec.execute(req, GzipUtils.compress(body)); + } + +} diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/compress/GzipUtils.java b/spring-resttemplate-2/src/main/java/com/baeldung/compress/GzipUtils.java new file mode 100644 index 0000000000..50c565d92c --- /dev/null +++ b/spring-resttemplate-2/src/main/java/com/baeldung/compress/GzipUtils.java @@ -0,0 +1,52 @@ +package com.baeldung.compress; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +import org.apache.commons.io.IOUtils; + +public class GzipUtils { + + /** + * Gzip a string. + * + * @param text + * @return + * @throws Exception + */ + public static byte[] compress(String text) throws Exception { + return GzipUtils.compress(text.getBytes(StandardCharsets.UTF_8)); + } + + /** + * Gzip a byte array. + * + * @param body + * @return + * @throws IOException + */ + public static byte[] compress(byte[] body) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (GZIPOutputStream gzipOutputStream = new GZIPOutputStream(baos)) { + gzipOutputStream.write(body); + } + return baos.toByteArray(); + } + + /** + * Decompress a Gzipped byte array to a String. + * + * @param body + * @return + * @throws IOException + */ + public static String decompress(byte[] body) throws IOException { + try (GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(body))) { + return IOUtils.toString(gzipInputStream, StandardCharsets.UTF_8); + } + } +} diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/compress/JettyWebServerConfiguration.java b/spring-resttemplate-2/src/main/java/com/baeldung/compress/JettyWebServerConfiguration.java new file mode 100644 index 0000000000..3ac8c31ab3 --- /dev/null +++ b/spring-resttemplate-2/src/main/java/com/baeldung/compress/JettyWebServerConfiguration.java @@ -0,0 +1,38 @@ +package com.baeldung.compress; + +import org.eclipse.jetty.server.handler.HandlerCollection; +import org.eclipse.jetty.server.handler.gzip.GzipHandler; +import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Configure Jetty web server so it handles compressed requests. + */ +@Configuration +public class JettyWebServerConfiguration { + + private static final int MIN_BYTES = 1; + + /** + * Customise the Jetty web server to automatically decompress requests. + */ + @Bean + public JettyServletWebServerFactory jettyServletWebServerFactory() { + + JettyServletWebServerFactory factory = new JettyServletWebServerFactory(); + factory.addServerCustomizers(server -> { + + GzipHandler gzipHandler = new GzipHandler(); + // Enable request decompression + gzipHandler.setInflateBufferSize(MIN_BYTES); + gzipHandler.setHandler(server.getHandler()); + + HandlerCollection handlerCollection = new HandlerCollection(gzipHandler); + server.setHandler(handlerCollection); + }); + + return factory; + } + +} diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/compress/Message.java b/spring-resttemplate-2/src/main/java/com/baeldung/compress/Message.java new file mode 100644 index 0000000000..f43d06c2fc --- /dev/null +++ b/spring-resttemplate-2/src/main/java/com/baeldung/compress/Message.java @@ -0,0 +1,29 @@ +package com.baeldung.compress; + +public class Message { + + private String text; + + public Message() { + } + + public Message(String text) { + this.text = text; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("Message {"); + sb.append("text='").append(text).append('\''); + sb.append('}'); + return sb.toString(); + } +} diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/compress/MessageController.java b/spring-resttemplate-2/src/main/java/com/baeldung/compress/MessageController.java new file mode 100644 index 0000000000..ec574d9dec --- /dev/null +++ b/spring-resttemplate-2/src/main/java/com/baeldung/compress/MessageController.java @@ -0,0 +1,38 @@ +package com.baeldung.compress; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@RestController +public class MessageController { + + protected static final String PROCESSED = "Processed "; + + protected static final String REQUEST_MAPPING = "process"; + + private static final Logger LOG = LoggerFactory.getLogger(MessageController.class); + + /** + * A simple endpoint that responds with "Processed " + supplied Message content. + * + * @param headers + * @param message + * @return + */ + @PostMapping(value = REQUEST_MAPPING) + public ResponseEntity processMessage(@RequestHeader Map headers, + @RequestBody Message message) { + + // Print headers + headers.forEach((k, v) -> LOG.info(k + "=" + v)); + + return ResponseEntity.ok(PROCESSED + message.getText()); + } +} diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/compress/RestTemplateConfiguration.java b/spring-resttemplate-2/src/main/java/com/baeldung/compress/RestTemplateConfiguration.java new file mode 100644 index 0000000000..12b1e4249e --- /dev/null +++ b/spring-resttemplate-2/src/main/java/com/baeldung/compress/RestTemplateConfiguration.java @@ -0,0 +1,21 @@ +package com.baeldung.compress; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; + +@Configuration +public class RestTemplateConfiguration { + + /** + * A RestTemplate that compresses requests. + * + * @return RestTemplate + */ + @Bean + public RestTemplate getRestTemplate() { + RestTemplate restTemplate = new RestTemplate(); + restTemplate.getInterceptors().add(new CompressingClientHttpRequestInterceptor()); + return restTemplate; + } +} diff --git a/spring-resttemplate-2/src/main/java/com/baeldung/compress/SpringCompressRequestApplication.java b/spring-resttemplate-2/src/main/java/com/baeldung/compress/SpringCompressRequestApplication.java new file mode 100644 index 0000000000..9ff88ab257 --- /dev/null +++ b/spring-resttemplate-2/src/main/java/com/baeldung/compress/SpringCompressRequestApplication.java @@ -0,0 +1,15 @@ +package com.baeldung.compress; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@EnableAutoConfiguration +public class SpringCompressRequestApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringCompressRequestApplication.class, args); + } + +} diff --git a/spring-resttemplate-2/src/test/java/com/baeldung/compress/GzipUtilsUnitTest.java b/spring-resttemplate-2/src/test/java/com/baeldung/compress/GzipUtilsUnitTest.java new file mode 100644 index 0000000000..10c2eeb748 --- /dev/null +++ b/spring-resttemplate-2/src/test/java/com/baeldung/compress/GzipUtilsUnitTest.java @@ -0,0 +1,19 @@ +package com.baeldung.compress; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class GzipUtilsUnitTest { + + @Test + public void givenCompressedText_whenDecompressed_thenSuccessful() throws Exception { + final String expectedText = "Hello Baeldung!"; + byte[] compressedText = GzipUtils.compress(expectedText); + String decompressedText = GzipUtils.decompress(compressedText); + assertNotNull(compressedText); + assertEquals(expectedText, decompressedText); + } + +} \ No newline at end of file diff --git a/spring-resttemplate-2/src/test/java/com/baeldung/compress/MessageControllerUnitTest.java b/spring-resttemplate-2/src/test/java/com/baeldung/compress/MessageControllerUnitTest.java new file mode 100644 index 0000000000..643e3f6881 --- /dev/null +++ b/spring-resttemplate-2/src/test/java/com/baeldung/compress/MessageControllerUnitTest.java @@ -0,0 +1,56 @@ +package com.baeldung.compress; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.client.RestTemplate; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class MessageControllerUnitTest { + + private static final Logger LOG = LoggerFactory.getLogger(MessageControllerUnitTest.class); + + @Autowired + private RestTemplate restTemplate; + + @LocalServerPort + private int randomServerPort; + + /** + * As a further test you can intercept the request body, using a tool like + * Wireshark, to see the request body is actually gzipped. + * + * @throws Exception + */ + @Test + public void givenRestTemplate_whenPostCompressedRequest_thenRespondsSuccessfully() throws Exception { + + final String text = "Hello Baeldung!"; + Message message = new Message(text); + + HttpEntity request = new HttpEntity<>(message); + String uri = String.format("http://localhost:%s/%s", randomServerPort, MessageController.REQUEST_MAPPING); + + ResponseEntity responseEntity = restTemplate.postForEntity(uri, request, String.class); + + String response = responseEntity.getBody(); + LOG.info("Got response [{}]", response); + + assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); + assertNotNull(response); + assertEquals(MessageController.PROCESSED + text, response); + } + +} From cbb0d50370075b4d326eb4248b0d748c2fee2458 Mon Sep 17 00:00:00 2001 From: Mithu Tokder Date: Sun, 11 Oct 2020 23:47:08 +0530 Subject: [PATCH 131/302] updated junit 5 version to latest version --- testing-modules/junit5-annotations/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing-modules/junit5-annotations/pom.xml b/testing-modules/junit5-annotations/pom.xml index 9e51d0ab55..7ffc17c69b 100644 --- a/testing-modules/junit5-annotations/pom.xml +++ b/testing-modules/junit5-annotations/pom.xml @@ -55,8 +55,8 @@ - 5.6.2 - 1.6.0 + 5.7.0 + 1.7.0 2.8.2 3.11.1 From afe9a94a4e8f5afdf1e3f355ae64e2ceb21e0a85 Mon Sep 17 00:00:00 2001 From: Simone Cusimano Date: Mon, 12 Oct 2020 08:07:01 +0200 Subject: [PATCH 132/302] Remove unnecessary files --- gradle/gradle-dependency-management/gradlew | 184 ------------------ .../gradle-dependency-management/gradlew.bat | 89 --------- 2 files changed, 273 deletions(-) delete mode 100644 gradle/gradle-dependency-management/gradlew delete mode 100644 gradle/gradle-dependency-management/gradlew.bat diff --git a/gradle/gradle-dependency-management/gradlew b/gradle/gradle-dependency-management/gradlew deleted file mode 100644 index 8f8904743c..0000000000 --- a/gradle/gradle-dependency-management/gradlew +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ]; do - ls=$(ls -ld "$PRG") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' >/dev/null; then - PRG="$link" - else - PRG=$(dirname "$PRG")"/$link" - fi -done -SAVED="$(pwd)" -cd "$(dirname \"$PRG\")/" >/dev/null -APP_HOME="$(pwd -P)" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=$(basename "$0") - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn() { - echo "$*" -} - -die() { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$(uname)" in -CYGWIN*) - cygwin=true - ;; -Darwin*) - darwin=true - ;; -MINGW*) - msys=true - ;; -NONSTOP*) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ]; then - if [ -x "$JAVA_HOME/jre/sh/java" ]; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ]; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then - MAX_FD_LIMIT=$(ulimit -H -n) - if [ $? -eq 0 ]; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ]; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ]; then - APP_HOME=$(cygpath --path --mixed "$APP_HOME") - CLASSPATH=$(cygpath --path --mixed "$CLASSPATH") - - JAVACMD=$(cygpath --unix "$JAVACMD") - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null) - SEP="" - for dir in $ROOTDIRSRAW; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ]; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@"; do - CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -) - CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition - eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg") - else - eval $(echo args$i)="\"$arg\"" - fi - i=$(expr $i + 1) - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save() { - for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/gradle/gradle-dependency-management/gradlew.bat b/gradle/gradle-dependency-management/gradlew.bat deleted file mode 100644 index 107acd32c4..0000000000 --- a/gradle/gradle-dependency-management/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega From 4c748f7a23f80242656cd3574dded30459d8f2ae Mon Sep 17 00:00:00 2001 From: Cristian Stancalau Date: Mon, 12 Oct 2020 16:35:24 +0300 Subject: [PATCH 133/302] =?UTF-8?q?Explanation=20of=20=E2=80=9CClassCastEx?= =?UTF-8?q?ception=E2=80=9D=20in=20Java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exceptions/classcastexception/Main.java | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java new file mode 100644 index 0000000000..ef891ccde6 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java @@ -0,0 +1,97 @@ +package com.baeldung.exceptions.classcastexception; + +import java.io.Serializable; + +public class Main { + + public static void main(String[] args) { + + checkedCasts(); + uncheckedConversion(); + genericConversion(); + } + + private static void checkedCasts() { + + Animal animal = new Frog(); + + try { + Mammal mammal = (Mammal) animal; + } catch (ClassCastException e) { + System.out.println("A checked downcast to Mammal is incompatible from Frog because Frog is not a subtype of Mammal."); + } + + try { + Serializable serial = (Serializable) animal; + } catch (ClassCastException e) { + System.out.println("A checked cast to Serializable is incompatible from Frog because Frog is not a subtype of Serializable."); + } + + Object primitives = new int[1]; + + try { + Integer[] integers = (Integer[]) primitives; + } catch (ClassCastException e) { + System.out.println("A checked cast to Integer[] is incompatible from primitive arrays. Auto-boxing does not work for arrays."); + } + + try { + long[] longs = (long[]) primitives; + } catch (ClassCastException e) { + System.out.println("A checked cast to long[] is incompatible from int[]. Type promotion does not work for arrays."); + } + } + + private static void uncheckedConversion() { + Box originalBox = new Box<>(); + Box raw = originalBox; + raw.setContent(2.5); + Box bound = (Box) raw; + try { + Long content = bound.getContent(); + } catch (ClassCastException e) { + System.out.println("An incompatible element was found in the raw box."); + } + } + + private static void genericConversion() { + try { + String shouldBeNull = convertInstanceOfObject(123); + } catch (ClassCastException e) { + System.out.println("Should have been null, but due to type erasure, inside convertInstanceOfObject, " + + "it will attempt to cast to Object instead of String, so it casts to Object, which is always possible."); + } + } + + public static T convertInstanceOfObject(Object o) { + try { + return (T) o; + } catch (ClassCastException e) { + return null; + } + } + + public interface Animal { + } + + public static class Reptile implements Animal { + } + + public static class Frog extends Reptile { + } + + public static class Mammal implements Animal { + } + + public static class Box { + private T content; + + public T getContent() { + return content; + } + + public void setContent(T content) { + this.content = content; + } + } +} From 6a82d1cde60aeca86944d3ce7a86346ba93ee389 Mon Sep 17 00:00:00 2001 From: Cristian Stancalau Date: Mon, 12 Oct 2020 16:37:08 +0300 Subject: [PATCH 134/302] Reformat --- .../com/baeldung/exceptions/classcastexception/Main.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java index ef891ccde6..a92c9c6d74 100644 --- a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java @@ -5,16 +5,13 @@ import java.io.Serializable; public class Main { public static void main(String[] args) { - checkedCasts(); uncheckedConversion(); genericConversion(); } private static void checkedCasts() { - Animal animal = new Frog(); - try { Mammal mammal = (Mammal) animal; } catch (ClassCastException e) { @@ -28,7 +25,6 @@ public class Main { } Object primitives = new int[1]; - try { Integer[] integers = (Integer[]) primitives; } catch (ClassCastException e) { @@ -94,4 +90,5 @@ public class Main { this.content = content; } } + } From 453327db2b1385477d8d4d3982156dd1bcd937dd Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Mon, 12 Oct 2020 18:49:59 +0200 Subject: [PATCH 135/302] Upgrade Gatling versions --- testing-modules/load-testing-comparison/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing-modules/load-testing-comparison/pom.xml b/testing-modules/load-testing-comparison/pom.xml index adc768b563..55e94379db 100644 --- a/testing-modules/load-testing-comparison/pom.xml +++ b/testing-modules/load-testing-comparison/pom.xml @@ -117,10 +117,10 @@ 1.8 1.8 UTF-8 - 2.11.12 - 2.2.5 - 3.2.2 - 2.2.1 + 2.12.12 + 3.4.0 + 4.4.0 + 3.1.0 5.0 From c608c133f64b708b4fa3dcc6afba60723c1080ea Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Mon, 12 Oct 2020 18:50:26 +0200 Subject: [PATCH 136/302] Remove extra headers as the other tools don't set them and that's extra traffic --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 5 ----- 1 file changed, 5 deletions(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index 15d86ebedb..050c99d9d4 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -10,11 +10,6 @@ class RewardsScenario extends Simulation { def randCustId() = java.util.concurrent.ThreadLocalRandom.current().nextInt(1, 10000) val httpProtocol = http.baseUrl("http://localhost:8080") - .acceptHeader("text/html,application/json;q=0.9,*/*;q=0.8") - .doNotTrackHeader("1") - .acceptLanguageHeader("en-US,en;q=0.5") - .acceptEncodingHeader("gzip, deflate") - .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0") val scn = scenario("RewardsScenario") .repeat(100){ From 024da8003bb3c445e32b8d57bed5edd6a756dcbb Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Mon, 12 Oct 2020 18:51:09 +0200 Subject: [PATCH 137/302] Remove RNG upper bound like in Grinder test to avoid race condition in application under test --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index 050c99d9d4..540e40a225 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -7,7 +7,7 @@ import scala.concurrent.duration._ class RewardsScenario extends Simulation { - def randCustId() = java.util.concurrent.ThreadLocalRandom.current().nextInt(1, 10000) + def randCustId() = java.util.concurrent.ThreadLocalRandom.current().nextInt() val httpProtocol = http.baseUrl("http://localhost:8080") From 775f790d1d3f6a19db6a1521a3d5d7c22264e950 Mon Sep 17 00:00:00 2001 From: Amit Pandey Date: Mon, 12 Oct 2020 23:37:44 +0530 Subject: [PATCH 138/302] renamed junit test case to manual test case (#10154) --- .../{OpenfeignUnitTest.java => OpenfeignManualTest.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spring-cloud/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/{OpenfeignUnitTest.java => OpenfeignManualTest.java} (100%) diff --git a/spring-cloud/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/OpenfeignUnitTest.java b/spring-cloud/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/OpenfeignManualTest.java similarity index 100% rename from spring-cloud/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/OpenfeignUnitTest.java rename to spring-cloud/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/OpenfeignManualTest.java From f0b9b3db29ccb0b59b7cbefb219c0584a06278bd Mon Sep 17 00:00:00 2001 From: sharifi Date: Mon, 12 Oct 2020 23:07:48 +0330 Subject: [PATCH 139/302] separate directories --- .../DispatchServletApplication.java | 15 ++++++++++ .../dispatchservlet/conf/WebConf.java | 29 ++++++++++++++++++ .../controller/Controller.java | 15 ++++++++++ .../dispatchservlet/filter/CustomFilter.java | 30 +++++++++++++++++++ .../listener/CustomListener.java | 22 ++++++++++++++ .../servlet/CustomServlet.java | 29 ++++++++++++++++++ 6 files changed, 140 insertions(+) create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/DispatchServletApplication.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/conf/WebConf.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/controller/Controller.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/filter/CustomFilter.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/listener/CustomListener.java create mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/servlet/CustomServlet.java diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/DispatchServletApplication.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/DispatchServletApplication.java new file mode 100644 index 0000000000..4d58715d88 --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/DispatchServletApplication.java @@ -0,0 +1,15 @@ +package com.baeldung.dispatchservlet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.context.annotation.Configuration; + +@SpringBootApplication +public class DispatchServletApplication { + + public static void main(String[] args) { + SpringApplication.run(DispatchServletApplication.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/conf/WebConf.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/conf/WebConf.java new file mode 100644 index 0000000000..9a1170ca34 --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/conf/WebConf.java @@ -0,0 +1,29 @@ +package com.baeldung.dispatchservlet.conf; + +import com.baeldung.dispatchservlet.listener.CustomListener; +import com.baeldung.dispatchservlet.servlet.CustomServlet; +import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.ServletContextListener; + +@Configuration +public class WebConf { + + @Bean + public ServletRegistrationBean customServletBean() { + ServletRegistrationBean bean = + new ServletRegistrationBean(new CustomServlet(), "/servlet"); + return bean; + } + + @Bean + public ServletListenerRegistrationBean customListenerBean() { + ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean(); + bean.setListener(new CustomListener()); + return bean; + } + +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/controller/Controller.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/controller/Controller.java new file mode 100644 index 0000000000..14d71c60fb --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/controller/Controller.java @@ -0,0 +1,15 @@ +package com.baeldung.dispatchservlet.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = "/") +public class Controller { + + @GetMapping + public String getRequest(){ + return "Baeldung DispatcherServlet"; + } +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/filter/CustomFilter.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/filter/CustomFilter.java new file mode 100644 index 0000000000..8429fc855f --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/filter/CustomFilter.java @@ -0,0 +1,30 @@ +package com.baeldung.dispatchservlet.filter; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import javax.servlet.*; +import java.io.IOException; + +@Component +public class CustomFilter implements Filter { + + Logger logger = LoggerFactory.getLogger(CustomFilter.class); + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + logger.info("CustomFilter is invoked"); + chain.doFilter(request, response); + } + + @Override + public void destroy() { + + } +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/listener/CustomListener.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/listener/CustomListener.java new file mode 100644 index 0000000000..62b316c012 --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/listener/CustomListener.java @@ -0,0 +1,22 @@ +package com.baeldung.dispatchservlet.listener; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +public class CustomListener implements ServletContextListener { + + Logger logger = LoggerFactory.getLogger(CustomListener.class); + + @Override + public void contextInitialized(ServletContextEvent sce) { + logger.info("CustomListener is initialized"); + } + + @Override + public void contextDestroyed(ServletContextEvent sce) { + logger.info("CustomListener is destroyed"); + } +} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/servlet/CustomServlet.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/servlet/CustomServlet.java new file mode 100644 index 0000000000..2a99e797ce --- /dev/null +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/dispatchservlet/servlet/CustomServlet.java @@ -0,0 +1,29 @@ +package com.baeldung.dispatchservlet.servlet; + +import com.baeldung.dispatchservlet.filter.CustomFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class CustomServlet extends HttpServlet { + + Logger logger = LoggerFactory.getLogger(CustomServlet.class); + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + logger.info("CustomServlet doGet() method is invoked"); + super.doGet(req, resp); + } + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + logger.info("CustomServlet doPost() method is invoked"); + super.doPost(req, resp); + } +} From 450614d511d5d3c2ce42b78cc9881d9b60ffc5c3 Mon Sep 17 00:00:00 2001 From: Loredana Date: Tue, 13 Oct 2020 16:44:18 +0300 Subject: [PATCH 140/302] update loops count JAVA-2603 --- .../src/main/resources/scripts/Gatling/GatlingScenario.scala | 2 +- .../src/main/resources/scripts/JMeter/Test Plan.jmx | 4 ++-- .../src/main/resources/scripts/The Grinder/grinder.properties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index 540e40a225..fc639881f5 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -12,7 +12,7 @@ class RewardsScenario extends Simulation { val httpProtocol = http.baseUrl("http://localhost:8080") val scn = scenario("RewardsScenario") - .repeat(100){ + .repeat(1000){ exec(http("transactions_add") .post("/transactions/add/") diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx b/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx index 413a8d3387..cbb036b77b 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx @@ -16,7 +16,7 @@ continue false - 100 + 1000 100 0 @@ -200,7 +200,7 @@ - 10000 + 9223372036854775806 1 false diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties index f256f5a7dd..ca5969cb7a 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties @@ -1,5 +1,5 @@ grinder.script = grinder.py grinder.threads = 100 grinder.processes = 1 -grinder.runs = 100 +grinder.runs = 1000 grinder.logDirectory = /logs From 3e25eae6513fe63ea36ec29995aeba263ec05f59 Mon Sep 17 00:00:00 2001 From: mikr Date: Tue, 13 Oct 2020 18:46:25 +0200 Subject: [PATCH 141/302] JAVA-2136 Fix integration test in spring-jersey module --- spring-jersey/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-jersey/pom.xml b/spring-jersey/pom.xml index 3c84e9c11e..50d377b73f 100644 --- a/spring-jersey/pom.xml +++ b/spring-jersey/pom.xml @@ -226,7 +226,7 @@ 4.4.9 4.5.5 4.0.0 - 2.25.1 + 2.27.2 3.10.0 1.5.10.RELEASE From eeadbb04f0521eb0db15f908be861320a04ad8f7 Mon Sep 17 00:00:00 2001 From: sharifi Date: Wed, 14 Oct 2020 15:32:29 +0330 Subject: [PATCH 142/302] delete the original classes related to separate the directories --- .../DispatchServletApplication.java | 15 ---------- .../conf/WebConf.java | 29 ------------------ .../controller/Controller.java | 15 ---------- .../filter/CustomFilter.java | 30 ------------------- .../listener/CustomListener.java | 22 -------------- .../servlet/CustomServlet.java | 29 ------------------ 6 files changed, 140 deletions(-) delete mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/DispatchServletApplication.java delete mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/conf/WebConf.java delete mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/controller/Controller.java delete mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/filter/CustomFilter.java delete mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/listener/CustomListener.java delete mode 100644 spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/servlet/CustomServlet.java diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/DispatchServletApplication.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/DispatchServletApplication.java deleted file mode 100644 index 4d58715d88..0000000000 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/DispatchServletApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.dispatchservlet; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.ServletComponentScan; -import org.springframework.context.annotation.Configuration; - -@SpringBootApplication -public class DispatchServletApplication { - - public static void main(String[] args) { - SpringApplication.run(DispatchServletApplication.class, args); - } - -} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/conf/WebConf.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/conf/WebConf.java deleted file mode 100644 index 9a1170ca34..0000000000 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/conf/WebConf.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.baeldung.dispatchservlet.conf; - -import com.baeldung.dispatchservlet.listener.CustomListener; -import com.baeldung.dispatchservlet.servlet.CustomServlet; -import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; -import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import javax.servlet.ServletContextListener; - -@Configuration -public class WebConf { - - @Bean - public ServletRegistrationBean customServletBean() { - ServletRegistrationBean bean = - new ServletRegistrationBean(new CustomServlet(), "/servlet"); - return bean; - } - - @Bean - public ServletListenerRegistrationBean customListenerBean() { - ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean(); - bean.setListener(new CustomListener()); - return bean; - } - -} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/controller/Controller.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/controller/Controller.java deleted file mode 100644 index 14d71c60fb..0000000000 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/controller/Controller.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.dispatchservlet.controller; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping(value = "/") -public class Controller { - - @GetMapping - public String getRequest(){ - return "Baeldung DispatcherServlet"; - } -} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/filter/CustomFilter.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/filter/CustomFilter.java deleted file mode 100644 index 8429fc855f..0000000000 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/filter/CustomFilter.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.dispatchservlet.filter; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.servlet.*; -import java.io.IOException; - -@Component -public class CustomFilter implements Filter { - - Logger logger = LoggerFactory.getLogger(CustomFilter.class); - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - logger.info("CustomFilter is invoked"); - chain.doFilter(request, response); - } - - @Override - public void destroy() { - - } -} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/listener/CustomListener.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/listener/CustomListener.java deleted file mode 100644 index 62b316c012..0000000000 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/listener/CustomListener.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.baeldung.dispatchservlet.listener; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -public class CustomListener implements ServletContextListener { - - Logger logger = LoggerFactory.getLogger(CustomListener.class); - - @Override - public void contextInitialized(ServletContextEvent sce) { - logger.info("CustomListener is initialized"); - } - - @Override - public void contextDestroyed(ServletContextEvent sce) { - logger.info("CustomListener is destroyed"); - } -} diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/servlet/CustomServlet.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/servlet/CustomServlet.java deleted file mode 100644 index 2a99e797ce..0000000000 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com.baeldung.dispatchservlet/servlet/CustomServlet.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.baeldung.dispatchservlet.servlet; - -import com.baeldung.dispatchservlet.filter.CustomFilter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class CustomServlet extends HttpServlet { - - Logger logger = LoggerFactory.getLogger(CustomServlet.class); - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - logger.info("CustomServlet doGet() method is invoked"); - super.doGet(req, resp); - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - logger.info("CustomServlet doPost() method is invoked"); - super.doPost(req, resp); - } -} From 5a05897688ce4c64c02f2fc35cb3d4640ed49974 Mon Sep 17 00:00:00 2001 From: Loredana Date: Wed, 14 Oct 2020 16:16:17 +0300 Subject: [PATCH 143/302] revert explicit junit, maven version overrides for boot projects --- persistence-modules/flyway-repair/pom.xml | 4 ---- persistence-modules/flyway/pom.xml | 4 ---- persistence-modules/r2dbc/pom.xml | 4 ---- persistence-modules/redis/pom.xml | 4 ---- persistence-modules/spring-boot-mysql/pom.xml | 4 ---- persistence-modules/spring-boot-persistence-h2/pom.xml | 4 ---- .../spring-boot-persistence-mongodb/pom.xml | 4 ---- persistence-modules/spring-boot-persistence/pom.xml | 5 ----- persistence-modules/spring-data-cassandra-reactive/pom.xml | 4 ---- persistence-modules/spring-data-cassandra/pom.xml | 4 ---- persistence-modules/spring-data-cosmosdb/pom.xml | 4 ---- persistence-modules/spring-data-dynamodb/pom.xml | 5 ----- persistence-modules/spring-data-elasticsearch/pom.xml | 5 ----- persistence-modules/spring-data-jdbc/pom.xml | 4 ---- persistence-modules/spring-data-jpa-annotations/pom.xml | 4 ---- persistence-modules/spring-data-jpa-crud/pom.xml | 5 ----- persistence-modules/spring-data-jpa-enterprise/pom.xml | 4 ---- persistence-modules/spring-data-jpa-filtering/pom.xml | 4 ---- persistence-modules/spring-data-jpa-query-2/pom.xml | 4 ---- persistence-modules/spring-data-jpa-query/pom.xml | 4 ---- persistence-modules/spring-data-jpa-repo-2/pom.xml | 4 ---- persistence-modules/spring-data-jpa-repo/pom.xml | 5 +---- persistence-modules/spring-data-keyvalue/pom.xml | 5 +---- persistence-modules/spring-data-mongodb/pom.xml | 4 ---- persistence-modules/spring-data-redis/pom.xml | 5 ----- persistence-modules/spring-data-solr/pom.xml | 4 ---- persistence-modules/spring-jdbc/pom.xml | 7 ------- 27 files changed, 2 insertions(+), 116 deletions(-) diff --git a/persistence-modules/flyway-repair/pom.xml b/persistence-modules/flyway-repair/pom.xml index 82e5d705f9..2c283cfc04 100644 --- a/persistence-modules/flyway-repair/pom.xml +++ b/persistence-modules/flyway-repair/pom.xml @@ -76,10 +76,6 @@ src/main/resources/application-${spring-boot.run.profiles}.properties - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/flyway/pom.xml b/persistence-modules/flyway/pom.xml index 2379f996d7..c4a3363bdc 100644 --- a/persistence-modules/flyway/pom.xml +++ b/persistence-modules/flyway/pom.xml @@ -66,10 +66,6 @@ 5.2.3 5.0.2 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/r2dbc/pom.xml b/persistence-modules/r2dbc/pom.xml index 7083eea64d..01f1b351cd 100644 --- a/persistence-modules/r2dbc/pom.xml +++ b/persistence-modules/r2dbc/pom.xml @@ -69,10 +69,6 @@ 0.8.1.RELEASE 1.4.200 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/redis/pom.xml b/persistence-modules/redis/pom.xml index 9e00566767..fa82bebc64 100644 --- a/persistence-modules/redis/pom.xml +++ b/persistence-modules/redis/pom.xml @@ -62,10 +62,6 @@ 3.3.0 4.1.50.Final - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-boot-mysql/pom.xml b/persistence-modules/spring-boot-mysql/pom.xml index 9b8c6d0028..834d1d1e64 100644 --- a/persistence-modules/spring-boot-mysql/pom.xml +++ b/persistence-modules/spring-boot-mysql/pom.xml @@ -40,10 +40,6 @@ 8.0.12 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-boot-persistence-h2/pom.xml b/persistence-modules/spring-boot-persistence-h2/pom.xml index 23520a3fda..c06c35cfee 100644 --- a/persistence-modules/spring-boot-persistence-h2/pom.xml +++ b/persistence-modules/spring-boot-persistence-h2/pom.xml @@ -47,10 +47,6 @@ com.baeldung.h2db.demo.server.SpringBootApp 1.0.4 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-boot-persistence-mongodb/pom.xml b/persistence-modules/spring-boot-persistence-mongodb/pom.xml index 69ef09356d..5167483aa3 100644 --- a/persistence-modules/spring-boot-persistence-mongodb/pom.xml +++ b/persistence-modules/spring-boot-persistence-mongodb/pom.xml @@ -37,9 +37,5 @@ - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index b034f6dad9..9e44a7b9c1 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -76,11 +76,6 @@ 2.23.0 2.0.1.Final - - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-cassandra-reactive/pom.xml b/persistence-modules/spring-data-cassandra-reactive/pom.xml index 42329e03f0..f2f71bceac 100644 --- a/persistence-modules/spring-data-cassandra-reactive/pom.xml +++ b/persistence-modules/spring-data-cassandra-reactive/pom.xml @@ -54,10 +54,6 @@ 2.2.6.RELEASE 3.11.2.0 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-cassandra/pom.xml b/persistence-modules/spring-data-cassandra/pom.xml index a56d067a05..9de1cbf20e 100644 --- a/persistence-modules/spring-data-cassandra/pom.xml +++ b/persistence-modules/spring-data-cassandra/pom.xml @@ -105,10 +105,6 @@ 2.1.9.2 2.0-0 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-cosmosdb/pom.xml b/persistence-modules/spring-data-cosmosdb/pom.xml index 0f9e8ac72f..19a66648b2 100644 --- a/persistence-modules/spring-data-cosmosdb/pom.xml +++ b/persistence-modules/spring-data-cosmosdb/pom.xml @@ -17,10 +17,6 @@ 1.8 2.3.0 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index 0f4b578088..377e35b635 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -182,11 +182,6 @@ 1.11.86 https://s3-us-west-2.amazonaws.com/dynamodb-local/release 3.1.1 - - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-elasticsearch/pom.xml b/persistence-modules/spring-data-elasticsearch/pom.xml index c94962d39d..6a983145ee 100644 --- a/persistence-modules/spring-data-elasticsearch/pom.xml +++ b/persistence-modules/spring-data-elasticsearch/pom.xml @@ -69,10 +69,5 @@ 1.2.47 0.7 1.15.0 - - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/persistence-modules/spring-data-jdbc/pom.xml b/persistence-modules/spring-data-jdbc/pom.xml index eca8037e20..15f8d7fb95 100644 --- a/persistence-modules/spring-data-jdbc/pom.xml +++ b/persistence-modules/spring-data-jdbc/pom.xml @@ -28,9 +28,5 @@ - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-jpa-annotations/pom.xml b/persistence-modules/spring-data-jpa-annotations/pom.xml index ea2fe34f3c..ff30790eaf 100644 --- a/persistence-modules/spring-data-jpa-annotations/pom.xml +++ b/persistence-modules/spring-data-jpa-annotations/pom.xml @@ -73,10 +73,6 @@ 42.2.5 21.0 - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-crud/pom.xml b/persistence-modules/spring-data-jpa-crud/pom.xml index 44944298e0..1708d14fc2 100644 --- a/persistence-modules/spring-data-jpa-crud/pom.xml +++ b/persistence-modules/spring-data-jpa-crud/pom.xml @@ -66,11 +66,6 @@ 1.4.1 21.0 1.12.2 - - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-jpa-enterprise/pom.xml b/persistence-modules/spring-data-jpa-enterprise/pom.xml index 9ecab5feaa..7ff2f00fdf 100644 --- a/persistence-modules/spring-data-jpa-enterprise/pom.xml +++ b/persistence-modules/spring-data-jpa-enterprise/pom.xml @@ -99,10 +99,6 @@ 21.0 1.12.2 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-jpa-filtering/pom.xml b/persistence-modules/spring-data-jpa-filtering/pom.xml index 7448a5a818..25ef68fe4c 100644 --- a/persistence-modules/spring-data-jpa-filtering/pom.xml +++ b/persistence-modules/spring-data-jpa-filtering/pom.xml @@ -73,10 +73,6 @@ 42.2.5 21.0 - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/pom.xml b/persistence-modules/spring-data-jpa-query-2/pom.xml index abac7b28da..282a1ff83a 100644 --- a/persistence-modules/spring-data-jpa-query-2/pom.xml +++ b/persistence-modules/spring-data-jpa-query-2/pom.xml @@ -84,10 +84,6 @@ - - 2.22.2 - 5.6.2 - 4.13 9.0.0.M26 1.1 21.0 diff --git a/persistence-modules/spring-data-jpa-query/pom.xml b/persistence-modules/spring-data-jpa-query/pom.xml index fe42d4b595..1576fd729d 100644 --- a/persistence-modules/spring-data-jpa-query/pom.xml +++ b/persistence-modules/spring-data-jpa-query/pom.xml @@ -44,10 +44,6 @@ 1.4.1 - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-repo-2/pom.xml b/persistence-modules/spring-data-jpa-repo-2/pom.xml index 98ecdc6645..3be1068d8c 100644 --- a/persistence-modules/spring-data-jpa-repo-2/pom.xml +++ b/persistence-modules/spring-data-jpa-repo-2/pom.xml @@ -44,9 +44,5 @@ 29.0-jre - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-repo/pom.xml b/persistence-modules/spring-data-jpa-repo/pom.xml index 07514e9771..16a214fd7f 100644 --- a/persistence-modules/spring-data-jpa-repo/pom.xml +++ b/persistence-modules/spring-data-jpa-repo/pom.xml @@ -50,9 +50,6 @@ - - 2.22.2 - 5.6.2 - 4.13 + \ No newline at end of file diff --git a/persistence-modules/spring-data-keyvalue/pom.xml b/persistence-modules/spring-data-keyvalue/pom.xml index 190d6c7445..3aaee2f00c 100644 --- a/persistence-modules/spring-data-keyvalue/pom.xml +++ b/persistence-modules/spring-data-keyvalue/pom.xml @@ -29,9 +29,6 @@ - - 2.22.2 - 5.6.2 - 4.13 + \ No newline at end of file diff --git a/persistence-modules/spring-data-mongodb/pom.xml b/persistence-modules/spring-data-mongodb/pom.xml index a3a81fe450..448b635667 100644 --- a/persistence-modules/spring-data-mongodb/pom.xml +++ b/persistence-modules/spring-data-mongodb/pom.xml @@ -108,10 +108,6 @@ 3.2.0.RELEASE 4.0.5 - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index 34674dc223..d271df31c7 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -98,11 +98,6 @@ 3.2.4 0.10.0 0.6 - - - 2.22.2 - 5.6.2 - 4.13 diff --git a/persistence-modules/spring-data-solr/pom.xml b/persistence-modules/spring-data-solr/pom.xml index 94a796c466..38b5bf8238 100644 --- a/persistence-modules/spring-data-solr/pom.xml +++ b/persistence-modules/spring-data-solr/pom.xml @@ -46,10 +46,6 @@ 2.0.5.RELEASE - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file diff --git a/persistence-modules/spring-jdbc/pom.xml b/persistence-modules/spring-jdbc/pom.xml index 77200cd66e..8a5786e1a5 100644 --- a/persistence-modules/spring-jdbc/pom.xml +++ b/persistence-modules/spring-jdbc/pom.xml @@ -18,7 +18,6 @@ org.springframework.data spring-data-jdbc - ${spring-data-jdbc.version} org.springframework.boot @@ -36,11 +35,5 @@ - 2.0.3.RELEASE - - - 2.22.2 - 5.6.2 - 4.13 \ No newline at end of file From e3dc0a40d4b16e8bd49d35813f4857f9ef0faff5 Mon Sep 17 00:00:00 2001 From: Loredana Date: Wed, 14 Oct 2020 16:24:30 +0300 Subject: [PATCH 144/302] revert explicit junit, maven version overrides for boot projects --- ddd/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ddd/pom.xml b/ddd/pom.xml index a67719f8a6..7d03208802 100644 --- a/ddd/pom.xml +++ b/ddd/pom.xml @@ -104,16 +104,12 @@ org.apache.maven.plugins maven-surefire-plugin - ${maven-surefire-plugin.version} - 2.22.2 - 1.0.1 - 5.6.2 From af0db9610ed916123ddc695266effbb81793203f Mon Sep 17 00:00:00 2001 From: Cristian Stancalau Date: Wed, 14 Oct 2020 18:22:32 +0300 Subject: [PATCH 145/302] Fix review suggestions. --- .../exceptions/classcastexception/Animal.java | 6 ++ .../exceptions/classcastexception/Box.java | 14 +++ .../exceptions/classcastexception/Frog.java | 9 ++ .../exceptions/classcastexception/Main.java | 94 ------------------- .../exceptions/classcastexception/Mammal.java | 9 ++ .../classcastexception/Reptile.java | 9 ++ .../CheckedCastsUnitTest.java | 40 ++++++++ .../GenericConversionUnitTest.java | 21 +++++ .../UncheckedConversionUnitTest.java | 17 ++++ 9 files changed, 125 insertions(+), 94 deletions(-) create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Animal.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Box.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Frog.java delete mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Mammal.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Reptile.java create mode 100644 core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/CheckedCastsUnitTest.java create mode 100644 core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/GenericConversionUnitTest.java create mode 100644 core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/UncheckedConversionUnitTest.java diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Animal.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Animal.java new file mode 100644 index 0000000000..b57f68f053 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Animal.java @@ -0,0 +1,6 @@ +package com.baeldung.exceptions.classcastexception; + +public interface Animal { + + String getName(); +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Box.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Box.java new file mode 100644 index 0000000000..bb67407218 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Box.java @@ -0,0 +1,14 @@ +package com.baeldung.exceptions.classcastexception; + +public class Box { + + private T content; + + public T getContent() { + return content; + } + + public void setContent(T content) { + this.content = content; + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Frog.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Frog.java new file mode 100644 index 0000000000..0a0b2d1f63 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Frog.java @@ -0,0 +1,9 @@ +package com.baeldung.exceptions.classcastexception; + +public class Frog extends Reptile { + + @Override + public String getName() { + return super.getName() + ": Frog"; + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java deleted file mode 100644 index a92c9c6d74..0000000000 --- a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Main.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.baeldung.exceptions.classcastexception; - -import java.io.Serializable; - -public class Main { - - public static void main(String[] args) { - checkedCasts(); - uncheckedConversion(); - genericConversion(); - } - - private static void checkedCasts() { - Animal animal = new Frog(); - try { - Mammal mammal = (Mammal) animal; - } catch (ClassCastException e) { - System.out.println("A checked downcast to Mammal is incompatible from Frog because Frog is not a subtype of Mammal."); - } - - try { - Serializable serial = (Serializable) animal; - } catch (ClassCastException e) { - System.out.println("A checked cast to Serializable is incompatible from Frog because Frog is not a subtype of Serializable."); - } - - Object primitives = new int[1]; - try { - Integer[] integers = (Integer[]) primitives; - } catch (ClassCastException e) { - System.out.println("A checked cast to Integer[] is incompatible from primitive arrays. Auto-boxing does not work for arrays."); - } - - try { - long[] longs = (long[]) primitives; - } catch (ClassCastException e) { - System.out.println("A checked cast to long[] is incompatible from int[]. Type promotion does not work for arrays."); - } - } - - private static void uncheckedConversion() { - Box originalBox = new Box<>(); - Box raw = originalBox; - raw.setContent(2.5); - Box bound = (Box) raw; - try { - Long content = bound.getContent(); - } catch (ClassCastException e) { - System.out.println("An incompatible element was found in the raw box."); - } - } - - private static void genericConversion() { - try { - String shouldBeNull = convertInstanceOfObject(123); - } catch (ClassCastException e) { - System.out.println("Should have been null, but due to type erasure, inside convertInstanceOfObject, " + - "it will attempt to cast to Object instead of String, so it casts to Object, which is always possible."); - } - } - - public static T convertInstanceOfObject(Object o) { - try { - return (T) o; - } catch (ClassCastException e) { - return null; - } - } - - public interface Animal { - } - - public static class Reptile implements Animal { - } - - public static class Frog extends Reptile { - } - - public static class Mammal implements Animal { - } - - public static class Box { - private T content; - - public T getContent() { - return content; - } - - public void setContent(T content) { - this.content = content; - } - } - -} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Mammal.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Mammal.java new file mode 100644 index 0000000000..2723cc5b7b --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Mammal.java @@ -0,0 +1,9 @@ +package com.baeldung.exceptions.classcastexception; + +public class Mammal implements Animal { + + @Override + public String getName() { + return "Mammal"; + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Reptile.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Reptile.java new file mode 100644 index 0000000000..ed4b0273e5 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/classcastexception/Reptile.java @@ -0,0 +1,9 @@ +package com.baeldung.exceptions.classcastexception; + +public class Reptile implements Animal { + + @Override + public String getName() { + return "Reptile"; + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/CheckedCastsUnitTest.java b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/CheckedCastsUnitTest.java new file mode 100644 index 0000000000..7fac000fa8 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/CheckedCastsUnitTest.java @@ -0,0 +1,40 @@ +package com.baeldung.exceptions.classcastexception; + +import org.junit.Test; + +import java.io.Serializable; + +public class CheckedCastsUnitTest { + + @Test(expected = ClassCastException.class) + public void givenBaseTypeVariableReferencingChildInstance_whenCastToIncompatibleSubtype_thenClassCastException() { + Animal animal = new Frog(); + + //A checked downcast to Mammal is incompatible from Frog because Frog is not a subtype of Mammal. + Mammal mammal = (Mammal) animal; + } + + @Test(expected = ClassCastException.class) + public void givenBaseTypeVariableReferencingChildInstance_whenCastToIncompatibleInterface_thenClassCastException() { + Animal animal = new Frog(); + + //A checked cast to Serializable is incompatible from Frog because Frog is not a subtype of Serializable. + Serializable serial = (Serializable) animal; + } + + @Test(expected = ClassCastException.class) + public void givenObjectVariableReferencingPrimitiveArray_whenCastToBoxedTypeArray_thenClassCastException() { + Object primitives = new int[1]; + + //A checked cast to Integer[] is incompatible from primitive arrays. Auto-boxing does not work for arrays. + Integer[] integers = (Integer[]) primitives; + } + + @Test(expected = ClassCastException.class) + public void givenObjectVariableReferencingPrimitiveArray_whenCastToPromotedTypeArray_thenClassCastException() { + Object primitives = new int[1]; + + //A checked cast to long[] is incompatible from int[]. Type promotion does not work for arrays. + long[] longs = (long[]) primitives; + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/GenericConversionUnitTest.java b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/GenericConversionUnitTest.java new file mode 100644 index 0000000000..027ece2db7 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/GenericConversionUnitTest.java @@ -0,0 +1,21 @@ +package com.baeldung.exceptions.classcastexception; + +import org.junit.Test; + +public class GenericConversionUnitTest { + + @Test(expected = ClassCastException.class) + public void givenIncompatibleType_whenConvertInstanceOfObject_thenClassCastException() { + // Should have been null, but due to type erasure, inside convertInstanceOfObject, + // it will attempt to cast to Object instead of String, so it casts to Object, which is always possible. + String shouldBeNull = convertInstanceOfObject(123); + } + + public static T convertInstanceOfObject(Object o) { + try { + return (T) o; // Casts to Object due to type erasure + } catch (ClassCastException e) { + return null; // Will never reach this + } + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/UncheckedConversionUnitTest.java b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/UncheckedConversionUnitTest.java new file mode 100644 index 0000000000..60e7d5a147 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/classcastexception/UncheckedConversionUnitTest.java @@ -0,0 +1,17 @@ +package com.baeldung.exceptions.classcastexception; + +import org.junit.Test; + +public class UncheckedConversionUnitTest { + + @Test(expected = ClassCastException.class) + public void givenPollutedGenericType_whenGetProperty_thenClassCastException() { + Box originalBox = new Box<>(); + Box raw = originalBox; + raw.setContent(2.5); + Box bound = (Box) raw; + + //An incompatible element was found in the raw box. + Long content = bound.getContent(); + } +} From bbdf2ae68606b19dedd331453375fadc9dbc315c Mon Sep 17 00:00:00 2001 From: "mateusz.szablak" Date: Thu, 15 Oct 2020 16:08:49 +0200 Subject: [PATCH 146/302] BAEL-4212 (String) or .toString()? - code + tests --- .../baeldung/tostring/StringCastUtils.java | 10 ++ .../baeldung/tostring/ToStringUnitTest.java | 92 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 core-java-modules/core-java-string-operations-3/src/main/java/com/baeldung/tostring/StringCastUtils.java create mode 100644 core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/tostring/ToStringUnitTest.java diff --git a/core-java-modules/core-java-string-operations-3/src/main/java/com/baeldung/tostring/StringCastUtils.java b/core-java-modules/core-java-string-operations-3/src/main/java/com/baeldung/tostring/StringCastUtils.java new file mode 100644 index 0000000000..056f961ea4 --- /dev/null +++ b/core-java-modules/core-java-string-operations-3/src/main/java/com/baeldung/tostring/StringCastUtils.java @@ -0,0 +1,10 @@ +package com.baeldung.tostring; + +public class StringCastUtils { + public static String castToString(Object object) { + if (object instanceof String) { + return (String) object; + } + return null; + } +} diff --git a/core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/tostring/ToStringUnitTest.java b/core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/tostring/ToStringUnitTest.java new file mode 100644 index 0000000000..88202e1797 --- /dev/null +++ b/core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/tostring/ToStringUnitTest.java @@ -0,0 +1,92 @@ +package com.baeldung.tostring; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class ToStringUnitTest { + @Test + public void givenString_whenCastToObjectAndString_thenSameAndNoException() { + String input = "baeldung"; + + Object obj = input; + String str = (String) obj; + + assertEquals(obj, str); + assertEquals(str, input); + assertSame(input, str); + } + + @Test(expected = ClassCastException.class) + public void givenIntegerObject_whenCastToObjectAndString_thenCastClassException() { + Integer input = 1234; + + Object obj = input; + String str = (String) obj; + } + + @Test + public void givenNullInteger_whenCastToObjectAndString_thenSameAndNoException() { + Integer input = null; + + Object obj = input; + String str = (String) obj; + + assertEquals(obj, str); + assertEquals(str, input); + assertSame(input, str); + } + + @Test(expected = NullPointerException.class) + public void givenNullInteger_whenToString_thenNullPointerException() { + Integer input = null; + + String str = input.toString(); + } + + @Test + public void givenInteger_whenCastToObject_thenToStringEquals() { + Integer input = 1234; + + Object obj = input; + + assertEquals("1234", input.toString()); + assertEquals("1234", obj.toString()); + assertEquals(input.toString(), obj.toString()); + } + + @Test + public void givenString_whenToString_thenSame() { + String str = "baeldung"; + + assertEquals("baeldung", str.toString()); + assertSame(str, str.toString()); + } + + @Test + public void givenString_whenCastToObject_thenCastToStringReturnsSame() { + String input = "baeldung"; + + Object obj = input; + + assertSame(input, StringCastUtils.castToString(obj)); + } + + @Test + public void givenInteger_whenCastToObject_thenCastToStringReturnsNull() { + Integer input = 1234; + + Object obj = input; + + assertEquals(null, StringCastUtils.castToString(obj)); + } + + @Test + public void givenIntegerNull_whenCastToObject_thenCastToStringReturnsNull() { + Integer input = null; + + Object obj = input; + + assertEquals(null, StringCastUtils.castToString(obj)); + } +} From 84d2b3a0f532302c36e05475859fb42ecfae39bf Mon Sep 17 00:00:00 2001 From: Stephane Landelle Date: Thu, 15 Oct 2020 16:26:35 +0200 Subject: [PATCH 147/302] Fix JSON payloads in the Gatling script Motivation: Ids are numbers (Integers), not Strings. Modifications: Remove wrong wrapping double quotes. Result: Less parsing overhead on the server side. --- .../main/resources/scripts/Gatling/GatlingScenario.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala index fc639881f5..e8cc608e42 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -16,7 +16,7 @@ class RewardsScenario extends Simulation { exec(http("transactions_add") .post("/transactions/add/") - .body(StringBody(_ => s"""{ "customerRewardsId":null,"customerId":"${randCustId()}","transactionDate":null }""")).asJson + .body(StringBody(_ => s"""{"customerRewardsId":null,"customerId":${randCustId()},"transactionDate":null}""")).asJson .check(jsonPath("$.id").saveAs("txnId")) .check(jsonPath("$.transactionDate").saveAs("txtDate")) .check(jsonPath("$.customerId").saveAs("custId"))) @@ -28,13 +28,13 @@ class RewardsScenario extends Simulation { .doIf("${rwdId.isUndefined()}"){ exec(http("rewards_add") .post("/rewards/add") - .body(StringBody("""{ "customerId": "${custId}" }""")).asJson + .body(StringBody("""{"customerId":${custId}}""")).asJson .check(jsonPath("$.id").saveAs("rwdId"))) } .exec(http("transactions_update") .post("/transactions/add/") - .body(StringBody("""{ "customerRewardsId":"${rwdId}","customerId":"${custId}","transactionDate":"${txtDate}" }""")).asJson) + .body(StringBody("""{"customerRewardsId":${rwdId},"customerId":${custId},"transactionDate":"${txtDate}" }""")).asJson) .exec(http("get_transactions") .get("/transactions/findAll/${rwdId}")) From 43feef5b42e2d11b27cd87706ed828bb60dee46e Mon Sep 17 00:00:00 2001 From: Loredana Date: Thu, 15 Oct 2020 19:03:52 +0300 Subject: [PATCH 148/302] add indexes to jpa entities --- testing-modules/load-testing-comparison/pom.xml | 2 -- .../baeldung/loadtesting/model/CustomerRewardsAccount.java | 3 +++ .../main/java/com/baeldung/loadtesting/model/Transaction.java | 4 ++++ .../src/main/resources/application.properties | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/testing-modules/load-testing-comparison/pom.xml b/testing-modules/load-testing-comparison/pom.xml index 55e94379db..4c237aeb75 100644 --- a/testing-modules/load-testing-comparison/pom.xml +++ b/testing-modules/load-testing-comparison/pom.xml @@ -37,7 +37,6 @@ com.fasterxml.jackson.core jackson-databind - ${jackson.version} org.springframework.boot @@ -72,7 +71,6 @@ org.springframework.boot spring-boot-maven-plugin - 2.0.5.RELEASE diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java index 0599020700..4d92c93fcb 100644 --- a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java @@ -4,8 +4,11 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.Table; @Entity +@Table(indexes = {@Index(columnList="customerId")}) public class CustomerRewardsAccount { @Id diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java index 1a6e0d4360..6e2fb39cc6 100644 --- a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java @@ -4,10 +4,14 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.Table; + import java.util.Date; import java.util.Calendar; @Entity +@Table(indexes = {@Index(columnList="customerRewardsId")}) public class Transaction { @Id diff --git a/testing-modules/load-testing-comparison/src/main/resources/application.properties b/testing-modules/load-testing-comparison/src/main/resources/application.properties index 424d3d0290..e2c8cb1879 100644 --- a/testing-modules/load-testing-comparison/src/main/resources/application.properties +++ b/testing-modules/load-testing-comparison/src/main/resources/application.properties @@ -2,6 +2,6 @@ spring.h2.console.enabled=true spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa -spring.datasource.password=password +spring.datasource.password= spring.jpa.database-platform=org.hibernate.dialect.H2Dialect From 1a6ff515fc96b84ac17a491d567ffaa06cb3271a Mon Sep 17 00:00:00 2001 From: AbdallahSawan Date: Thu, 15 Oct 2020 23:21:47 +0300 Subject: [PATCH 149/302] The Value of 0xFF Number and Its Uses With & Operation in Java Article by Abdallah Sawan --- .../src/main/java/com/baeldung/Main.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 java-numbers-5/src/main/java/com/baeldung/Main.java diff --git a/java-numbers-5/src/main/java/com/baeldung/Main.java b/java-numbers-5/src/main/java/com/baeldung/Main.java new file mode 100644 index 0000000000..dfc625809d --- /dev/null +++ b/java-numbers-5/src/main/java/com/baeldung/Main.java @@ -0,0 +1,23 @@ +package com.baeldung; + +public class Main { + + public static void main(String[] args) { + int x = 0xff; + System.out.println(x); // output is 255 + + byte y = (byte) 0xff; + System.out.println(y); // output is -1 + + int rgba = 272214023; + int r = rgba >> 24; + int g = rgba >> 16 & 0xFF; + int b = rgba >> 8 & 0xFF; + int a = rgba & 0xFF; + + System.out.println(r); // output is 64 + System.out.println(g); // output is 57 + System.out.println(b); // output is 168 + System.out.println(a); // output is 7 + } +} From 470d4efde85784f1c9e33d3c2947ca00d6607ca6 Mon Sep 17 00:00:00 2001 From: Adrian Maghear Date: Fri, 16 Oct 2020 13:07:22 +0200 Subject: [PATCH 150/302] [BAEL-3600] add integration test --- netflix-modules/mantis/pom.xml | 14 ++++ .../netflix/mantis/job/LogAggregationJob.java | 9 ++- .../netflix/mantis/job/LogCollectingJob.java | 11 ++- .../netflix/mantis/model/LogAggregate.java | 6 +- .../job/LogAggregationJobIntegrationTest.java | 56 ++++++++++++++ .../job/LogCollectingJobIntegrationTest.java | 73 +++++++++++++++++++ .../netflix/mantis/job/MantisJobTestBase.java | 49 +++++++++++++ 7 files changed, 212 insertions(+), 6 deletions(-) create mode 100644 netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/LogAggregationJobIntegrationTest.java create mode 100644 netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/LogCollectingJobIntegrationTest.java create mode 100644 netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/MantisJobTestBase.java diff --git a/netflix-modules/mantis/pom.xml b/netflix-modules/mantis/pom.xml index 48151c142f..5d9611ccdf 100644 --- a/netflix-modules/mantis/pom.xml +++ b/netflix-modules/mantis/pom.xml @@ -52,6 +52,20 @@ 1.18.12 + + org.springframework + spring-webflux + 5.0.9.RELEASE + test + + + + io.projectreactor.netty + reactor-netty + 0.9.12.RELEASE + test + + diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogAggregationJob.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogAggregationJob.java index 229d11d39d..7fc514deef 100644 --- a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogAggregationJob.java +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogAggregationJob.java @@ -9,10 +9,17 @@ import io.mantisrx.runtime.Job; import io.mantisrx.runtime.MantisJob; import io.mantisrx.runtime.MantisJobProvider; import io.mantisrx.runtime.Metadata; +import io.mantisrx.runtime.sink.Sink; import io.mantisrx.runtime.sink.Sinks; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +@NoArgsConstructor +@AllArgsConstructor public class LogAggregationJob extends MantisJobProvider { + private Sink sink = Sinks.eagerSubscribe(Sinks.sse(LogAggregate::toJsonString)); + @Override public Job getJobInstance() { @@ -21,7 +28,7 @@ public class LogAggregationJob extends MantisJobProvider { .stage(new TransformLogStage(), TransformLogStage.stageConfig()) .stage(new GroupLogStage(), GroupLogStage.config()) .stage(new CountLogStage(), CountLogStage.config()) - .sink(Sinks.eagerSubscribe(Sinks.sse(LogAggregate::toJsonString))) + .sink(sink) .metadata(new Metadata.Builder().build()) .create(); diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java index 492f30c43a..34ccf8355a 100644 --- a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/job/LogCollectingJob.java @@ -9,18 +9,23 @@ import io.mantisrx.runtime.MantisJob; import io.mantisrx.runtime.MantisJobProvider; import io.mantisrx.runtime.Metadata; import io.mantisrx.runtime.ScalarToScalar; -import lombok.extern.slf4j.Slf4j; +import io.mantisrx.runtime.sink.Sink; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; -@Slf4j +@NoArgsConstructor +@AllArgsConstructor public class LogCollectingJob extends MantisJobProvider { + private Sink sink = new LogSink(); + @Override public Job getJobInstance() { return MantisJob .source(new RandomLogSource()) .stage(new TransformLogStage(), new ScalarToScalar.Config<>()) - .sink(new LogSink()) + .sink(sink) .metadata(new Metadata.Builder().build()) .create(); diff --git a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java index 0eeb7ea086..e0e3c4f9fa 100644 --- a/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java +++ b/netflix-modules/mantis/src/main/java/com/baeldung/netflix/mantis/model/LogAggregate.java @@ -5,15 +5,17 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.mantisrx.runtime.codec.JsonType; import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@NoArgsConstructor @AllArgsConstructor public class LogAggregate implements JsonType { private static final ObjectMapper mapper = new ObjectMapper(); - private final Integer count; - private final String level; + private Integer count; + private String level; public String toJsonString() { try { diff --git a/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/LogAggregationJobIntegrationTest.java b/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/LogAggregationJobIntegrationTest.java new file mode 100644 index 0000000000..b9b16e2146 --- /dev/null +++ b/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/LogAggregationJobIntegrationTest.java @@ -0,0 +1,56 @@ +package com.baeldung.netflix.mantis.job; + +import com.baeldung.netflix.mantis.model.LogAggregate; +import io.mantisrx.runtime.PortRequest; +import io.mantisrx.runtime.sink.Sinks; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static java.util.Arrays.asList; +import static java.util.Optional.of; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class LogAggregationJobIntegrationTest extends MantisJobTestBase { + + private final static int PORT = 7382; + private final static String SINK_URL = "http://localhost:" + PORT; + + @BeforeAll + static void beforeAll() { + start(new LogAggregationJob((context, portRequest, logAggregateObservable) -> { + logAggregateObservable.subscribe(); + Sinks.sse(LogAggregate::toJsonString).call(context, new PortRequest(PORT), logAggregateObservable); + })); + } + + @Override + public String getSinkUrl() { + return SINK_URL; + } + + @Override + public Class getEventType() { + return LogAggregate.class; + } + + @Test + void whenReadingFromSink_thenShouldRetrieveCorrectNumberOfLogAggregates() { + assertEquals(of(5L), sinkStream.take(5).count().blockOptional()); + } + + @Test + void whenReadingFromSink_thenShouldRetrieveLogAggregate() { + assertNotNull(sinkStream.take(1).blockFirst()); + } + + @Test + void whenReadingFromSink_thenShouldRetrieveValidLogAggregate() { + LogAggregate logAggregate = sinkStream.take(1).blockFirst(); + + assertTrue(asList("ERROR", "WARN", "INFO").contains(logAggregate.getLevel())); + assertTrue(logAggregate.getCount() > 0); + } + +} \ No newline at end of file diff --git a/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/LogCollectingJobIntegrationTest.java b/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/LogCollectingJobIntegrationTest.java new file mode 100644 index 0000000000..87e0c194b5 --- /dev/null +++ b/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/LogCollectingJobIntegrationTest.java @@ -0,0 +1,73 @@ +package com.baeldung.netflix.mantis.job; + +import com.baeldung.netflix.mantis.model.LogEvent; +import com.baeldung.netflix.mantis.sink.LogSink; +import io.mantisrx.runtime.Context; +import io.mantisrx.runtime.PortRequest; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import rx.Observable; + +import static java.util.Arrays.asList; +import static java.util.Optional.of; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class LogCollectingJobIntegrationTest extends MantisJobTestBase { + + private final static int PORT = 7381; + private final static String SINK_URL = "http://localhost:" + PORT; + + @BeforeAll + static void beforeAll() { + + start(new LogCollectingJob(new LogSink() { + + @Override + public void call(Context context, PortRequest portRequest, Observable observable) { + super.call(context, new PortRequest(PORT), observable); + } + + })); + + } + + @Override + public String getSinkUrl() { + return SINK_URL; + } + + @Override + public Class getEventType() { + return LogEvent.class; + } + + @Test + void whenReadingFromSink_thenShouldRetrieveCorrectNumberOfLogEvents() { + assertEquals(of(5L), sinkStream.take(5).count().blockOptional()); + } + + @Test + void whenReadingFromSink_thenShouldRetrieveLogEvent() { + assertNotNull(sinkStream.take(1).blockFirst()); + } + + @Test + void whenReadingFromSink_thenShouldRetrieveValidLogEvent() { + LogEvent logEvent = sinkStream.take(1).blockFirst(); + + assertTrue(asList("ERROR", "WARN", "INFO").contains(logEvent.getLevel())); + assertTrue(asList("login attempt", "user created").contains(logEvent.getMessage())); + } + + @Test + void whenReadingFromSink_thenShouldRetrieveFilteredLogEvents() { + getSinkStream(SINK_URL + "?filter=login") + .take(7) + .toStream().forEach( + logEvent -> assertEquals("login attempt", logEvent.getMessage()) + ); + } + +} \ No newline at end of file diff --git a/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/MantisJobTestBase.java b/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/MantisJobTestBase.java new file mode 100644 index 0000000000..89425299a4 --- /dev/null +++ b/netflix-modules/mantis/src/test/java/com/baeldung/netflix/mantis/job/MantisJobTestBase.java @@ -0,0 +1,49 @@ +package com.baeldung.netflix.mantis.job; + +import io.mantisrx.runtime.Job; +import io.mantisrx.runtime.MantisJobProvider; +import io.mantisrx.runtime.executor.LocalJobExecutorNetworked; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; +import reactor.util.retry.Retry; + +import java.time.Duration; + +public abstract class MantisJobTestBase { + + private static Job jobInstance; + Flux sinkStream; + + public abstract String getSinkUrl(); + public abstract Class getEventType(); + + @BeforeEach + void setUp() { + sinkStream = getSinkStream(getSinkUrl()); + } + + @AfterAll + static void afterAll() { + stopJob(); + } + + protected Flux getSinkStream(String sinkUrl) { + return WebClient.builder().build().get() + .uri(sinkUrl) + .retrieve() + .bodyToFlux(getEventType()) + .retryWhen(Retry.fixedDelay(10, Duration.ofMillis(2000))); + } + + static void start(MantisJobProvider job) { + jobInstance = job.getJobInstance(); + new Thread(() -> LocalJobExecutorNetworked.execute(jobInstance)).start(); + } + + static void stopJob() { + jobInstance.getLifecycle().shutdown(); + } + +} From 5709eee956777f2cbeda0c7721ef6dfdd70c1d25 Mon Sep 17 00:00:00 2001 From: Umang Budhwar Date: Fri, 16 Oct 2020 19:22:25 +0530 Subject: [PATCH 151/302] BAEL-4475 (#10151) * Added code for checking if a class is abstract or not. * Renamed test name as per review comments. * Added code to get database URL from Connection object. * Refactored code to break lines. --- .../core-java-persistence-2/pom.xml | 29 +++++++++++++++++++ .../baeldung/getdburl/DBConfiguration.java | 13 +++++++++ .../getdburl/DBConfigurationUnitTest.java | 18 ++++++++++++ persistence-modules/pom.xml | 1 + 4 files changed, 61 insertions(+) create mode 100644 persistence-modules/core-java-persistence-2/pom.xml create mode 100644 persistence-modules/core-java-persistence-2/src/main/java/com/baeldung/getdburl/DBConfiguration.java create mode 100644 persistence-modules/core-java-persistence-2/src/test/java/com/baeldung/getdburl/DBConfigurationUnitTest.java diff --git a/persistence-modules/core-java-persistence-2/pom.xml b/persistence-modules/core-java-persistence-2/pom.xml new file mode 100644 index 0000000000..9845d5009d --- /dev/null +++ b/persistence-modules/core-java-persistence-2/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + com.baeldung.core-java-persistence-2 + core-java-persistence-2 + 0.1.0-SNAPSHOT + core-java-persistence-2 + jar + + + com.baeldung + persistence-modules + 1.0.0-SNAPSHOT + + + + + com.h2database + h2 + ${h2.version} + + + + + 1.4.200 + + + \ No newline at end of file diff --git a/persistence-modules/core-java-persistence-2/src/main/java/com/baeldung/getdburl/DBConfiguration.java b/persistence-modules/core-java-persistence-2/src/main/java/com/baeldung/getdburl/DBConfiguration.java new file mode 100644 index 0000000000..51d3a432ac --- /dev/null +++ b/persistence-modules/core-java-persistence-2/src/main/java/com/baeldung/getdburl/DBConfiguration.java @@ -0,0 +1,13 @@ +package com.baeldung.getdburl; + +import java.sql.Connection; +import java.sql.DriverManager; + +public class DBConfiguration { + + public static Connection getConnection() throws Exception { + Class.forName("org.h2.Driver"); + String url = "jdbc:h2:mem:testdb"; + return DriverManager.getConnection(url, "user", "password"); + } +} diff --git a/persistence-modules/core-java-persistence-2/src/test/java/com/baeldung/getdburl/DBConfigurationUnitTest.java b/persistence-modules/core-java-persistence-2/src/test/java/com/baeldung/getdburl/DBConfigurationUnitTest.java new file mode 100644 index 0000000000..845076f070 --- /dev/null +++ b/persistence-modules/core-java-persistence-2/src/test/java/com/baeldung/getdburl/DBConfigurationUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.getdburl; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.sql.Connection; + +import org.junit.jupiter.api.Test; + +class DBConfigurationUnitTest { + + @Test + void givenConnectionObject_whenExtractMetaData_thenGetDbURL() throws Exception { + Connection connection = DBConfiguration.getConnection(); + String dbUrl = connection.getMetaData().getURL(); + assertEquals("jdbc:h2:mem:testdb", dbUrl); + } + +} diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index 05ef14f188..c7905a178d 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -17,6 +17,7 @@ apache-bookkeeper apache-cayenne core-java-persistence + core-java-persistence-2 deltaspike elasticsearch flyway From 1c21d3ed2769d0c54709c38ebeba4c74d4901879 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 16 Oct 2020 19:14:29 +0300 Subject: [PATCH 152/302] Update MaxSizeConstraintValidator.java --- .../listvalidation/constraint/MaxSizeConstraintValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java b/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java index 524e98a39e..409b6e1ab5 100644 --- a/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java +++ b/spring-mvc-basics-3/src/main/java/com/baeldung/validation/listvalidation/constraint/MaxSizeConstraintValidator.java @@ -11,7 +11,7 @@ public class MaxSizeConstraintValidator implements ConstraintValidator values, ConstraintValidatorContext context) { - return values.size()<=4 + return values.size() <= 4; } } From 90c65b053095848c89d659b969839239bfbe28f7 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 17 Oct 2020 12:36:50 +0300 Subject: [PATCH 153/302] fix redis context test --- .../spring/data/redis/config/RedisConfig.java | 1 - .../java/com/baeldung/SpringContextTest.java | 28 +++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java index 497e1506bd..7fd13d2777 100644 --- a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java +++ b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java @@ -5,7 +5,6 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.listener.ChannelTopic; import org.springframework.data.redis.listener.RedisMessageListenerContainer; diff --git a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/SpringContextTest.java b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/SpringContextTest.java index 4df0cbd0ad..5167e63721 100644 --- a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/SpringContextTest.java +++ b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/SpringContextTest.java @@ -1,16 +1,32 @@ package com.baeldung; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; -import com.baeldung.spring.data.redis.config.RedisConfig; +import com.baeldung.spring.data.redis.SpringRedisApplication; -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = RedisConfig.class) +import redis.embedded.RedisServerBuilder; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringRedisApplication.class) +@DirtiesContext(classMode = ClassMode.BEFORE_CLASS) public class SpringContextTest { + + private static redis.embedded.RedisServer redisServer; + + @BeforeClass + public static void startRedisServer() { + redisServer = new RedisServerBuilder().port(6379).setting("maxmemory 256M").build(); + redisServer.start(); + } + @AfterClass + public static void stopRedisServer() { + redisServer.stop(); + } @Test public void whenSpringContextIsBootstrapped_thenNoExceptions() { } From 7d297f344f7c4a0be17a5652a72448e370107241 Mon Sep 17 00:00:00 2001 From: amdegregorio Date: Sat, 17 Oct 2020 08:28:31 -0400 Subject: [PATCH 154/302] BAEL-4503 PR/article review feedback --- .../constantspatterns/calculations/MathConstants.java | 6 +++--- .../baeldung/constantspatterns/ConstantPatternUnitTest.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/calculations/MathConstants.java b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/calculations/MathConstants.java index a7ecf7aabe..1c9c4172ca 100644 --- a/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/calculations/MathConstants.java +++ b/core-java-modules/core-java-lang-3/src/main/java/com/baeldung/constantspatterns/calculations/MathConstants.java @@ -2,9 +2,9 @@ package com.baeldung.constantspatterns.calculations; public final class MathConstants { public static final double PI = 3.14159265359; - public static final double GOLDEN_RATIO = 1.6180; - public static final double GRAVITATIONAL_ACCELERATION = 9.8; - public static final double EULERS_NUMBER = 2.7182818284590452353602874713527; + static final double GOLDEN_RATIO = 1.6180; + static final double GRAVITATIONAL_ACCELERATION = 9.8; + static final double EULERS_NUMBER = 2.7182818284590452353602874713527; public enum Operation { ADD, SUBTRACT, DIVIDE, MULTIPLY diff --git a/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/constantspatterns/ConstantPatternUnitTest.java b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/constantspatterns/ConstantPatternUnitTest.java index 39cb8f82f9..ba8f237fd3 100644 --- a/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/constantspatterns/ConstantPatternUnitTest.java +++ b/core-java-modules/core-java-lang-3/src/test/java/com/baeldung/constantspatterns/ConstantPatternUnitTest.java @@ -6,7 +6,7 @@ import org.junit.Test; public class ConstantPatternUnitTest { @Test - public void givenTwoNumbersAndAdd_whenCallingCalculatorOperatOneTwoNumbers_correctAnswerReturned() { + public void givenTwoNumbersAndAdd_whenCallingCalculatorOperatOneTwoNumbers_thenCorrectAnswerReturned() { Calculator calculator = new Calculator(); double expected = 4; double answer = calculator.operateOnTwoNumbers(2, 2, Calculator.Operation.ADD); @@ -14,7 +14,7 @@ public class ConstantPatternUnitTest { } @Test - public void givenTwoNumbersAndAdd_whenCallingGeometryCalculatorOperatOneTwoNumbers_correctAnswerReturned() { + public void givenTwoNumbersAndAdd_whenCallingGeometryCalculatorOperatOneTwoNumbers_thenCorrectAnswerReturned() { GeometryCalculator calculator = new GeometryCalculator(); double expected = 4; double answer = calculator.operateOnTwoNumbers(2, 2, GeometryCalculator.Operation.ADD); From 12dcd4e4bb806aedbd4e2022806450096e9a6ff6 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 17 Oct 2020 16:16:00 +0300 Subject: [PATCH 155/302] exclude logback, add log4j config file --- spring-boot-modules/spring-boot-mvc-birt/pom.xml | 16 +++++----------- .../src/main/resources/log4j.properties | 9 +++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 spring-boot-modules/spring-boot-mvc-birt/src/main/resources/log4j.properties diff --git a/spring-boot-modules/spring-boot-mvc-birt/pom.xml b/spring-boot-modules/spring-boot-mvc-birt/pom.xml index 0ab744bb26..1e3075dc2d 100644 --- a/spring-boot-modules/spring-boot-mvc-birt/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-birt/pom.xml @@ -5,10 +5,10 @@ 4.0.0 - com.baeldung.spring-boot-modules - spring-boot-modules - 1.0.0-SNAPSHOT - ../ + org.springframework.boot + spring-boot-starter-parent + 2.1.1.RELEASE + spring-boot-mvc-birt @@ -19,10 +19,6 @@ Module For Spring Boot Integration with BIRT - - org.springframework.boot - spring-boot-starter - org.springframework.boot @@ -51,17 +47,14 @@ org.eclipse.birt.runtime_4.8.0-20180626 ${eclipse.birt.runtime.version} - log4j log4j ${log4j.version} - org.projectlombok lombok - ${lombok.version} provided @@ -81,6 +74,7 @@ 1.8 1.8 4.8.0 + 1.2.17 diff --git a/spring-boot-modules/spring-boot-mvc-birt/src/main/resources/log4j.properties b/spring-boot-modules/spring-boot-mvc-birt/src/main/resources/log4j.properties new file mode 100644 index 0000000000..e4fcb01308 --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-birt/src/main/resources/log4j.properties @@ -0,0 +1,9 @@ +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=DEBUG, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n \ No newline at end of file From 07da242830fd1e6864e7569d61fa94e271317ff8 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 17 Oct 2020 16:19:01 +0300 Subject: [PATCH 156/302] add context test, explanation --- spring-boot-modules/spring-boot-mvc-birt/pom.xml | 1 + .../com/baeldung/birt/engine/SpringContextTest.java | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 spring-boot-modules/spring-boot-mvc-birt/src/test/java/com/baeldung/birt/engine/SpringContextTest.java diff --git a/spring-boot-modules/spring-boot-mvc-birt/pom.xml b/spring-boot-modules/spring-boot-mvc-birt/pom.xml index 1e3075dc2d..4963cc3036 100644 --- a/spring-boot-modules/spring-boot-mvc-birt/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-birt/pom.xml @@ -4,6 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + org.springframework.boot spring-boot-starter-parent diff --git a/spring-boot-modules/spring-boot-mvc-birt/src/test/java/com/baeldung/birt/engine/SpringContextTest.java b/spring-boot-modules/spring-boot-mvc-birt/src/test/java/com/baeldung/birt/engine/SpringContextTest.java new file mode 100644 index 0000000000..5235a494df --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-birt/src/test/java/com/baeldung/birt/engine/SpringContextTest.java @@ -0,0 +1,13 @@ +package com.baeldung.birt.engine; + +import org.junit.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +public class SpringContextTest { + + @Test + public void whenSpringContextIsBootstrapped_thenNoExceptions() { + + } +} From 000275f9f7d18a482a377b05ec9ca0f06423b234 Mon Sep 17 00:00:00 2001 From: AmitB Date: Sun, 18 Oct 2020 21:29:00 +0530 Subject: [PATCH 157/302] [BAEL-4495] - Add test for case when 2nd collection is also hashset (#10175) * [BAEL-4495] Performance of removeAll() in a HashSet * [BAEL-4495] Add unit test for hashset removeAll() * [BAEL-4495] Update test methods to camelCase * [BAEL-4495] Add test for case when 2nd collection is also hashset --- .../removeallperformance/HashSetBenchmark.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/removeallperformance/HashSetBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/removeallperformance/HashSetBenchmark.java index 8ce58c865e..8f784de26d 100644 --- a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/removeallperformance/HashSetBenchmark.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/removeallperformance/HashSetBenchmark.java @@ -33,11 +33,15 @@ public class HashSetBenchmark { private List employeeList1 = new ArrayList<>(); private Set employeeSet2 = new HashSet<>(); private List employeeList2 = new ArrayList<>(); + private Set employeeSet3 = new HashSet<>(); + private Set employeeSet4 = new HashSet<>(); private long set1Size = 60000; private long list1Size = 50000; private long set2Size = 50000; private long list2Size = 60000; + private long set3Size = 50000; + private long set4Size = 60000; @Setup(Level.Trial) public void setUp() { @@ -57,6 +61,14 @@ public class HashSetBenchmark { for (long i = 0; i < list2Size; i++) { employeeList2.add(new Employee(i, RandomStringUtils.random(7, true, false))); } + + for (long i = 0; i < set3Size; i++) { + employeeSet3.add(new Employee(i, RandomStringUtils.random(7, true, false))); + } + + for (long i = 0; i < set4Size; i++) { + employeeSet4.add(new Employee(i, RandomStringUtils.random(7, true, false))); + } } @@ -71,6 +83,11 @@ public class HashSetBenchmark { public boolean given_SizeOfHashsetSmallerThanSizeOfCollection_When_RemoveAllFromHashSet_Then_BadPerformance(MyState state) { return state.employeeSet2.removeAll(state.employeeList2); } + + @Benchmark + public boolean given_SizeOfHashsetSmallerThanSizeOfAnotherHashSet_When_RemoveAllFromHashSet_Then_GoodPerformance(MyState state) { + return state.employeeSet3.removeAll(state.employeeSet4); + } public static void main(String[] args) throws Exception { Options options = new OptionsBuilder().include(HashSetBenchmark.class.getSimpleName()) From 41609ee63f1df4b42a1daf537e05dafc1d0f18f7 Mon Sep 17 00:00:00 2001 From: Kai Yuan Date: Fri, 16 Oct 2020 23:38:46 +0200 Subject: [PATCH 158/302] [BAEL-4533] get class names from a jar --- core-java-modules/core-java-jar/.gitignore | 1 + .../baeldung/jar/GetClassNamesFromJar.java | 43 ++++++++++++++++++ .../jar/GetClassNamesFromJarUnitTest.java | 39 ++++++++++++++++ .../example-jar/stripe-0.0.1-SNAPSHOT.jar | Bin 0 -> 10082 bytes 4 files changed, 83 insertions(+) create mode 100644 core-java-modules/core-java-jar/.gitignore create mode 100644 core-java-modules/core-java-jar/src/main/java/com/baeldung/jar/GetClassNamesFromJar.java create mode 100644 core-java-modules/core-java-jar/src/test/java/com/baeldung/jar/GetClassNamesFromJarUnitTest.java create mode 100644 core-java-modules/core-java-jar/src/test/resources/example-jar/stripe-0.0.1-SNAPSHOT.jar diff --git a/core-java-modules/core-java-jar/.gitignore b/core-java-modules/core-java-jar/.gitignore new file mode 100644 index 0000000000..ba516c02b5 --- /dev/null +++ b/core-java-modules/core-java-jar/.gitignore @@ -0,0 +1 @@ +!src/test/resources/example-jar/stripe-0.0.1-SNAPSHOT.jar diff --git a/core-java-modules/core-java-jar/src/main/java/com/baeldung/jar/GetClassNamesFromJar.java b/core-java-modules/core-java-jar/src/main/java/com/baeldung/jar/GetClassNamesFromJar.java new file mode 100644 index 0000000000..0d8a67dbd6 --- /dev/null +++ b/core-java-modules/core-java-jar/src/main/java/com/baeldung/jar/GetClassNamesFromJar.java @@ -0,0 +1,43 @@ +package com.baeldung.jar; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +public class GetClassNamesFromJar { + + public static Set getClassNamesFromJarFile(File givenFile) throws IOException { + Set classNames = new HashSet<>(); + try (JarFile jarFile = new JarFile(givenFile)) { + Enumeration e = jarFile.entries(); + while (e.hasMoreElements()) { + JarEntry jarEntry = e.nextElement(); + if (jarEntry.getName().endsWith(".class")) { + String className = jarEntry.getName() + .replace("/", ".") + .replace(".class", ""); + classNames.add(className); + } + } + return classNames; + } + } + + public static Set getClassesFromJarFile(File jarFile) throws IOException, ClassNotFoundException { + Set classNames = getClassNamesFromJarFile(jarFile); + Set classes = new HashSet<>(classNames.size()); + try (URLClassLoader cl = URLClassLoader.newInstance(new URL[] { new URL("jar:file:" + jarFile + "!/") })) { + for (String name : classNames) { + Class clazz = cl.loadClass(name); // Loading the class by its name + classes.add(clazz); + } + } + return classes; + } +} diff --git a/core-java-modules/core-java-jar/src/test/java/com/baeldung/jar/GetClassNamesFromJarUnitTest.java b/core-java-modules/core-java-jar/src/test/java/com/baeldung/jar/GetClassNamesFromJarUnitTest.java new file mode 100644 index 0000000000..7af3ff59fd --- /dev/null +++ b/core-java-modules/core-java-jar/src/test/java/com/baeldung/jar/GetClassNamesFromJarUnitTest.java @@ -0,0 +1,39 @@ +package com.baeldung.jar; + +import com.google.common.collect.Sets; +import org.junit.Assert; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.Arrays; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +public class GetClassNamesFromJarUnitTest { + private static final String JAR_PATH = "example-jar/stripe-0.0.1-SNAPSHOT.jar"; + private static final Set EXPECTED_CLASS_NAMES = Sets.newHashSet( + "com.baeldung.stripe.StripeApplication", + "com.baeldung.stripe.ChargeRequest", + "com.baeldung.stripe.StripeService", + "com.baeldung.stripe.ChargeRequest$Currency", + "com.baeldung.stripe.ChargeController", + "com.baeldung.stripe.CheckoutController"); + + @Test + public void givenJarFilePath_whenLoadClassNames_thenGetClassNames() throws IOException, URISyntaxException { + File jarFile = new File(Objects.requireNonNull(getClass().getClassLoader().getResource(JAR_PATH)).toURI()); + Set classNames = GetClassNamesFromJar.getClassNamesFromJarFile(jarFile); + Assert.assertEquals(EXPECTED_CLASS_NAMES, classNames); + } + + @Test + public void givenJarFilePath_whenLoadClass_thenGetClassObjects() throws IOException, ClassNotFoundException, URISyntaxException { + File jarFile = new File(Objects.requireNonNull(getClass().getClassLoader().getResource(JAR_PATH)).toURI()); + Set classes = GetClassNamesFromJar.getClassesFromJarFile(jarFile); + Set names = classes.stream().map(Class::getName).collect(Collectors.toSet()); + Assert.assertEquals(EXPECTED_CLASS_NAMES, names); + } +} diff --git a/core-java-modules/core-java-jar/src/test/resources/example-jar/stripe-0.0.1-SNAPSHOT.jar b/core-java-modules/core-java-jar/src/test/resources/example-jar/stripe-0.0.1-SNAPSHOT.jar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fq2~P+BNJkWu&|X>bUJu@_Nz}s}3?X9#wyK zaTPfJkPZ_Jzh0-KCF;@+8c{)KW}@Lz&{t$!-Zr z*=)BmCkjuGb{oTlbYI_wIQ-^==67UnWwKSlO1u-NPfU&MW2~ zx|*KbVb2{dsv09&fr)?ZFDlqHSh+i?!qJP>lH2Z^WdFFpPZK+w@gkQ_Zv_y z41x~)C+yVy8WtT-mLpa&`Su-6!Uhc;(drYwo>GcJ=jd6feBJEVH5>VsEi2#jH5JN> zuWBM@5%Si)-;n){`ZXK2U`=rXSI+-gV{Z8nB?q~FDSAmd2^j_P0_A-fI;s8@MF-j* z<$XB@1tvBnCYCZ5_9_+*WorjylzWGvNHsl*A;GLiM?mCbq+=v|pDTPwZ@x?6nvsx0 zDMVf+V9XKdBpO`_q$qhbauO^R%z~&`iyk7$GKwA}~RL)-s;hHlap zz85rz9l@KYpC{^8?9XWoKja{?yl&z}KgE7YYPd!CJ&OPwX8KWXI&KF)|4cl%9qrxx zgzs~>k-HJv0)OA~#=my=;B$XNEd7_nO=`mTa?=yr4~f5R(|?NIq$=Es z>fROoX^#G$=ATm+{>I4iiUK42lE`p7>OT|ww}M$#=eru}fKy^DL-cfQ3%#{D>K#oi%?z)8ho;E5>y^RB!HjZ5#9XyKZW9&RsaA1 literal 0 HcmV?d00001 From 16bd27cab262974d07fc4a84ab9c597c146a9eaf Mon Sep 17 00:00:00 2001 From: Simone Cusimano Date: Tue, 20 Oct 2020 08:51:00 +0200 Subject: [PATCH 159/302] Remove gitignore file --- .../gradle-dependency-management/.gitignore | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 gradle/gradle-dependency-management/.gitignore diff --git a/gradle/gradle-dependency-management/.gitignore b/gradle/gradle-dependency-management/.gitignore deleted file mode 100644 index 84695dca6f..0000000000 --- a/gradle/gradle-dependency-management/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -HELP.md -.gradle -build/ -!gradle/wrapper/gradle-wrapper.jar -!**/src/main/**/build/ -!**/src/test/**/build/ - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ From 61f2654a9d17591a90026613ba3dd168d2ddc3b7 Mon Sep 17 00:00:00 2001 From: Loredana Date: Tue, 20 Oct 2020 11:16:17 +0300 Subject: [PATCH 160/302] update basename for messagesource --- .../com/baeldung/spring/configuration/EmailConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/EmailConfiguration.java b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/EmailConfiguration.java index 86a7f1162c..7f296ce6a7 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/EmailConfiguration.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/spring/configuration/EmailConfiguration.java @@ -119,7 +119,7 @@ public class EmailConfiguration { @Bean public ResourceBundleMessageSource emailMessageSource() { final ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("/mailMessages"); + messageSource.setBasename("mailMessages"); return messageSource; } From e012de2de98270702e7cdb93227c0c7725d010e6 Mon Sep 17 00:00:00 2001 From: Loredana Date: Tue, 20 Oct 2020 11:42:57 +0300 Subject: [PATCH 161/302] add the oidc legacy code back --- spring-security-modules/pom.xml | 1 + .../spring-security-legacy-oidc/README.md | 23 ++++ .../spring-security-legacy-oidc/pom.xml | 58 ++++++++++ .../oidc/GoogleOpenIdConnectConfig.java | 51 +++++++++ .../baeldung/openid/oidc/HomeController.java | 22 ++++ .../openid/oidc/OpenIdConnectFilter.java | 103 ++++++++++++++++++ .../openid/oidc/OpenIdConnectUserDetails.java | 81 ++++++++++++++ .../baeldung/openid/oidc/SecurityConfig.java | 48 ++++++++ .../openid/oidc/SpringOpenidApplication.java | 14 +++ .../src/main/resources/application.properties | 8 ++ .../src/main/resources/logback.xml | 13 +++ .../openid/oidc/SpringContextTest.java | 15 +++ 12 files changed, 437 insertions(+) create mode 100644 spring-security-modules/spring-security-legacy-oidc/README.md create mode 100644 spring-security-modules/spring-security-legacy-oidc/pom.xml create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/GoogleOpenIdConnectConfig.java create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/HomeController.java create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/OpenIdConnectFilter.java create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/OpenIdConnectUserDetails.java create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/SecurityConfig.java create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/SpringOpenidApplication.java create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/main/resources/application.properties create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/main/resources/logback.xml create mode 100644 spring-security-modules/spring-security-legacy-oidc/src/test/java/com/baeldung/openid/oidc/SpringContextTest.java diff --git a/spring-security-modules/pom.xml b/spring-security-modules/pom.xml index d5c0c0dd6e..0fc2b49fa7 100644 --- a/spring-security-modules/pom.xml +++ b/spring-security-modules/pom.xml @@ -28,6 +28,7 @@ spring-security-web-login spring-security-web-persisted-remember-me spring-security-web-sockets + spring-security-legacy-oidc spring-security-oidc spring-security-okta spring-security-web-react diff --git a/spring-security-modules/spring-security-legacy-oidc/README.md b/spring-security-modules/spring-security-legacy-oidc/README.md new file mode 100644 index 0000000000..5e8f391b96 --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/README.md @@ -0,0 +1,23 @@ +## Spring Security OpenID + +This module contains articles about OpenID with Spring Security + +### Relevant articles + +- [Spring Security and OpenID Connect (Legacy)](https://www.baeldung.com/spring-security-openid-connect-legacy) + +### OpenID Connect with Spring Security + +### Run the Project + +``` +mvn spring-boot:run +``` + +### Obtain Google App - Client ID, Secret + +- We need to get client id and client secret by creating a new project at [Google Developer Console](https://console.developers.google.com/project/_/apiui/credential?pli=1) +- We can follow these instructions to register our client application on their platform + +- Once we have the client id and secret, we have to make sure we add them to the YAML files of the project + diff --git a/spring-security-modules/spring-security-legacy-oidc/pom.xml b/spring-security-modules/spring-security-legacy-oidc/pom.xml new file mode 100644 index 0000000000..a4ead0f6e0 --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + spring-security-legacy-oidc + spring-security-legacy-oidc + war + Spring OpenID Connect sample project + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-tomcat + + + + org.springframework.security.oauth + spring-security-oauth2 + ${spring-security-oauth2.version} + + + + org.springframework.security + spring-security-jwt + ${spring-security-jwt.version} + + + + com.auth0 + jwks-rsa + ${jwks-rsa.version} + + + + + 2.2.1.RELEASE + 1.0.9.RELEASE + 0.3.0 + + + diff --git a/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/GoogleOpenIdConnectConfig.java b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/GoogleOpenIdConnectConfig.java new file mode 100644 index 0000000000..a9fdcfb286 --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/GoogleOpenIdConnectConfig.java @@ -0,0 +1,51 @@ +package com.baeldung.openid.oidc; + +import java.util.Arrays; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.oauth2.client.OAuth2ClientContext; +import org.springframework.security.oauth2.client.OAuth2RestTemplate; +import org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails; +import org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeResourceDetails; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableOAuth2Client; + +@Configuration +@EnableOAuth2Client +public class GoogleOpenIdConnectConfig { + @Value("${google.clientId}") + private String clientId; + + @Value("${google.clientSecret}") + private String clientSecret; + + @Value("${google.accessTokenUri}") + private String accessTokenUri; + + @Value("${google.userAuthorizationUri}") + private String userAuthorizationUri; + + @Value("${google.redirectUri}") + private String redirectUri; + + @Bean + public OAuth2ProtectedResourceDetails googleOpenId() { + final AuthorizationCodeResourceDetails details = new AuthorizationCodeResourceDetails(); + details.setClientId(clientId); + details.setClientSecret(clientSecret); + details.setAccessTokenUri(accessTokenUri); + details.setUserAuthorizationUri(userAuthorizationUri); + details.setScope(Arrays.asList("openid", "email")); + details.setPreEstablishedRedirectUri(redirectUri); + details.setUseCurrentUri(false); + return details; + } + + @Bean + public OAuth2RestTemplate googleOpenIdTemplate(final OAuth2ClientContext clientContext) { + final OAuth2RestTemplate template = new OAuth2RestTemplate(googleOpenId(), clientContext); + return template; + } + +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/HomeController.java b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/HomeController.java new file mode 100644 index 0000000000..3d2e776eca --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/HomeController.java @@ -0,0 +1,22 @@ +package com.baeldung.openid.oidc; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +public class HomeController { + private final Logger logger = LoggerFactory.getLogger(getClass()); + + @RequestMapping("/") + @ResponseBody + public final String home() { + final String username = SecurityContextHolder.getContext().getAuthentication().getName(); + logger.info(username); + return "Welcome, " + username; + } + +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/OpenIdConnectFilter.java b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/OpenIdConnectFilter.java new file mode 100644 index 0000000000..c0b08bc548 --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/OpenIdConnectFilter.java @@ -0,0 +1,103 @@ +package com.baeldung.openid.oidc; + +import java.io.IOException; +import java.net.URL; +import java.security.interfaces.RSAPublicKey; +import java.util.Date; +import java.util.Map; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.jwt.Jwt; +import org.springframework.security.jwt.JwtHelper; +import org.springframework.security.jwt.crypto.sign.RsaVerifier; +import org.springframework.security.oauth2.client.OAuth2RestOperations; +import org.springframework.security.oauth2.client.OAuth2RestTemplate; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; +import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; + +import com.auth0.jwk.Jwk; +import com.auth0.jwk.JwkProvider; +import com.auth0.jwk.UrlJwkProvider; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class OpenIdConnectFilter extends AbstractAuthenticationProcessingFilter { + @Value("${google.clientId}") + private String clientId; + + @Value("${google.issuer}") + private String issuer; + + @Value("${google.jwkUrl}") + private String jwkUrl; + + public OAuth2RestOperations restTemplate; + + public OpenIdConnectFilter(String defaultFilterProcessesUrl) { + super(defaultFilterProcessesUrl); + setAuthenticationManager(new NoopAuthenticationManager()); + } + + @Override + public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { + + OAuth2AccessToken accessToken; + try { + accessToken = restTemplate.getAccessToken(); + } catch (final OAuth2Exception e) { + throw new BadCredentialsException("Could not obtain access token", e); + } + try { + final String idToken = accessToken.getAdditionalInformation().get("id_token").toString(); + String kid = JwtHelper.headers(idToken) + .get("kid"); + final Jwt tokenDecoded = JwtHelper.decodeAndVerify(idToken, verifier(kid)); + final Map authInfo = new ObjectMapper().readValue(tokenDecoded.getClaims(), Map.class); + verifyClaims(authInfo); + final OpenIdConnectUserDetails user = new OpenIdConnectUserDetails(authInfo, accessToken); + return new UsernamePasswordAuthenticationToken(user, null, user.getAuthorities()); + } catch (final Exception e) { + throw new BadCredentialsException("Could not obtain user details from token", e); + } + + } + + public void verifyClaims(Map claims) { + int exp = (int) claims.get("exp"); + Date expireDate = new Date(exp * 1000L); + Date now = new Date(); + if (expireDate.before(now) || !claims.get("iss").equals(issuer) || !claims.get("aud").equals(clientId)) { + throw new RuntimeException("Invalid claims"); + } + } + + + private RsaVerifier verifier(String kid) throws Exception { + JwkProvider provider = new UrlJwkProvider(new URL(jwkUrl)); + Jwk jwk = provider.get(kid); + return new RsaVerifier((RSAPublicKey) jwk.getPublicKey()); + } + + public void setRestTemplate(OAuth2RestTemplate restTemplate2) { + restTemplate = restTemplate2; + + } + + private static class NoopAuthenticationManager implements AuthenticationManager { + + @Override + public Authentication authenticate(Authentication authentication) throws AuthenticationException { + throw new UnsupportedOperationException("No authentication should be done with this AuthenticationManager"); + } + + } +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/OpenIdConnectUserDetails.java b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/OpenIdConnectUserDetails.java new file mode 100644 index 0000000000..4ff61bcad9 --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/OpenIdConnectUserDetails.java @@ -0,0 +1,81 @@ +package com.baeldung.openid.oidc; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; + +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.oauth2.common.OAuth2AccessToken; + +public class OpenIdConnectUserDetails implements UserDetails { + + private static final long serialVersionUID = 1L; + + private String userId; + private String username; + private OAuth2AccessToken token; + + public OpenIdConnectUserDetails(Map userInfo, OAuth2AccessToken token) { + this.userId = userInfo.get("sub"); + this.username = userInfo.get("email"); + this.token = token; + } + + @Override + public String getUsername() { + return username; + } + + @Override + public Collection getAuthorities() { + return Arrays.asList(new SimpleGrantedAuthority("ROLE_USER")); + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public OAuth2AccessToken getToken() { + return token; + } + + public void setToken(OAuth2AccessToken token) { + this.token = token; + } + + public void setUsername(String username) { + this.username = username; + } + + @Override + public String getPassword() { + return null; + } + + @Override + public boolean isAccountNonExpired() { + return true; + } + + @Override + public boolean isAccountNonLocked() { + return true; + } + + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + @Override + public boolean isEnabled() { + return true; + } + +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/SecurityConfig.java b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/SecurityConfig.java new file mode 100644 index 0000000000..fc5397a35b --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/SecurityConfig.java @@ -0,0 +1,48 @@ +package com.baeldung.openid.oidc; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.builders.WebSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.oauth2.client.OAuth2RestTemplate; +import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; +import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint; +import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter; + +@Configuration +@EnableWebSecurity +public class SecurityConfig extends WebSecurityConfigurerAdapter { + @Autowired + private OAuth2RestTemplate restTemplate; + + @Override + public void configure(WebSecurity web) throws Exception { + web.ignoring().antMatchers("/resources/**"); + } + + @Bean + public OpenIdConnectFilter myFilter() { + final OpenIdConnectFilter filter = new OpenIdConnectFilter("/google-login"); + filter.setRestTemplate(restTemplate); + return filter; + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + // @formatter:off + http + .addFilterAfter(new OAuth2ClientContextFilter(), AbstractPreAuthenticatedProcessingFilter.class) + .addFilterAfter(myFilter(), OAuth2ClientContextFilter.class) + .httpBasic().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/google-login")) + .and() + .authorizeRequests() + // .antMatchers("/","/index*").permitAll() + .anyRequest().authenticated() + ; + + // @formatter:on + } +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/SpringOpenidApplication.java b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/SpringOpenidApplication.java new file mode 100644 index 0000000000..ec686f746d --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/main/java/com/baeldung/openid/oidc/SpringOpenidApplication.java @@ -0,0 +1,14 @@ +package com.baeldung.openid.oidc; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +@SpringBootApplication +public class SpringOpenidApplication extends SpringBootServletInitializer { + + public static void main(String[] args) { + SpringApplication.run(SpringOpenidApplication.class, args); + } + +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/src/main/resources/application.properties b/spring-security-modules/spring-security-legacy-oidc/src/main/resources/application.properties new file mode 100644 index 0000000000..e9ae90dd10 --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/main/resources/application.properties @@ -0,0 +1,8 @@ +server.port=8081 +google.clientId=475873350264-g1opb20lf2fc60h0o84rrkn972krgkvo.apps.googleusercontent.com +google.clientSecret=GiA1Agf_aSt-bhTrnXjre-5Z +google.accessTokenUri=https://www.googleapis.com/oauth2/v3/token +google.userAuthorizationUri=https://accounts.google.com/o/oauth2/auth +google.redirectUri=http://localhost:8081/google-login +google.issuer=accounts.google.com +google.jwkUrl=https://www.googleapis.com/oauth2/v2/certs \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/src/main/resources/logback.xml b/spring-security-modules/spring-security-legacy-oidc/src/main/resources/logback.xml new file mode 100644 index 0000000000..3b8d0b9964 --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/src/test/java/com/baeldung/openid/oidc/SpringContextTest.java b/spring-security-modules/spring-security-legacy-oidc/src/test/java/com/baeldung/openid/oidc/SpringContextTest.java new file mode 100644 index 0000000000..0a21c5e93f --- /dev/null +++ b/spring-security-modules/spring-security-legacy-oidc/src/test/java/com/baeldung/openid/oidc/SpringContextTest.java @@ -0,0 +1,15 @@ +package com.baeldung.openid.oidc; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = SpringOpenidApplication.class) +public class SpringContextTest { + + @Test + public void whenSpringContextIsBootstrapped_thenNoExceptions() { + } +} \ No newline at end of file From e16eef77267fe0d7a0bfb105d9e01d8821c899ac Mon Sep 17 00:00:00 2001 From: Loredana Date: Tue, 20 Oct 2020 12:33:13 +0300 Subject: [PATCH 162/302] update jpa shared key --- .../hibernate/jpabootstrap/application/Application.java | 2 +- .../baeldung/hibernate/onetoone/sharedkeybased/Address.java | 5 +++-- .../com/baeldung/hibernate/onetoone/sharedkeybased/User.java | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java b/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java index f7b8e6bf6d..b547a60b06 100644 --- a/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java +++ b/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java @@ -8,7 +8,7 @@ public class Application { public static void main(String[] args) { EntityManager entityManager = getJpaEntityManager(); - User user = entityManager.find(User.class, 1); + User user = entityManager.find(User.class, 1l); System.out.println(user); entityManager.getTransaction().begin(); user.setName("John"); diff --git a/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java b/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java index 927516f6bb..e70c62e77b 100644 --- a/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java +++ b/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java @@ -1,9 +1,9 @@ package com.baeldung.hibernate.onetoone.sharedkeybased; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.MapsId; import javax.persistence.OneToOne; import javax.persistence.Table; @@ -13,7 +13,7 @@ import javax.persistence.Table; public class Address { @Id - @Column(name = "id") + @Column(name = "user_id") private Long id; @Column(name = "street") @@ -24,6 +24,7 @@ public class Address { @OneToOne @MapsId + @JoinColumn(name = "user_id") private User user; public Long getId() { diff --git a/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java b/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java index fa00db1271..605671a149 100644 --- a/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java +++ b/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java @@ -8,6 +8,7 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToOne; +import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.Table; @Entity @@ -22,6 +23,7 @@ public class User { private String userName; @OneToOne(mappedBy = "user", cascade = CascadeType.ALL) + @PrimaryKeyJoinColumn private Address address; public Long getId() { From b6dbadc18e4c4408d117adc710963184dea57585 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Tue, 20 Oct 2020 12:41:36 +0300 Subject: [PATCH 163/302] Update README.md --- spring-security-modules/spring-security-oidc/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-security-modules/spring-security-oidc/README.md b/spring-security-modules/spring-security-oidc/README.md index ca6053f70f..5e8f391b96 100644 --- a/spring-security-modules/spring-security-oidc/README.md +++ b/spring-security-modules/spring-security-oidc/README.md @@ -4,7 +4,6 @@ This module contains articles about OpenID with Spring Security ### Relevant articles -- [Spring Security and OpenID Connect](https://www.baeldung.com/spring-security-openid-connect) - [Spring Security and OpenID Connect (Legacy)](https://www.baeldung.com/spring-security-openid-connect-legacy) ### OpenID Connect with Spring Security From 3f8591f891725ea65539e1be7b6bc4da2645453d Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Tue, 20 Oct 2020 12:42:29 +0300 Subject: [PATCH 164/302] Update README.md --- spring-security-modules/spring-security-legacy-oidc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-security-modules/spring-security-legacy-oidc/README.md b/spring-security-modules/spring-security-legacy-oidc/README.md index 5e8f391b96..9d47b35b21 100644 --- a/spring-security-modules/spring-security-legacy-oidc/README.md +++ b/spring-security-modules/spring-security-legacy-oidc/README.md @@ -19,5 +19,5 @@ mvn spring-boot:run - We need to get client id and client secret by creating a new project at [Google Developer Console](https://console.developers.google.com/project/_/apiui/credential?pli=1) - We can follow these instructions to register our client application on their platform -- Once we have the client id and secret, we have to make sure we add them to the YAML files of the project +- Once we have the client id and secret, we have to make sure we add them to the application.properties file. From 0efc73afccbd920ae0e078fea4108b0c87bbca70 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Tue, 20 Oct 2020 13:14:22 +0300 Subject: [PATCH 165/302] Update README.md --- spring-security-modules/spring-security-web-sockets/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-security-modules/spring-security-web-sockets/README.md b/spring-security-modules/spring-security-web-sockets/README.md index 14ef0c8b99..76717e2fe6 100644 --- a/spring-security-modules/spring-security-web-sockets/README.md +++ b/spring-security-modules/spring-security-web-sockets/README.md @@ -5,7 +5,7 @@ This module contains articles about WebSockets with Spring Security ### Relevant Articles: - [Intro to Security and WebSockets](https://www.baeldung.com/spring-security-websockets) -- [Spring WebSockets: Build an User Chat](https://www.baeldung.com/spring-websockets-send-message-to-user) +- [Spring WebSockets: Send Messages to a Specific User](https://www.baeldung.com/spring-websockets-send-message-to-user) - [REST vs WebSockets](https://www.baeldung.com/rest-vs-websockets) ### Running This Project: From b8f341a7ae474ead59b3ca9e5410188b6cc83cf4 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 21 Oct 2020 10:19:38 +0800 Subject: [PATCH 166/302] Update README.md --- spring-boot-modules/spring-boot-annotations/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-modules/spring-boot-annotations/README.md b/spring-boot-modules/spring-boot-annotations/README.md index a721f28d55..6ead94de86 100644 --- a/spring-boot-modules/spring-boot-annotations/README.md +++ b/spring-boot-modules/spring-boot-annotations/README.md @@ -9,3 +9,4 @@ This module contains articles about Spring Boot annotations - [Spring Web Annotations](https://www.baeldung.com/spring-mvc-annotations) - [Spring Core Annotations](https://www.baeldung.com/spring-core-annotations) - [Spring Bean Annotations](https://www.baeldung.com/spring-bean-annotations) +- [Difference Between @ComponentScan and @EnableAutoConfiguration in Spring Boot](https://www.baeldung.com/spring-componentscan-vs-enableautoconfiguration) From 8af5182f924b8a9f8c750a0137f09632af26a489 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 21 Oct 2020 11:23:19 +0800 Subject: [PATCH 167/302] Update README.md --- persistence-modules/spring-persistence-simple/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-persistence-simple/README.md b/persistence-modules/spring-persistence-simple/README.md index 8bef16868d..34211e981e 100644 --- a/persistence-modules/spring-persistence-simple/README.md +++ b/persistence-modules/spring-persistence-simple/README.md @@ -7,6 +7,7 @@ - [Transaction Propagation and Isolation in Spring @Transactional](https://www.baeldung.com/spring-transactional-propagation-isolation) - [JTA Transaction with Spring](https://www.baeldung.com/spring-vs-jta-transactional) - [Test a Mock JNDI Datasource with Spring](https://www.baeldung.com/spring-mock-jndi-datasource) +- [Detecting If a Spring Transaction Is Active](https://www.baeldung.com/spring-transaction-active) ### Eclipse Config After importing the project into Eclipse, you may see the following error: From 3a1bcc1a154e7c168f865766ef9290ec764b6765 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 21 Oct 2020 11:25:34 +0800 Subject: [PATCH 168/302] Update README.md --- core-java-modules/core-java-networking-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-networking-2/README.md b/core-java-modules/core-java-networking-2/README.md index fa49c35bf8..9def4c8eb6 100644 --- a/core-java-modules/core-java-networking-2/README.md +++ b/core-java-modules/core-java-networking-2/README.md @@ -14,4 +14,5 @@ This module contains articles about networking in Java - [Handling java.net.ConnectException](https://www.baeldung.com/java-net-connectexception) - [Getting MAC addresses in Java](https://www.baeldung.com/java-mac-address) - [Sending Emails with Attachments in Java](https://www.baeldung.com/java-send-emails-attachments) +- [Finding a Free Port in Java](https://www.baeldung.com/java-free-port) - [[<-- Prev]](/core-java-modules/core-java-networking) From e4430ea67247e4de6a0218a6b7ffdca94025120b Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 21 Oct 2020 11:28:46 +0800 Subject: [PATCH 169/302] Create README.md --- persistence-modules/core-java-persistence-2/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 persistence-modules/core-java-persistence-2/README.md diff --git a/persistence-modules/core-java-persistence-2/README.md b/persistence-modules/core-java-persistence-2/README.md new file mode 100644 index 0000000000..467de757ce --- /dev/null +++ b/persistence-modules/core-java-persistence-2/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Getting Database URL From JDBC Connection Object](https://www.baeldung.com/jdbc-get-url-from-connection) From dad6426ea1c1e2bcb90f79f36517388cf4f573be Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 21 Oct 2020 11:31:57 +0800 Subject: [PATCH 170/302] Update README.md --- apache-spark/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/apache-spark/README.md b/apache-spark/README.md index c60b556d51..3a2d2f4e15 100644 --- a/apache-spark/README.md +++ b/apache-spark/README.md @@ -8,3 +8,4 @@ This module contains articles about Apache Spark - [Building a Data Pipeline with Kafka, Spark Streaming and Cassandra](https://www.baeldung.com/kafka-spark-data-pipeline) - [Machine Learning with Spark MLlib](https://www.baeldung.com/spark-mlib-machine-learning) - [Introduction to Spark Graph Processing with GraphFrames](https://www.baeldung.com/spark-graph-graphframes) +- [Apache Spark: Differences between Dataframes, Datasets and RDDs](https://www.baeldung.com/java-spark-dataframe-dataset-rdd) From 88820fbc6324b2944319559c3a1b665d4e641b7a Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 21 Oct 2020 11:37:34 +0800 Subject: [PATCH 171/302] Update README.md --- persistence-modules/spring-boot-persistence-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-boot-persistence-2/README.md b/persistence-modules/spring-boot-persistence-2/README.md index 392218d2bf..e7f32053e4 100644 --- a/persistence-modules/spring-boot-persistence-2/README.md +++ b/persistence-modules/spring-boot-persistence-2/README.md @@ -5,4 +5,5 @@ - [Integrating Spring Boot with HSQLDB](https://www.baeldung.com/spring-boot-hsqldb) - [List of In-Memory Databases](https://www.baeldung.com/java-in-memory-databases) - [Oracle Connection Pooling With Spring](https://www.baeldung.com/spring-oracle-connection-pooling) +- [Object States in Hibernate’s Session](https://www.baeldung.com/hibernate-session-object-states) - More articles: [[<-- prev]](../spring-boot-persistence) From 2bf7f715b04a5d7b2959fcd17fd585c8c2ea127d Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Wed, 21 Oct 2020 11:41:32 +0800 Subject: [PATCH 172/302] Update README.md --- core-java-modules/core-java-lang-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-lang-3/README.md b/core-java-modules/core-java-lang-3/README.md index 598014bb92..0707d0de98 100644 --- a/core-java-modules/core-java-lang-3/README.md +++ b/core-java-modules/core-java-lang-3/README.md @@ -7,4 +7,5 @@ This module contains articles about core features in the Java language - [When are Static Variables Initialized in Java?](https://www.baeldung.com/java-static-variables-initialization) - [Checking if a Class Exists in Java](https://www.baeldung.com/java-check-class-exists) - [The Difference Between a.getClass() and A.class in Java](https://www.baeldung.com/java-getclass-vs-class) +- [Constants in Java: Patterns and Anti-Patterns](https://www.baeldung.com/java-constants-good-practices) - [[<-- Prev]](/core-java-modules/core-java-lang-2) From 6d65fb29d0376b54011e638eac0b26da6fdfd892 Mon Sep 17 00:00:00 2001 From: Loredana Date: Wed, 21 Oct 2020 11:05:24 +0300 Subject: [PATCH 173/302] update h2 in jooq project --- spring-jooq/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-jooq/pom.xml b/spring-jooq/pom.xml index 95418645fa..550d49b5b2 100644 --- a/spring-jooq/pom.xml +++ b/spring-jooq/pom.xml @@ -206,7 +206,7 @@ 1.0.0 1.5 1.0.0 - org.jooq.example.spring.Application + 1.4.198 \ No newline at end of file From a66f2f55efa5be1108d3afb4cd3f8820488995a6 Mon Sep 17 00:00:00 2001 From: Loredana Date: Wed, 21 Oct 2020 14:45:56 +0300 Subject: [PATCH 174/302] fix relative path, fix start of kerberos app --- .../spring-security-sso-auth-server/pom.xml | 2 +- .../spring-security-sso-kerberos/pom.xml | 6 +++++- .../spring-security-sso-ui-2/pom.xml | 2 +- .../spring-security-sso-ui/pom.xml | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-auth-server/pom.xml b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-auth-server/pom.xml index 3537c01e46..20a43eaf04 100644 --- a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-auth-server/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-auth-server/pom.xml @@ -8,7 +8,7 @@ com.baeldung - spring-security-sso + spring-security-oauth2-sso 1.0.0-SNAPSHOT diff --git a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-kerberos/pom.xml b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-kerberos/pom.xml index a67cc4af83..f17ca171a5 100644 --- a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-kerberos/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-kerberos/pom.xml @@ -7,7 +7,7 @@ com.baeldung - spring-security-sso + spring-security-oauth2-sso 1.0.0-SNAPSHOT @@ -91,5 +91,9 @@ + + + com.baeldung.intro.Application + \ No newline at end of file diff --git a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui-2/pom.xml b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui-2/pom.xml index 0645ba3593..514dd0d0f7 100644 --- a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui-2/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui-2/pom.xml @@ -8,7 +8,7 @@ com.baeldung - spring-security-sso + spring-security-oauth2-sso 1.0.0-SNAPSHOT diff --git a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui/pom.xml b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui/pom.xml index d34317a4b0..5076b1878b 100644 --- a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui/pom.xml @@ -8,7 +8,7 @@ com.baeldung - spring-security-sso + spring-security-oauth2-sso 1.0.0-SNAPSHOT From 9f9f0c40f5df741e1e31e2f0af3effc605b2f095 Mon Sep 17 00:00:00 2001 From: Kai Yuan Date: Wed, 21 Oct 2020 22:39:43 +0200 Subject: [PATCH 175/302] [BAEL-4284] AbstractMethodError --- .../core-java-exceptions-3/pom.xml | 8 +++++++ .../AbstractMethodErrorUnitTest.java | 23 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/abstractmethoderror/AbstractMethodErrorUnitTest.java diff --git a/core-java-modules/core-java-exceptions-3/pom.xml b/core-java-modules/core-java-exceptions-3/pom.xml index b909572afe..8c36fd0af1 100644 --- a/core-java-modules/core-java-exceptions-3/pom.xml +++ b/core-java-modules/core-java-exceptions-3/pom.xml @@ -17,6 +17,14 @@ + + + com.h2database + h2 + 1.4.191 + test + + org.assertj diff --git a/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/abstractmethoderror/AbstractMethodErrorUnitTest.java b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/abstractmethoderror/AbstractMethodErrorUnitTest.java new file mode 100644 index 0000000000..cadc884487 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/abstractmethoderror/AbstractMethodErrorUnitTest.java @@ -0,0 +1,23 @@ +package com.baeldung.exceptions.abstractmethoderror; + + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +class AbstractMethodErrorUnitTest { + private static final String url = "jdbc:h2:mem:A-DATABASE;INIT=CREATE SCHEMA IF NOT EXISTS myschema"; + private static final String username = "sa"; + + @Test + void givenOldH2Database_whenCallgetSchemaMethod_thenThrowAbstractMethodError() throws SQLException { + Connection conn = DriverManager.getConnection(url, username, ""); + assertNotNull(conn); + Assertions.assertThrows(AbstractMethodError.class, () -> conn.getSchema()); + } +} From b2a3a69b4aa2ca7035f0f95db11fd1a9f6351679 Mon Sep 17 00:00:00 2001 From: AbdallahSawan Date: Thu, 22 Oct 2020 11:19:33 +0300 Subject: [PATCH 176/302] The Value of 0xFF Number and Its Uses With & Operation in Java Article by Abdallah Sawan --- .../com/baeldung/number_0xff/Number0xff.java | 20 ++++++++ .../number_0xff/Number0xffUnitTest.java | 49 +++++++++++++++++++ .../src/main/java/com/baeldung/Main.java | 23 --------- 3 files changed, 69 insertions(+), 23 deletions(-) create mode 100644 java-numbers-4/src/main/java/com/baeldung/number_0xff/Number0xff.java create mode 100644 java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java delete mode 100644 java-numbers-5/src/main/java/com/baeldung/Main.java diff --git a/java-numbers-4/src/main/java/com/baeldung/number_0xff/Number0xff.java b/java-numbers-4/src/main/java/com/baeldung/number_0xff/Number0xff.java new file mode 100644 index 0000000000..2828dccdb3 --- /dev/null +++ b/java-numbers-4/src/main/java/com/baeldung/number_0xff/Number0xff.java @@ -0,0 +1,20 @@ +package com.baeldung.number_0xff; + +public class Number0xff { + + public static int getRedColor(int rgba) { + return rgba >> 24 & 0xff; + } + + public static int getGreenColor(int rgba) { + return rgba >> 16 & 0xff; + } + + public static int getBlueColor(int rgba) { + return rgba >> 8 & 0xff; + } + + public static int getAlfa(int rgba) { + return rgba >> rgba & 0xff; + } +} diff --git a/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java b/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java new file mode 100644 index 0000000000..6dc4d03c48 --- /dev/null +++ b/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java @@ -0,0 +1,49 @@ +package com.baeldung.number_0xff; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; + +public class Number0xffUtitTest { + + @Test + public void test0xFFAssignedToInteger() { + int x = 0xff; + int expectedValue = 255; + assertEquals(x, expectedValue); + } + + @Test + public void test0xFFAssignedToByte() { + byte y = (byte) 0xff; + int expectedValue = -1; + assertEquals(x, expectedValue); + } + + @Test + public void givenColor_thenExtractRedColor() { + int rgba = 272214023; + int expectedValue = 64; + assertEquals(Number0xff.getRedColor(rgba), expectedValue); + } + + @Test + public void givenColor_thenExtractGreenColor() { + int rgba = 272214023; + int expectedValue = 57; + assertEquals(Number0xff.getGreenColor(rgba), expectedValue); + } + + @Test + public void givenColor_thenExtractBlueColor() { + int rgba = 272214023; + int expectedValue = 168; + assertEquals(Number0xff.getBlueColor(rgba), expectedValue); + } + + @Test + public void givenColor_thenExtractAlfa() { + int rgba = 272214023; + int expectedValue = 7; + assertEquals(Number0xff.getAlfa(rgba), expectedValue); + } +} diff --git a/java-numbers-5/src/main/java/com/baeldung/Main.java b/java-numbers-5/src/main/java/com/baeldung/Main.java deleted file mode 100644 index dfc625809d..0000000000 --- a/java-numbers-5/src/main/java/com/baeldung/Main.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung; - -public class Main { - - public static void main(String[] args) { - int x = 0xff; - System.out.println(x); // output is 255 - - byte y = (byte) 0xff; - System.out.println(y); // output is -1 - - int rgba = 272214023; - int r = rgba >> 24; - int g = rgba >> 16 & 0xFF; - int b = rgba >> 8 & 0xFF; - int a = rgba & 0xFF; - - System.out.println(r); // output is 64 - System.out.println(g); // output is 57 - System.out.println(b); // output is 168 - System.out.println(a); // output is 7 - } -} From 506953bb567dc7038c060b8d7372aaa746a122f9 Mon Sep 17 00:00:00 2001 From: AbdallahSawan Date: Thu, 22 Oct 2020 13:53:45 +0300 Subject: [PATCH 177/302] The Value of 0xFF Number and Its Uses With & Operation in Java Article by Abdallah Sawan --- .../com/baeldung/number_0xff/Number0xffUnitTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java b/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java index 6dc4d03c48..e9f80c57d5 100644 --- a/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java +++ b/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java @@ -3,7 +3,7 @@ package com.baeldung.number_0xff; import org.junit.Test; import static org.junit.Assert.assertEquals; -public class Number0xffUtitTest { +public class Number0xffUnitTest { @Test public void test0xFFAssignedToInteger() { @@ -20,28 +20,28 @@ public class Number0xffUtitTest { } @Test - public void givenColor_thenExtractRedColor() { + public void givenColor_whenGetRedColor_thenExtractRedColor() { int rgba = 272214023; int expectedValue = 64; assertEquals(Number0xff.getRedColor(rgba), expectedValue); } @Test - public void givenColor_thenExtractGreenColor() { + public void givenColor_whenGetGreenColor_thenExtractGreenColor() { int rgba = 272214023; int expectedValue = 57; assertEquals(Number0xff.getGreenColor(rgba), expectedValue); } @Test - public void givenColor_thenExtractBlueColor() { + public void givenColor_whenGetBlueColor_thenExtractBlueColor() { int rgba = 272214023; int expectedValue = 168; assertEquals(Number0xff.getBlueColor(rgba), expectedValue); } @Test - public void givenColor_thenExtractAlfa() { + public void givenColor_whenGetAlfa_thenExtractAlfa() { int rgba = 272214023; int expectedValue = 7; assertEquals(Number0xff.getAlfa(rgba), expectedValue); From 06419d4deb253022edebf22a9efed21005fa5ae8 Mon Sep 17 00:00:00 2001 From: AbdallahSawan Date: Thu, 22 Oct 2020 14:00:10 +0300 Subject: [PATCH 178/302] The Value of 0xFF Number and Its Uses With & Operation in Java Article by Abdallah Sawan --- .../test/java/com/baeldung/number_0xff/Number0xffUnitTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java b/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java index e9f80c57d5..64615ccee9 100644 --- a/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java +++ b/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java @@ -16,7 +16,7 @@ public class Number0xffUnitTest { public void test0xFFAssignedToByte() { byte y = (byte) 0xff; int expectedValue = -1; - assertEquals(x, expectedValue); + assertEquals(y, expectedValue); } @Test From 12b927e2aea4d550c7430d6a6f68e85d1a13a5e4 Mon Sep 17 00:00:00 2001 From: AbdallahSawan Date: Thu, 22 Oct 2020 14:11:18 +0300 Subject: [PATCH 179/302] The Value of 0xFF Number and Its Uses With & Operation in Java Article by Abdallah Sawan --- .../src/main/java/com/baeldung/number_0xff/Number0xff.java | 2 +- .../test/java/com/baeldung/number_0xff/Number0xffUnitTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java-numbers-4/src/main/java/com/baeldung/number_0xff/Number0xff.java b/java-numbers-4/src/main/java/com/baeldung/number_0xff/Number0xff.java index 2828dccdb3..1708afb5a2 100644 --- a/java-numbers-4/src/main/java/com/baeldung/number_0xff/Number0xff.java +++ b/java-numbers-4/src/main/java/com/baeldung/number_0xff/Number0xff.java @@ -15,6 +15,6 @@ public class Number0xff { } public static int getAlfa(int rgba) { - return rgba >> rgba & 0xff; + return rgba & 0xff; } } diff --git a/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java b/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java index 64615ccee9..95a9349b49 100644 --- a/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java +++ b/java-numbers-4/src/test/java/com/baeldung/number_0xff/Number0xffUnitTest.java @@ -22,7 +22,7 @@ public class Number0xffUnitTest { @Test public void givenColor_whenGetRedColor_thenExtractRedColor() { int rgba = 272214023; - int expectedValue = 64; + int expectedValue = 16; assertEquals(Number0xff.getRedColor(rgba), expectedValue); } From 65739ae38233b56aa989a15533be5fed38acc283 Mon Sep 17 00:00:00 2001 From: Loredana Date: Thu, 22 Oct 2020 17:34:56 +0300 Subject: [PATCH 180/302] upgrade gradle, kotlin versions --- kotlin-js/build.gradle | 54 +++++++++--------- kotlin-js/gradle/wrapper/gradle-wrapper.jar | Bin 54329 -> 58694 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- kotlin-js/gradlew | 51 ++++++++++------- kotlin-js/gradlew.bat | 21 ++++++- kotlin-js/package.json | 20 +++---- kotlin-js/settings.gradle | 2 +- 7 files changed, 89 insertions(+), 61 deletions(-) mode change 100755 => 100644 kotlin-js/build.gradle mode change 100755 => 100644 kotlin-js/gradlew.bat mode change 100755 => 100644 kotlin-js/package.json diff --git a/kotlin-js/build.gradle b/kotlin-js/build.gradle old mode 100755 new mode 100644 index 9efef0f475..ede6f51448 --- a/kotlin-js/build.gradle +++ b/kotlin-js/build.gradle @@ -1,27 +1,27 @@ -buildscript { - ext.kotlin_version = '1.2.41' - repositories { - mavenCentral() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -group 'com.baeldung' -version '1.0-SNAPSHOT' -apply plugin: 'kotlin2js' - -repositories { - mavenCentral() -} - -dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" -} - -compileKotlin2Js.kotlinOptions { - moduleKind = "commonjs" - outputFile = "node/crypto.js" -} +buildscript { + ext.kotlin_version = '1.4.10' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +group 'com.baeldung' +version '1.0-SNAPSHOT' +apply plugin: 'kotlin2js' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" + testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" +} + +compileKotlin2Js.kotlinOptions { + moduleKind = "commonjs" + outputFile = "node/crypto.js" +} diff --git a/kotlin-js/gradle/wrapper/gradle-wrapper.jar b/kotlin-js/gradle/wrapper/gradle-wrapper.jar index 01b8bf6b1f99cad9213fc495b33ad5bbab8efd20..490fda8577df6c95960ba7077c43220e5bb2c0d9 100644 GIT binary patch literal 58694 zcma&OV~}Oh(k5J8>Mq;1ZQHhO+v>7y+qO>Gc6Hgdjp>5?}0s%q%y~>Cv3(!c&iqe4q$^V<9O+7CU z|6d2bzlQvOI?4#hN{EUmDbvb`-pfo*NK4Vs&cR60P)<+IG%C_BGVL7RP11}?Ovy}9 zNl^cQJPR>SIVjSkXhS0@IVhqGLL)&%E<(L^ymkEXU!M5)A^-c;K>yy`Ihy@nZ}orr zK>gFl%+bKu+T{P~iuCWUZjJ`__9l-1*OFwCg_8CkKtLEEKtOc=d5NH%owJkk-}N#E z7Pd;x29C}qj>HVKM%D&SPSJ`JwhR2oJPU0u3?)GiA|6TndJ+~^eXL<%D)IcZ)QT?t zE7BJP>Ejq;`w$<dd^@|esR(;1Z@9EVR%7cZG`%Xr%6 zLHXY#GmPV!HIO3@j5yf7D{PN5E6tHni4mC;qIq0Fj_fE~F1XB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XDZp4-=+e5Uu^!Y>-Li5WoYd)iE;dIll<|% z{z+`)CCkeg&Sw^b#NTH5b42G$f|v1g&jg|=|DOc^tHoYMG(A({rT+%i|7@$5p)Jq& zu9?4q|IdLgFWc>9B)~ISBVax9V!-~>SoO!R`1K^~<^J Date: Thu, 22 Oct 2020 17:42:22 +0300 Subject: [PATCH 181/302] fix description, start script --- kotlin-js/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kotlin-js/package.json b/kotlin-js/package.json index 711627307a..915b9d41ea 100644 --- a/kotlin-js/package.json +++ b/kotlin-js/package.json @@ -1,10 +1,10 @@ { "name": "kotlin-node", "version": "1.0.0", - "description": "kotlin node ex", + "description": "Example of using NodeJS in Kotlin", "main": "crypto.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node node/crypto.js" }, "author": "", "license": "ISC", From 667bfb4b264a74e83113fb7ade1feea693b8e8cf Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 24 Oct 2020 13:11:51 +0300 Subject: [PATCH 182/302] upgrade jobrunr --- spring-boot-modules/spring-boot-libraries-2/pom.xml | 4 ++-- .../src/main/resources/application.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-modules/spring-boot-libraries-2/pom.xml b/spring-boot-modules/spring-boot-libraries-2/pom.xml index 2633c8fad3..35dec54450 100644 --- a/spring-boot-modules/spring-boot-libraries-2/pom.xml +++ b/spring-boot-modules/spring-boot-libraries-2/pom.xml @@ -39,8 +39,8 @@ - 1.0.0 + 1.1.0 4.0.3 - \ No newline at end of file + diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-libraries-2/src/main/resources/application.properties index 69f5a7356e..bb2a31f1d9 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/resources/application.properties @@ -1,2 +1,2 @@ -org.jobrunr.background_job_server=true -org.jobrunr.dashboard=true +org.jobrunr.background-job-server.enabled=true +org.jobrunr.dashboard.enabled=true From 4c983291accb36a634d8c913875da16ff09a63dc Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 24 Oct 2020 17:15:44 +0300 Subject: [PATCH 183/302] fix results display --- .../com/baeldung/view/SearchController.java | 32 ++++++++++--------- .../src/main/resources/SearchController.fxml | 15 ++++----- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/javafx/src/main/java/com/baeldung/view/SearchController.java b/javafx/src/main/java/com/baeldung/view/SearchController.java index 430580f8b5..93bca82053 100644 --- a/javafx/src/main/java/com/baeldung/view/SearchController.java +++ b/javafx/src/main/java/com/baeldung/view/SearchController.java @@ -10,6 +10,7 @@ import javafx.scene.Node; import javafx.scene.control.*; import javafx.scene.input.KeyCode; import javafx.scene.layout.VBox; +import javafx.scene.control.cell.PropertyValueFactory; import java.util.stream.Collectors; @@ -22,11 +23,14 @@ public class SearchController { @FXML private Button searchButton; @FXML - private Pagination pagination; - @FXML private Label searchLabel; - + @FXML + private TableView tableView; + @FXML + private VBox dataContainer; + private ObservableList masterData = FXCollections.observableArrayList(); + private ObservableList results = FXCollections.observableList(masterData); public SearchController() { masterData.add(new Person(5, "John", true)); @@ -52,22 +56,21 @@ public class SearchController { searchLabel.setText(newValue); }); - pagination.setPageFactory(SearchController.this::createPage); + initTable(); + } - private Node createPage(Integer pageIndex) { - - VBox dataContainer = new VBox(); - - TableView tableView = new TableView<>(masterData); + private void initTable() { + tableView = new TableView<>(FXCollections.observableList(masterData)); TableColumn id = new TableColumn("ID"); + id.setCellValueFactory(new PropertyValueFactory("id")); TableColumn name = new TableColumn("NAME"); + name.setCellValueFactory(new PropertyValueFactory("name")); TableColumn employed = new TableColumn("EMPLOYED"); + employed.setCellValueFactory(new PropertyValueFactory("isEmployed")); tableView.getColumns().addAll(id, name, employed); dataContainer.getChildren().add(tableView); - - return dataContainer; } private void loadData() { @@ -86,11 +89,10 @@ public class SearchController { }; task.setOnSucceeded(event -> { - masterData = task.getValue(); - pagination.setVisible(true); - pagination.setPageCount(masterData.size() / PAGE_ITEMS_COUNT); + results = task.getValue(); + tableView.setItems(FXCollections.observableList(results)); }); - + Thread th = new Thread(task); th.setDaemon(true); th.start(); diff --git a/javafx/src/main/resources/SearchController.fxml b/javafx/src/main/resources/SearchController.fxml index 5e83024d03..b1e11a8864 100644 --- a/javafx/src/main/resources/SearchController.fxml +++ b/javafx/src/main/resources/SearchController.fxml @@ -20,14 +20,13 @@