Skip to content

Commit f89db28

Browse files
Glenn LeeGlenn Lee
authored andcommitted
Added Gradle and JUnit Tests
1 parent 060332a commit f89db28

17 files changed

Lines changed: 487 additions & 2 deletions

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf
6+

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ bin/
1515

1616
/text-ui-test/ACTUAL.txt
1717
text-ui-test/EXPECTED-UNIX.TXT
18+
19+
# Ignore Gradle project-specific cache directory
20+
.gradle
21+
22+
# Ignore Gradle build output directory
23+
build

build.gradle

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
plugins {
2+
id 'java'
3+
id 'application'
4+
id 'checkstyle'
5+
id 'com.github.johnrengelman.shadow' version '5.1.0'
6+
}
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0'
14+
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0'
15+
}
16+
17+
test {
18+
useJUnitPlatform()
19+
20+
testLogging {
21+
events "passed", "skipped", "failed"
22+
23+
showExceptions true
24+
exceptionFormat "full"
25+
showCauses true
26+
showStackTraces true
27+
showStandardStreams = false
28+
}
29+
}
30+
31+
application {
32+
mainClassName = "duke.Duke"
33+
}
34+
35+
shadowJar {
36+
archiveBaseName = "duke"
37+
archiveClassifier = null
38+
}
39+
40+
checkstyle {
41+
toolVersion = '8.32'
42+
}
43+
44+
run{
45+
standardInput = System.in
46+
}

gradle/wrapper/gradle-wrapper.jar

57.8 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

gradlew

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* The settings file is used to specify which projects to include in your build.
5+
*
6+
* Detailed information about configuring a multi-project build in Gradle can be found
7+
* in the user manual at https://docs.gradle.org/6.8.1/userguide/multi_project_builds.html
8+
*/
9+
10+
rootProject.name = 'ip'

src/main/java/Checklst.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void run() {
3737
continue;
3838
}
3939
input = command.split(" ", 2);
40-
this.parser.parse(input, ui, taskList, storage);
40+
this.parser.parseHistoryCommand(input, taskList);
4141
}
4242
this.ui.sendOutput("History successfully restored!");
4343
} catch (InvalidPathException | IOException e) {

src/main/java/storage/Storage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ public void saveToFile() throws ChecklstException {
3131
}
3232
}
3333

34+
protected ArrayList<String> getCommandHistory() {
35+
return this.commandHistory;
36+
}
37+
3438
}

0 commit comments

Comments
 (0)