From 5aa9389a19050a49e1b73de9cad6deae8df3353b Mon Sep 17 00:00:00 2001 From: eugenp Date: Tue, 5 Aug 2014 09:50:16 +0300 Subject: [PATCH] minor testing work --- .../baeldung/java/CoreJavaRandomUnitTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/core-java/src/test/java/org/baeldung/java/CoreJavaRandomUnitTest.java b/core-java/src/test/java/org/baeldung/java/CoreJavaRandomUnitTest.java index 17a78651ff..36eb8d4714 100644 --- a/core-java/src/test/java/org/baeldung/java/CoreJavaRandomUnitTest.java +++ b/core-java/src/test/java/org/baeldung/java/CoreJavaRandomUnitTest.java @@ -17,6 +17,13 @@ public class CoreJavaRandomUnitTest { System.out.println(generatedLong); } + @Test + public void givenUsingApacheCommons_whenGeneratingRandomLongUnbounded_thenCorrect() { + final long generatedLong = new RandomDataGenerator().getRandomGenerator().nextLong(); + + System.out.println(generatedLong); + } + @Test public void givenUsingPlainJava_whenGeneratingRandomLongBounded_thenCorrect() { final long leftLimit = 1L; @@ -53,6 +60,13 @@ public class CoreJavaRandomUnitTest { System.out.println(generatedInteger); } + @Test + public void givenUsingApache_whenGeneratingRandomIntegerUnbounded_thenCorrect() { + final Integer generatedInteger = new RandomDataGenerator().getRandomGenerator().nextInt(); + + System.out.println(generatedInteger); + } + @Test public void givenUsingApache_whenGeneratingRandomIntegerBounded_thenCorrect() { final int leftLimit = 1; @@ -71,6 +85,13 @@ public class CoreJavaRandomUnitTest { System.out.println(generatedFloat); } + @Test + public void givenUsingApache_whenGeneratingRandomFloatUnbounded_thenCorrect() { + final float generatedFloat = new RandomDataGenerator().getRandomGenerator().nextFloat(); + + System.out.println(generatedFloat); + } + @Test public void givenUsingPlainJava_whenGeneratingRandomFloatBouned_thenCorrect() { final float leftLimit = 1F;