From fd675a4c4200e65cd602acfa28b6bcdd51b2b613 Mon Sep 17 00:00:00 2001 From: Elainee610 Date: Tue, 28 Feb 2023 21:55:44 +0800 Subject: [PATCH 01/29] Title --- .metadata/.lock | 0 .metadata/.log | 53 + .../.org.eclipse.egit.core.cmp/.location | Bin 0 -> 203 bytes .../.root/.indexes/history.version | 1 + .../.root/.indexes/properties.index | Bin 0 -> 57 bytes .../.root/.indexes/properties.version | 1 + .../org.eclipse.core.resources/.root/1.tree | Bin 0 -> 189 bytes .../.safetable/org.eclipse.core.resources | Bin 0 -> 440 bytes .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.ui.prefs | 8 + .../.settings/org.eclipse.jsch.core.prefs | 2 + .../.settings/org.eclipse.m2e.discovery.prefs | 2 + .../.settings/org.eclipse.ui.ide.prefs | 4 + .../.settings/org.eclipse.ui.prefs | 2 + .../.settings/org.eclipse.ui.workbench.prefs | 9 + .../.settings/org.eclipse.urischeme.prefs | 2 + .../org.eclipse.e4.workbench/workbench.xmi | 2134 +++++++++++++++++ .../.org.eclipse.egit.core.cmp/.project | 11 + .../assumedExternalFilesCache | Bin 0 -> 4 bytes .../org.eclipse.jdt.core/externalFilesCache | Bin 0 -> 4 bytes .../org.eclipse.jdt.core/javaLikeNames.txt | 1 + .../org.eclipse.jdt.core/nonChainingJarsCache | Bin 0 -> 4 bytes .../variablesAndContainers.dat | Bin 0 -> 110 bytes .../org.eclipse.jdt.ui/OpenTypeHistory.xml | 2 + .../QualifiedTypeNameHistory.xml | 2 + .../org.eclipse.jdt.ui/dialog_settings.xml | 10 + .../0.log | 1 + .../logback.1.16.3.20211002-1029.xml | 41 + .../org.eclipse.oomph.setup/workspace.setup | 6 + .../org.eclipse.tips.ide/dialog_settings.xml | 3 + .../.plugins/org.eclipse.ui.intro/introstate | 2 + .../org.eclipse.ui.workbench/workingsets.xml | 6 + .metadata/version.ini | 3 + 33 files changed, 2308 insertions(+) create mode 100644 .metadata/.lock create mode 100644 .metadata/.log create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/1.tree create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs create mode 100644 .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi create mode 100644 .metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/externalFilesCache create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat create mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml create mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml create mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml create mode 100644 .metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log create mode 100644 .metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.3.20211002-1029.xml create mode 100644 .metadata/.plugins/org.eclipse.oomph.setup/workspace.setup create mode 100644 .metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml create mode 100644 .metadata/.plugins/org.eclipse.ui.intro/introstate create mode 100644 .metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml create mode 100644 .metadata/version.ini diff --git a/.metadata/.lock b/.metadata/.lock new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.log b/.metadata/.log new file mode 100644 index 0000000..f3e86a8 --- /dev/null +++ b/.metadata/.log @@ -0,0 +1,53 @@ +!SESSION 2023-02-28 21:46:09.990 ----------------------------------------------- +eclipse.buildId=4.23.0.I20220308-0310 +java.version=17.0.2 +java.vendor=Eclipse Adoptium +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product C:\Users\Huawei\Documents\Y2S2\UECS2354 Software Testing\SoftwareTesting\src\PrintingKioskSystem\Charge.java +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data C:\Users\Huawei\Documents\Y2S2\UECS2354 Software Testing\SoftwareTesting -product org.eclipse.epp.package.java.product C:\Users\Huawei\Documents\Y2S2\UECS2354 Software Testing\SoftwareTesting\src\PrintingKioskSystem\Charge.java + +!ENTRY org.eclipse.jface 2 0 2023-02-28 21:46:15.916 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2023-02-28 21:46:15.916 +!MESSAGE A conflict occurred for CTRL+SHIFT+T: +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, + Open a type in a Java editor, + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@50fd739d, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, + , + Category(org.eclipse.lsp4e.category,Language Servers,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5e1d1524, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2023-02-28 21:46:15.916 +!MESSAGE A conflict occurred for ALT+SHIFT+R: +Binding(ALT+SHIFT+R, + ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring , + Rename the selected element, + Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@d0a2c82, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(ALT+SHIFT+R, + ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename, + Rename the selected item, + Category(org.eclipse.ui.category.file,File,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@430aae8e, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.egit.ui 2 0 2023-02-28 21:46:22.407 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Huawei'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location b/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location new file mode 100644 index 0000000000000000000000000000000000000000..da49d5154202155073a86281ce6631c4bec9d3c5 GIT binary patch literal 203 zcmZ?R*xjhShe1S2b=vdAllRFn%nl9m)YnhT%t^Je*7qn)EKkkUcgasK z%}vcKDb|lP3O3RYb#)FlGB!0)H8Kd!Pb(=;EJ_73LsE-NGV{{)VL~vzUT$hhVoG93 zqP|{1PHB2(Ua@|DQMz7ga!zJJajITwdS;1Ua(+>&z8+R#z2w{i1{820;`e8;(*r;E JRPQc71^`ieMmzuj literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 0000000..25cb955 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000000000000000000000000000000000000..bb5ccc45e269530cb0369a289d8392463eaff5f0 GIT binary patch literal 57 zcmZQ%U|?WmVAN+|WMUA>FG|--P0q6s8!dday3KqU$+!a!ARGu#X(Lyd>o3g$90aOf2jAu0l+>isbcnGKb^3ZGMX5kLc)1Ql g{QeB~O5o?7>fPnX90s4)(h_ruiSip%A#TqB0DL8wDF6Tf literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..dffc6b5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +version=1 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..f305bcf --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,8 @@ +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.formatterprofiles.version=22 +spelling_locale_initialized=true +typefilter_migrated_2=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs new file mode 100644 index 0000000..d56c53f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jsch.core.hasChangedDefaultWin32SshHome=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs new file mode 100644 index 0000000..67b1d96 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.m2e.discovery.pref.projects= diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 0000000..7a42350 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +platformState=1656293867235 +quickStart=false +tipsAndTricks=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs new file mode 100644 index 0000000..08076f2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +showIntro=false diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..b85d0db --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,9 @@ +//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false +PLUGINS_NOT_ACTIVATED_ON_STARTUP=;org.eclipse.m2e.discovery; +eclipse.preferences.version=1 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END=255,255,255 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START=255,255,255 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR=16,16,16 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_END=255,255,255 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_START=255,255,255 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_START=242,242,242 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs new file mode 100644 index 0000000..855d634 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +processedSchemes=,eclipse+command,eclipse+mpc diff --git a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 0000000..0e5601f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,2134 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + + + + + + + + topLevel + shellMaximized + + + + + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.text.quicksearch.actionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.debug.ui.launchActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaElementCreationActionSet + persp.actionSet:org.eclipse.ui.NavigateActionSet + persp.viewSC:org.eclipse.jdt.ui.PackageExplorer + persp.viewSC:org.eclipse.jdt.ui.TypeHierarchy + persp.viewSC:org.eclipse.jdt.ui.SourceView + persp.viewSC:org.eclipse.jdt.ui.JavadocView + persp.viewSC:org.eclipse.search.ui.views.SearchView + persp.viewSC:org.eclipse.ui.console.ConsoleView + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.viewSC:org.eclipse.ui.views.ProblemView + persp.viewSC:org.eclipse.ui.views.ResourceNavigator + persp.viewSC:org.eclipse.ui.views.TaskList + persp.viewSC:org.eclipse.ui.views.ProgressView + persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.ui.texteditor.TemplatesView + persp.viewSC:org.eclipse.pde.runtime.LogView + persp.newWizSC:org.eclipse.jdt.ui.wizards.JavaProjectWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewPackageCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewClassCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewEnumCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewRecordCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.newWizSC:org.eclipse.ui.editors.wizards.UntitledTextFileWizard + persp.perspSC:org.eclipse.jdt.ui.JavaBrowsingPerspective + persp.perspSC:org.eclipse.debug.ui.DebugPerspective + persp.showIn:org.eclipse.jdt.ui.PackageExplorer + persp.showIn:org.eclipse.team.ui.GenericHistoryView + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.actionSet:org.eclipse.debug.ui.breakpointActionSet + persp.actionSet:org.eclipse.jdt.debug.ui.JDTDebugActionSet + persp.showIn:org.eclipse.egit.ui.RepositoriesView + persp.actionSet:org.eclipse.eclemma.ui.CoverageActionSet + persp.showIn:org.eclipse.eclemma.ui.CoverageView + persp.viewSC:org.eclipse.tm.terminal.view.ui.TerminalsView + persp.showIn:org.eclipse.tm.terminal.view.ui.TerminalsView + persp.newWizSC:org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard + persp.actionSet:org.eclipse.jdt.junit.JUnitActionSet + persp.viewSC:org.eclipse.ant.ui.views.AntView + + + + org.eclipse.e4.primaryNavigationStack + active + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:Java + + + + + View + categoryTag:Git + + + + + + + + org.eclipse.e4.secondaryNavigationStack + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Ant + + + + + org.eclipse.e4.secondaryDataStack + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Terminal + + + + + + + + + View + categoryTag:Help + + + View + categoryTag:General + + + View + categoryTag:Help + + + + + + + View + categoryTag:Help + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Help + + + + org.eclipse.e4.primaryDataStack + EditorStack + + + + + + + View + categoryTag:Java + active + activeOnClose + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Git + + + + + View + categoryTag:Terminal + + + + + View + categoryTag:Java + + + + + View + categoryTag:Ant + + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + Draggable + + + toolbarSeparator + + + + Draggable + + + Draggable + + + Draggable + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + + stretch + SHOW_RESTORE_MENU + + + Draggable + HIDEABLE + SHOW_RESTORE_MENU + + + + + stretch + + + Draggable + + + Draggable + + + + + TrimStack + Draggable + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + removeOnHide + + + + + View + categoryTag:Ant + + + + + View + categoryTag:Gradle + + + + + View + categoryTag:Gradle + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + NoRestore + + + + + View + categoryTag:Git + + + + + View + categoryTag:Help + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Oomph + + + + + View + categoryTag:General + + + + + View + categoryTag:Version Control (Team) + + + + + View + categoryTag:Version Control (Team) + + + View + categoryTag:Help + + + + + View + categoryTag:Terminal + + + + + View + categoryTag:Other + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Help + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + glue + move_after:PerspectiveSpacer + SHOW_RESTORE_MENU + + + move_after:Spacer Glue + HIDEABLE + SHOW_RESTORE_MENU + + + glue + move_after:SearchField + SHOW_RESTORE_MENU + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project b/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project new file mode 100644 index 0000000..3c10856 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project @@ -0,0 +1,11 @@ + + + .org.eclipse.egit.core.cmp + + + + + + + + diff --git a/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache b/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt new file mode 100644 index 0000000..8586397 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt @@ -0,0 +1 @@ +java \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat new file mode 100644 index 0000000000000000000000000000000000000000..0edae4b20855dcd5c83bdac184b9ed16afb1b634 GIT binary patch literal 110 zcmZQzU|?c^05&ki?iJ)3@8jvj2;?y`aD#ZkLC!(`{vjX{CI&9AP(RO*cn^PHSC9ZR e16Tu435dtSzz2~A^5IHY8Q6V|;)7fR{22i=Q4xRu literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml new file mode 100644 index 0000000..a4ee3cb --- /dev/null +++ b/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml new file mode 100644 index 0000000..9e390f5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml b/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml new file mode 100644 index 0000000..fdd7818 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml @@ -0,0 +1,10 @@ + +
+
+ + + + + +
+
diff --git a/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log b/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log new file mode 100644 index 0000000..d4aa070 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log @@ -0,0 +1 @@ +2023-02-28 21:46:22,406 [Worker-4: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is up-to-date. Trying to read. diff --git a/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.3.20211002-1029.xml b/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.3.20211002-1029.xml new file mode 100644 index 0000000..4512556 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.3.20211002-1029.xml @@ -0,0 +1,41 @@ + + + + %date [%thread] %-5level %logger{35} - %msg%n + + + OFF + + + + + ${org.eclipse.m2e.log.dir}/0.log + + ${org.eclipse.m2e.log.dir}/%i.log + 1 + 10 + + + 100MB + + + %date [%thread] %-5level %logger{35} - %msg%n + + + + + + WARN + + + + + + + + + + + + + diff --git a/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup b/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup new file mode 100644 index 0000000..1f73e14 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup @@ -0,0 +1,6 @@ + + diff --git a/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml b/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml new file mode 100644 index 0000000..5ca0b77 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml @@ -0,0 +1,3 @@ + +
+
diff --git a/.metadata/.plugins/org.eclipse.ui.intro/introstate b/.metadata/.plugins/org.eclipse.ui.intro/introstate new file mode 100644 index 0000000..02f134f --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ui.intro/introstate @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..9688c96 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.metadata/version.ini b/.metadata/version.ini new file mode 100644 index 0000000..ee5d3a7 --- /dev/null +++ b/.metadata/version.ini @@ -0,0 +1,3 @@ +#Tue Feb 28 21:46:12 AWST 2023 +org.eclipse.core.runtime=2 +org.eclipse.platform=4.23.0.v20220308-0310 From 0fd21bda4d1ae5e6e2e9228ef855d6e59765c783 Mon Sep 17 00:00:00 2001 From: TszenYong Date: Tue, 28 Feb 2023 21:58:36 +0800 Subject: [PATCH 02/29] Removed metadata --- .metadata/.lock | 0 .metadata/.log | 53 - .../.org.eclipse.egit.core.cmp/.location | Bin 203 -> 0 bytes .../.root/.indexes/history.version | 1 - .../.root/.indexes/properties.index | Bin 57 -> 0 bytes .../.root/.indexes/properties.version | 1 - .../org.eclipse.core.resources/.root/1.tree | Bin 189 -> 0 bytes .../.safetable/org.eclipse.core.resources | Bin 440 -> 0 bytes .../org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.jdt.ui.prefs | 8 - .../.settings/org.eclipse.jsch.core.prefs | 2 - .../.settings/org.eclipse.m2e.discovery.prefs | 2 - .../.settings/org.eclipse.ui.ide.prefs | 4 - .../.settings/org.eclipse.ui.prefs | 2 - .../.settings/org.eclipse.ui.workbench.prefs | 9 - .../.settings/org.eclipse.urischeme.prefs | 2 - .../org.eclipse.e4.workbench/workbench.xmi | 2134 ----------------- .../.org.eclipse.egit.core.cmp/.project | 11 - .../assumedExternalFilesCache | Bin 4 -> 0 bytes .../org.eclipse.jdt.core/externalFilesCache | Bin 4 -> 0 bytes .../org.eclipse.jdt.core/javaLikeNames.txt | 1 - .../org.eclipse.jdt.core/nonChainingJarsCache | Bin 4 -> 0 bytes .../variablesAndContainers.dat | Bin 110 -> 0 bytes .../org.eclipse.jdt.ui/OpenTypeHistory.xml | 2 - .../QualifiedTypeNameHistory.xml | 2 - .../org.eclipse.jdt.ui/dialog_settings.xml | 10 - .../0.log | 1 - .../logback.1.16.3.20211002-1029.xml | 41 - .../org.eclipse.oomph.setup/workspace.setup | 6 - .../org.eclipse.tips.ide/dialog_settings.xml | 3 - .../.plugins/org.eclipse.ui.intro/introstate | 2 - .../org.eclipse.ui.workbench/workingsets.xml | 6 - .metadata/version.ini | 3 - 33 files changed, 2308 deletions(-) delete mode 100644 .metadata/.lock delete mode 100644 .metadata/.log delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/1.tree delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs delete mode 100644 .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi delete mode 100644 .metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/externalFilesCache delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat delete mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml delete mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml delete mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml delete mode 100644 .metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log delete mode 100644 .metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.3.20211002-1029.xml delete mode 100644 .metadata/.plugins/org.eclipse.oomph.setup/workspace.setup delete mode 100644 .metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml delete mode 100644 .metadata/.plugins/org.eclipse.ui.intro/introstate delete mode 100644 .metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml delete mode 100644 .metadata/version.ini diff --git a/.metadata/.lock b/.metadata/.lock deleted file mode 100644 index e69de29..0000000 diff --git a/.metadata/.log b/.metadata/.log deleted file mode 100644 index f3e86a8..0000000 --- a/.metadata/.log +++ /dev/null @@ -1,53 +0,0 @@ -!SESSION 2023-02-28 21:46:09.990 ----------------------------------------------- -eclipse.buildId=4.23.0.I20220308-0310 -java.version=17.0.2 -java.vendor=Eclipse Adoptium -BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US -Framework arguments: -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product C:\Users\Huawei\Documents\Y2S2\UECS2354 Software Testing\SoftwareTesting\src\PrintingKioskSystem\Charge.java -Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data C:\Users\Huawei\Documents\Y2S2\UECS2354 Software Testing\SoftwareTesting -product org.eclipse.epp.package.java.product C:\Users\Huawei\Documents\Y2S2\UECS2354 Software Testing\SoftwareTesting\src\PrintingKioskSystem\Charge.java - -!ENTRY org.eclipse.jface 2 0 2023-02-28 21:46:15.916 -!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. -!SUBENTRY 1 org.eclipse.jface 2 0 2023-02-28 21:46:15.916 -!MESSAGE A conflict occurred for CTRL+SHIFT+T: -Binding(CTRL+SHIFT+T, - ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, - Open a type in a Java editor, - Category(org.eclipse.ui.category.navigate,Navigate,null,true), - org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@50fd739d, - ,,true),null), - org.eclipse.ui.defaultAcceleratorConfiguration, - org.eclipse.ui.contexts.window,,,system) -Binding(CTRL+SHIFT+T, - ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, - , - Category(org.eclipse.lsp4e.category,Language Servers,null,true), - org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5e1d1524, - ,,true),null), - org.eclipse.ui.defaultAcceleratorConfiguration, - org.eclipse.ui.contexts.window,,,system) -!SUBENTRY 1 org.eclipse.jface 2 0 2023-02-28 21:46:15.916 -!MESSAGE A conflict occurred for ALT+SHIFT+R: -Binding(ALT+SHIFT+R, - ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring , - Rename the selected element, - Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), - org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@d0a2c82, - ,,true),null), - org.eclipse.ui.defaultAcceleratorConfiguration, - org.eclipse.ui.contexts.window,,,system) -Binding(ALT+SHIFT+R, - ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename, - Rename the selected item, - Category(org.eclipse.ui.category.file,File,null,true), - org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@430aae8e, - ,,true),null), - org.eclipse.ui.defaultAcceleratorConfiguration, - org.eclipse.ui.contexts.window,,,system) - -!ENTRY org.eclipse.egit.ui 2 0 2023-02-28 21:46:22.407 -!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git -user global configuration and to define the default location to store repositories: 'C:\Users\Huawei'. If this is -not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and -EGit might behave differently since they see different configuration options. -This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location b/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location deleted file mode 100644 index da49d5154202155073a86281ce6631c4bec9d3c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 203 zcmZ?R*xjhShe1S2b=vdAllRFn%nl9m)YnhT%t^Je*7qn)EKkkUcgasK z%}vcKDb|lP3O3RYb#)FlGB!0)H8Kd!Pb(=;EJ_73LsE-NGV{{)VL~vzUT$hhVoG93 zqP|{1PHB2(Ua@|DQMz7ga!zJJajITwdS;1Ua(+>&z8+R#z2w{i1{820;`e8;(*r;E JRPQc71^`ieMmzuj diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version deleted file mode 100644 index 25cb955..0000000 --- a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index deleted file mode 100644 index bb5ccc45e269530cb0369a289d8392463eaff5f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57 zcmZQ%U|?WmVAN+|WMUA>FG|--P0q6s8!dday3KqU$+!a!ARGu#X(Lyd>o3g$90aOf2jAu0l+>isbcnGKb^3ZGMX5kLc)1Ql g{QeB~O5o?7>fPnX90s4)(h_ruiSip%A#TqB0DL8wDF6Tf diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index dffc6b5..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -version=1 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index f305bcf..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,8 +0,0 @@ -content_assist_proposals_background=255,255,255 -content_assist_proposals_foreground=0,0,0 -eclipse.preferences.version=1 -org.eclipse.jdt.ui.formatterprofiles.version=22 -spelling_locale_initialized=true -typefilter_migrated_2=true -useAnnotationsPrefPage=true -useQuickDiffPrefPage=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs deleted file mode 100644 index d56c53f..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jsch.core.hasChangedDefaultWin32SshHome=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs deleted file mode 100644 index 67b1d96..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.m2e.discovery.pref.projects= diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs deleted file mode 100644 index 7a42350..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -platformState=1656293867235 -quickStart=false -tipsAndTricks=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs deleted file mode 100644 index 08076f2..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -showIntro=false diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs deleted file mode 100644 index b85d0db..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs +++ /dev/null @@ -1,9 +0,0 @@ -//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false -PLUGINS_NOT_ACTIVATED_ON_STARTUP=;org.eclipse.m2e.discovery; -eclipse.preferences.version=1 -org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END=255,255,255 -org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START=255,255,255 -org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR=16,16,16 -org.eclipse.ui.workbench.ACTIVE_TAB_BG_END=255,255,255 -org.eclipse.ui.workbench.ACTIVE_TAB_BG_START=255,255,255 -org.eclipse.ui.workbench.INACTIVE_TAB_BG_START=242,242,242 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs deleted file mode 100644 index 855d634..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -processedSchemes=,eclipse+command,eclipse+mpc diff --git a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi deleted file mode 100644 index 0e5601f..0000000 --- a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi +++ /dev/null @@ -1,2134 +0,0 @@ - - - - activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration - - - - - - - - topLevel - shellMaximized - - - - - persp.actionSet:org.eclipse.ui.cheatsheets.actionSet - persp.actionSet:org.eclipse.search.searchActionSet - persp.actionSet:org.eclipse.text.quicksearch.actionSet - persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation - persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation - persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo - persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet - persp.actionSet:org.eclipse.ui.actionSet.keyBindings - persp.actionSet:org.eclipse.ui.actionSet.openFiles - persp.actionSet:org.eclipse.debug.ui.launchActionSet - persp.actionSet:org.eclipse.jdt.ui.JavaActionSet - persp.actionSet:org.eclipse.jdt.ui.JavaElementCreationActionSet - persp.actionSet:org.eclipse.ui.NavigateActionSet - persp.viewSC:org.eclipse.jdt.ui.PackageExplorer - persp.viewSC:org.eclipse.jdt.ui.TypeHierarchy - persp.viewSC:org.eclipse.jdt.ui.SourceView - persp.viewSC:org.eclipse.jdt.ui.JavadocView - persp.viewSC:org.eclipse.search.ui.views.SearchView - persp.viewSC:org.eclipse.ui.console.ConsoleView - persp.viewSC:org.eclipse.ui.views.ContentOutline - persp.viewSC:org.eclipse.ui.views.ProblemView - persp.viewSC:org.eclipse.ui.views.ResourceNavigator - persp.viewSC:org.eclipse.ui.views.TaskList - persp.viewSC:org.eclipse.ui.views.ProgressView - persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer - persp.viewSC:org.eclipse.ui.texteditor.TemplatesView - persp.viewSC:org.eclipse.pde.runtime.LogView - persp.newWizSC:org.eclipse.jdt.ui.wizards.JavaProjectWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewPackageCreationWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewClassCreationWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewEnumCreationWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewRecordCreationWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard - persp.newWizSC:org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard - persp.newWizSC:org.eclipse.ui.wizards.new.folder - persp.newWizSC:org.eclipse.ui.wizards.new.file - persp.newWizSC:org.eclipse.ui.editors.wizards.UntitledTextFileWizard - persp.perspSC:org.eclipse.jdt.ui.JavaBrowsingPerspective - persp.perspSC:org.eclipse.debug.ui.DebugPerspective - persp.showIn:org.eclipse.jdt.ui.PackageExplorer - persp.showIn:org.eclipse.team.ui.GenericHistoryView - persp.showIn:org.eclipse.ui.navigator.ProjectExplorer - persp.actionSet:org.eclipse.debug.ui.breakpointActionSet - persp.actionSet:org.eclipse.jdt.debug.ui.JDTDebugActionSet - persp.showIn:org.eclipse.egit.ui.RepositoriesView - persp.actionSet:org.eclipse.eclemma.ui.CoverageActionSet - persp.showIn:org.eclipse.eclemma.ui.CoverageView - persp.viewSC:org.eclipse.tm.terminal.view.ui.TerminalsView - persp.showIn:org.eclipse.tm.terminal.view.ui.TerminalsView - persp.newWizSC:org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard - persp.actionSet:org.eclipse.jdt.junit.JUnitActionSet - persp.viewSC:org.eclipse.ant.ui.views.AntView - - - - org.eclipse.e4.primaryNavigationStack - active - - View - categoryTag:Java - - - View - categoryTag:Java - - - View - categoryTag:General - - - View - categoryTag:Java - - - - - View - categoryTag:Git - - - - - - - - org.eclipse.e4.secondaryNavigationStack - - View - categoryTag:General - - - View - categoryTag:General - - - View - categoryTag:General - - - View - categoryTag:Ant - - - - - org.eclipse.e4.secondaryDataStack - - View - categoryTag:General - - - View - categoryTag:Java - - - View - categoryTag:Java - - - View - categoryTag:General - - - View - categoryTag:General - - - View - categoryTag:General - - - View - categoryTag:General - - - View - categoryTag:Terminal - - - - - - - - - View - categoryTag:Help - - - View - categoryTag:General - - - View - categoryTag:Help - - - - - - - View - categoryTag:Help - - - - - - View - categoryTag:General - - ViewMenu - menuContribution:menu - - - - - - - View - categoryTag:Help - - - - org.eclipse.e4.primaryDataStack - EditorStack - - - - - - - View - categoryTag:Java - active - activeOnClose - - ViewMenu - menuContribution:menu - - - - - - - View - categoryTag:Java - - - - - View - categoryTag:General - - - - - - View - categoryTag:General - - ViewMenu - menuContribution:menu - - - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - - View - categoryTag:General - - ViewMenu - menuContribution:menu - - - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:Git - - - - - View - categoryTag:Terminal - - - - - View - categoryTag:Java - - - - - View - categoryTag:Ant - - - - toolbarSeparator - - - - Draggable - - - - toolbarSeparator - - - - Draggable - - - toolbarSeparator - - - - Draggable - - - Draggable - - - Draggable - - - toolbarSeparator - - - - Draggable - - - - toolbarSeparator - - - - toolbarSeparator - - - - Draggable - - - stretch - SHOW_RESTORE_MENU - - - Draggable - HIDEABLE - SHOW_RESTORE_MENU - - - - - stretch - - - Draggable - - - Draggable - - - - - TrimStack - Draggable - - - - - - - - - - - - - - - - - - - - - - platform:win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - platform:win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Editor - removeOnHide - - - - - View - categoryTag:Ant - - - - - View - categoryTag:Gradle - - - - - View - categoryTag:Gradle - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - View - categoryTag:Debug - - - - - View - categoryTag:Java - - - - - View - categoryTag:Git - - - - - View - categoryTag:Git - - - - - View - categoryTag:Git - - - - - View - categoryTag:Git - NoRestore - - - - - View - categoryTag:Git - - - - - View - categoryTag:Help - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java Browsing - - - - - View - categoryTag:Java Browsing - - - - - View - categoryTag:Java Browsing - - - - - View - categoryTag:Java Browsing - - - - - View - categoryTag:Java - - - - - View - categoryTag:General - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java - - - - - View - categoryTag:Maven - - - - - View - categoryTag:Maven - - - - - View - categoryTag:Maven - - - - - View - categoryTag:Oomph - - - - - View - categoryTag:General - - - - - View - categoryTag:Version Control (Team) - - - - - View - categoryTag:Version Control (Team) - - - View - categoryTag:Help - - - - - View - categoryTag:Terminal - - - - - View - categoryTag:Other - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:Help - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - glue - move_after:PerspectiveSpacer - SHOW_RESTORE_MENU - - - move_after:Spacer Glue - HIDEABLE - SHOW_RESTORE_MENU - - - glue - move_after:SearchField - SHOW_RESTORE_MENU - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project b/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project deleted file mode 100644 index 3c10856..0000000 --- a/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - .org.eclipse.egit.core.cmp - - - - - - - - diff --git a/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache b/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache deleted file mode 100644 index 593f4708db84ac8fd0f5cc47c634f38c013fe9e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4 LcmZQzU|;|M00aO5 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache deleted file mode 100644 index 593f4708db84ac8fd0f5cc47c634f38c013fe9e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4 LcmZQzU|;|M00aO5 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt deleted file mode 100644 index 8586397..0000000 --- a/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt +++ /dev/null @@ -1 +0,0 @@ -java \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache deleted file mode 100644 index 593f4708db84ac8fd0f5cc47c634f38c013fe9e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4 LcmZQzU|;|M00aO5 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat deleted file mode 100644 index 0edae4b20855dcd5c83bdac184b9ed16afb1b634..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 110 zcmZQzU|?c^05&ki?iJ)3@8jvj2;?y`aD#ZkLC!(`{vjX{CI&9AP(RO*cn^PHSC9ZR e16Tu435dtSzz2~A^5IHY8Q6V|;)7fR{22i=Q4xRu diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml deleted file mode 100644 index a4ee3cb..0000000 --- a/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml deleted file mode 100644 index 9e390f5..0000000 --- a/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml b/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml deleted file mode 100644 index fdd7818..0000000 --- a/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml +++ /dev/null @@ -1,10 +0,0 @@ - -
-
- - - - - -
-
diff --git a/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log b/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log deleted file mode 100644 index d4aa070..0000000 --- a/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log +++ /dev/null @@ -1 +0,0 @@ -2023-02-28 21:46:22,406 [Worker-4: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is up-to-date. Trying to read. diff --git a/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.3.20211002-1029.xml b/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.3.20211002-1029.xml deleted file mode 100644 index 4512556..0000000 --- a/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.3.20211002-1029.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - %date [%thread] %-5level %logger{35} - %msg%n - - - OFF - - - - - ${org.eclipse.m2e.log.dir}/0.log - - ${org.eclipse.m2e.log.dir}/%i.log - 1 - 10 - - - 100MB - - - %date [%thread] %-5level %logger{35} - %msg%n - - - - - - WARN - - - - - - - - - - - - - diff --git a/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup b/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup deleted file mode 100644 index 1f73e14..0000000 --- a/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml b/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml deleted file mode 100644 index 5ca0b77..0000000 --- a/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - -
-
diff --git a/.metadata/.plugins/org.eclipse.ui.intro/introstate b/.metadata/.plugins/org.eclipse.ui.intro/introstate deleted file mode 100644 index 02f134f..0000000 --- a/.metadata/.plugins/org.eclipse.ui.intro/introstate +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml deleted file mode 100644 index 9688c96..0000000 --- a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.metadata/version.ini b/.metadata/version.ini deleted file mode 100644 index ee5d3a7..0000000 --- a/.metadata/version.ini +++ /dev/null @@ -1,3 +0,0 @@ -#Tue Feb 28 21:46:12 AWST 2023 -org.eclipse.core.runtime=2 -org.eclipse.platform=4.23.0.v20220308-0310 From f32440d3576d75eb4110e73bde499a87756a297c Mon Sep 17 00:00:00 2001 From: TszenYong Date: Tue, 28 Feb 2023 22:09:27 +0800 Subject: [PATCH 03/29] Deleted Charges and Print --- src/PrintingKioskSystem/Charge.java | 94 --------------------------- src/PrintingKioskSystem/Printing.java | 16 ----- 2 files changed, 110 deletions(-) delete mode 100644 src/PrintingKioskSystem/Charge.java delete mode 100644 src/PrintingKioskSystem/Printing.java diff --git a/src/PrintingKioskSystem/Charge.java b/src/PrintingKioskSystem/Charge.java deleted file mode 100644 index 09b3dde..0000000 --- a/src/PrintingKioskSystem/Charge.java +++ /dev/null @@ -1,94 +0,0 @@ -package PrintingKioskSystem; - -import java.util.*; - -public class Charge { - - - private double charge, surcharge; - private String option,addOption; - private int quantity, addOpt, ttlQtt; - - public int getQuantity() - { - return quantity; - } - public Charge(String option, int quantity) { - this.option = option; - this.quantity = quantity; - } - - public Charge(int addOpt,int ttlQtt) { - this.addOpt = addOpt; - this.ttlQtt = ttlQtt; - } - - public double calNormalCharge() { - - switch(option) { - case "A": charge = getBlackAndWhiteCharge(quantity); break; - case "B": charge = getColourCharge(quantity); break; - case "C": charge = getNormalCharge(quantity); break; - case "D": charge = getPassportCharge(quantity); break; - } - return charge*quantity; - } - - public double calSurcharge() { - - surcharge = getAddOptSurcharge(); - return surcharge*ttlQtt; - } - - - public double getBlackAndWhiteCharge(int quantity){ - if(quantity < 5) - return 0.5; - else if (quantity >= 5 && quantity <= 10) - return 0.4; - else if(quantity >= 11 && quantity <= 20) - return 0.3; - else - return 0.2; - } - - public double getColourCharge(int quantity) { - if(quantity < 5) - return 1; - else if (quantity >= 5 && quantity <= 10) - return 0.9; - else if(quantity >= 11 && quantity <= 20) - return 0.8; - else - return 0.7; - } - - public double getNormalCharge(int quantity) { - if(quantity < 5) - return 1; - else if (quantity >= 5 && quantity <= 10) - return 0.9; - else if(quantity >= 11 && quantity <= 20) - return 0.75; - else - return 0.5; - } - - public double getPassportCharge(int quantity) { - if(quantity < 5) - return 1.2; - else if (quantity >= 5 && quantity <= 10) - return 0.95; - else if(quantity >= 11 && quantity <= 20) - return 0.85; - else - return 0.75; - } - - public double getAddOptSurcharge() { - if(addOpt==1) - return 0.1; - else - return 0.15; - } -} diff --git a/src/PrintingKioskSystem/Printing.java b/src/PrintingKioskSystem/Printing.java deleted file mode 100644 index 7cd0e6c..0000000 --- a/src/PrintingKioskSystem/Printing.java +++ /dev/null @@ -1,16 +0,0 @@ -package PrintingKioskSystem; - -import java.util.*; - -public class Printing { - public static void main(String[] args) { - - //Table - - - Order order = new Order(); - //order.getMainOpt1(); - } - - -} From 0cb773983693c546333cf89b67456d576bd42550 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 9 Mar 2023 17:17:48 +0800 Subject: [PATCH 04/29] Update Order.java --- src/PrintingKioskSystem/Order.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/PrintingKioskSystem/Order.java b/src/PrintingKioskSystem/Order.java index 773490f..32e4355 100644 --- a/src/PrintingKioskSystem/Order.java +++ b/src/PrintingKioskSystem/Order.java @@ -79,8 +79,13 @@ public static void document() { System.out.print("Enter option(A-Black & White/B-Colour): "); opt = scanner.next().toUpperCase(); if (opt.equals("A") || opt.equals("B")) { - - System.out.print("Enter quantity in black and white: "); + if(opt.equals("A")) { + System.out.print("Enter quantity in black and white: "); + } + else if(opt.equals("B")) { + System.out.print("Enter quantity in color: "); + } + Qtt = scanner.nextInt(); PrintingOption pOpt = PrintingOption.Unknown; if (opt.equals("A")) { @@ -111,7 +116,14 @@ public static void photo() { System.out.print("Enter option(C-Normal(4R)/D-Passport): "); opt = scanner.next().toUpperCase(); if (opt.equals("C") || opt.equals("D")) { - System.out.print("Enter quantity in normal(4R): "); + if(opt.equals("C")) { + System.out.print("Enter quantity in normal(4R): "); + } + else if(opt.equals("D")) { + System.out.print("Enter quantity in passport: "); + } + + Qtt = scanner.nextInt(); PrintingOption pOpt = PrintingOption.Unknown; From 7adccaa35659604cd4426a82ef5c906bc9bb837a Mon Sep 17 00:00:00 2001 From: TszenYong Date: Sat, 15 Apr 2023 17:27:27 +0800 Subject: [PATCH 05/29] Update Order.java Added validation for printing quantity --- src/PrintingKioskSystem/Order.java | 94 +++++++++++++++++++----------- 1 file changed, 60 insertions(+), 34 deletions(-) diff --git a/src/PrintingKioskSystem/Order.java b/src/PrintingKioskSystem/Order.java index 32e4355..75a3323 100644 --- a/src/PrintingKioskSystem/Order.java +++ b/src/PrintingKioskSystem/Order.java @@ -85,17 +85,30 @@ public static void document() { else if(opt.equals("B")) { System.out.print("Enter quantity in color: "); } - - Qtt = scanner.nextInt(); - PrintingOption pOpt = PrintingOption.Unknown; - if (opt.equals("A")) { - pOpt = PrintingOption.BlackWhite; - } else if (opt.equals("B")) { - pOpt = PrintingOption.Colour; + try + { + Qtt = scanner.nextInt(); + if(Qtt>50) { + System.out.println("Invalid Quantity, Maximum 50 copies per printing"); + } + else if(Qtt<=0) { + System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); + } + else { + PrintingOption pOpt = PrintingOption.Unknown; + if (opt.equals("A")) { + pOpt = PrintingOption.BlackWhite; + } else if (opt.equals("B")) { + pOpt = PrintingOption.Colour; + } + PrintingDocument newDoc = new PrintingDocument(pOpt, Qtt); + printingOrders.add(newDoc); + } + } + catch(Exception e){ + e.printStackTrace(); + System.out.println("Invalid Option please enter integer only"); } - PrintingDocument newDoc = new PrintingDocument(pOpt, Qtt); - printingOrders.add(newDoc); - } else { System.out.println("Invalid choice. Please enter again."); isDocumentError = true; @@ -122,32 +135,45 @@ public static void photo() { else if(opt.equals("D")) { System.out.print("Enter quantity in passport: "); } - - - Qtt = scanner.nextInt(); - - PrintingOption pOpt = PrintingOption.Unknown; - if (opt.equals("C")) { - pOpt = PrintingOption.Normal; - } else if (opt.equals("D")) { - pOpt = PrintingOption.Passport; + try + { + Qtt = scanner.nextInt(); + if(Qtt>50) { + System.out.println("Invalid Quantity, Maximum 50 copies per printing"); + } + else if(Qtt<=0) { + System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); + } + else { + PrintingOption pOpt = PrintingOption.Unknown; + if (opt.equals("C")) { + pOpt = PrintingOption.Normal; + } else if (opt.equals("D")) { + pOpt = PrintingOption.Passport; + } + PrintingPhoto newPhoto = new PrintingPhoto(pOpt, Qtt); + + System.out.println("Additional Option"); + System.out.println("1. High quality paper"); + System.out.println("2. Design effect"); + System.out.println("None (Enter any key to skip)"); + System.out.print("Enter Option: "); + String addOpt = scanner.nextLine(); + scanner.nextLine(); + if (addOpt.equals("1")) { + newPhoto.isHighQualityPaper = true; + } else if (addOpt.equals("2")) { + newPhoto.isDesignEffect = true; + } + + printingOrders.add(newPhoto); + } } - PrintingPhoto newPhoto = new PrintingPhoto(pOpt, Qtt); - - System.out.println("Additional Option"); - System.out.println("1. High quality paper"); - System.out.println("2. Design effect"); - System.out.println("None (Enter any key to skip)"); - System.out.print("Enter Option: "); - String addOpt = scanner.nextLine(); - scanner.nextLine(); - if (addOpt.equals("1")) { - newPhoto.isHighQualityPaper = true; - } else if (addOpt.equals("2")) { - newPhoto.isDesignEffect = true; + catch(Exception e){ + e.printStackTrace(); + System.out.println("Invalid Option please enter integer only"); } - - printingOrders.add(newPhoto); + } else { System.out.println("Invalid choice. Please enter again."); From 0aff41dcf638130c589de43f53d9c38f6b107972 Mon Sep 17 00:00:00 2001 From: TszenYong Date: Sat, 15 Apr 2023 17:37:38 +0800 Subject: [PATCH 06/29] Update Order.java Fixed some erorr on validation --- src/PrintingKioskSystem/Order.java | 173 ++++++++++++++++------------- 1 file changed, 93 insertions(+), 80 deletions(-) diff --git a/src/PrintingKioskSystem/Order.java b/src/PrintingKioskSystem/Order.java index 75a3323..1c141b1 100644 --- a/src/PrintingKioskSystem/Order.java +++ b/src/PrintingKioskSystem/Order.java @@ -73,47 +73,54 @@ public static void document() { String opt; int Qtt = 0; boolean isDocumentError; + boolean isQuantityError; do { isDocumentError = false; System.out.print("Enter option(A-Black & White/B-Colour): "); opt = scanner.next().toUpperCase(); - if (opt.equals("A") || opt.equals("B")) { - if(opt.equals("A")) { - System.out.print("Enter quantity in black and white: "); - } - else if(opt.equals("B")) { - System.out.print("Enter quantity in color: "); - } - try - { - Qtt = scanner.nextInt(); - if(Qtt>50) { - System.out.println("Invalid Quantity, Maximum 50 copies per printing"); - } - else if(Qtt<=0) { - System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); - } - else { - PrintingOption pOpt = PrintingOption.Unknown; - if (opt.equals("A")) { - pOpt = PrintingOption.BlackWhite; - } else if (opt.equals("B")) { - pOpt = PrintingOption.Colour; + do { + isQuantityError=false; + + if (opt.equals("A") || opt.equals("B")) { + if(opt.equals("A")) { + System.out.print("Enter quantity in black and white: "); + } + else if(opt.equals("B")) { + System.out.print("Enter quantity in color: "); + } + try + { + Qtt = scanner.nextInt(); + if(Qtt>50) { + System.out.println("Invalid Quantity, Maximum 50 copies per printing"); + isQuantityError=true; + } + else if(Qtt<=0) { + System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); + isQuantityError=true; + } + else { + PrintingOption pOpt = PrintingOption.Unknown; + if (opt.equals("A")) { + pOpt = PrintingOption.BlackWhite; + } else if (opt.equals("B")) { + pOpt = PrintingOption.Colour; + } + PrintingDocument newDoc = new PrintingDocument(pOpt, Qtt); + printingOrders.add(newDoc); } - PrintingDocument newDoc = new PrintingDocument(pOpt, Qtt); - printingOrders.add(newDoc); } + catch(Exception e){ + e.printStackTrace(); + System.out.println("Invalid Option please enter integer only"); + } + } else { + System.out.println("Invalid choice. Please enter again."); + isDocumentError = true; } - catch(Exception e){ - e.printStackTrace(); - System.out.println("Invalid Option please enter integer only"); - } - } else { - System.out.println("Invalid choice. Please enter again."); - isDocumentError = true; - } - + }while(isQuantityError); + } while (isDocumentError); } @@ -123,62 +130,68 @@ public static void photo() { String opt; int Qtt; boolean isPhotoError; - + boolean isQuantityError; do { isPhotoError = false; System.out.print("Enter option(C-Normal(4R)/D-Passport): "); opt = scanner.next().toUpperCase(); - if (opt.equals("C") || opt.equals("D")) { - if(opt.equals("C")) { - System.out.print("Enter quantity in normal(4R): "); - } - else if(opt.equals("D")) { - System.out.print("Enter quantity in passport: "); - } - try - { - Qtt = scanner.nextInt(); - if(Qtt>50) { - System.out.println("Invalid Quantity, Maximum 50 copies per printing"); - } - else if(Qtt<=0) { - System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); - } - else { - PrintingOption pOpt = PrintingOption.Unknown; - if (opt.equals("C")) { - pOpt = PrintingOption.Normal; - } else if (opt.equals("D")) { - pOpt = PrintingOption.Passport; + + do { + isQuantityError=false; + if (opt.equals("C") || opt.equals("D")) { + if(opt.equals("C")) { + System.out.print("Enter quantity in normal(4R): "); } - PrintingPhoto newPhoto = new PrintingPhoto(pOpt, Qtt); - - System.out.println("Additional Option"); - System.out.println("1. High quality paper"); - System.out.println("2. Design effect"); - System.out.println("None (Enter any key to skip)"); - System.out.print("Enter Option: "); - String addOpt = scanner.nextLine(); - scanner.nextLine(); - if (addOpt.equals("1")) { - newPhoto.isHighQualityPaper = true; - } else if (addOpt.equals("2")) { - newPhoto.isDesignEffect = true; + else if(opt.equals("D")) { + System.out.print("Enter quantity in passport: "); + } + try + { + Qtt = scanner.nextInt(); + if(Qtt>50) { + System.out.println("Invalid Quantity, Maximum 50 copies per printing"); + isQuantityError=true; + } + else if(Qtt<=0) { + System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); + isQuantityError=true; + } + else { + PrintingOption pOpt = PrintingOption.Unknown; + if (opt.equals("C")) { + pOpt = PrintingOption.Normal; + } else if (opt.equals("D")) { + pOpt = PrintingOption.Passport; + } + PrintingPhoto newPhoto = new PrintingPhoto(pOpt, Qtt); + + System.out.println("Additional Option"); + System.out.println("1. High quality paper"); + System.out.println("2. Design effect"); + System.out.println("None (Enter any key to skip)"); + System.out.print("Enter Option: "); + String addOpt = scanner.nextLine(); + scanner.nextLine(); + if (addOpt.equals("1")) { + newPhoto.isHighQualityPaper = true; + } else if (addOpt.equals("2")) { + newPhoto.isDesignEffect = true; + } + + printingOrders.add(newPhoto); } - - printingOrders.add(newPhoto); } - } - catch(Exception e){ - e.printStackTrace(); - System.out.println("Invalid Option please enter integer only"); - } + catch(Exception e){ + e.printStackTrace(); + System.out.println("Invalid Option please enter integer only"); + } + } else { + System.out.println("Invalid choice. Please enter again."); + isPhotoError = true; + } + }while(isQuantityError); - } else { - System.out.println("Invalid choice. Please enter again."); - isPhotoError = true; - } } while (isPhotoError); From c87487dfa8dc20f63c7e725e35ff387a4977fd6f Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:03 +0800 Subject: [PATCH 07/29] Update .classpath --- .classpath | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.classpath b/.classpath index f00af9b..f0a2fcb 100644 --- a/.classpath +++ b/.classpath @@ -1,10 +1,17 @@ + + - + + + + + + From 2c6370afbc1d27920cdeeee456c4641b14e31403 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:06 +0800 Subject: [PATCH 08/29] Update .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7920af5..30e0b36 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ _ReSharper.* bin obj -packages \ No newline at end of file +packages +/testclasses/ From c60b605258b3a794594610582a74f5c57872b924 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:11 +0800 Subject: [PATCH 09/29] Create Order.java --- src/main/java/printing/app/Order.java | 200 ++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 src/main/java/printing/app/Order.java diff --git a/src/main/java/printing/app/Order.java b/src/main/java/printing/app/Order.java new file mode 100644 index 0000000..1e499b3 --- /dev/null +++ b/src/main/java/printing/app/Order.java @@ -0,0 +1,200 @@ +package printing.app; + +import java.util.ArrayList; +import java.util.Scanner; + +import printing.objects.*; + +public class Order { + + public static ArrayList printingOrders = new ArrayList(); + private static Scanner scanner; + + public static void main(String[] args) { + scanner = new Scanner(System.in); + + boolean error = true, isInvalidInput = false; + String order; + + do { + System.out.print("Enter type of order(D-Document/P-Photo)(E-exit): "); + order = scanner.next().toUpperCase(); + switch (order) { + case "D": + document(); + break; + case "P": + photo(); + break; + case "E": + error = false; + break; + default: + isInvalidInput = true; + break; + } + + if (isInvalidInput) { + System.out.println("Invalid choice. Please enter again"); + isInvalidInput = false; + } else { + boolean er = false; + do { + System.out.print("Proceed to another option? (Y-yes/N-No): "); + String choice = scanner.next().toUpperCase(); + if (choice.equals("Y")) { + error = true; + er = false; + } else if (choice.equals("N")) { + error = false; + er = false; + } else { + System.out.println("Invalid input. Please enter again."); + er = true; + } + } while (er); + + } + + } while (error); + + System.out.println("Proceeding to Billing..."); + double totalBill = 0; + for (int i = 0; i < printingOrders.size(); i++) { + double bill=printingOrders.get(i).getTotal(); + System.out.println((i+1)+": Order "+ printingOrders.get(i).printingOpt + "Quantity= " +printingOrders.get(i).quantity+ " and bill is: " +bill); + totalBill += bill; + } + System.out.print("Your billing total is " + totalBill); + + } + + public static void document() { + String opt; + int Qtt = 0; + boolean isDocumentError; + boolean isQuantityError; + + do { + isDocumentError = false; + System.out.print("Enter option(A-Black & White/B-Colour): "); + opt = scanner.next().toUpperCase(); + do { + isQuantityError=false; + + if (opt.equals("A") || opt.equals("B")) { + if(opt.equals("A")) { + System.out.print("Enter quantity in black and white: "); + } + else if(opt.equals("B")) { + System.out.print("Enter quantity in color: "); + } + try + { + Qtt = scanner.nextInt(); + if(Qtt>50) { + System.out.println("Invalid Quantity, Maximum 50 copies per printing"); + isQuantityError=true; + } + else if(Qtt<=0) { + System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); + isQuantityError=true; + } + else { + PrintingOption pOpt = PrintingOption.Unknown; + if (opt.equals("A")) { + pOpt = PrintingOption.BlackWhite; + } else if (opt.equals("B")) { + pOpt = PrintingOption.Colour; + } + PrintingDocument newDoc = new PrintingDocument(pOpt, Qtt); + printingOrders.add(newDoc); + } + } + catch(Exception e){ + e.printStackTrace(); + System.out.println("Invalid Option please enter integer only"); + } + } else { + System.out.println("Invalid choice. Please enter again."); + isDocumentError = true; + } + }while(isQuantityError); + + } while (isDocumentError); + + } + + public static void photo() { + + String opt; + int Qtt; + boolean isPhotoError; + boolean isQuantityError; + do { + isPhotoError = false; + System.out.print("Enter option(C-Normal(4R)/D-Passport): "); + opt = scanner.next().toUpperCase(); + + do { + isQuantityError=false; + if (opt.equals("C") || opt.equals("D")) { + if(opt.equals("C")) { + System.out.print("Enter quantity in normal(4R): "); + } + else if(opt.equals("D")) { + System.out.print("Enter quantity in passport: "); + } + try + { + Qtt = scanner.nextInt(); + if(Qtt>50) { + System.out.println("Invalid Quantity, Maximum 50 copies per printing"); + isQuantityError=true; + } + else if(Qtt<=0) { + System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); + isQuantityError=true; + } + else { + PrintingOption pOpt = PrintingOption.Unknown; + if (opt.equals("C")) { + pOpt = PrintingOption.Normal; + } else if (opt.equals("D")) { + pOpt = PrintingOption.Passport; + } + PrintingPhoto newPhoto = new PrintingPhoto(pOpt, Qtt); + + System.out.println("Additional Option"); + System.out.println("1. High quality paper"); + System.out.println("2. Design effect"); + System.out.println("None (Enter any key to skip)"); + System.out.print("Enter Option: "); + String addOpt = scanner.nextLine(); + scanner.nextLine(); + if (addOpt.equals("1")) { + newPhoto.isHighQualityPaper = true; + } else if (addOpt.equals("2")) { + newPhoto.isDesignEffect = true; + } + + printingOrders.add(newPhoto); + } + } + catch(Exception e){ + e.printStackTrace(); + System.out.println("Invalid Option please enter integer only"); + } + } else { + System.out.println("Invalid choice. Please enter again."); + isPhotoError = true; + } + }while(isQuantityError); + + + + } while (isPhotoError); + + } + +} From d73ce36fb8a124955481adf7b5e31663a34fc077 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:15 +0800 Subject: [PATCH 10/29] Create IPrintingOrder.java --- .../java/printing/objects/IPrintingOrder.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/java/printing/objects/IPrintingOrder.java diff --git a/src/main/java/printing/objects/IPrintingOrder.java b/src/main/java/printing/objects/IPrintingOrder.java new file mode 100644 index 0000000..fc1596a --- /dev/null +++ b/src/main/java/printing/objects/IPrintingOrder.java @@ -0,0 +1,25 @@ +package printing.objects; + +public class IPrintingOrder { + + public PrintingType printingType; + public PrintingOption printingOpt; + public int quantity; + public double sum; + public boolean isHighQualityPaper=false; + public boolean isDesignEffect=false; + + public double getTotal() { + return 0; + } + public IPrintingOrder(PrintingType pType, PrintingOption pOpt, int qtt) + { + this.printingType=pType; + this.printingOpt=pOpt; + this.quantity=qtt; + } + + + +} + From 48cf97c148756c2e10c558f58254c7144281f75f Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:19 +0800 Subject: [PATCH 11/29] Create PrintingDocument.java --- .../printing/objects/PrintingDocument.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/main/java/printing/objects/PrintingDocument.java diff --git a/src/main/java/printing/objects/PrintingDocument.java b/src/main/java/printing/objects/PrintingDocument.java new file mode 100644 index 0000000..c1ee9af --- /dev/null +++ b/src/main/java/printing/objects/PrintingDocument.java @@ -0,0 +1,47 @@ +package printing.objects; + +public class PrintingDocument extends IPrintingOrder { + + + public PrintingDocument(PrintingOption pOpt,int qtt) + { + super(PrintingType.Document,pOpt,qtt); + } + @Override + public double getTotal() + { + double charge=0; + if(printingOpt==PrintingOption.BlackWhite) + { + charge=getBlackAndWhiteCharge(); + } + else if(printingOpt==PrintingOption.Colour) + { + charge=getColourCharge(); + } + sum=quantity*charge; + return sum; + } + + public double getBlackAndWhiteCharge(){ + if(quantity < 5) + return 0.5; + else if (quantity >= 5 && quantity <= 10) + return 0.4; + else if(quantity >= 11 && quantity <= 20) + return 0.3; + else + return 0.2; + } + + public double getColourCharge() { + if(quantity < 5) + return 1; + else if (quantity >= 5 && quantity <= 10) + return 0.9; + else if(quantity >= 11 && quantity <= 20) + return 0.8; + else + return 0.7; + } +} From 12ac21f23d6cdc3e809ca093c7fc501ad6f05ee9 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:22 +0800 Subject: [PATCH 12/29] Create PrintingOption.java --- src/main/java/printing/objects/PrintingOption.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/main/java/printing/objects/PrintingOption.java diff --git a/src/main/java/printing/objects/PrintingOption.java b/src/main/java/printing/objects/PrintingOption.java new file mode 100644 index 0000000..43d06f5 --- /dev/null +++ b/src/main/java/printing/objects/PrintingOption.java @@ -0,0 +1,9 @@ +package printing.objects; + +public enum PrintingOption { + BlackWhite, + Colour, + Normal, + Passport, + Unknown +} From 8715680ea22c9102ee7b1442725a332766830b29 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:25 +0800 Subject: [PATCH 13/29] Create PrintingPhoto.java --- .../java/printing/objects/PrintingPhoto.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/main/java/printing/objects/PrintingPhoto.java diff --git a/src/main/java/printing/objects/PrintingPhoto.java b/src/main/java/printing/objects/PrintingPhoto.java new file mode 100644 index 0000000..bf42036 --- /dev/null +++ b/src/main/java/printing/objects/PrintingPhoto.java @@ -0,0 +1,59 @@ +package printing.objects; + +public class PrintingPhoto extends IPrintingOrder{ + + public boolean isHighQualityPaper=false; + public boolean isDesignEffect=false; + + public PrintingPhoto(PrintingOption pOpt,int qtt) + { + super(PrintingType.Photo,pOpt,qtt); + } + @Override + public double getTotal() + { + + double charge=0; + if(printingOpt==PrintingOption.Normal) + { + charge=getNormalCharge(); + } + else if(printingOpt==PrintingOption.Passport) + { + charge=getPassportCharge(); + } + if(isHighQualityPaper) + { + charge+=0.10; + } + if(isDesignEffect) + { + charge+=0.15; + } + sum=quantity*charge; + return sum; + } + + public double getNormalCharge() { + if(quantity < 5) + return 1; + else if (quantity >= 5 && quantity <= 10) + return 0.9; + else if(quantity >= 11 && quantity <= 20) + return 0.75; + else + return 0.5; + } + + public double getPassportCharge() { + if(quantity < 5) + return 1.2; + else if (quantity >= 5 && quantity <= 10) + return 0.95; + else if(quantity >= 11 && quantity <= 20) + return 0.85; + else + return 0.75; + } +} + From 019ff67e08950b9fc4f36b1b594312498da7c61b Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:27 +0800 Subject: [PATCH 14/29] Create PrintingType.java --- src/main/java/printing/objects/PrintingType.java | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/java/printing/objects/PrintingType.java diff --git a/src/main/java/printing/objects/PrintingType.java b/src/main/java/printing/objects/PrintingType.java new file mode 100644 index 0000000..08240e0 --- /dev/null +++ b/src/main/java/printing/objects/PrintingType.java @@ -0,0 +1,8 @@ +package printing.objects; + +public enum PrintingType { + + Document, + Photo +} + From 4d347aca14b8940f59d6a5e995920f175186e1fa Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:30 +0800 Subject: [PATCH 15/29] Delete IPrintingOrder.java --- .../Objects/IPrintingOrder.java | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/PrintingKioskSystem/Objects/IPrintingOrder.java diff --git a/src/PrintingKioskSystem/Objects/IPrintingOrder.java b/src/PrintingKioskSystem/Objects/IPrintingOrder.java deleted file mode 100644 index fe514e8..0000000 --- a/src/PrintingKioskSystem/Objects/IPrintingOrder.java +++ /dev/null @@ -1,25 +0,0 @@ -package PrintingKioskSystem.Objects; - -public class IPrintingOrder { - - public PrintingType printingType; - public PrintingOption printingOpt; - public int quantity; - public double sum; - public boolean isHighQualityPaper=false; - public boolean isDesignEffect=false; - - public double getTotal() { - return 0; - } - public IPrintingOrder(PrintingType pType, PrintingOption pOpt, int qtt) - { - this.printingType=pType; - this.printingOpt=pOpt; - this.quantity=qtt; - } - - - -} - From 8b196e9377d3df4f8397a6325eeb2a8f3318939c Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:35 +0800 Subject: [PATCH 16/29] Delete PrintingDocument.java --- .../Objects/PrintingDocument.java | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/PrintingKioskSystem/Objects/PrintingDocument.java diff --git a/src/PrintingKioskSystem/Objects/PrintingDocument.java b/src/PrintingKioskSystem/Objects/PrintingDocument.java deleted file mode 100644 index 5d49c9e..0000000 --- a/src/PrintingKioskSystem/Objects/PrintingDocument.java +++ /dev/null @@ -1,47 +0,0 @@ -package PrintingKioskSystem.Objects; - -public class PrintingDocument extends IPrintingOrder { - - - public PrintingDocument(PrintingOption pOpt,int qtt) - { - super(PrintingType.Document,pOpt,qtt); - } - @Override - public double getTotal() - { - double charge=0; - if(printingOpt==PrintingOption.BlackWhite) - { - charge=getBlackAndWhiteCharge(); - } - else if(printingOpt==PrintingOption.Colour) - { - charge=getColourCharge(); - } - sum=quantity*charge; - return sum; - } - - public double getBlackAndWhiteCharge(){ - if(quantity < 5) - return 0.5; - else if (quantity >= 5 && quantity <= 10) - return 0.4; - else if(quantity >= 11 && quantity <= 20) - return 0.3; - else - return 0.2; - } - - public double getColourCharge() { - if(quantity < 5) - return 1; - else if (quantity >= 5 && quantity <= 10) - return 0.9; - else if(quantity >= 11 && quantity <= 20) - return 0.8; - else - return 0.7; - } -} From ef5b78e7901267a6b445e14e014eeb34d9e27730 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:38 +0800 Subject: [PATCH 17/29] Delete PrintingOption.java --- src/PrintingKioskSystem/Objects/PrintingOption.java | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 src/PrintingKioskSystem/Objects/PrintingOption.java diff --git a/src/PrintingKioskSystem/Objects/PrintingOption.java b/src/PrintingKioskSystem/Objects/PrintingOption.java deleted file mode 100644 index 44dee4f..0000000 --- a/src/PrintingKioskSystem/Objects/PrintingOption.java +++ /dev/null @@ -1,9 +0,0 @@ -package PrintingKioskSystem.Objects; - -public enum PrintingOption { - BlackWhite, - Colour, - Normal, - Passport, - Unknown -} From ed8c4f2bb07baed6992eb016c3ac4207d5129bf2 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:41 +0800 Subject: [PATCH 18/29] Delete PrintingPhoto.java --- .../Objects/PrintingPhoto.java | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 src/PrintingKioskSystem/Objects/PrintingPhoto.java diff --git a/src/PrintingKioskSystem/Objects/PrintingPhoto.java b/src/PrintingKioskSystem/Objects/PrintingPhoto.java deleted file mode 100644 index 70cb2fe..0000000 --- a/src/PrintingKioskSystem/Objects/PrintingPhoto.java +++ /dev/null @@ -1,59 +0,0 @@ -package PrintingKioskSystem.Objects; - -public class PrintingPhoto extends IPrintingOrder{ - - public boolean isHighQualityPaper=false; - public boolean isDesignEffect=false; - - public PrintingPhoto(PrintingOption pOpt,int qtt) - { - super(PrintingType.Photo,pOpt,qtt); - } - @Override - public double getTotal() - { - - double charge=0; - if(printingOpt==PrintingOption.Normal) - { - charge=getNormalCharge(); - } - else if(printingOpt==PrintingOption.Passport) - { - charge=getPassportCharge(); - } - if(isHighQualityPaper) - { - charge+=0.10; - } - if(isDesignEffect) - { - charge+=0.15; - } - sum=quantity*charge; - return sum; - } - - public double getNormalCharge() { - if(quantity < 5) - return 1; - else if (quantity >= 5 && quantity <= 10) - return 0.9; - else if(quantity >= 11 && quantity <= 20) - return 0.75; - else - return 0.5; - } - - public double getPassportCharge() { - if(quantity < 5) - return 1.2; - else if (quantity >= 5 && quantity <= 10) - return 0.95; - else if(quantity >= 11 && quantity <= 20) - return 0.85; - else - return 0.75; - } -} - From 124cfa08d2e0c38c023dfc444869cebd183614ed Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:44 +0800 Subject: [PATCH 19/29] Delete PrintingType.java --- src/PrintingKioskSystem/Objects/PrintingType.java | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 src/PrintingKioskSystem/Objects/PrintingType.java diff --git a/src/PrintingKioskSystem/Objects/PrintingType.java b/src/PrintingKioskSystem/Objects/PrintingType.java deleted file mode 100644 index 9b8d429..0000000 --- a/src/PrintingKioskSystem/Objects/PrintingType.java +++ /dev/null @@ -1,7 +0,0 @@ -package PrintingKioskSystem.Objects; - -public enum PrintingType { - - Document, - Photo -} From ad75ddb3398210ffcc8cd5bd8d48618c707110a1 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:44:47 +0800 Subject: [PATCH 20/29] Delete Order.java --- src/PrintingKioskSystem/Order.java | 200 ----------------------------- 1 file changed, 200 deletions(-) delete mode 100644 src/PrintingKioskSystem/Order.java diff --git a/src/PrintingKioskSystem/Order.java b/src/PrintingKioskSystem/Order.java deleted file mode 100644 index 1c141b1..0000000 --- a/src/PrintingKioskSystem/Order.java +++ /dev/null @@ -1,200 +0,0 @@ -package PrintingKioskSystem; - -import java.util.ArrayList; -import java.util.Scanner; - -import PrintingKioskSystem.Objects.*; - -public class Order { - - public static ArrayList printingOrders = new ArrayList(); - private static Scanner scanner; - - public static void main(String[] args) { - scanner = new Scanner(System.in); - - boolean error = true, isInvalidInput = false; - String order; - - do { - System.out.print("Enter type of order(D-Document/P-Photo)(E-exit): "); - order = scanner.next().toUpperCase(); - switch (order) { - case "D": - document(); - break; - case "P": - photo(); - break; - case "E": - error = false; - break; - default: - isInvalidInput = true; - break; - } - - if (isInvalidInput) { - System.out.println("Invalid choice. Please enter again"); - isInvalidInput = false; - } else { - boolean er = false; - do { - System.out.print("Proceed to another option? (Y-yes/N-No): "); - String choice = scanner.next().toUpperCase(); - if (choice.equals("Y")) { - error = true; - er = false; - } else if (choice.equals("N")) { - error = false; - er = false; - } else { - System.out.println("Invalid input. Please enter again."); - er = true; - } - } while (er); - - } - - } while (error); - - System.out.println("Proceeding to Billing..."); - double totalBill = 0; - for (int i = 0; i < printingOrders.size(); i++) { - double bill=printingOrders.get(i).getTotal(); - System.out.println((i+1)+": Order "+ printingOrders.get(i).printingOpt + "Quantity= " +printingOrders.get(i).quantity+ " and bill is: " +bill); - totalBill += bill; - } - System.out.print("Your billing total is " + totalBill); - - } - - public static void document() { - String opt; - int Qtt = 0; - boolean isDocumentError; - boolean isQuantityError; - - do { - isDocumentError = false; - System.out.print("Enter option(A-Black & White/B-Colour): "); - opt = scanner.next().toUpperCase(); - do { - isQuantityError=false; - - if (opt.equals("A") || opt.equals("B")) { - if(opt.equals("A")) { - System.out.print("Enter quantity in black and white: "); - } - else if(opt.equals("B")) { - System.out.print("Enter quantity in color: "); - } - try - { - Qtt = scanner.nextInt(); - if(Qtt>50) { - System.out.println("Invalid Quantity, Maximum 50 copies per printing"); - isQuantityError=true; - } - else if(Qtt<=0) { - System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); - isQuantityError=true; - } - else { - PrintingOption pOpt = PrintingOption.Unknown; - if (opt.equals("A")) { - pOpt = PrintingOption.BlackWhite; - } else if (opt.equals("B")) { - pOpt = PrintingOption.Colour; - } - PrintingDocument newDoc = new PrintingDocument(pOpt, Qtt); - printingOrders.add(newDoc); - } - } - catch(Exception e){ - e.printStackTrace(); - System.out.println("Invalid Option please enter integer only"); - } - } else { - System.out.println("Invalid choice. Please enter again."); - isDocumentError = true; - } - }while(isQuantityError); - - } while (isDocumentError); - - } - - public static void photo() { - - String opt; - int Qtt; - boolean isPhotoError; - boolean isQuantityError; - do { - isPhotoError = false; - System.out.print("Enter option(C-Normal(4R)/D-Passport): "); - opt = scanner.next().toUpperCase(); - - do { - isQuantityError=false; - if (opt.equals("C") || opt.equals("D")) { - if(opt.equals("C")) { - System.out.print("Enter quantity in normal(4R): "); - } - else if(opt.equals("D")) { - System.out.print("Enter quantity in passport: "); - } - try - { - Qtt = scanner.nextInt(); - if(Qtt>50) { - System.out.println("Invalid Quantity, Maximum 50 copies per printing"); - isQuantityError=true; - } - else if(Qtt<=0) { - System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); - isQuantityError=true; - } - else { - PrintingOption pOpt = PrintingOption.Unknown; - if (opt.equals("C")) { - pOpt = PrintingOption.Normal; - } else if (opt.equals("D")) { - pOpt = PrintingOption.Passport; - } - PrintingPhoto newPhoto = new PrintingPhoto(pOpt, Qtt); - - System.out.println("Additional Option"); - System.out.println("1. High quality paper"); - System.out.println("2. Design effect"); - System.out.println("None (Enter any key to skip)"); - System.out.print("Enter Option: "); - String addOpt = scanner.nextLine(); - scanner.nextLine(); - if (addOpt.equals("1")) { - newPhoto.isHighQualityPaper = true; - } else if (addOpt.equals("2")) { - newPhoto.isDesignEffect = true; - } - - printingOrders.add(newPhoto); - } - } - catch(Exception e){ - e.printStackTrace(); - System.out.println("Invalid Option please enter integer only"); - } - } else { - System.out.println("Invalid choice. Please enter again."); - isPhotoError = true; - } - }while(isQuantityError); - - - - } while (isPhotoError); - - } - -} From a6c63fedb682ea49ac8dabd5969b5b4487181bf7 Mon Sep 17 00:00:00 2001 From: Czooi <126080176+Czooi@users.noreply.github.com> Date: Thu, 20 Apr 2023 20:48:44 +0800 Subject: [PATCH 21/29] Create PrintingTest.java --- src/test/java/printing/test/PrintingTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/java/printing/test/PrintingTest.java diff --git a/src/test/java/printing/test/PrintingTest.java b/src/test/java/printing/test/PrintingTest.java new file mode 100644 index 0000000..8fca5e7 --- /dev/null +++ b/src/test/java/printing/test/PrintingTest.java @@ -0,0 +1,17 @@ +package printing.test; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import org.junit.Test; + +public class PrintingTest { + + @Test + public void test() { + fail("Not yet implemented"); + } + +} From 4f654a78147bb74b5480a74bfd67565782f1aeb6 Mon Sep 17 00:00:00 2001 From: TszenYong Date: Fri, 21 Apr 2023 04:47:18 +0800 Subject: [PATCH 22/29] Added TestCase for All BVA --- src/main/java/printing/app/Order.java | 4 +- .../printing/objects/PrintingDocument.java | 9 + .../java/printing/objects/PrintingPhoto.java | 20 +- src/test/java/printing/objects/OrderTest.java | 359 ++++++++++++++++++ 4 files changed, 388 insertions(+), 4 deletions(-) create mode 100644 src/test/java/printing/objects/OrderTest.java diff --git a/src/main/java/printing/app/Order.java b/src/main/java/printing/app/Order.java index 1e499b3..5deb874 100644 --- a/src/main/java/printing/app/Order.java +++ b/src/main/java/printing/app/Order.java @@ -173,9 +173,9 @@ else if(Qtt<=0) { String addOpt = scanner.nextLine(); scanner.nextLine(); if (addOpt.equals("1")) { - newPhoto.isHighQualityPaper = true; + newPhoto.setIsHighQualityEffect(true); } else if (addOpt.equals("2")) { - newPhoto.isDesignEffect = true; + newPhoto.setIsDesignEffect(true); } printingOrders.add(newPhoto); diff --git a/src/main/java/printing/objects/PrintingDocument.java b/src/main/java/printing/objects/PrintingDocument.java index c1ee9af..085716e 100644 --- a/src/main/java/printing/objects/PrintingDocument.java +++ b/src/main/java/printing/objects/PrintingDocument.java @@ -7,6 +7,7 @@ public PrintingDocument(PrintingOption pOpt,int qtt) { super(PrintingType.Document,pOpt,qtt); } + @Override public double getTotal() { @@ -24,6 +25,10 @@ else if(printingOpt==PrintingOption.Colour) } public double getBlackAndWhiteCharge(){ + if(quantity <=0) + throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); + else if(quantity >50) + throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); if(quantity < 5) return 0.5; else if (quantity >= 5 && quantity <= 10) @@ -35,6 +40,10 @@ else if(quantity >= 11 && quantity <= 20) } public double getColourCharge() { + if(quantity <=0) + throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); + else if(quantity >50) + throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); if(quantity < 5) return 1; else if (quantity >= 5 && quantity <= 10) diff --git a/src/main/java/printing/objects/PrintingPhoto.java b/src/main/java/printing/objects/PrintingPhoto.java index bf42036..e5d4895 100644 --- a/src/main/java/printing/objects/PrintingPhoto.java +++ b/src/main/java/printing/objects/PrintingPhoto.java @@ -2,8 +2,8 @@ public class PrintingPhoto extends IPrintingOrder{ - public boolean isHighQualityPaper=false; - public boolean isDesignEffect=false; + private boolean isHighQualityPaper=false; + private boolean isDesignEffect=false; public PrintingPhoto(PrintingOption pOpt,int qtt) { @@ -35,6 +35,10 @@ else if(printingOpt==PrintingOption.Passport) } public double getNormalCharge() { + if(quantity <=0) + throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); + else if(quantity >50) + throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); if(quantity < 5) return 1; else if (quantity >= 5 && quantity <= 10) @@ -46,6 +50,10 @@ else if(quantity >= 11 && quantity <= 20) } public double getPassportCharge() { + if(quantity <=0) + throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); + else if(quantity >50) + throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); if(quantity < 5) return 1.2; else if (quantity >= 5 && quantity <= 10) @@ -55,5 +63,13 @@ else if(quantity >= 11 && quantity <= 20) else return 0.75; } + + public void setIsHighQualityEffect(boolean isHighQualityPaper) { + this.isHighQualityPaper=isHighQualityPaper; + } + + public void setIsDesignEffect(boolean isDesignEffect) { + this.isDesignEffect=isDesignEffect; + } } diff --git a/src/test/java/printing/objects/OrderTest.java b/src/test/java/printing/objects/OrderTest.java new file mode 100644 index 0000000..c025f37 --- /dev/null +++ b/src/test/java/printing/objects/OrderTest.java @@ -0,0 +1,359 @@ +package printing.objects; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import junitparams.JUnitParamsRunner; +import junitparams.Parameters; + + +@RunWith(JUnitParamsRunner.class) +public class OrderTest { + + + + private Object [] paramForDocumentGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Colour,1,1.00}, + new Object [] {PrintingOption.Colour,4,4.00}, + new Object [] {PrintingOption.Colour,5,4.50}, + new Object [] {PrintingOption.Colour,10,9.00}, + new Object [] {PrintingOption.Colour,11,8.80}, + new Object [] {PrintingOption.Colour,20,16.00}, + new Object [] {PrintingOption.Colour,21,14.70}, + new Object [] {PrintingOption.Colour,50,35.00}, + }; + } + //Valid Test for Document Colour + @Test + @Parameters(method="paramForDocumentGetTotalBVA") + public void DocumentColourValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) + { + IPrintingOrder testDocument = new PrintingDocument(pOpt,qtt); + double AR=testDocument.getTotal(); + assertEquals(ER, AR, 0); + + } + + //Invalid Test For Document Colour + private Object [] InvalidParamForDocumentColourGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Colour,0}, + new Object [] {PrintingOption.Colour,51}, + }; + } + + @Test(expected=IllegalArgumentException.class) + @Parameters(method="InvalidParamForDocumentColourGetTotalBVA") + public void DocumentColourInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { + IPrintingOrder testDocument = new PrintingDocument(pOpt,qtt); + double AR=testDocument.getTotal(); + } + + //Valid Test for Document Black and White + private Object [] paramForDocumentBWGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.BlackWhite,1,0.50}, + new Object [] {PrintingOption.BlackWhite,4,2.00}, + new Object [] {PrintingOption.BlackWhite,5,2.00}, + new Object [] {PrintingOption.BlackWhite,10,4.00}, + new Object [] {PrintingOption.BlackWhite,11,3.30}, + new Object [] {PrintingOption.BlackWhite,20,6.00}, + new Object [] {PrintingOption.BlackWhite,21,4.20}, + new Object [] {PrintingOption.BlackWhite,50,10.00}, + }; + } + + @Test + @Parameters(method="paramForDocumentBWGetTotalBVA") + public void DocumentBWValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) + { + IPrintingOrder testDocument = new PrintingDocument(pOpt,qtt); + double AR=testDocument.getTotal(); + assertEquals(ER, AR, 0); + + } + //Invalid Test For Document Black and White + private Object [] InvalidParamForDocumenBWtGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.BlackWhite,0}, + new Object [] {PrintingOption.BlackWhite,51}, + }; + } + + @Test(expected=IllegalArgumentException.class) + @Parameters(method="InvalidParamForDocumenBWtGetTotalBVA") + public void DocumentBWInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { + IPrintingOrder testDocument = new PrintingDocument(pOpt,qtt); + double AR=testDocument.getTotal(); + } + + //Valid Test For Photo High Quality + private Object [] paramForPhotoNormalHighQualityGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Normal,1,1.10}, + new Object [] {PrintingOption.Normal,4,4.40}, + new Object [] {PrintingOption.Normal,5,5.00}, + new Object [] {PrintingOption.Normal,10,10.00}, + new Object [] {PrintingOption.Normal,11,9.35}, + new Object [] {PrintingOption.Normal,20,17.00}, + new Object [] {PrintingOption.Normal,21,12.60}, + new Object [] {PrintingOption.Normal,50,30.00}, + }; + } + + @Test + @Parameters(method="paramForPhotoNormalHighQualityGetTotalBVA") + public void PhotoNormalHighQualityValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) + { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); + double AR=testPhoto.getTotal(); + assertEquals(ER, AR, 0); + } + + + //Invalid Test For Photo Normal High Quality + private Object [] InvalidParamForPhotoNormalHighQualityGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Normal,0}, + new Object [] {PrintingOption.Normal,51}, + }; + } + + @Test(expected=IllegalArgumentException.class) + @Parameters(method="InvalidParamForPhotoNormalHighQualityGetTotalBVA") + public void PhotoNormalHighQualityInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); + double AR=testPhoto.getTotal(); + } + + //Valid Test For Photo Normal Design + private Object [] paramForPhotoNormalDesignGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Normal,1,1.15}, + new Object [] {PrintingOption.Normal,4,4.60}, + new Object [] {PrintingOption.Normal,5,5.25}, + new Object [] {PrintingOption.Normal,10,10.50}, + new Object [] {PrintingOption.Normal,11,9.90}, + new Object [] {PrintingOption.Normal,20,18.00}, + new Object [] {PrintingOption.Normal,21,13.65}, + new Object [] {PrintingOption.Normal,50,32.50}, + }; + } + + @Test + @Parameters(method="paramForPhotoNormalDesignGetTotalBVA") + public void PhotoNormalDesignValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) + { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + ((PrintingPhoto) testPhoto).setIsDesignEffect(true); + double AR=testPhoto.getTotal(); + assertEquals(ER, AR, 0); + + } + + //Invalid Test For Photo Normal Design + private Object [] InvalidParamForPhotoNormalDesignGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Normal,0}, + new Object [] {PrintingOption.Normal,51}, + }; + } + + @Test(expected=IllegalArgumentException.class) + @Parameters(method="InvalidParamForPhotoNormalDesignGetTotalBVA") + public void PhotoNormalDesignInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + ((PrintingPhoto) testPhoto).setIsDesignEffect(true); + double AR=testPhoto.getTotal(); + } + + //Valid Test For Photo Normal + private Object [] paramForPhotoNormalGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Normal,1,1.00}, + new Object [] {PrintingOption.Normal,4,4.00}, + new Object [] {PrintingOption.Normal,5,4.50}, + new Object [] {PrintingOption.Normal,10,9.00}, + new Object [] {PrintingOption.Normal,11,8.25}, + new Object [] {PrintingOption.Normal,20,15.00}, + new Object [] {PrintingOption.Normal,21,10.50}, + new Object [] {PrintingOption.Normal,50,25.0}, + }; + } + + @Test + @Parameters(method="paramForPhotoNormalGetTotalBVA") + public void PhotoNormalValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) + { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + double AR=testPhoto.getTotal(); + assertEquals(ER, AR, 0); + + } + + //Invalid Test For Photo Normal + private Object [] InvalidParamForPhotoNormalGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Normal,0}, + new Object [] {PrintingOption.Normal,51}, + }; + } + + @Test(expected=IllegalArgumentException.class) + @Parameters(method="InvalidParamForPhotoNormalGetTotalBVA") + public void PhotoNormalInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + double AR=testPhoto.getTotal(); + } + + //Valid Test For Photo Passport High Quality + private Object [] paramForPhotoPassportHighQualityGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Passport,1,1.30}, + new Object [] {PrintingOption.Passport,4,5.20}, + new Object [] {PrintingOption.Passport,5,5.25}, + new Object [] {PrintingOption.Passport,10,10.50}, + new Object [] {PrintingOption.Passport,11,10.45}, + new Object [] {PrintingOption.Passport,20,19.00}, + new Object [] {PrintingOption.Passport,21,17.85}, + new Object [] {PrintingOption.Passport,50,42.50}, + }; + } + + @Test + @Parameters(method="paramForPhotoPassportHighQualityGetTotalBVA") + public void PhotoPassportHighQualityValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) + { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); + double AR=testPhoto.getTotal(); + assertEquals(ER, AR, 0.0005); + + } + + //Invalid Test For Photo Passport High Quality + private Object [] InvalidParamForPhotoPassportHighQualityGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Passport,0}, + new Object [] {PrintingOption.Passport,51}, + }; + } + + @Test(expected=IllegalArgumentException.class) + @Parameters(method="InvalidParamForPhotoPassportHighQualityGetTotalBVA") + public void PhotoPassportHighQualityInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); + double AR=testPhoto.getTotal(); + } + + + //Valid Test For Photo Passport Design + private Object [] paramForPhotoPassportDesignGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Passport,1,1.35}, + new Object [] {PrintingOption.Passport,4,5.40}, + new Object [] {PrintingOption.Passport,5,5.50}, + new Object [] {PrintingOption.Passport,10,11.00}, + new Object [] {PrintingOption.Passport,11,11.00}, + new Object [] {PrintingOption.Passport,20,20.00}, + new Object [] {PrintingOption.Passport,21,18.90}, + new Object [] {PrintingOption.Passport,50,45.00}, + }; + } + + @Test + @Parameters(method="paramForPhotoPassportDesignGetTotalBVA") + public void PhotoPassportDesignValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) + { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + ((PrintingPhoto) testPhoto).setIsDesignEffect(true); + double AR=testPhoto.getTotal(); + assertEquals(ER, AR, 0.0005); + + } + + //Invalid Test For Photo Passport Design + private Object [] InvalidParamForPhotoPassportDesignGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Passport,0}, + new Object [] {PrintingOption.Passport,51}, + }; + } + + @Test(expected=IllegalArgumentException.class) + @Parameters(method="InvalidParamForPhotoPassportDesignGetTotalBVA") + public void PhotoPassportDesignInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + ((PrintingPhoto) testPhoto).setIsDesignEffect(true); + double AR=testPhoto.getTotal(); + } + + //Valid Test For Photo Passport + private Object [] paramForPhotoPassportGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Passport,1,1.20}, + new Object [] {PrintingOption.Passport,4,4.80}, + new Object [] {PrintingOption.Passport,5,4.75}, + new Object [] {PrintingOption.Passport,10,9.50}, + new Object [] {PrintingOption.Passport,11,9.35}, + new Object [] {PrintingOption.Passport,20,17.00}, + new Object [] {PrintingOption.Passport,21,15.75}, + new Object [] {PrintingOption.Passport,50,37.50}, + }; + } + + @Test + @Parameters(method="paramForPhotoPassportGetTotalBVA") + public void PhotoPassportValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) + { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + double AR=testPhoto.getTotal(); + assertEquals(ER, AR, 0); + + } + + //Invalid Test For Photo Passport + private Object [] InvalidParamForPhotoPassportGetTotalBVA() + { + return new Object [] { + new Object [] {PrintingOption.Passport,0}, + new Object [] {PrintingOption.Passport,51}, + }; + } + + @Test(expected=IllegalArgumentException.class) + @Parameters(method="InvalidParamForPhotoPassportGetTotalBVA") + public void PhotoPassportInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + double AR=testPhoto.getTotal(); + } + + + +} From 06bffa0fff2395e17616668479d5c46168d250f9 Mon Sep 17 00:00:00 2001 From: quanBong Date: Fri, 21 Apr 2023 04:55:16 +0800 Subject: [PATCH 23/29] Delete PrintingTest.java --- src/test/java/printing/test/PrintingTest.java | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/test/java/printing/test/PrintingTest.java diff --git a/src/test/java/printing/test/PrintingTest.java b/src/test/java/printing/test/PrintingTest.java deleted file mode 100644 index 8fca5e7..0000000 --- a/src/test/java/printing/test/PrintingTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package printing.test; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.*; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import org.junit.Test; - -public class PrintingTest { - - @Test - public void test() { - fail("Not yet implemented"); - } - -} From 521d04ab8cc3d2aed72dad32fdc55d51c4b74783 Mon Sep 17 00:00:00 2001 From: TszenYong Date: Fri, 21 Apr 2023 19:10:01 +0800 Subject: [PATCH 24/29] Added mockito for test array --- src/main/java/printing/app/Order.java | 17 +++++---- src/main/java/printing/app/PhotoPrinter.java | 27 ++++++++++++++ .../java/printing/objects/IPrintingOrder.java | 15 +++++++- .../printing/objects/PrintingDocument.java | 2 +- .../printing/objects/PhotoPrinterTest.java | 37 +++++++++++++++++++ 5 files changed, 88 insertions(+), 10 deletions(-) create mode 100644 src/main/java/printing/app/PhotoPrinter.java create mode 100644 src/test/java/printing/objects/PhotoPrinterTest.java diff --git a/src/main/java/printing/app/Order.java b/src/main/java/printing/app/Order.java index 5deb874..e4e4a6f 100644 --- a/src/main/java/printing/app/Order.java +++ b/src/main/java/printing/app/Order.java @@ -1,13 +1,16 @@ package printing.app; import java.util.ArrayList; +import printing.objects.IPrintingOrder; import java.util.Scanner; import printing.objects.*; -public class Order { - public static ArrayList printingOrders = new ArrayList(); +public class Order{ + + + private static Scanner scanner; public static void main(String[] args) { @@ -60,9 +63,9 @@ public static void main(String[] args) { System.out.println("Proceeding to Billing..."); double totalBill = 0; - for (int i = 0; i < printingOrders.size(); i++) { - double bill=printingOrders.get(i).getTotal(); - System.out.println((i+1)+": Order "+ printingOrders.get(i).printingOpt + "Quantity= " +printingOrders.get(i).quantity+ " and bill is: " +bill); + for (int i = 0; i < IPrintingOrder.printingOrders.size(); i++) { + double bill=IPrintingOrder.printingOrders.get(i).getTotal(); + System.out.println((i+1)+": Order "+IPrintingOrder.printingOrders.get(i).printingOpt + "Quantity= " +IPrintingOrder.printingOrders.get(i).quantity+ " and bill is: " +bill); totalBill += bill; } System.out.print("Your billing total is " + totalBill); @@ -108,7 +111,7 @@ else if(Qtt<=0) { pOpt = PrintingOption.Colour; } PrintingDocument newDoc = new PrintingDocument(pOpt, Qtt); - printingOrders.add(newDoc); + IPrintingOrder.printingOrders.add(newDoc); } } catch(Exception e){ @@ -178,7 +181,7 @@ else if(Qtt<=0) { newPhoto.setIsDesignEffect(true); } - printingOrders.add(newPhoto); + IPrintingOrder.printingOrders.add(newPhoto); } } catch(Exception e){ diff --git a/src/main/java/printing/app/PhotoPrinter.java b/src/main/java/printing/app/PhotoPrinter.java new file mode 100644 index 0000000..872c862 --- /dev/null +++ b/src/main/java/printing/app/PhotoPrinter.java @@ -0,0 +1,27 @@ +package printing.app; + +import java.util.ArrayList; + + +import printing.objects.IPrintingOrder; + +public class PhotoPrinter { + + IPrintingOrder order; + ArrayList orderArr; + + public PhotoPrinter(IPrintingOrder order) + { + this.order=order; + } + + + + public void queueRequest() + { + orderArr =order.getRequest(); + order.updateRequest(orderArr); + } +} + + diff --git a/src/main/java/printing/objects/IPrintingOrder.java b/src/main/java/printing/objects/IPrintingOrder.java index fc1596a..2097854 100644 --- a/src/main/java/printing/objects/IPrintingOrder.java +++ b/src/main/java/printing/objects/IPrintingOrder.java @@ -1,7 +1,11 @@ package printing.objects; +import java.util.ArrayList; + + public class IPrintingOrder { + public static ArrayList printingOrders = new ArrayList(); public PrintingType printingType; public PrintingOption printingOpt; public int quantity; @@ -18,8 +22,15 @@ public IPrintingOrder(PrintingType pType, PrintingOption pOpt, int qtt) this.printingOpt=pOpt; this.quantity=qtt; } - - + public ArrayList getRequest(){ + + return printingOrders; + } + + public void updateRequest(ArrayList orderArr) + { + //place the request into queue for printing + } } diff --git a/src/main/java/printing/objects/PrintingDocument.java b/src/main/java/printing/objects/PrintingDocument.java index 085716e..9b474e5 100644 --- a/src/main/java/printing/objects/PrintingDocument.java +++ b/src/main/java/printing/objects/PrintingDocument.java @@ -2,7 +2,6 @@ public class PrintingDocument extends IPrintingOrder { - public PrintingDocument(PrintingOption pOpt,int qtt) { super(PrintingType.Document,pOpt,qtt); @@ -53,4 +52,5 @@ else if(quantity >= 11 && quantity <= 20) else return 0.7; } + } diff --git a/src/test/java/printing/objects/PhotoPrinterTest.java b/src/test/java/printing/objects/PhotoPrinterTest.java new file mode 100644 index 0000000..70abbea --- /dev/null +++ b/src/test/java/printing/objects/PhotoPrinterTest.java @@ -0,0 +1,37 @@ +package printing.objects; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.ArrayList; + +import org.junit.Test; +import org.mockito.InOrder; +import org.mockito.Mockito; + +import printing.app.PhotoPrinter; + +public class PhotoPrinterTest { + + @Test + public void testQueueRequest() + { + IPrintingOrder orderMock = mock(IPrintingOrder.class); + IPrintingOrder getOrderMock = mock(IPrintingOrder.class); + + when(orderMock.getRequest()).thenReturn(orderMock.printingOrders); + + PhotoPrinter print = new PhotoPrinter (orderMock); + InOrder inOrder = Mockito.inOrder(orderMock); + + print.queueRequest(); + assertEquals(orderMock.getRequest(),getOrderMock.printingOrders); + + inOrder.verify(orderMock).updateRequest(getOrderMock.printingOrders); + + + } + + +} From 842b6df604b1640f67f5423ed0c7d67f2f3a98f8 Mon Sep 17 00:00:00 2001 From: TszenYong Date: Mon, 24 Apr 2023 00:36:03 +0800 Subject: [PATCH 25/29] added integration test and test suite --- .../printing/objects/IntegrationTest.java | 102 ++++++++++++++++++ .../printing/objects/PhotoPrinterTest.java | 8 +- .../java/printing/objects/TestSuiteCase.java | 14 +++ 3 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 src/test/java/printing/objects/IntegrationTest.java create mode 100644 src/test/java/printing/objects/TestSuiteCase.java diff --git a/src/test/java/printing/objects/IntegrationTest.java b/src/test/java/printing/objects/IntegrationTest.java new file mode 100644 index 0000000..0ffbfc0 --- /dev/null +++ b/src/test/java/printing/objects/IntegrationTest.java @@ -0,0 +1,102 @@ +package printing.objects; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class IntegrationTest { + + IPrintingOrder orderDocumentBW = new PrintingDocument(PrintingOption.BlackWhite,30 ); + IPrintingOrder orderDocumentColour = new PrintingDocument(PrintingOption.Colour,30 ); + IPrintingOrder orderNormalHighQuality = new PrintingPhoto(PrintingOption.Normal,20 ); + IPrintingOrder orderNormalDesign = new PrintingPhoto(PrintingOption.Normal,20 ); + IPrintingOrder orderNormal = new PrintingPhoto(PrintingOption.Normal,20 ); + IPrintingOrder orderPassportHighQuality = new PrintingPhoto(PrintingOption.Passport,20 ); + IPrintingOrder orderPassportDesign = new PrintingPhoto(PrintingOption.Passport,20 ); + IPrintingOrder orderPassport = new PrintingPhoto(PrintingOption.Passport,20 ); + + + @Test + public void testDocumentBW() + { + double totalER = 6.00; + double chargeER= 0.2; + double totalAR = orderDocumentBW.getTotal(); + double chargeAR = ((PrintingDocument) orderDocumentBW).getBlackAndWhiteCharge(); + assertEquals(totalER,totalAR,0); + assertEquals(chargeER,chargeAR,0); + } + + @Test + public void testDocumentColour() + { + double totalER = 21.00; + double chargeER= 0.7; + double totalAR = orderDocumentColour.getTotal(); + double chargeAR = ((PrintingDocument) orderDocumentColour).getColourCharge(); + assertEquals(totalER,totalAR,0); + assertEquals(chargeER,chargeAR,0); + } + + @Test + public void testNormalHighQuality() + { + double totalER = 15.00; + double chargeER= 0.75; + double totalAR = orderNormalHighQuality.getTotal(); + double chargeAR = ((PrintingPhoto) orderNormalHighQuality).getNormalCharge(); + assertEquals(totalER,totalAR,0); + assertEquals(chargeER,chargeAR,0); + } + @Test + public void testNormalDesign() + { + double totalER = 15.00; + double chargeER= 0.75; + double totalAR = orderNormalDesign.getTotal(); + double chargeAR = ((PrintingPhoto) orderNormalDesign).getNormalCharge(); + assertEquals(totalER,totalAR,0); + assertEquals(chargeER,chargeAR,0); + } + @Test + public void testNormal() + { + double totalER = 15.00; + double chargeER= 0.75; + double totalAR = orderNormal.getTotal(); + double chargeAR = ((PrintingPhoto) orderNormal).getNormalCharge(); + assertEquals(totalER,totalAR,0); + assertEquals(chargeER,chargeAR,0); + } + + @Test + public void testPassportHighQuality() + { + double totalER = 17.00; + double chargeER= 0.85; + double totalAR = orderPassportHighQuality.getTotal(); + double chargeAR = ((PrintingPhoto) orderPassportHighQuality).getPassportCharge(); + assertEquals(totalER,totalAR,0); + assertEquals(chargeER,chargeAR,0); + } + @Test + public void testPassportDesign() + { + double totalER = 17.00; + double chargeER= 0.85; + double totalAR = orderPassportDesign.getTotal(); + double chargeAR = ((PrintingPhoto) orderPassportDesign).getPassportCharge(); + assertEquals(totalER,totalAR,0); + assertEquals(chargeER,chargeAR,0); + } + @Test + public void testPassport() + { + double totalER = 17.00; + double chargeER= 0.85; + double totalAR = orderPassport.getTotal(); + double chargeAR = ((PrintingPhoto) orderPassport).getPassportCharge(); + assertEquals(totalER,totalAR,0); + assertEquals(chargeER,chargeAR,0); + } +} diff --git a/src/test/java/printing/objects/PhotoPrinterTest.java b/src/test/java/printing/objects/PhotoPrinterTest.java index 70abbea..1a6a172 100644 --- a/src/test/java/printing/objects/PhotoPrinterTest.java +++ b/src/test/java/printing/objects/PhotoPrinterTest.java @@ -4,8 +4,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.util.ArrayList; - import org.junit.Test; import org.mockito.InOrder; import org.mockito.Mockito; @@ -29,9 +27,7 @@ public void testQueueRequest() assertEquals(orderMock.getRequest(),getOrderMock.printingOrders); inOrder.verify(orderMock).updateRequest(getOrderMock.printingOrders); - - + } - - + } diff --git a/src/test/java/printing/objects/TestSuiteCase.java b/src/test/java/printing/objects/TestSuiteCase.java new file mode 100644 index 0000000..03be07b --- /dev/null +++ b/src/test/java/printing/objects/TestSuiteCase.java @@ -0,0 +1,14 @@ +package printing.objects; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +@RunWith(value = Suite.class) +@SuiteClasses(value = { + IntegrationTest.class, + OrderTest.class, + PhotoPrinterTest.class, +}) +public class TestSuiteCase { +} From fe754b5bc36551ca3db42b523f9518f8ad3c4409 Mon Sep 17 00:00:00 2001 From: TszenYong Date: Mon, 24 Apr 2023 01:39:49 +0800 Subject: [PATCH 26/29] Added Integration.txt and readfrom text file --- IntegrationER.txt | 8 ++ .../java/printing/objects/PrintingPhoto.java | 44 ++++++---- .../printing/objects/IntegrationTest.java | 85 +++++++++++++------ 3 files changed, 95 insertions(+), 42 deletions(-) create mode 100644 IntegrationER.txt diff --git a/IntegrationER.txt b/IntegrationER.txt new file mode 100644 index 0000000..00193fc --- /dev/null +++ b/IntegrationER.txt @@ -0,0 +1,8 @@ +6.00,0.20 +21.00,0.70 +17.00,0.85 +18.00,0.90 +15.00,0.75 +19.00,0.95 +20.00,1.00 +17.00,0.85 \ No newline at end of file diff --git a/src/main/java/printing/objects/PrintingPhoto.java b/src/main/java/printing/objects/PrintingPhoto.java index e5d4895..d9f0f53 100644 --- a/src/main/java/printing/objects/PrintingPhoto.java +++ b/src/main/java/printing/objects/PrintingPhoto.java @@ -22,46 +22,58 @@ else if(printingOpt==PrintingOption.Passport) { charge=getPassportCharge(); } - if(isHighQualityPaper) - { - charge+=0.10; - } - if(isDesignEffect) - { - charge+=0.15; - } sum=quantity*charge; return sum; } public double getNormalCharge() { + double charge=0; if(quantity <=0) throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); else if(quantity >50) throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); if(quantity < 5) - return 1; + charge=1; else if (quantity >= 5 && quantity <= 10) - return 0.9; + charge=0.9; else if(quantity >= 11 && quantity <= 20) - return 0.75; + charge=0.75; else - return 0.5; + charge=0.5; + if(isHighQualityPaper) + { + charge+=0.10; + } + if(isDesignEffect) + { + charge+=0.15; + } + return charge; } public double getPassportCharge() { + double charge=0; if(quantity <=0) throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); else if(quantity >50) throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); if(quantity < 5) - return 1.2; + charge=1.2; else if (quantity >= 5 && quantity <= 10) - return 0.95; + charge=0.95; else if(quantity >= 11 && quantity <= 20) - return 0.85; + charge=0.85; else - return 0.75; + charge=0.75; + if(isHighQualityPaper) + { + charge+=0.10; + } + if(isDesignEffect) + { + charge+=0.15; + } + return charge; } public void setIsHighQualityEffect(boolean isHighQualityPaper) { diff --git a/src/test/java/printing/objects/IntegrationTest.java b/src/test/java/printing/objects/IntegrationTest.java index 0ffbfc0..d100275 100644 --- a/src/test/java/printing/objects/IntegrationTest.java +++ b/src/test/java/printing/objects/IntegrationTest.java @@ -2,25 +2,30 @@ import static org.junit.Assert.assertEquals; +import java.io.File; +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.Scanner; + import org.junit.Test; public class IntegrationTest { - - IPrintingOrder orderDocumentBW = new PrintingDocument(PrintingOption.BlackWhite,30 ); - IPrintingOrder orderDocumentColour = new PrintingDocument(PrintingOption.Colour,30 ); - IPrintingOrder orderNormalHighQuality = new PrintingPhoto(PrintingOption.Normal,20 ); - IPrintingOrder orderNormalDesign = new PrintingPhoto(PrintingOption.Normal,20 ); - IPrintingOrder orderNormal = new PrintingPhoto(PrintingOption.Normal,20 ); - IPrintingOrder orderPassportHighQuality = new PrintingPhoto(PrintingOption.Passport,20 ); - IPrintingOrder orderPassportDesign = new PrintingPhoto(PrintingOption.Passport,20 ); - IPrintingOrder orderPassport = new PrintingPhoto(PrintingOption.Passport,20 ); + ArrayList linesRead= readER(); + PrintingDocument orderDocumentBW = new PrintingDocument(PrintingOption.BlackWhite,30 ); + PrintingDocument orderDocumentColour = new PrintingDocument(PrintingOption.Colour,30 ); + PrintingPhoto orderNormalHighQuality = new PrintingPhoto(PrintingOption.Normal,20 ); + PrintingPhoto orderNormalDesign = new PrintingPhoto(PrintingOption.Normal,20 ); + PrintingPhoto orderNormal = new PrintingPhoto(PrintingOption.Normal,20 ); + PrintingPhoto orderPassportHighQuality = new PrintingPhoto(PrintingOption.Passport,20 ); + PrintingPhoto orderPassportDesign = new PrintingPhoto(PrintingOption.Passport,20 ); + PrintingPhoto orderPassport = new PrintingPhoto(PrintingOption.Passport,20 ); @Test public void testDocumentBW() { - double totalER = 6.00; - double chargeER= 0.2; + double totalER = Double.parseDouble(linesRead.get(0)[0]); + double chargeER= Double.parseDouble(linesRead.get(0)[1]); double totalAR = orderDocumentBW.getTotal(); double chargeAR = ((PrintingDocument) orderDocumentBW).getBlackAndWhiteCharge(); assertEquals(totalER,totalAR,0); @@ -30,8 +35,8 @@ public void testDocumentBW() @Test public void testDocumentColour() { - double totalER = 21.00; - double chargeER= 0.7; + double totalER = Double.parseDouble(linesRead.get(1)[0]); + double chargeER= Double.parseDouble(linesRead.get(1)[1]); double totalAR = orderDocumentColour.getTotal(); double chargeAR = ((PrintingDocument) orderDocumentColour).getColourCharge(); assertEquals(totalER,totalAR,0); @@ -41,18 +46,20 @@ public void testDocumentColour() @Test public void testNormalHighQuality() { - double totalER = 15.00; - double chargeER= 0.75; + double totalER = Double.parseDouble(linesRead.get(2)[0]); + double chargeER= Double.parseDouble(linesRead.get(2)[1]); + orderNormalHighQuality.setIsHighQualityEffect(true); double totalAR = orderNormalHighQuality.getTotal(); - double chargeAR = ((PrintingPhoto) orderNormalHighQuality).getNormalCharge(); + double chargeAR = orderNormalHighQuality.getNormalCharge(); assertEquals(totalER,totalAR,0); assertEquals(chargeER,chargeAR,0); } @Test public void testNormalDesign() { - double totalER = 15.00; - double chargeER= 0.75; + double totalER = Double.parseDouble(linesRead.get(3)[0]); + double chargeER= Double.parseDouble(linesRead.get(3)[1]); + ((PrintingPhoto)orderNormalDesign).setIsDesignEffect(true); double totalAR = orderNormalDesign.getTotal(); double chargeAR = ((PrintingPhoto) orderNormalDesign).getNormalCharge(); assertEquals(totalER,totalAR,0); @@ -61,8 +68,8 @@ public void testNormalDesign() @Test public void testNormal() { - double totalER = 15.00; - double chargeER= 0.75; + double totalER = Double.parseDouble(linesRead.get(4)[0]); + double chargeER= Double.parseDouble(linesRead.get(4)[1]); double totalAR = orderNormal.getTotal(); double chargeAR = ((PrintingPhoto) orderNormal).getNormalCharge(); assertEquals(totalER,totalAR,0); @@ -72,8 +79,9 @@ public void testNormal() @Test public void testPassportHighQuality() { - double totalER = 17.00; - double chargeER= 0.85; + double totalER = Double.parseDouble(linesRead.get(5)[0]); + double chargeER= Double.parseDouble(linesRead.get(5)[1]); + ((PrintingPhoto)orderPassportHighQuality).setIsHighQualityEffect(true); double totalAR = orderPassportHighQuality.getTotal(); double chargeAR = ((PrintingPhoto) orderPassportHighQuality).getPassportCharge(); assertEquals(totalER,totalAR,0); @@ -82,8 +90,9 @@ public void testPassportHighQuality() @Test public void testPassportDesign() { - double totalER = 17.00; - double chargeER= 0.85; + double totalER = Double.parseDouble(linesRead.get(6)[0]); + double chargeER= Double.parseDouble(linesRead.get(6)[1]); + ((PrintingPhoto)orderPassportDesign).setIsDesignEffect(true); double totalAR = orderPassportDesign.getTotal(); double chargeAR = ((PrintingPhoto) orderPassportDesign).getPassportCharge(); assertEquals(totalER,totalAR,0); @@ -92,11 +101,35 @@ public void testPassportDesign() @Test public void testPassport() { - double totalER = 17.00; - double chargeER= 0.85; + double totalER = Double.parseDouble(linesRead.get(7)[0]); + double chargeER= Double.parseDouble(linesRead.get(7)[1]); double totalAR = orderPassport.getTotal(); double chargeAR = ((PrintingPhoto) orderPassport).getPassportCharge(); assertEquals(totalER,totalAR,0); assertEquals(chargeER,chargeAR,0); } + + public ArrayList readER() { + ArrayList linesRead = new ArrayList(); + String fileName = "IntegrationER.txt"; + Scanner inputStream = null; + try { + inputStream = new Scanner(new File(fileName)); + } + + catch (FileNotFoundException e) { + System.out.println("Error opening the file " + fileName); + System.exit(0); + } + + while (inputStream.hasNextLine()) { + String singleLine = inputStream.nextLine(); + String[] tokens = singleLine.split(","); + linesRead.add(tokens); + } + + inputStream.close(); + return linesRead; + } + } From de84b3eb5dff0f195342606df028044fcb4663a1 Mon Sep 17 00:00:00 2001 From: TszenYong Date: Mon, 24 Apr 2023 02:30:35 +0800 Subject: [PATCH 27/29] Update IntegrationTest.java --- .../printing/objects/IntegrationTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/java/printing/objects/IntegrationTest.java b/src/test/java/printing/objects/IntegrationTest.java index d100275..1e4b944 100644 --- a/src/test/java/printing/objects/IntegrationTest.java +++ b/src/test/java/printing/objects/IntegrationTest.java @@ -11,14 +11,14 @@ public class IntegrationTest { ArrayList linesRead= readER(); - PrintingDocument orderDocumentBW = new PrintingDocument(PrintingOption.BlackWhite,30 ); - PrintingDocument orderDocumentColour = new PrintingDocument(PrintingOption.Colour,30 ); - PrintingPhoto orderNormalHighQuality = new PrintingPhoto(PrintingOption.Normal,20 ); - PrintingPhoto orderNormalDesign = new PrintingPhoto(PrintingOption.Normal,20 ); - PrintingPhoto orderNormal = new PrintingPhoto(PrintingOption.Normal,20 ); - PrintingPhoto orderPassportHighQuality = new PrintingPhoto(PrintingOption.Passport,20 ); - PrintingPhoto orderPassportDesign = new PrintingPhoto(PrintingOption.Passport,20 ); - PrintingPhoto orderPassport = new PrintingPhoto(PrintingOption.Passport,20 ); + IPrintingOrder orderDocumentBW = new PrintingDocument(PrintingOption.BlackWhite,30 ); + IPrintingOrder orderDocumentColour = new PrintingDocument(PrintingOption.Colour,30 ); + IPrintingOrder orderNormalHighQuality = new PrintingPhoto(PrintingOption.Normal,20 ); + IPrintingOrder orderNormalDesign = new PrintingPhoto(PrintingOption.Normal,20 ); + IPrintingOrder orderNormal = new PrintingPhoto(PrintingOption.Normal,20 ); + IPrintingOrder orderPassportHighQuality = new PrintingPhoto(PrintingOption.Passport,20 ); + IPrintingOrder orderPassportDesign = new PrintingPhoto(PrintingOption.Passport,20 ); + IPrintingOrder orderPassport = new PrintingPhoto(PrintingOption.Passport,20 ); @Test @@ -48,9 +48,9 @@ public void testNormalHighQuality() { double totalER = Double.parseDouble(linesRead.get(2)[0]); double chargeER= Double.parseDouble(linesRead.get(2)[1]); - orderNormalHighQuality.setIsHighQualityEffect(true); + ((PrintingPhoto)orderNormalHighQuality).setIsHighQualityEffect(true); double totalAR = orderNormalHighQuality.getTotal(); - double chargeAR = orderNormalHighQuality.getNormalCharge(); + double chargeAR = ((PrintingPhoto)orderNormalHighQuality).getNormalCharge(); assertEquals(totalER,totalAR,0); assertEquals(chargeER,chargeAR,0); } From e8a4cbc37504e8cf003a3cba4e5d4f16f65fd3ee Mon Sep 17 00:00:00 2001 From: TszenYong Date: Mon, 24 Apr 2023 03:04:38 +0800 Subject: [PATCH 28/29] Update PhotoPrinterTest.java --- src/test/java/printing/objects/PhotoPrinterTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/java/printing/objects/PhotoPrinterTest.java b/src/test/java/printing/objects/PhotoPrinterTest.java index 1a6a172..c045f7e 100644 --- a/src/test/java/printing/objects/PhotoPrinterTest.java +++ b/src/test/java/printing/objects/PhotoPrinterTest.java @@ -15,17 +15,20 @@ public class PhotoPrinterTest { @Test public void testQueueRequest() { + //Mock the class that contain method of getRequest that will return the array of orders IPrintingOrder orderMock = mock(IPrintingOrder.class); + //Mock the class that contain array of orders IPrintingOrder getOrderMock = mock(IPrintingOrder.class); - + //When getRequest is called, always return the fixed array of orders when(orderMock.getRequest()).thenReturn(orderMock.printingOrders); - + //Pass the mock to the printer class the contains the queueRequest method PhotoPrinter print = new PhotoPrinter (orderMock); InOrder inOrder = Mockito.inOrder(orderMock); print.queueRequest(); + //Assert equals the array of orders return from getRequest with Actual array of orders assertEquals(orderMock.getRequest(),getOrderMock.printingOrders); - + //Verify array of orders used for updateRequest method with actual array of orders inOrder.verify(orderMock).updateRequest(getOrderMock.printingOrders); } From 701e5af8052879872a2121b34ce9b9895c704e9b Mon Sep 17 00:00:00 2001 From: Elainee610 Date: Mon, 24 Apr 2023 17:05:55 +0800 Subject: [PATCH 29/29] ctrl+shift+f --- src/main/java/printing/app/Order.java | 98 ++- src/main/java/printing/app/PhotoPrinter.java | 21 +- .../java/printing/objects/IPrintingOrder.java | 33 +- .../printing/objects/PrintingDocument.java | 49 +- .../java/printing/objects/PrintingOption.java | 6 +- .../java/printing/objects/PrintingPhoto.java | 103 ++-- .../java/printing/objects/PrintingType.java | 4 +- .../printing/objects/IntegrationTest.java | 119 ++-- src/test/java/printing/objects/OrderTest.java | 575 ++++++++---------- .../printing/objects/PhotoPrinterTest.java | 28 +- .../java/printing/objects/TestSuiteCase.java | 6 +- 11 files changed, 455 insertions(+), 587 deletions(-) diff --git a/src/main/java/printing/app/Order.java b/src/main/java/printing/app/Order.java index e4e4a6f..44fabfc 100644 --- a/src/main/java/printing/app/Order.java +++ b/src/main/java/printing/app/Order.java @@ -6,10 +6,7 @@ import printing.objects.*; - -public class Order{ - - +public class Order { private static Scanner scanner; @@ -64,8 +61,9 @@ public static void main(String[] args) { System.out.println("Proceeding to Billing..."); double totalBill = 0; for (int i = 0; i < IPrintingOrder.printingOrders.size(); i++) { - double bill=IPrintingOrder.printingOrders.get(i).getTotal(); - System.out.println((i+1)+": Order "+IPrintingOrder.printingOrders.get(i).printingOpt + "Quantity= " +IPrintingOrder.printingOrders.get(i).quantity+ " and bill is: " +bill); + double bill = IPrintingOrder.printingOrders.get(i).getTotal(); + System.out.println((i + 1) + ": Order " + IPrintingOrder.printingOrders.get(i).printingOpt + "Quantity= " + + IPrintingOrder.printingOrders.get(i).quantity + " and bill is: " + bill); totalBill += bill; } System.out.print("Your billing total is " + totalBill); @@ -82,28 +80,24 @@ public static void document() { isDocumentError = false; System.out.print("Enter option(A-Black & White/B-Colour): "); opt = scanner.next().toUpperCase(); - do { - isQuantityError=false; - - if (opt.equals("A") || opt.equals("B")) { - if(opt.equals("A")) { - System.out.print("Enter quantity in black and white: "); - } - else if(opt.equals("B")) { - System.out.print("Enter quantity in color: "); - } - try - { + do { + isQuantityError = false; + + if (opt.equals("A") || opt.equals("B")) { + if (opt.equals("A")) { + System.out.print("Enter quantity in black and white: "); + } else if (opt.equals("B")) { + System.out.print("Enter quantity in color: "); + } + try { Qtt = scanner.nextInt(); - if(Qtt>50) { + if (Qtt > 50) { System.out.println("Invalid Quantity, Maximum 50 copies per printing"); - isQuantityError=true; - } - else if(Qtt<=0) { + isQuantityError = true; + } else if (Qtt <= 0) { System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); - isQuantityError=true; - } - else { + isQuantityError = true; + } else { PrintingOption pOpt = PrintingOption.Unknown; if (opt.equals("A")) { pOpt = PrintingOption.BlackWhite; @@ -113,8 +107,7 @@ else if(Qtt<=0) { PrintingDocument newDoc = new PrintingDocument(pOpt, Qtt); IPrintingOrder.printingOrders.add(newDoc); } - } - catch(Exception e){ + } catch (Exception e) { e.printStackTrace(); System.out.println("Invalid Option please enter integer only"); } @@ -122,8 +115,8 @@ else if(Qtt<=0) { System.out.println("Invalid choice. Please enter again."); isDocumentError = true; } - }while(isQuantityError); - + } while (isQuantityError); + } while (isDocumentError); } @@ -139,27 +132,23 @@ public static void photo() { System.out.print("Enter option(C-Normal(4R)/D-Passport): "); opt = scanner.next().toUpperCase(); - do { - isQuantityError=false; - if (opt.equals("C") || opt.equals("D")) { - if(opt.equals("C")) { - System.out.print("Enter quantity in normal(4R): "); - } - else if(opt.equals("D")) { - System.out.print("Enter quantity in passport: "); - } - try - { + do { + isQuantityError = false; + if (opt.equals("C") || opt.equals("D")) { + if (opt.equals("C")) { + System.out.print("Enter quantity in normal(4R): "); + } else if (opt.equals("D")) { + System.out.print("Enter quantity in passport: "); + } + try { Qtt = scanner.nextInt(); - if(Qtt>50) { + if (Qtt > 50) { System.out.println("Invalid Quantity, Maximum 50 copies per printing"); - isQuantityError=true; - } - else if(Qtt<=0) { + isQuantityError = true; + } else if (Qtt <= 0) { System.out.println("Invalid Quantity, please enter quantity ranging from 1-50"); - isQuantityError=true; - } - else { + isQuantityError = true; + } else { PrintingOption pOpt = PrintingOption.Unknown; if (opt.equals("C")) { pOpt = PrintingOption.Normal; @@ -183,18 +172,15 @@ else if(Qtt<=0) { IPrintingOrder.printingOrders.add(newPhoto); } - } - catch(Exception e){ + } catch (Exception e) { e.printStackTrace(); System.out.println("Invalid Option please enter integer only"); } - } else { - System.out.println("Invalid choice. Please enter again."); - isPhotoError = true; - } - }while(isQuantityError); - - + } else { + System.out.println("Invalid choice. Please enter again."); + isPhotoError = true; + } + } while (isQuantityError); } while (isPhotoError); diff --git a/src/main/java/printing/app/PhotoPrinter.java b/src/main/java/printing/app/PhotoPrinter.java index 872c862..cd6dd2d 100644 --- a/src/main/java/printing/app/PhotoPrinter.java +++ b/src/main/java/printing/app/PhotoPrinter.java @@ -2,26 +2,19 @@ import java.util.ArrayList; - import printing.objects.IPrintingOrder; public class PhotoPrinter { - + IPrintingOrder order; ArrayList orderArr; - - public PhotoPrinter(IPrintingOrder order) - { - this.order=order; + + public PhotoPrinter(IPrintingOrder order) { + this.order = order; } - - - - public void queueRequest() - { - orderArr =order.getRequest(); + + public void queueRequest() { + orderArr = order.getRequest(); order.updateRequest(orderArr); } } - - diff --git a/src/main/java/printing/objects/IPrintingOrder.java b/src/main/java/printing/objects/IPrintingOrder.java index 2097854..159fb60 100644 --- a/src/main/java/printing/objects/IPrintingOrder.java +++ b/src/main/java/printing/objects/IPrintingOrder.java @@ -2,35 +2,32 @@ import java.util.ArrayList; - public class IPrintingOrder { - + public static ArrayList printingOrders = new ArrayList(); public PrintingType printingType; public PrintingOption printingOpt; public int quantity; public double sum; - public boolean isHighQualityPaper=false; - public boolean isDesignEffect=false; - + public boolean isHighQualityPaper = false; + public boolean isDesignEffect = false; + public double getTotal() { return 0; } - public IPrintingOrder(PrintingType pType, PrintingOption pOpt, int qtt) - { - this.printingType=pType; - this.printingOpt=pOpt; - this.quantity=qtt; + + public IPrintingOrder(PrintingType pType, PrintingOption pOpt, int qtt) { + this.printingType = pType; + this.printingOpt = pOpt; + this.quantity = qtt; } - - public ArrayList getRequest(){ - + + public ArrayList getRequest() { + return printingOrders; } - - public void updateRequest(ArrayList orderArr) - { - //place the request into queue for printing + + public void updateRequest(ArrayList orderArr) { + // place the request into queue for printing } } - diff --git a/src/main/java/printing/objects/PrintingDocument.java b/src/main/java/printing/objects/PrintingDocument.java index 9b474e5..6f52d99 100644 --- a/src/main/java/printing/objects/PrintingDocument.java +++ b/src/main/java/printing/objects/PrintingDocument.java @@ -2,55 +2,50 @@ public class PrintingDocument extends IPrintingOrder { - public PrintingDocument(PrintingOption pOpt,int qtt) - { - super(PrintingType.Document,pOpt,qtt); + public PrintingDocument(PrintingOption pOpt, int qtt) { + super(PrintingType.Document, pOpt, qtt); } - + @Override - public double getTotal() - { - double charge=0; - if(printingOpt==PrintingOption.BlackWhite) - { - charge=getBlackAndWhiteCharge(); - } - else if(printingOpt==PrintingOption.Colour) - { - charge=getColourCharge(); + public double getTotal() { + double charge = 0; + if (printingOpt == PrintingOption.BlackWhite) { + charge = getBlackAndWhiteCharge(); + } else if (printingOpt == PrintingOption.Colour) { + charge = getColourCharge(); } - sum=quantity*charge; + sum = quantity * charge; return sum; } - - public double getBlackAndWhiteCharge(){ - if(quantity <=0) + + public double getBlackAndWhiteCharge() { + if (quantity <= 0) throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); - else if(quantity >50) + else if (quantity > 50) throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); - if(quantity < 5) + if (quantity < 5) return 0.5; else if (quantity >= 5 && quantity <= 10) return 0.4; - else if(quantity >= 11 && quantity <= 20) + else if (quantity >= 11 && quantity <= 20) return 0.3; else return 0.2; } - + public double getColourCharge() { - if(quantity <=0) + if (quantity <= 0) throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); - else if(quantity >50) + else if (quantity > 50) throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); - if(quantity < 5) + if (quantity < 5) return 1; else if (quantity >= 5 && quantity <= 10) return 0.9; - else if(quantity >= 11 && quantity <= 20) + else if (quantity >= 11 && quantity <= 20) return 0.8; else return 0.7; } - + } diff --git a/src/main/java/printing/objects/PrintingOption.java b/src/main/java/printing/objects/PrintingOption.java index 43d06f5..e90f826 100644 --- a/src/main/java/printing/objects/PrintingOption.java +++ b/src/main/java/printing/objects/PrintingOption.java @@ -1,9 +1,5 @@ package printing.objects; public enum PrintingOption { - BlackWhite, - Colour, - Normal, - Passport, - Unknown + BlackWhite, Colour, Normal, Passport, Unknown } diff --git a/src/main/java/printing/objects/PrintingPhoto.java b/src/main/java/printing/objects/PrintingPhoto.java index d9f0f53..1b8b8ee 100644 --- a/src/main/java/printing/objects/PrintingPhoto.java +++ b/src/main/java/printing/objects/PrintingPhoto.java @@ -1,87 +1,78 @@ package printing.objects; -public class PrintingPhoto extends IPrintingOrder{ +public class PrintingPhoto extends IPrintingOrder { - private boolean isHighQualityPaper=false; - private boolean isDesignEffect=false; - - public PrintingPhoto(PrintingOption pOpt,int qtt) - { - super(PrintingType.Photo,pOpt,qtt); + private boolean isHighQualityPaper = false; + private boolean isDesignEffect = false; + + public PrintingPhoto(PrintingOption pOpt, int qtt) { + super(PrintingType.Photo, pOpt, qtt); } + @Override - public double getTotal() - { - - double charge=0; - if(printingOpt==PrintingOption.Normal) - { - charge=getNormalCharge(); - } - else if(printingOpt==PrintingOption.Passport) - { - charge=getPassportCharge(); + public double getTotal() { + + double charge = 0; + if (printingOpt == PrintingOption.Normal) { + charge = getNormalCharge(); + } else if (printingOpt == PrintingOption.Passport) { + charge = getPassportCharge(); } - sum=quantity*charge; + sum = quantity * charge; return sum; } - + public double getNormalCharge() { - double charge=0; - if(quantity <=0) + double charge = 0; + if (quantity <= 0) throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); - else if(quantity >50) + else if (quantity > 50) throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); - if(quantity < 5) - charge=1; + if (quantity < 5) + charge = 1; else if (quantity >= 5 && quantity <= 10) - charge=0.9; - else if(quantity >= 11 && quantity <= 20) - charge=0.75; + charge = 0.9; + else if (quantity >= 11 && quantity <= 20) + charge = 0.75; else - charge=0.5; - if(isHighQualityPaper) - { - charge+=0.10; + charge = 0.5; + if (isHighQualityPaper) { + charge += 0.10; } - if(isDesignEffect) - { - charge+=0.15; + if (isDesignEffect) { + charge += 0.15; } return charge; } - + public double getPassportCharge() { - double charge=0; - if(quantity <=0) + double charge = 0; + if (quantity <= 0) throw new IllegalArgumentException("Invalid Quantity, quantity cannot be negative"); - else if(quantity >50) + else if (quantity > 50) throw new IllegalArgumentException("Invalid Quantity, Maximum 50 copies per printing"); - if(quantity < 5) - charge=1.2; + if (quantity < 5) + charge = 1.2; else if (quantity >= 5 && quantity <= 10) - charge=0.95; - else if(quantity >= 11 && quantity <= 20) - charge=0.85; + charge = 0.95; + else if (quantity >= 11 && quantity <= 20) + charge = 0.85; else - charge=0.75; - if(isHighQualityPaper) - { - charge+=0.10; + charge = 0.75; + if (isHighQualityPaper) { + charge += 0.10; } - if(isDesignEffect) - { - charge+=0.15; + if (isDesignEffect) { + charge += 0.15; } return charge; } - + public void setIsHighQualityEffect(boolean isHighQualityPaper) { - this.isHighQualityPaper=isHighQualityPaper; + this.isHighQualityPaper = isHighQualityPaper; } - + public void setIsDesignEffect(boolean isDesignEffect) { - this.isDesignEffect=isDesignEffect; + this.isDesignEffect = isDesignEffect; } } - diff --git a/src/main/java/printing/objects/PrintingType.java b/src/main/java/printing/objects/PrintingType.java index 08240e0..077245f 100644 --- a/src/main/java/printing/objects/PrintingType.java +++ b/src/main/java/printing/objects/PrintingType.java @@ -2,7 +2,5 @@ public enum PrintingType { - Document, - Photo + Document, Photo } - diff --git a/src/test/java/printing/objects/IntegrationTest.java b/src/test/java/printing/objects/IntegrationTest.java index 1e4b944..b97d753 100644 --- a/src/test/java/printing/objects/IntegrationTest.java +++ b/src/test/java/printing/objects/IntegrationTest.java @@ -10,105 +10,100 @@ import org.junit.Test; public class IntegrationTest { - ArrayList linesRead= readER(); - IPrintingOrder orderDocumentBW = new PrintingDocument(PrintingOption.BlackWhite,30 ); - IPrintingOrder orderDocumentColour = new PrintingDocument(PrintingOption.Colour,30 ); - IPrintingOrder orderNormalHighQuality = new PrintingPhoto(PrintingOption.Normal,20 ); - IPrintingOrder orderNormalDesign = new PrintingPhoto(PrintingOption.Normal,20 ); - IPrintingOrder orderNormal = new PrintingPhoto(PrintingOption.Normal,20 ); - IPrintingOrder orderPassportHighQuality = new PrintingPhoto(PrintingOption.Passport,20 ); - IPrintingOrder orderPassportDesign = new PrintingPhoto(PrintingOption.Passport,20 ); - IPrintingOrder orderPassport = new PrintingPhoto(PrintingOption.Passport,20 ); - - + ArrayList linesRead = readER(); + IPrintingOrder orderDocumentBW = new PrintingDocument(PrintingOption.BlackWhite, 30); + IPrintingOrder orderDocumentColour = new PrintingDocument(PrintingOption.Colour, 30); + IPrintingOrder orderNormalHighQuality = new PrintingPhoto(PrintingOption.Normal, 20); + IPrintingOrder orderNormalDesign = new PrintingPhoto(PrintingOption.Normal, 20); + IPrintingOrder orderNormal = new PrintingPhoto(PrintingOption.Normal, 20); + IPrintingOrder orderPassportHighQuality = new PrintingPhoto(PrintingOption.Passport, 20); + IPrintingOrder orderPassportDesign = new PrintingPhoto(PrintingOption.Passport, 20); + IPrintingOrder orderPassport = new PrintingPhoto(PrintingOption.Passport, 20); + @Test - public void testDocumentBW() - { + public void testDocumentBW() { double totalER = Double.parseDouble(linesRead.get(0)[0]); - double chargeER= Double.parseDouble(linesRead.get(0)[1]); + double chargeER = Double.parseDouble(linesRead.get(0)[1]); double totalAR = orderDocumentBW.getTotal(); double chargeAR = ((PrintingDocument) orderDocumentBW).getBlackAndWhiteCharge(); - assertEquals(totalER,totalAR,0); - assertEquals(chargeER,chargeAR,0); + assertEquals(totalER, totalAR, 0); + assertEquals(chargeER, chargeAR, 0); } - + @Test - public void testDocumentColour() - { + public void testDocumentColour() { double totalER = Double.parseDouble(linesRead.get(1)[0]); - double chargeER= Double.parseDouble(linesRead.get(1)[1]); + double chargeER = Double.parseDouble(linesRead.get(1)[1]); double totalAR = orderDocumentColour.getTotal(); double chargeAR = ((PrintingDocument) orderDocumentColour).getColourCharge(); - assertEquals(totalER,totalAR,0); - assertEquals(chargeER,chargeAR,0); + assertEquals(totalER, totalAR, 0); + assertEquals(chargeER, chargeAR, 0); } - + @Test - public void testNormalHighQuality() - { + public void testNormalHighQuality() { double totalER = Double.parseDouble(linesRead.get(2)[0]); - double chargeER= Double.parseDouble(linesRead.get(2)[1]); - ((PrintingPhoto)orderNormalHighQuality).setIsHighQualityEffect(true); + double chargeER = Double.parseDouble(linesRead.get(2)[1]); + ((PrintingPhoto) orderNormalHighQuality).setIsHighQualityEffect(true); double totalAR = orderNormalHighQuality.getTotal(); - double chargeAR = ((PrintingPhoto)orderNormalHighQuality).getNormalCharge(); - assertEquals(totalER,totalAR,0); - assertEquals(chargeER,chargeAR,0); + double chargeAR = ((PrintingPhoto) orderNormalHighQuality).getNormalCharge(); + assertEquals(totalER, totalAR, 0); + assertEquals(chargeER, chargeAR, 0); } + @Test - public void testNormalDesign() - { + public void testNormalDesign() { double totalER = Double.parseDouble(linesRead.get(3)[0]); - double chargeER= Double.parseDouble(linesRead.get(3)[1]); - ((PrintingPhoto)orderNormalDesign).setIsDesignEffect(true); + double chargeER = Double.parseDouble(linesRead.get(3)[1]); + ((PrintingPhoto) orderNormalDesign).setIsDesignEffect(true); double totalAR = orderNormalDesign.getTotal(); double chargeAR = ((PrintingPhoto) orderNormalDesign).getNormalCharge(); - assertEquals(totalER,totalAR,0); - assertEquals(chargeER,chargeAR,0); + assertEquals(totalER, totalAR, 0); + assertEquals(chargeER, chargeAR, 0); } + @Test - public void testNormal() - { + public void testNormal() { double totalER = Double.parseDouble(linesRead.get(4)[0]); - double chargeER= Double.parseDouble(linesRead.get(4)[1]); + double chargeER = Double.parseDouble(linesRead.get(4)[1]); double totalAR = orderNormal.getTotal(); double chargeAR = ((PrintingPhoto) orderNormal).getNormalCharge(); - assertEquals(totalER,totalAR,0); - assertEquals(chargeER,chargeAR,0); + assertEquals(totalER, totalAR, 0); + assertEquals(chargeER, chargeAR, 0); } - + @Test - public void testPassportHighQuality() - { + public void testPassportHighQuality() { double totalER = Double.parseDouble(linesRead.get(5)[0]); - double chargeER= Double.parseDouble(linesRead.get(5)[1]); - ((PrintingPhoto)orderPassportHighQuality).setIsHighQualityEffect(true); + double chargeER = Double.parseDouble(linesRead.get(5)[1]); + ((PrintingPhoto) orderPassportHighQuality).setIsHighQualityEffect(true); double totalAR = orderPassportHighQuality.getTotal(); double chargeAR = ((PrintingPhoto) orderPassportHighQuality).getPassportCharge(); - assertEquals(totalER,totalAR,0); - assertEquals(chargeER,chargeAR,0); + assertEquals(totalER, totalAR, 0); + assertEquals(chargeER, chargeAR, 0); } + @Test - public void testPassportDesign() - { + public void testPassportDesign() { double totalER = Double.parseDouble(linesRead.get(6)[0]); - double chargeER= Double.parseDouble(linesRead.get(6)[1]); - ((PrintingPhoto)orderPassportDesign).setIsDesignEffect(true); + double chargeER = Double.parseDouble(linesRead.get(6)[1]); + ((PrintingPhoto) orderPassportDesign).setIsDesignEffect(true); double totalAR = orderPassportDesign.getTotal(); double chargeAR = ((PrintingPhoto) orderPassportDesign).getPassportCharge(); - assertEquals(totalER,totalAR,0); - assertEquals(chargeER,chargeAR,0); + assertEquals(totalER, totalAR, 0); + assertEquals(chargeER, chargeAR, 0); } + @Test - public void testPassport() - { + public void testPassport() { double totalER = Double.parseDouble(linesRead.get(7)[0]); - double chargeER= Double.parseDouble(linesRead.get(7)[1]); + double chargeER = Double.parseDouble(linesRead.get(7)[1]); double totalAR = orderPassport.getTotal(); double chargeAR = ((PrintingPhoto) orderPassport).getPassportCharge(); - assertEquals(totalER,totalAR,0); - assertEquals(chargeER,chargeAR,0); + assertEquals(totalER, totalAR, 0); + assertEquals(chargeER, chargeAR, 0); } - + public ArrayList readER() { ArrayList linesRead = new ArrayList(); String fileName = "IntegrationER.txt"; @@ -127,9 +122,9 @@ public ArrayList readER() { String[] tokens = singleLine.split(","); linesRead.add(tokens); } - + inputStream.close(); return linesRead; } - + } diff --git a/src/test/java/printing/objects/OrderTest.java b/src/test/java/printing/objects/OrderTest.java index c025f37..3f0e849 100644 --- a/src/test/java/printing/objects/OrderTest.java +++ b/src/test/java/printing/objects/OrderTest.java @@ -13,347 +13,266 @@ import junitparams.JUnitParamsRunner; import junitparams.Parameters; - @RunWith(JUnitParamsRunner.class) public class OrderTest { - - - - private Object [] paramForDocumentGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Colour,1,1.00}, - new Object [] {PrintingOption.Colour,4,4.00}, - new Object [] {PrintingOption.Colour,5,4.50}, - new Object [] {PrintingOption.Colour,10,9.00}, - new Object [] {PrintingOption.Colour,11,8.80}, - new Object [] {PrintingOption.Colour,20,16.00}, - new Object [] {PrintingOption.Colour,21,14.70}, - new Object [] {PrintingOption.Colour,50,35.00}, - }; - } - //Valid Test for Document Colour + + private Object[] paramForDocumentGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Colour, 1, 1.00 }, + new Object[] { PrintingOption.Colour, 4, 4.00 }, new Object[] { PrintingOption.Colour, 5, 4.50 }, + new Object[] { PrintingOption.Colour, 10, 9.00 }, new Object[] { PrintingOption.Colour, 11, 8.80 }, + new Object[] { PrintingOption.Colour, 20, 16.00 }, new Object[] { PrintingOption.Colour, 21, 14.70 }, + new Object[] { PrintingOption.Colour, 50, 35.00 }, }; + } + + // Valid Test for Document Colour @Test - @Parameters(method="paramForDocumentGetTotalBVA") - public void DocumentColourValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) - { - IPrintingOrder testDocument = new PrintingDocument(pOpt,qtt); - double AR=testDocument.getTotal(); + @Parameters(method = "paramForDocumentGetTotalBVA") + public void DocumentColourValidTestGetTotalBVA(PrintingOption pOpt, int qtt, double ER) { + IPrintingOrder testDocument = new PrintingDocument(pOpt, qtt); + double AR = testDocument.getTotal(); assertEquals(ER, AR, 0); - - } - - //Invalid Test For Document Colour - private Object [] InvalidParamForDocumentColourGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Colour,0}, - new Object [] {PrintingOption.Colour,51}, - }; - } - - @Test(expected=IllegalArgumentException.class) - @Parameters(method="InvalidParamForDocumentColourGetTotalBVA") - public void DocumentColourInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { - IPrintingOrder testDocument = new PrintingDocument(pOpt,qtt); - double AR=testDocument.getTotal(); - } - - //Valid Test for Document Black and White - private Object [] paramForDocumentBWGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.BlackWhite,1,0.50}, - new Object [] {PrintingOption.BlackWhite,4,2.00}, - new Object [] {PrintingOption.BlackWhite,5,2.00}, - new Object [] {PrintingOption.BlackWhite,10,4.00}, - new Object [] {PrintingOption.BlackWhite,11,3.30}, - new Object [] {PrintingOption.BlackWhite,20,6.00}, - new Object [] {PrintingOption.BlackWhite,21,4.20}, - new Object [] {PrintingOption.BlackWhite,50,10.00}, - }; - } - + + } + + // Invalid Test For Document Colour + private Object[] InvalidParamForDocumentColourGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Colour, 0 }, new Object[] { PrintingOption.Colour, 51 }, }; + } + + @Test(expected = IllegalArgumentException.class) + @Parameters(method = "InvalidParamForDocumentColourGetTotalBVA") + public void DocumentColourInvalidTestGetTotalBVA(PrintingOption pOpt, int qtt) { + IPrintingOrder testDocument = new PrintingDocument(pOpt, qtt); + double AR = testDocument.getTotal(); + } + + // Valid Test for Document Black and White + private Object[] paramForDocumentBWGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.BlackWhite, 1, 0.50 }, + new Object[] { PrintingOption.BlackWhite, 4, 2.00 }, + new Object[] { PrintingOption.BlackWhite, 5, 2.00 }, + new Object[] { PrintingOption.BlackWhite, 10, 4.00 }, + new Object[] { PrintingOption.BlackWhite, 11, 3.30 }, + new Object[] { PrintingOption.BlackWhite, 20, 6.00 }, + new Object[] { PrintingOption.BlackWhite, 21, 4.20 }, + new Object[] { PrintingOption.BlackWhite, 50, 10.00 }, }; + } + @Test - @Parameters(method="paramForDocumentBWGetTotalBVA") - public void DocumentBWValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) - { - IPrintingOrder testDocument = new PrintingDocument(pOpt,qtt); - double AR=testDocument.getTotal(); + @Parameters(method = "paramForDocumentBWGetTotalBVA") + public void DocumentBWValidTestGetTotalBVA(PrintingOption pOpt, int qtt, double ER) { + IPrintingOrder testDocument = new PrintingDocument(pOpt, qtt); + double AR = testDocument.getTotal(); assertEquals(ER, AR, 0); - - } - //Invalid Test For Document Black and White - private Object [] InvalidParamForDocumenBWtGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.BlackWhite,0}, - new Object [] {PrintingOption.BlackWhite,51}, - }; - } - - @Test(expected=IllegalArgumentException.class) - @Parameters(method="InvalidParamForDocumenBWtGetTotalBVA") - public void DocumentBWInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { - IPrintingOrder testDocument = new PrintingDocument(pOpt,qtt); - double AR=testDocument.getTotal(); - } - - //Valid Test For Photo High Quality - private Object [] paramForPhotoNormalHighQualityGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Normal,1,1.10}, - new Object [] {PrintingOption.Normal,4,4.40}, - new Object [] {PrintingOption.Normal,5,5.00}, - new Object [] {PrintingOption.Normal,10,10.00}, - new Object [] {PrintingOption.Normal,11,9.35}, - new Object [] {PrintingOption.Normal,20,17.00}, - new Object [] {PrintingOption.Normal,21,12.60}, - new Object [] {PrintingOption.Normal,50,30.00}, - }; - } - + + } + + // Invalid Test For Document Black and White + private Object[] InvalidParamForDocumenBWtGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.BlackWhite, 0 }, + new Object[] { PrintingOption.BlackWhite, 51 }, }; + } + + @Test(expected = IllegalArgumentException.class) + @Parameters(method = "InvalidParamForDocumenBWtGetTotalBVA") + public void DocumentBWInvalidTestGetTotalBVA(PrintingOption pOpt, int qtt) { + IPrintingOrder testDocument = new PrintingDocument(pOpt, qtt); + double AR = testDocument.getTotal(); + } + + // Valid Test For Photo High Quality + private Object[] paramForPhotoNormalHighQualityGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Normal, 1, 1.10 }, + new Object[] { PrintingOption.Normal, 4, 4.40 }, new Object[] { PrintingOption.Normal, 5, 5.00 }, + new Object[] { PrintingOption.Normal, 10, 10.00 }, new Object[] { PrintingOption.Normal, 11, 9.35 }, + new Object[] { PrintingOption.Normal, 20, 17.00 }, new Object[] { PrintingOption.Normal, 21, 12.60 }, + new Object[] { PrintingOption.Normal, 50, 30.00 }, }; + } + @Test - @Parameters(method="paramForPhotoNormalHighQualityGetTotalBVA") - public void PhotoNormalHighQualityValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) - { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + @Parameters(method = "paramForPhotoNormalHighQualityGetTotalBVA") + public void PhotoNormalHighQualityValidTestGetTotalBVA(PrintingOption pOpt, int qtt, double ER) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); - double AR=testPhoto.getTotal(); - assertEquals(ER, AR, 0); - } - - - //Invalid Test For Photo Normal High Quality - private Object [] InvalidParamForPhotoNormalHighQualityGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Normal,0}, - new Object [] {PrintingOption.Normal,51}, - }; - } - - @Test(expected=IllegalArgumentException.class) - @Parameters(method="InvalidParamForPhotoNormalHighQualityGetTotalBVA") - public void PhotoNormalHighQualityInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + double AR = testPhoto.getTotal(); + assertEquals(ER, AR, 0); + } + + // Invalid Test For Photo Normal High Quality + private Object[] InvalidParamForPhotoNormalHighQualityGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Normal, 0 }, new Object[] { PrintingOption.Normal, 51 }, }; + } + + @Test(expected = IllegalArgumentException.class) + @Parameters(method = "InvalidParamForPhotoNormalHighQualityGetTotalBVA") + public void PhotoNormalHighQualityInvalidTestGetTotalBVA(PrintingOption pOpt, int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); - double AR=testPhoto.getTotal(); - } - - //Valid Test For Photo Normal Design - private Object [] paramForPhotoNormalDesignGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Normal,1,1.15}, - new Object [] {PrintingOption.Normal,4,4.60}, - new Object [] {PrintingOption.Normal,5,5.25}, - new Object [] {PrintingOption.Normal,10,10.50}, - new Object [] {PrintingOption.Normal,11,9.90}, - new Object [] {PrintingOption.Normal,20,18.00}, - new Object [] {PrintingOption.Normal,21,13.65}, - new Object [] {PrintingOption.Normal,50,32.50}, - }; - } - + double AR = testPhoto.getTotal(); + } + + // Valid Test For Photo Normal Design + private Object[] paramForPhotoNormalDesignGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Normal, 1, 1.15 }, + new Object[] { PrintingOption.Normal, 4, 4.60 }, new Object[] { PrintingOption.Normal, 5, 5.25 }, + new Object[] { PrintingOption.Normal, 10, 10.50 }, new Object[] { PrintingOption.Normal, 11, 9.90 }, + new Object[] { PrintingOption.Normal, 20, 18.00 }, new Object[] { PrintingOption.Normal, 21, 13.65 }, + new Object[] { PrintingOption.Normal, 50, 32.50 }, }; + } + @Test - @Parameters(method="paramForPhotoNormalDesignGetTotalBVA") - public void PhotoNormalDesignValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) - { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + @Parameters(method = "paramForPhotoNormalDesignGetTotalBVA") + public void PhotoNormalDesignValidTestGetTotalBVA(PrintingOption pOpt, int qtt, double ER) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); ((PrintingPhoto) testPhoto).setIsDesignEffect(true); - double AR=testPhoto.getTotal(); + double AR = testPhoto.getTotal(); + assertEquals(ER, AR, 0); + + } + + // Invalid Test For Photo Normal Design + private Object[] InvalidParamForPhotoNormalDesignGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Normal, 0 }, new Object[] { PrintingOption.Normal, 51 }, }; + } + + @Test(expected = IllegalArgumentException.class) + @Parameters(method = "InvalidParamForPhotoNormalDesignGetTotalBVA") + public void PhotoNormalDesignInvalidTestGetTotalBVA(PrintingOption pOpt, int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); + ((PrintingPhoto) testPhoto).setIsDesignEffect(true); + double AR = testPhoto.getTotal(); + } + + // Valid Test For Photo Normal + private Object[] paramForPhotoNormalGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Normal, 1, 1.00 }, + new Object[] { PrintingOption.Normal, 4, 4.00 }, new Object[] { PrintingOption.Normal, 5, 4.50 }, + new Object[] { PrintingOption.Normal, 10, 9.00 }, new Object[] { PrintingOption.Normal, 11, 8.25 }, + new Object[] { PrintingOption.Normal, 20, 15.00 }, new Object[] { PrintingOption.Normal, 21, 10.50 }, + new Object[] { PrintingOption.Normal, 50, 25.0 }, }; + } + + @Test + @Parameters(method = "paramForPhotoNormalGetTotalBVA") + public void PhotoNormalValidTestGetTotalBVA(PrintingOption pOpt, int qtt, double ER) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); + double AR = testPhoto.getTotal(); assertEquals(ER, AR, 0); - - } - - //Invalid Test For Photo Normal Design - private Object [] InvalidParamForPhotoNormalDesignGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Normal,0}, - new Object [] {PrintingOption.Normal,51}, - }; - } - - @Test(expected=IllegalArgumentException.class) - @Parameters(method="InvalidParamForPhotoNormalDesignGetTotalBVA") - public void PhotoNormalDesignInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); + + } + + // Invalid Test For Photo Normal + private Object[] InvalidParamForPhotoNormalGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Normal, 0 }, new Object[] { PrintingOption.Normal, 51 }, }; + } + + @Test(expected = IllegalArgumentException.class) + @Parameters(method = "InvalidParamForPhotoNormalGetTotalBVA") + public void PhotoNormalInvalidTestGetTotalBVA(PrintingOption pOpt, int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); + double AR = testPhoto.getTotal(); + } + + // Valid Test For Photo Passport High Quality + private Object[] paramForPhotoPassportHighQualityGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Passport, 1, 1.30 }, + new Object[] { PrintingOption.Passport, 4, 5.20 }, new Object[] { PrintingOption.Passport, 5, 5.25 }, + new Object[] { PrintingOption.Passport, 10, 10.50 }, + new Object[] { PrintingOption.Passport, 11, 10.45 }, + new Object[] { PrintingOption.Passport, 20, 19.00 }, + new Object[] { PrintingOption.Passport, 21, 17.85 }, + new Object[] { PrintingOption.Passport, 50, 42.50 }, }; + } + + @Test + @Parameters(method = "paramForPhotoPassportHighQualityGetTotalBVA") + public void PhotoPassportHighQualityValidTestGetTotalBVA(PrintingOption pOpt, int qtt, double ER) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); + ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); + double AR = testPhoto.getTotal(); + assertEquals(ER, AR, 0.0005); + + } + + // Invalid Test For Photo Passport High Quality + private Object[] InvalidParamForPhotoPassportHighQualityGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Passport, 0 }, + new Object[] { PrintingOption.Passport, 51 }, }; + } + + @Test(expected = IllegalArgumentException.class) + @Parameters(method = "InvalidParamForPhotoPassportHighQualityGetTotalBVA") + public void PhotoPassportHighQualityInvalidTestGetTotalBVA(PrintingOption pOpt, int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); + ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); + double AR = testPhoto.getTotal(); + } + + // Valid Test For Photo Passport Design + private Object[] paramForPhotoPassportDesignGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Passport, 1, 1.35 }, + new Object[] { PrintingOption.Passport, 4, 5.40 }, new Object[] { PrintingOption.Passport, 5, 5.50 }, + new Object[] { PrintingOption.Passport, 10, 11.00 }, + new Object[] { PrintingOption.Passport, 11, 11.00 }, + new Object[] { PrintingOption.Passport, 20, 20.00 }, + new Object[] { PrintingOption.Passport, 21, 18.90 }, + new Object[] { PrintingOption.Passport, 50, 45.00 }, }; + } + + @Test + @Parameters(method = "paramForPhotoPassportDesignGetTotalBVA") + public void PhotoPassportDesignValidTestGetTotalBVA(PrintingOption pOpt, int qtt, double ER) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); + ((PrintingPhoto) testPhoto).setIsDesignEffect(true); + double AR = testPhoto.getTotal(); + assertEquals(ER, AR, 0.0005); + + } + + // Invalid Test For Photo Passport Design + private Object[] InvalidParamForPhotoPassportDesignGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Passport, 0 }, + new Object[] { PrintingOption.Passport, 51 }, }; + } + + @Test(expected = IllegalArgumentException.class) + @Parameters(method = "InvalidParamForPhotoPassportDesignGetTotalBVA") + public void PhotoPassportDesignInvalidTestGetTotalBVA(PrintingOption pOpt, int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); ((PrintingPhoto) testPhoto).setIsDesignEffect(true); - double AR=testPhoto.getTotal(); - } - - //Valid Test For Photo Normal - private Object [] paramForPhotoNormalGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Normal,1,1.00}, - new Object [] {PrintingOption.Normal,4,4.00}, - new Object [] {PrintingOption.Normal,5,4.50}, - new Object [] {PrintingOption.Normal,10,9.00}, - new Object [] {PrintingOption.Normal,11,8.25}, - new Object [] {PrintingOption.Normal,20,15.00}, - new Object [] {PrintingOption.Normal,21,10.50}, - new Object [] {PrintingOption.Normal,50,25.0}, - }; - } - + double AR = testPhoto.getTotal(); + } + + // Valid Test For Photo Passport + private Object[] paramForPhotoPassportGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Passport, 1, 1.20 }, + new Object[] { PrintingOption.Passport, 4, 4.80 }, new Object[] { PrintingOption.Passport, 5, 4.75 }, + new Object[] { PrintingOption.Passport, 10, 9.50 }, new Object[] { PrintingOption.Passport, 11, 9.35 }, + new Object[] { PrintingOption.Passport, 20, 17.00 }, + new Object[] { PrintingOption.Passport, 21, 15.75 }, + new Object[] { PrintingOption.Passport, 50, 37.50 }, }; + } + @Test - @Parameters(method="paramForPhotoNormalGetTotalBVA") - public void PhotoNormalValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) - { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); - double AR=testPhoto.getTotal(); + @Parameters(method = "paramForPhotoPassportGetTotalBVA") + public void PhotoPassportValidTestGetTotalBVA(PrintingOption pOpt, int qtt, double ER) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); + double AR = testPhoto.getTotal(); assertEquals(ER, AR, 0); - - } - - //Invalid Test For Photo Normal - private Object [] InvalidParamForPhotoNormalGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Normal,0}, - new Object [] {PrintingOption.Normal,51}, - }; - } - - @Test(expected=IllegalArgumentException.class) - @Parameters(method="InvalidParamForPhotoNormalGetTotalBVA") - public void PhotoNormalInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); - double AR=testPhoto.getTotal(); - } - - //Valid Test For Photo Passport High Quality - private Object [] paramForPhotoPassportHighQualityGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Passport,1,1.30}, - new Object [] {PrintingOption.Passport,4,5.20}, - new Object [] {PrintingOption.Passport,5,5.25}, - new Object [] {PrintingOption.Passport,10,10.50}, - new Object [] {PrintingOption.Passport,11,10.45}, - new Object [] {PrintingOption.Passport,20,19.00}, - new Object [] {PrintingOption.Passport,21,17.85}, - new Object [] {PrintingOption.Passport,50,42.50}, - }; - } - - @Test - @Parameters(method="paramForPhotoPassportHighQualityGetTotalBVA") - public void PhotoPassportHighQualityValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) - { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); - ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); - double AR=testPhoto.getTotal(); - assertEquals(ER, AR, 0.0005); - - } - - //Invalid Test For Photo Passport High Quality - private Object [] InvalidParamForPhotoPassportHighQualityGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Passport,0}, - new Object [] {PrintingOption.Passport,51}, - }; - } - - @Test(expected=IllegalArgumentException.class) - @Parameters(method="InvalidParamForPhotoPassportHighQualityGetTotalBVA") - public void PhotoPassportHighQualityInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); - ((PrintingPhoto) testPhoto).setIsHighQualityEffect(true); - double AR=testPhoto.getTotal(); - } - - - //Valid Test For Photo Passport Design - private Object [] paramForPhotoPassportDesignGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Passport,1,1.35}, - new Object [] {PrintingOption.Passport,4,5.40}, - new Object [] {PrintingOption.Passport,5,5.50}, - new Object [] {PrintingOption.Passport,10,11.00}, - new Object [] {PrintingOption.Passport,11,11.00}, - new Object [] {PrintingOption.Passport,20,20.00}, - new Object [] {PrintingOption.Passport,21,18.90}, - new Object [] {PrintingOption.Passport,50,45.00}, - }; - } - - @Test - @Parameters(method="paramForPhotoPassportDesignGetTotalBVA") - public void PhotoPassportDesignValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) - { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); - ((PrintingPhoto) testPhoto).setIsDesignEffect(true); - double AR=testPhoto.getTotal(); - assertEquals(ER, AR, 0.0005); - - } - - //Invalid Test For Photo Passport Design - private Object [] InvalidParamForPhotoPassportDesignGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Passport,0}, - new Object [] {PrintingOption.Passport,51}, - }; - } - - @Test(expected=IllegalArgumentException.class) - @Parameters(method="InvalidParamForPhotoPassportDesignGetTotalBVA") - public void PhotoPassportDesignInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); - ((PrintingPhoto) testPhoto).setIsDesignEffect(true); - double AR=testPhoto.getTotal(); - } - - //Valid Test For Photo Passport - private Object [] paramForPhotoPassportGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Passport,1,1.20}, - new Object [] {PrintingOption.Passport,4,4.80}, - new Object [] {PrintingOption.Passport,5,4.75}, - new Object [] {PrintingOption.Passport,10,9.50}, - new Object [] {PrintingOption.Passport,11,9.35}, - new Object [] {PrintingOption.Passport,20,17.00}, - new Object [] {PrintingOption.Passport,21,15.75}, - new Object [] {PrintingOption.Passport,50,37.50}, - }; - } - - @Test - @Parameters(method="paramForPhotoPassportGetTotalBVA") - public void PhotoPassportValidTestGetTotalBVA(PrintingOption pOpt,int qtt, double ER) - { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); - double AR=testPhoto.getTotal(); - assertEquals(ER, AR, 0); - - } - - //Invalid Test For Photo Passport - private Object [] InvalidParamForPhotoPassportGetTotalBVA() - { - return new Object [] { - new Object [] {PrintingOption.Passport,0}, - new Object [] {PrintingOption.Passport,51}, - }; - } - - @Test(expected=IllegalArgumentException.class) - @Parameters(method="InvalidParamForPhotoPassportGetTotalBVA") - public void PhotoPassportInvalidTestGetTotalBVA(PrintingOption pOpt,int qtt) { - IPrintingOrder testPhoto = new PrintingPhoto(pOpt,qtt); - double AR=testPhoto.getTotal(); - } - - - + + } + + // Invalid Test For Photo Passport + private Object[] InvalidParamForPhotoPassportGetTotalBVA() { + return new Object[] { new Object[] { PrintingOption.Passport, 0 }, + new Object[] { PrintingOption.Passport, 51 }, }; + } + + @Test(expected = IllegalArgumentException.class) + @Parameters(method = "InvalidParamForPhotoPassportGetTotalBVA") + public void PhotoPassportInvalidTestGetTotalBVA(PrintingOption pOpt, int qtt) { + IPrintingOrder testPhoto = new PrintingPhoto(pOpt, qtt); + double AR = testPhoto.getTotal(); + } + } diff --git a/src/test/java/printing/objects/PhotoPrinterTest.java b/src/test/java/printing/objects/PhotoPrinterTest.java index c045f7e..2cd5fcc 100644 --- a/src/test/java/printing/objects/PhotoPrinterTest.java +++ b/src/test/java/printing/objects/PhotoPrinterTest.java @@ -13,24 +13,26 @@ public class PhotoPrinterTest { @Test - public void testQueueRequest() - { - //Mock the class that contain method of getRequest that will return the array of orders + public void testQueueRequest() { + // Mock the class that contain method of getRequest that will return the array + // of orders IPrintingOrder orderMock = mock(IPrintingOrder.class); - //Mock the class that contain array of orders + // Mock the class that contain array of orders IPrintingOrder getOrderMock = mock(IPrintingOrder.class); - //When getRequest is called, always return the fixed array of orders + // When getRequest is called, always return the fixed array of orders when(orderMock.getRequest()).thenReturn(orderMock.printingOrders); - //Pass the mock to the printer class the contains the queueRequest method - PhotoPrinter print = new PhotoPrinter (orderMock); + // Pass the mock to the printer class the contains the queueRequest method + PhotoPrinter print = new PhotoPrinter(orderMock); InOrder inOrder = Mockito.inOrder(orderMock); - + print.queueRequest(); - //Assert equals the array of orders return from getRequest with Actual array of orders - assertEquals(orderMock.getRequest(),getOrderMock.printingOrders); - //Verify array of orders used for updateRequest method with actual array of orders + // Assert equals the array of orders return from getRequest with Actual array of + // orders + assertEquals(orderMock.getRequest(), getOrderMock.printingOrders); + // Verify array of orders used for updateRequest method with actual array of + // orders inOrder.verify(orderMock).updateRequest(getOrderMock.printingOrders); - + } - + } diff --git a/src/test/java/printing/objects/TestSuiteCase.java b/src/test/java/printing/objects/TestSuiteCase.java index 03be07b..d0c62cb 100644 --- a/src/test/java/printing/objects/TestSuiteCase.java +++ b/src/test/java/printing/objects/TestSuiteCase.java @@ -5,10 +5,6 @@ import org.junit.runners.Suite.SuiteClasses; @RunWith(value = Suite.class) -@SuiteClasses(value = { - IntegrationTest.class, - OrderTest.class, - PhotoPrinterTest.class, -}) +@SuiteClasses(value = { IntegrationTest.class, OrderTest.class, PhotoPrinterTest.class, }) public class TestSuiteCase { }