diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..16ecbf7230e9c0678ca974d9c8bb943932661719 --- /dev/null +++ b/.gitignore @@ -0,0 +1,320 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/gradle,intellij,java,visualstudiocode,macos,linux,windows,vim,eclipse +# Edit at https://www.toptal.com/developers/gitignore?templates=gradle,intellij,java,visualstudiocode,macos,linux,windows,vim,eclipse + +### Eclipse ### +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +.project +.classpath + +### Eclipse Patch ### +# Spring Boot Tooling +.sts4-cache/ + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +.idea/artifacts +.idea/compiler.xml +.idea/jarRepositories.xml +.idea/modules.xml +.idea/*.iml +.idea/modules +*.iml +*.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/tasks.json +!.vscode/launch.json +*.code-workspace + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### Gradle ### +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +### Gradle Patch ### +**/build/ + +# End of https://www.toptal.com/developers/gitignore/api/gradle,intellij,java,visualstudiocode,macos,linux,windows,vim,eclipse diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8686e8e35b77841d1621e98ca7975f598e83c945..3a9f80ab1ef553e77462cda8e64f32a953831e1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,32 @@ -image: java:latest - stages: - build - - execute + - test + +default: + image: gradle:6.8.3-jdk15 + before_script: + - export GRADLE_USER_HOME=`pwd`/.gradle + +variables: + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + JACOCO_CSV_LOCATION: '$CI_PROJECT_DIR/build/jacocoCsv' build: stage: build - script: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac Main.java + script: + - gradle assemble + +test: + stage: test + script: + - gradle test + - gradle check + - gradle jacocoTestReport + - gradle jacocoTestCoverageVerification + - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print 100*covered/instructions, "% covered" }' $JACOCO_CSV_LOCATION artifacts: + when: always paths: - - Main.* - -execute: - stage: execute - script: /usr/lib/jvm/java-8-openjdk-amd64/bin/java Main + - build/jacoco/test.exec + reports: + junit: build/test-results/test/**/TEST-*.xml diff --git a/.idea/libraries-with-intellij-classes.xml b/.idea/libraries-with-intellij-classes.xml new file mode 100644 index 0000000000000000000000000000000000000000..9fa31567f15dc501f8e689495e8083da1ee0d041 --- /dev/null +++ b/.idea/libraries-with-intellij-classes.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="libraries-with-intellij-classes"> + <option name="intellijApiContainingLibraries"> + <list> + <LibraryCoordinatesState> + <option name="artifactId" value="ideaIU" /> + <option name="groupId" value="com.jetbrains.intellij.idea" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="ideaIU" /> + <option name="groupId" value="com.jetbrains" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="ideaIC" /> + <option name="groupId" value="com.jetbrains.intellij.idea" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="ideaIC" /> + <option name="groupId" value="com.jetbrains" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="pycharmPY" /> + <option name="groupId" value="com.jetbrains.intellij.pycharm" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="pycharmPY" /> + <option name="groupId" value="com.jetbrains" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="pycharmPC" /> + <option name="groupId" value="com.jetbrains.intellij.pycharm" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="pycharmPC" /> + <option name="groupId" value="com.jetbrains" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="clion" /> + <option name="groupId" value="com.jetbrains.intellij.clion" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="clion" /> + <option name="groupId" value="com.jetbrains" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="riderRD" /> + <option name="groupId" value="com.jetbrains.intellij.rider" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="riderRD" /> + <option name="groupId" value="com.jetbrains" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="goland" /> + <option name="groupId" value="com.jetbrains.intellij.goland" /> + </LibraryCoordinatesState> + <LibraryCoordinatesState> + <option name="artifactId" value="goland" /> + <option name="groupId" value="com.jetbrains" /> + </LibraryCoordinatesState> + </list> + </option> + </component> +</project> \ No newline at end of file diff --git a/.idea/libraries/opencsv.xml b/.idea/libraries/opencsv.xml deleted file mode 100644 index 00318c250707f45f340b310008c10278f3bf4c7c..0000000000000000000000000000000000000000 --- a/.idea/libraries/opencsv.xml +++ /dev/null @@ -1,9 +0,0 @@ -<component name="libraryTable"> - <library name="opencsv"> - <CLASSES> - <root url="jar://$PROJECT_DIR$/opencsv-5.4.jar!/com/opencsv" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> -</component> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index d72bc4ca88d59c86b5ca51209deed6c339d4c705..0000000000000000000000000000000000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectRootManager" version="2" project-jdk-name="15" project-jdk-type="JavaSDK"> - <output url="file://$PROJECT_DIR$/out" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 523c1809d41e8ab5cd6bf017817d3b59a94bc2ec..0000000000000000000000000000000000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectModuleManager"> - <modules> - <module fileurl="file://$PROJECT_DIR$/SiJadwal_Simple.iml" filepath="$PROJECT_DIR$/SiJadwal_Simple.iml" /> - </modules> - </component> -</project> \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index e96534fb27b68192f27f985d3879e173ec77adb8..0000000000000000000000000000000000000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="Palette2"> - <group name="Swing"> - <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> - </item> - <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> - </item> - <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> - </item> - <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> - <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> - </item> - <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> - <initial-values> - <property name="text" value="Button" /> - </initial-values> - </item> - <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> - <initial-values> - <property name="text" value="RadioButton" /> - </initial-values> - </item> - <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> - <initial-values> - <property name="text" value="CheckBox" /> - </initial-values> - </item> - <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> - <initial-values> - <property name="text" value="Label" /> - </initial-values> - </item> - <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> - <preferred-size width="150" height="-1" /> - </default-constraints> - </item> - <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> - <preferred-size width="150" height="-1" /> - </default-constraints> - </item> - <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> - <preferred-size width="150" height="-1" /> - </default-constraints> - </item> - <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> - </item> - <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> - <preferred-size width="150" height="50" /> - </default-constraints> - </item> - <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> - <preferred-size width="200" height="200" /> - </default-constraints> - </item> - <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> - <preferred-size width="200" height="200" /> - </default-constraints> - </item> - <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> - </item> - <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> - </item> - <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> - </item> - <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> - </item> - <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> - <preferred-size width="-1" height="20" /> - </default-constraints> - </item> - <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> - <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> - </item> - <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> - <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> - </item> - </group> - </component> -</project> \ No newline at end of file diff --git a/Courses.csv b/Courses.csv index 92384f8172d92522dea79954455a54d5a1df53ac..79c05a37c2ca9a665a38869b15ae00b1a9d2c0b7 100644 --- a/Courses.csv +++ b/Courses.csv @@ -1,3 +1,3 @@ rpl,ade,1:01:01,1:01:02 adpro,daya,5:05:05,7:07:07 -daa,there,4:04:04,13:01:01 \ No newline at end of file +daa,there,4:04:04,13:01:01 diff --git a/README.md b/README.md index 39393307a5bf67913c9a4410f0eaee8c73f80c19..3c7acfa702f0846a1d13b9d1f120194f3aa2fe33 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[](https://gitlab.cs.ui.ac.id/softeng-group-3/weekly-planner/-/commits/master) +[](https://gitlab.cs.ui.ac.id/softeng-group-3/weekly-planner/-/commits/master) # Readme File ## Work Breakdown Structure diff --git a/SiJadwal_Simple.iml b/SiJadwal_Simple.iml deleted file mode 100644 index 00344b83db69f153cf452c7d00d62e822abe5d3a..0000000000000000000000000000000000000000 --- a/SiJadwal_Simple.iml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_13" inherit-compiler-output="true"> - <exclude-output /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="opencsv" level="project" /> - <orderEntry type="module-library" scope="TEST"> - <library name="JUnit5.7.0"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.7.0/junit-jupiter-5.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.7.0/junit-platform-commons-1.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.7.0/junit-jupiter-params-5.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.7.0/junit-jupiter-engine-5.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.7.0/junit-platform-engine-1.7.0.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.7.0/junit-jupiter-5.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.7.0/junit-platform-commons-1.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.7.0/junit-jupiter-params-5.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.7.0/junit-jupiter-engine-5.7.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.7.0/junit-platform-engine-1.7.0.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library name="JUnit5.4"> - <CLASSES> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.4.2/junit-jupiter-5.4.2.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.4.2/junit-jupiter-api-5.4.2.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.4.2/junit-platform-commons-1.4.2.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.4.2/junit-jupiter-params-5.4.2.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.4.2/junit-jupiter-engine-5.4.2.jar!/" /> - <root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.4.2/junit-platform-engine-1.4.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - </component> -</module> \ No newline at end of file diff --git a/Users.csv b/Users.csv index 6906da146beb56c621dd5cb1730e11f22cafdc3e..7bb33c9c1f747bf7fe4df91f7382eecaab3f6403 100644 --- a/Users.csv +++ b/Users.csv @@ -1,3 +1,3 @@ admin,Admin st,Student -ta,Teaching Assistant +ta,Teaching Assistant \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..3c6d530187ae1dd3bc4ad233b78646d0c3d66d4f --- /dev/null +++ b/build.gradle @@ -0,0 +1,54 @@ +// Apply the application plugin to add support for building a CLI application in Java. +apply plugin: "application" +apply plugin: "jacoco" + +mainClassName = "sijadwal.Main" + + +group = 'Softeng.Group3' +version = '1.0-SNAPSHOT' + +repositories { + // Use Maven Central for resolving dependencies. + mavenCentral() +} + +dependencies { + implementation 'org.junit.jupiter:junit-jupiter:5.4.2' + + // Use JUnit Jupiter API for testing. + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1' + + // Use JUnit Jupiter Engine for testing. + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' + + // This dependency is used by the application. + implementation 'com.google.guava:guava:30.0-jre' +} + +run { + standardInput = System.in +} + +test { + useJUnitPlatform() + finalizedBy("jacocoTestReport") // report is always generated after tests run +} +jacoco { + toolVersion = "0.8.6" +} + +jacocoTestReport { + dependsOn test // tests are required to run before generating the report + reports { + csv.enabled true + csv.destination file("${buildDir}/jacocoCsv") + html.destination layout.buildDirectory.dir('jacocoHtml').get().asFile + } + afterEvaluate { + classDirectories.setFrom(files(classDirectories.files.collect { + fileTree(dir: it, exclude:['**/Main*.class'] + ) + })) + } +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..da9702f9e70d99d587ce73bbfb0c212fc66e24c9 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000000000000000000000000000000000000..4f906e0c811fc9e230eb44819f509cd0627f2600 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..107acd32c4e687021ef32db511e8a206129b88ec --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/out/artifacts/SiJadwal_Simple_jar/SiJadwal_Simple.jar b/out/artifacts/SiJadwal_Simple_jar/SiJadwal_Simple.jar deleted file mode 100644 index 1cfe93e98242d504eaf93ef247a20fab9d488525..0000000000000000000000000000000000000000 Binary files a/out/artifacts/SiJadwal_Simple_jar/SiJadwal_Simple.jar and /dev/null differ diff --git a/out/production/SiJadwal_Simple/META-INF/MANIFEST.MF b/out/production/SiJadwal_Simple/META-INF/MANIFEST.MF deleted file mode 100644 index 48f6ef6ce9e655d7076b69fef2e1e7ae6ac23324..0000000000000000000000000000000000000000 --- a/out/production/SiJadwal_Simple/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Main-Class: Softeng.Group3.SiJadwal.Main - diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/Main.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/Main.class deleted file mode 100644 index 1ec0127728124627b8f3517dd1e8ca643a79dfa5..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/Main.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Admin.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Admin.class deleted file mode 100644 index 244b32e46226063c45b862d02fa777f6ab25cb05..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Admin.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Role.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Role.class deleted file mode 100644 index fe3dd327ac1309f986141930055822db591792e4..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Role.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/RoleType$1.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/RoleType$1.class deleted file mode 100644 index f326200ee0962ede78fd35caf2a752bc001e6174..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/RoleType$1.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/RoleType.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/RoleType.class deleted file mode 100644 index a5991500295fe3519ffaaf2f89db83b59caef844..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/RoleType.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Student.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Student.class deleted file mode 100644 index ff0dc20211a724da5601310ca49055e2b364f37d..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/Student.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/TeachingAssistant.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/TeachingAssistant.class deleted file mode 100644 index 7caedf275f045fdae253cd886240a8d5f8d336e5..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/TeachingAssistant.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User$1.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User$1.class deleted file mode 100644 index c4da1397991b4748464a585544f65679f5d9d7c2..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User$1.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User.class deleted file mode 100644 index 2fcfe8b8045e36319dd2f45fcf06d5b97859ff0d..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/actor/User.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Assignment.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Assignment.class deleted file mode 100644 index c76e04e455ef1bb0e0f3068ced3d937d5a709589..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Assignment.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Course.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Course.class deleted file mode 100644 index 12528c012a2138c58f2ef04fdd9b08586f629c05..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Course.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Timetable.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Timetable.class deleted file mode 100644 index 6d2c9f3816a98310b234a19f813b97348b351ca1..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/model/Timetable.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/AssignmentList.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/AssignmentList.class deleted file mode 100644 index 4b0bb5f052dc4f23fb12534fa43ba5b1b1be5331..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/AssignmentList.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVCourse.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVCourse.class deleted file mode 100644 index 378848f9045046d59f67a7fccaaaab58c278c614..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVCourse.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVOperator.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVOperator.class deleted file mode 100644 index 0419395f59697c2a531c62640b2985be4f928ae8..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVOperator.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVTimetable.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVTimetable.class deleted file mode 100644 index fb977c25a303c48104636bea11d199202ae95a81..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVTimetable.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVUser.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVUser.class deleted file mode 100644 index 61afc6402c45065ef44d375e115de2efbbfe384c..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CSVUser.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CourseList.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CourseList.class deleted file mode 100644 index 246df7617bf02198db205c519189fcd4470453d2..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/CourseList.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/TimetableList.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/TimetableList.class deleted file mode 100644 index dc2d679ec29e3031e4c68812c699cb491c5f9e89..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/TimetableList.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/UserList.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/UserList.class deleted file mode 100644 index 9727898588520753e74ab57109257f2e405922ae..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/repository/UserList.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/utility/InputReader.class b/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/utility/InputReader.class deleted file mode 100644 index 6a5e216169ee71e153bdad93409937928afe80a4..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/Softeng/Group3/SiJadwal/utility/InputReader.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/test/AssignmentTest.class b/out/production/SiJadwal_Simple/test/AssignmentTest.class deleted file mode 100644 index 06c12fe9f7eef0dc2b25bb18be2bda2da27c047f..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/test/AssignmentTest.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/test/CourseTest.class b/out/production/SiJadwal_Simple/test/CourseTest.class deleted file mode 100644 index 5b0db063e0759d4f333cff804ae4ba1448fae51f..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/test/CourseTest.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/test/TimetableTest.class b/out/production/SiJadwal_Simple/test/TimetableTest.class deleted file mode 100644 index a02e6dee235b4cc3c9fade486157b670f61b8b2e..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/test/TimetableTest.class and /dev/null differ diff --git a/out/production/SiJadwal_Simple/test/UserListTest.class b/out/production/SiJadwal_Simple/test/UserListTest.class deleted file mode 100644 index e7dfa4ac23939e9cc4774ca10a7984c8b84e67c5..0000000000000000000000000000000000000000 Binary files a/out/production/SiJadwal_Simple/test/UserListTest.class and /dev/null differ diff --git a/src/Softeng/Group3/SiJadwal/actor/TeachingAssistant.java b/src/Softeng/Group3/SiJadwal/actor/TeachingAssistant.java deleted file mode 100644 index c34bdbd57b2c3a3c517759bd8f7a323092f998d8..0000000000000000000000000000000000000000 --- a/src/Softeng/Group3/SiJadwal/actor/TeachingAssistant.java +++ /dev/null @@ -1,14 +0,0 @@ -package Softeng.Group3.SiJadwal.actor; - -public class TeachingAssistant extends Role { - - @Override - public void exclusiveActions() { - - } - - @Override - public void doExclusiveActions(int userAction) { - - } -} diff --git a/src/Softeng/Group3/SiJadwal/Main.java b/src/main/java/Softeng/Group3/SiJadwal/Main.java similarity index 98% rename from src/Softeng/Group3/SiJadwal/Main.java rename to src/main/java/Softeng/Group3/SiJadwal/Main.java index 7eab6a7a89af62582f7faffdc45f5d2b6b8ddbf5..7e31c219691f9d7e565dfaf245775e72c6b32b3b 100644 --- a/src/Softeng/Group3/SiJadwal/Main.java +++ b/src/main/java/Softeng/Group3/SiJadwal/Main.java @@ -19,7 +19,7 @@ public class Main { public static User currentUser = new User(); private static int roleInt; - private static UserList userList = new UserList(); + public static UserList userList = new UserList(); private static CourseList courseList = new CourseList(); private static TimetableList timetableList = new TimetableList(); diff --git a/src/Softeng/Group3/SiJadwal/actor/Admin.java b/src/main/java/Softeng/Group3/SiJadwal/actor/Admin.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/actor/Admin.java rename to src/main/java/Softeng/Group3/SiJadwal/actor/Admin.java diff --git a/src/Softeng/Group3/SiJadwal/actor/Role.java b/src/main/java/Softeng/Group3/SiJadwal/actor/Role.java similarity index 98% rename from src/Softeng/Group3/SiJadwal/actor/Role.java rename to src/main/java/Softeng/Group3/SiJadwal/actor/Role.java index b2773935f266eb54c191ad6fb90aa9d450afa066..1ae0c40ddbedb82812e9f925cf472e5cee26686d 100644 --- a/src/Softeng/Group3/SiJadwal/actor/Role.java +++ b/src/main/java/Softeng/Group3/SiJadwal/actor/Role.java @@ -10,7 +10,7 @@ import java.io.PrintWriter; public abstract class Role { protected InputReader in = new InputReader(System.in); protected PrintWriter out = new PrintWriter(System.out); - protected UserList userList = new UserList(); + UserList userList = new UserList(); protected CourseList courseList = new CourseList(); diff --git a/src/Softeng/Group3/SiJadwal/actor/RoleType.java b/src/main/java/Softeng/Group3/SiJadwal/actor/RoleType.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/actor/RoleType.java rename to src/main/java/Softeng/Group3/SiJadwal/actor/RoleType.java diff --git a/src/Softeng/Group3/SiJadwal/actor/Student.java b/src/main/java/Softeng/Group3/SiJadwal/actor/Student.java similarity index 78% rename from src/Softeng/Group3/SiJadwal/actor/Student.java rename to src/main/java/Softeng/Group3/SiJadwal/actor/Student.java index 3d65cad6136651df08efecc031eff7372ee57819..9e2125a29cdaa4a699d4dce875d8f2f3bd00fac7 100644 --- a/src/Softeng/Group3/SiJadwal/actor/Student.java +++ b/src/main/java/Softeng/Group3/SiJadwal/actor/Student.java @@ -37,6 +37,9 @@ public class Student extends Role { System.out.println("11. Delete a timetable"); System.out.println("12. Add an assignment"); System.out.println("13. See the list of assignments"); + System.out.println("14. Validate assignments"); + System.out.println("15. Update an assignments"); + System.out.println("16. Delete an assignments"); } @Override @@ -283,11 +286,67 @@ public class Student extends Role { break; } + case 14: + System.out.println("Pick the assignment that you want to validate:"); + String[] assignmentsPicked = in.next().split(""); + System.out.println("Picked: "); + for (String s: assignmentsPicked) { + System.out.println(s + " " + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName()); + String courseAssignment = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentCourse().getCourseName(); + String assignmentName = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName(); + validateAssignment(courseAssignment, assignmentName); + } + break; + + case 15: + System.out.println("Update an assignment: "); + System.out.println("==============================="); + + System.out.println("Pick an assignment to update: "); + assignmentList.listToString(assignmentList.getAssignmentList()); + assignmentsPicked = in.next().split(""); + System.out.println("Picked: "); + for (String s: assignmentsPicked) { + System.out.println(s + " " + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName()); + assignment = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1); + + System.out.println("Enter new due date: yyyy-MM-dd"); + String updateDate = in.nextLine(); + dueDate = LocalDate.parse(updateDate); + assignment.setDueDate(dueDate); + + + String courseAssignment = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentCourse().getCourseName(); + String assignmentName = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName(); + validateAssignment(courseAssignment, assignmentName); + + } + break; + + case 16: + System.out.println("Pick an assignment to delete: "); + + assignmentsPicked = in.next().split(""); + System.out.println("Picked: "); + for (String s: assignmentsPicked) { + System.out.println(s + " " + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName()); + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentCourse(). + deleteAssignment(assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1)); + + assignmentList.deleteAssignment(assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1)); + + System.out.println("Assignment deleted."); + break; + } default: } } + private void validateAssignment(String courseName, String assignmentName) { + Assignment toValidate = courseList.getCourse(courseName).getAssignment(assignmentName); + toValidate.addValidatedBy(Main.currentUser); + } public HashMap<String, Course> listToHashmap(List<Course> list){ HashMap<String, Course> hashMap = new HashMap<>(); diff --git a/src/main/java/Softeng/Group3/SiJadwal/actor/TeachingAssistant.java b/src/main/java/Softeng/Group3/SiJadwal/actor/TeachingAssistant.java new file mode 100644 index 0000000000000000000000000000000000000000..1955f44212c2f01cf27034166d0d6f470b741b7e --- /dev/null +++ b/src/main/java/Softeng/Group3/SiJadwal/actor/TeachingAssistant.java @@ -0,0 +1,186 @@ +package Softeng.Group3.SiJadwal.actor; + +import Softeng.Group3.SiJadwal.Main; +import Softeng.Group3.SiJadwal.model.Assignment; +import Softeng.Group3.SiJadwal.model.Course; +import Softeng.Group3.SiJadwal.model.Timetable; +import Softeng.Group3.SiJadwal.repository.AssignmentList; +import Softeng.Group3.SiJadwal.repository.CourseList; +import Softeng.Group3.SiJadwal.repository.TimetableList; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class TeachingAssistant extends Role { + + private String timetableName; + private HashMap<String, Course> courseOptions; + + private CourseList courseList = new CourseList(); + private TimetableList timetableList = new TimetableList(); + private AssignmentList assignmentList = new AssignmentList(); + + + private String assignmentName; + private Course assignmentCourse; + private LocalDate dueDate; + private Boolean validated; + private Set<User> validatedBy = new HashSet<>(); + private User createdBy; + + private List<Assignment> retrieveAllAssignment() { + try { + assignmentList.listToString(assignmentList.getAssignmentList()); + return assignmentList.getAssignmentList(); + } catch (NullPointerException e) { + System.out.println("No Assignment"); + return null; + } + } + + private Assignment validateAssignment(String courseName, String assignmentName) { + Assignment toValidate = courseList.getCourse(courseName).getAssignment(assignmentName); + toValidate.addValidatedBy(Main.currentUser); + validated = toValidate.getValidated(); + toValidate.setValidated((validated)); + return toValidate; + } + + @Override + public void exclusiveActions() { + System.out.println("6. Add an assignment"); + System.out.println("7. See the list of assignment"); + System.out.println("8. Validate assignment"); + System.out.println("9. Update assignment"); + System.out.println("10. Delete Assignment"); + } + + @Override + public void doExclusiveActions(int userAction) { + + courseOptions = listToHashmap(courseList.getCourseList()); + + switch (userAction){ + + case 6: + System.out.println("Add an assignment: "); + System.out.println("==============================="); + + Assignment assignment = new Assignment(); + System.out.println("Assignment Name?"); + assignmentName = in.next(); + assignment.setAssignmentName(assignmentName); + + System.out.println("Pick a course to add assignment: "); + courseList.listToString(courseList.getCourseList()); + String[] coursesPicked = in.next().split(""); + System.out.println("Picked: "); + for (String s: coursesPicked) { + System.out.println(s + " " + courseList.getCourseList().get(Integer.parseInt(s) - 1).getCourseName()); + assignment.setAssignmentCourse( + courseList.getCourseList().get(Integer.parseInt(s) - 1)); + } + + System.out.println("Enter due date: yyyy-MM-dd"); + String date = in.nextLine(); + dueDate = LocalDate.parse(date); + assignment.setDueDate(dueDate); + + assignment.setCreatedBy(Main.currentUser); + + assignmentList.addAssignment(assignmentName, assignment); + + for (String s: coursesPicked) { + courseList.getCourseList().get(Integer.parseInt(s) - 1).addAssignment(assignment); + } + + validateAssignment(assignment.getAssignmentCourse().getCourseName(), assignmentName); + break; + + case 7: + try { + retrieveAllAssignment(); + break; + } catch (NullPointerException e) { + System.out.println("No Assignment"); + break; + } + + case 8: + System.out.println("Pick the assignment that you want to validate:"); + retrieveAllAssignment(); + String[] assignmentsPicked = in.next().split(""); + System.out.println("Picked: "); + for (String s: assignmentsPicked) { + System.out.println(s + " " + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName()); + String courseAssignment = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentCourse().getCourseName(); + String assignmentName = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName(); + validateAssignment(courseAssignment, assignmentName); + } + break; + + case 9: + System.out.println("Update an assignment: "); + System.out.println("==============================="); + + System.out.println("Pick an assignment to update: "); + retrieveAllAssignment(); + + assignmentsPicked = in.next().split(""); + System.out.println("Picked: "); + for (String s: assignmentsPicked) { + System.out.println(s + " " + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName()); + assignment = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1); + + + System.out.println("Enter new due date: yyyy-MM-dd"); + String updateDate = in.nextLine(); + dueDate = LocalDate.parse(updateDate); + assignment.setDueDate(dueDate); + + + String courseAssignment = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentCourse().getCourseName(); + String assignmentName = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName(); + validateAssignment(courseAssignment, assignmentName); + + } + break; + + case 10: + System.out.println("Pick an assignment to delete: "); + retrieveAllAssignment(); + + assignmentsPicked = in.next().split(""); + System.out.println("Picked: "); + for (String s: assignmentsPicked) { + System.out.println(s + " " + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName()); + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentCourse(). + deleteAssignment(assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1)); + + assignmentList.deleteAssignment(assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1)); + + System.out.println("Assignment deleted."); + break; + } + default: + + } + } + + public HashMap<String, Course> listToHashmap(List<Course> list){ + HashMap<String, Course> hashMap = new HashMap<>(); + + for (Course c: list) { + hashMap.put(c.getCourseName(), c); + } + + return hashMap; + } + + +} diff --git a/src/Softeng/Group3/SiJadwal/actor/User.java b/src/main/java/Softeng/Group3/SiJadwal/actor/User.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/actor/User.java rename to src/main/java/Softeng/Group3/SiJadwal/actor/User.java diff --git a/src/Softeng/Group3/SiJadwal/model/Assignment.java b/src/main/java/Softeng/Group3/SiJadwal/model/Assignment.java similarity index 91% rename from src/Softeng/Group3/SiJadwal/model/Assignment.java rename to src/main/java/Softeng/Group3/SiJadwal/model/Assignment.java index b29a02bf35832d966db2c0146c2211c4cd037ef6..d713b11b8027d503104c5a21933238919fccecff 100644 --- a/src/Softeng/Group3/SiJadwal/model/Assignment.java +++ b/src/main/java/Softeng/Group3/SiJadwal/model/Assignment.java @@ -1,6 +1,5 @@ package Softeng.Group3.SiJadwal.model; -import Softeng.Group3.SiJadwal.actor.Role; import Softeng.Group3.SiJadwal.actor.RoleType; import Softeng.Group3.SiJadwal.actor.User; @@ -24,11 +23,12 @@ public class Assignment { public Assignment() { } - public Assignment(String assignmentName, Course assignmentCourse, LocalDate dueDate, Boolean validated, User createdBy) { + public Assignment(String assignmentName, Course assignmentCourse, LocalDate dueDate, Boolean validated, Set<User> validatedBy,User createdBy) { this.assignmentName = assignmentName; this.assignmentCourse = assignmentCourse; this.dueDate = dueDate; this.validated = validated; + this.validatedBy = validatedBy; this.createdBy = createdBy; } @@ -100,7 +100,8 @@ public class Assignment { @Override public String toString() { - return "Name: " + assignmentName + ", Due Date: " + dueDate + ", Created by: " + createdBy; + return "Name: " + assignmentName + ", Due Date: " + dueDate + ", Created by: " + + createdBy +", Validation: " + validated + ", Validated by: " + validatedBy; } } diff --git a/src/Softeng/Group3/SiJadwal/model/Course.java b/src/main/java/Softeng/Group3/SiJadwal/model/Course.java similarity index 84% rename from src/Softeng/Group3/SiJadwal/model/Course.java rename to src/main/java/Softeng/Group3/SiJadwal/model/Course.java index 433ec892e6789e98d6f6b4261d3b1fe28cdad4ac..a477202b9e80875f03061b802adc7f42abbc4714 100644 --- a/src/Softeng/Group3/SiJadwal/model/Course.java +++ b/src/main/java/Softeng/Group3/SiJadwal/model/Course.java @@ -71,6 +71,16 @@ public class Course { assignments.add(assignment); } + public void deleteAssignment(Assignment assignment){ assignments.remove(assignment); } + + public Assignment getAssignment(String assignmentName) { + for (Assignment a: assignments) { + if (a.getAssignmentName().equalsIgnoreCase(assignmentName)) { + return a; + } + } + return null; + } @Override public String toString() { return "\nCourse: " + courseName + ", Start Time: " + startTime + ", End Time: " + endTime + "\nAssignments: " + assignments; diff --git a/src/Softeng/Group3/SiJadwal/model/Timetable.java b/src/main/java/Softeng/Group3/SiJadwal/model/Timetable.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/model/Timetable.java rename to src/main/java/Softeng/Group3/SiJadwal/model/Timetable.java diff --git a/src/Softeng/Group3/SiJadwal/repository/AssignmentList.java b/src/main/java/Softeng/Group3/SiJadwal/repository/AssignmentList.java similarity index 87% rename from src/Softeng/Group3/SiJadwal/repository/AssignmentList.java rename to src/main/java/Softeng/Group3/SiJadwal/repository/AssignmentList.java index 798be575bef8e9dce4f532818d1d116330652a66..5af222c06ac40b1977543bb1b368bcd7fb304ce7 100644 --- a/src/Softeng/Group3/SiJadwal/repository/AssignmentList.java +++ b/src/main/java/Softeng/Group3/SiJadwal/repository/AssignmentList.java @@ -3,6 +3,7 @@ package Softeng.Group3.SiJadwal.repository; import Softeng.Group3.SiJadwal.actor.User; import Softeng.Group3.SiJadwal.model.Assignment; import Softeng.Group3.SiJadwal.model.Course; +import Softeng.Group3.SiJadwal.model.Timetable; import java.sql.Time; import java.util.ArrayList; @@ -28,6 +29,10 @@ public class AssignmentList { assignmentList.add(assignment); } + public void deleteAssignment(Assignment assignment){ + assignmentList.remove(assignment); + } + public void listToString(List<Assignment> assignmentList){ int i = 1; diff --git a/src/Softeng/Group3/SiJadwal/repository/CSVCourse.java b/src/main/java/Softeng/Group3/SiJadwal/repository/CSVCourse.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/repository/CSVCourse.java rename to src/main/java/Softeng/Group3/SiJadwal/repository/CSVCourse.java diff --git a/src/Softeng/Group3/SiJadwal/repository/CSVOperator.java b/src/main/java/Softeng/Group3/SiJadwal/repository/CSVOperator.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/repository/CSVOperator.java rename to src/main/java/Softeng/Group3/SiJadwal/repository/CSVOperator.java diff --git a/src/Softeng/Group3/SiJadwal/repository/CSVTimetable.java b/src/main/java/Softeng/Group3/SiJadwal/repository/CSVTimetable.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/repository/CSVTimetable.java rename to src/main/java/Softeng/Group3/SiJadwal/repository/CSVTimetable.java diff --git a/src/Softeng/Group3/SiJadwal/repository/CSVUser.java b/src/main/java/Softeng/Group3/SiJadwal/repository/CSVUser.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/repository/CSVUser.java rename to src/main/java/Softeng/Group3/SiJadwal/repository/CSVUser.java diff --git a/src/Softeng/Group3/SiJadwal/repository/CourseList.java b/src/main/java/Softeng/Group3/SiJadwal/repository/CourseList.java similarity index 69% rename from src/Softeng/Group3/SiJadwal/repository/CourseList.java rename to src/main/java/Softeng/Group3/SiJadwal/repository/CourseList.java index 63a0d169eb69a118e4af034f1f6d83811b02d949..67fde371f015d4855cc70fd9992ef7b979c10564 100644 --- a/src/Softeng/Group3/SiJadwal/repository/CourseList.java +++ b/src/main/java/Softeng/Group3/SiJadwal/repository/CourseList.java @@ -1,6 +1,7 @@ package Softeng.Group3.SiJadwal.repository; import Softeng.Group3.SiJadwal.model.Course; +import Softeng.Group3.SiJadwal.model.Timetable; import java.sql.Time; import java.util.ArrayList; @@ -46,6 +47,19 @@ public class CourseList { public void deleteCourse(String name){ Course delCourse = getCourse(name); + + TimetableList timetableList = new TimetableList(); + List<Timetable> containsCourse = TimetableList.getAllTimetableList(); + for(int i = 0; i < containsCourse.size(); i++){ + List<Course> courses = containsCourse.get(i).getCourses(); + for(int j = 0; j < courses.size(); j++){ + if(courses.get(j).getCourseName().equalsIgnoreCase(delCourse.getCourseName())){ + timetableList.getTimetable(containsCourse.get(i).getTimetableName(), containsCourse.get(i).getOwner()).deleteCourse(delCourse); + CSVTimetable.updateCourseTimetable(containsCourse.get(i).getOwner().getUsername(), containsCourse.get(i).getTimetableName(), containsCourse.get(i).getCourses()); + break; + } + } + } courseList.remove(delCourse); CSVCourse.deleteCourse(name); } diff --git a/src/Softeng/Group3/SiJadwal/repository/TimetableList.java b/src/main/java/Softeng/Group3/SiJadwal/repository/TimetableList.java similarity index 91% rename from src/Softeng/Group3/SiJadwal/repository/TimetableList.java rename to src/main/java/Softeng/Group3/SiJadwal/repository/TimetableList.java index 4ec1d3abafaa478c7327e0927ea0793d8bf53924..bd6c0ece23d52ae103380c8f969b88b46259ee8a 100644 --- a/src/Softeng/Group3/SiJadwal/repository/TimetableList.java +++ b/src/main/java/Softeng/Group3/SiJadwal/repository/TimetableList.java @@ -1,12 +1,8 @@ package Softeng.Group3.SiJadwal.repository; -import Softeng.Group3.SiJadwal.Main; -import Softeng.Group3.SiJadwal.actor.RoleType; import Softeng.Group3.SiJadwal.actor.User; -import Softeng.Group3.SiJadwal.model.Course; import Softeng.Group3.SiJadwal.model.Timetable; -import java.sql.Time; import java.util.ArrayList; import java.util.List; diff --git a/src/Softeng/Group3/SiJadwal/repository/UserList.java b/src/main/java/Softeng/Group3/SiJadwal/repository/UserList.java similarity index 96% rename from src/Softeng/Group3/SiJadwal/repository/UserList.java rename to src/main/java/Softeng/Group3/SiJadwal/repository/UserList.java index 5f4bbb88d33283ea73798b900807cd2f771dc338..2cf23bf9537c9cf330bfb21a9f0f1a2b97d2b45e 100644 --- a/src/Softeng/Group3/SiJadwal/repository/UserList.java +++ b/src/main/java/Softeng/Group3/SiJadwal/repository/UserList.java @@ -54,6 +54,10 @@ public class UserList { CSVUser.deleteUser(Uname); } + public void clearUserList() { + userList.clear(); + } + public void listToString(List<User> userList){ int i = 1; for (User user: userList) { diff --git a/src/Softeng/Group3/SiJadwal/utility/InputReader.java b/src/main/java/Softeng/Group3/SiJadwal/utility/InputReader.java similarity index 100% rename from src/Softeng/Group3/SiJadwal/utility/InputReader.java rename to src/main/java/Softeng/Group3/SiJadwal/utility/InputReader.java diff --git a/src/test/AssignmentTest.java b/src/test/java/model/AssignmentTest.java similarity index 99% rename from src/test/AssignmentTest.java rename to src/test/java/model/AssignmentTest.java index 3a633dbb24e1f247e1eea131761c6a5314dbe54e..269ea920f6f81e9e8cc65dea5ef035f45ac42361 100644 --- a/src/test/AssignmentTest.java +++ b/src/test/java/model/AssignmentTest.java @@ -1,4 +1,4 @@ -package test; +package model; import Softeng.Group3.SiJadwal.actor.*; import Softeng.Group3.SiJadwal.model.Assignment; diff --git a/src/test/CourseTest.java b/src/test/java/model/CourseTest.java similarity index 99% rename from src/test/CourseTest.java rename to src/test/java/model/CourseTest.java index e7fb92ff939d20e842824961e84c2ef4b1329c87..98ece056a767296b0545bdacf32e53c14ccbddbf 100644 --- a/src/test/CourseTest.java +++ b/src/test/java/model/CourseTest.java @@ -1,4 +1,4 @@ -package test; +package model; import Softeng.Group3.SiJadwal.actor.User; import Softeng.Group3.SiJadwal.model.Course; diff --git a/src/test/TimetableTest.java b/src/test/java/model/TimetableTest.java similarity index 99% rename from src/test/TimetableTest.java rename to src/test/java/model/TimetableTest.java index a05c59cb7e8630aa33191c0bf8f4bbb404017734..5d4296227ecede01c69b43ce804d3c7f087b84da 100644 --- a/src/test/TimetableTest.java +++ b/src/test/java/model/TimetableTest.java @@ -1,4 +1,4 @@ -package test; +package model; import Softeng.Group3.SiJadwal.actor.User; import Softeng.Group3.SiJadwal.model.Course; diff --git a/src/test/java/repository/TimetableListTest.java b/src/test/java/repository/TimetableListTest.java new file mode 100644 index 0000000000000000000000000000000000000000..020cd57556b800dcdba1a9afc86cacaa95d6be58 --- /dev/null +++ b/src/test/java/repository/TimetableListTest.java @@ -0,0 +1,43 @@ +package repository; + +import Softeng.Group3.SiJadwal.actor.User; +import Softeng.Group3.SiJadwal.model.Timetable; +import Softeng.Group3.SiJadwal.repository.TimetableList; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; + +import static org.junit.jupiter.api.Assertions.*; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +class TimetableListTest { + + @Test + void getAllTimetableList() { + TimetableList timetableList = new TimetableList(); +// Test Should Pointing to the same TimetableList using static variable + assertSame(new TimetableList().getAllTimetableList(), timetableList.getAllTimetableList()); + } + + @Test + void getTimetableList() { + TimetableList timetableList = new TimetableList(); + Timetable timetableA = new Timetable(); + User A = new User(); + } + + @Test + void getTimetable() { + } + + @Test + void addTimetable() { + } + + @Test + void listToString() { + } + + @Test + void deleteTimetable() { + } +} \ No newline at end of file diff --git a/src/test/UserListTest.java b/src/test/java/repository/UserListTest.java similarity index 97% rename from src/test/UserListTest.java rename to src/test/java/repository/UserListTest.java index 805a28337406959e96e70d5527e352d8c786079f..70f7b81fe1743d95b21c1d55c2ba9b5c46cc3a02 100644 --- a/src/test/UserListTest.java +++ b/src/test/java/repository/UserListTest.java @@ -1,4 +1,4 @@ -package test; +package repository; import Softeng.Group3.SiJadwal.actor.RoleType; import Softeng.Group3.SiJadwal.repository.UserList; @@ -55,6 +55,7 @@ class UserListTest { @Test void ListToStringTest(){ System.setOut(new PrintStream(outputStreamCaptor)); + userList.clearUserList(); userList.addUser("Test", RoleType.STUDENT); userList.listToString(userList.getUserList()); assertEquals("1. Test", outputStreamCaptor.toString().trim());