From c3e056c318113809809aa47fe134bde9c41dc378 Mon Sep 17 00:00:00 2001 From: Jen Date: Fri, 25 Jun 2021 18:56:10 -0400 Subject: [PATCH] Loggin Lab --- LogginLab1.iml | 16 +++++++++++ pom.xml | 4 +++ src/.idea/misc.xml | 6 ++++ src/.idea/modules.xml | 10 +++++++ src/.idea/src.iml | 9 ++++++ src/.idea/vcs.xml | 6 ++++ src/.idea/workspace.xml | 49 ++++++++++++++++++++++++++++++++ src/main/java/LogginLab.java | 2 ++ src/main/main.iml | 11 +++++++ src/test/java/LogginLabTest.java | 17 +++++++++++ src/test/test.iml | 11 +++++++ 11 files changed, 141 insertions(+) create mode 100644 LogginLab1.iml create mode 100644 src/.idea/misc.xml create mode 100644 src/.idea/modules.xml create mode 100644 src/.idea/src.iml create mode 100644 src/.idea/vcs.xml create mode 100644 src/.idea/workspace.xml create mode 100644 src/main/main.iml create mode 100644 src/test/test.iml diff --git a/LogginLab1.iml b/LogginLab1.iml new file mode 100644 index 0000000..4e3316b --- /dev/null +++ b/LogginLab1.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 68a484b..f9b09b9 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,10 @@ rocks.zipcode LogginLab1 1.0-SNAPSHOT + + 1.8 + 1.8 + junit diff --git a/src/.idea/misc.xml b/src/.idea/misc.xml new file mode 100644 index 0000000..40674af --- /dev/null +++ b/src/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/.idea/modules.xml b/src/.idea/modules.xml new file mode 100644 index 0000000..31eaf94 --- /dev/null +++ b/src/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/.idea/src.iml b/src/.idea/src.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/src/.idea/src.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/.idea/vcs.xml b/src/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/src/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/.idea/workspace.xml b/src/.idea/workspace.xml new file mode 100644 index 0000000..130a7c1 --- /dev/null +++ b/src/.idea/workspace.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1624659889866 + + + + + + + \ No newline at end of file diff --git a/src/main/java/LogginLab.java b/src/main/java/LogginLab.java index 11744ac..aa78cd0 100644 --- a/src/main/java/LogginLab.java +++ b/src/main/java/LogginLab.java @@ -32,6 +32,8 @@ public boolean thresholdExceeds(Integer limit) { return (this.threshold > limit); } + public boolean thresholdReached(Integer limit) { return (this.threshold < limit); } + // Write a method called thresholdReached, returns true if argument 'limit' is over the threshold. // Write a test for the method in the Test class. } diff --git a/src/main/main.iml b/src/main/main.iml new file mode 100644 index 0000000..908ad4f --- /dev/null +++ b/src/main/main.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/LogginLabTest.java b/src/test/java/LogginLabTest.java index be1c95f..e8926d1 100644 --- a/src/test/java/LogginLabTest.java +++ b/src/test/java/LogginLabTest.java @@ -31,4 +31,21 @@ public void thresholdExceeds() { } } } + @org.junit.Test + public void thresholdReached() { + Integer finalLimit = 5; + + LogginLab lab = new LogginLab(); + lab.setThreshold(finalLimit); + + for (Integer i = 1; i <= finalLimit; i++) { + if (lab.thresholdReached(i)) { + logger.log(Level.INFO, "Threshold reached. It is "+i); + assertTrue(lab.thresholdExceeds(i)); + } else { + logger.log(Level.INFO, "Threshold not reached. It is "+i); + assertFalse(lab.thresholdExceeds(i)); + } + } + } } \ No newline at end of file diff --git a/src/test/test.iml b/src/test/test.iml new file mode 100644 index 0000000..a0e49a3 --- /dev/null +++ b/src/test/test.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file