Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions LogginLab1.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
</component>
</module>
Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/main/.DS_Store
Binary file not shown.
Binary file added src/main/java/.DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions src/main/java/LogginLab.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public LogginLab() {
this.threshold = 0;
}


public static void main(String[] args) {

logger.log(Level.INFO, "Hello World!");
Expand All @@ -32,6 +33,11 @@ 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.
}
Binary file added src/test/.DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions src/test/java/LogginLabTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,20 @@ public void thresholdExceeds() {
}
}
}
@org.junit.Test
public void thresholdReached(){
Integer finalLimit = 5;
int maxLimit=6;
LogginLab lab = new LogginLab();
lab.setThreshold(finalLimit);
for (Integer i=1;i<=maxLimit; i++){
if (lab.thresholdReached(i)){
logger.log(Level.INFO,"Theshold over the limit");
assertTrue(lab.thresholdReached(i));
}else {
logger.log(Level.INFO,"Limit over the theshold"+1);
}
}

}
}