Skip to content

Commit

Permalink
Merge pull request AY2324S2-CS2103T-T08-2#64 from bertrandong/add-pro…
Browse files Browse the repository at this point in the history
…ducttest

Add ProductTest and fix QuantityTest
  • Loading branch information
bertrandong authored Mar 19, 2024
2 parents db5de3c + 1da9985 commit 5530427
Show file tree
Hide file tree
Showing 345 changed files with 19,321 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pdf binary
18 changes: 18 additions & 0 deletions .github/check-eof-newline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
# Checks that all text files end with a newline.

ret=0

# Preserve filename with spaces by only splitting on newlines.
IFS='
'

for filename in $(git grep --cached -I -l -e '' -- ':/'); do
if [ "$(tail -c 1 "./$filename")" != '' ]; then
line="$(wc -l "./$filename" | cut -d' ' -f1)"
echo "ERROR:$filename:$line: no newline at EOF."
ret=1
fi
done

exit $ret
19 changes: 19 additions & 0 deletions .github/check-line-endings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
# Checks for prohibited line endings.
# Prohibited line endings: \r\n

git grep --cached -I -n --no-color -P '\r$' -- ':/' |
awk '
BEGIN {
FS = ":"
OFS = ":"
ret = 0
}
{
ret = 1
print "ERROR", $1, $2, " prohibited \\r\\n line ending, use \\n instead."
}
END {
exit ret
}
'
26 changes: 26 additions & 0 deletions .github/check-trailing-whitespace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
# Checks for trailing whitespace

git grep --cached -I -n --no-color -P '[ \t]+$' -- ':/' |
awk '
BEGIN {
FS = ":"
OFS = ":"
ret = 0
}
{
# Only warn for markdown files (*.md) to accomodate text editors
# which do not properly handle trailing whitespace.
# (e.g. GitHub web editor)
if ($1 ~ /\.md$/) {
severity = "WARN"
} else {
severity = "ERROR"
ret = 1
}
print severity, $1, $2, " trailing whitespace."
}
END {
exit ret
}
'
11 changes: 11 additions & 0 deletions .github/run-checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# Runs all check-* scripts, and returns a non-zero exit code if any of them fail.

dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) &&
ret=0 &&
for checkscript in "$dir"/check-*; do
if ! "$checkscript"; then
ret=1
fi
done
exit $ret
51 changes: 51 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Java CI

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- name: Set up repository
uses: actions/checkout@main

- name: Set up repository
uses: actions/checkout@main
with:
ref: master

- name: Merge to master
run: git checkout --progress --force ${{ github.sha }}

- name: Run repository-wide tests
if: runner.os == 'Linux'
working-directory: ${{ github.workspace }}/.github
run: ./run-checks.sh

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
java-package: jdk+fx

- name: Build and check with Gradle
run: ./gradlew check coverage

- name: Upload coverage reports to Codecov
if: runner.os == 'Linux'
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: AY2324S2-CS2103T-T08-2/tp
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Gradle build files
/.gradle/
/build/
src/main/resources/docs/

# IDEA files
/.idea/
/out/
/*.iml

# Storage/log files
/data/
/config.json
/preferences.json
/*.log.*
hs_err_pid[0-9]*.log

# Test sandbox files
src/test/data/sandbox/

# MacOS custom attributes files created by Finder
.DS_Store
docs/_site/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Software Engineering Education - FOSS Resources

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/AY2324S2-CS2103T-T08-2/tp/actions)

![Ui](docs/images/Ui.png)

## Strack.io
* `Strack.io` is a desktop application for **managing customer information and orders**.<br>
Example usages:
* For homemade food sellers to keep track of customer orders.
* Keep records of customer information for easy reference.
* `Strack.io` can help homemade food sellers **organize customer information and orders** so that they know **what** to bake, **how much** to bake and **where to deliver** the order to. This information management tool aims to be **more efficient to use than paper-work or general-purpose excel sheets**. We also aim to **reduce chances of mistakes** such as wrong delivery address, forgetting an order or sending repeated orders.
* Feature list:
* Add new customer contact information
* Edit contact information
* Search contact based on keywords
* Create orders, which will be tagged to the respective customer
* Edit order information
* List out all active orders
* Delete order when delivery is done
* It is named `Strack.io` because it was created to help keep track of snack orders.
* For the detailed documentation of this project, see the **[Strack.io Product Website](https://ay2324s2-cs2103t-t08-2.github.io/tp/)**.

**Acknowledgements**

* Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5)
* This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org).
72 changes: 72 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
plugins {
id 'java'
id 'checkstyle'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'application'
id 'jacoco'
}

mainClassName = 'seedu.address.Main'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}

checkstyle {
toolVersion = '10.2'
}

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

task coverage(type: JacocoReport) {
sourceDirectories.from files(sourceSets.main.allSource.srcDirs)
classDirectories.from files(sourceSets.main.output)
executionData.from files(jacocoTestReport.executionData)
afterEvaluate {
classDirectories.from files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/*.jar'])
})
}
reports {
html.required = true
xml.required = true
}
}

dependencies {
String jUnitVersion = '5.4.0'
String javaFxVersion = '17.0.7'

implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux'

implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.7.4'

testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: jUnitVersion

testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: jUnitVersion
}

shadowJar {
archiveFileName = 'addressbook.jar'
}

defaultTasks 'clean', 'test'
Loading

0 comments on commit 5530427

Please sign in to comment.