From 344264763f04d182894af1ec3b3bd9d9e1615cad Mon Sep 17 00:00:00 2001 From: yylonly Date: Mon, 18 Feb 2019 01:33:51 +0800 Subject: [PATCH 1/8] support mvn gui test --- .../.classpath | 63 ++++++++-------- .../.travis.yml | 52 +++++++++++++ .../pom.xml | 74 +++++++++++++++++++ .../test/java}/gui/MainTest.java | 0 4 files changed, 155 insertions(+), 34 deletions(-) create mode 100644 net.mydreamy.casestudies.cocome.autogui.refined/.travis.yml rename net.mydreamy.casestudies.cocome.autogui.refined/{src-gen => src/test/java}/gui/MainTest.java (100%) diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/.classpath b/net.mydreamy.casestudies.cocome.autogui.refined/.classpath index 3f7cdfc..a1c037d 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/.classpath +++ b/net.mydreamy.casestudies.cocome.autogui.refined/.classpath @@ -1,34 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/.travis.yml b/net.mydreamy.casestudies.cocome.autogui.refined/.travis.yml new file mode 100644 index 0000000..10aa5a3 --- /dev/null +++ b/net.mydreamy.casestudies.cocome.autogui.refined/.travis.yml @@ -0,0 +1,52 @@ +language: java + +sudo: false + +git: + depth: false + submodules: false + +matrix: + include: + # Ubuntu Linux (trusty) / Oracle JDK 8 / Headed (AWT Robot) + - os: linux + dist: trusty + jdk: oraclejdk8 + env: + - _JAVA_OPTIONS="-Dtestfx.robot=awt" + # Ubuntu Linux (trusty) / Oracle JDK 8 / Headed (Glass Robot) / HiDPI + - os: linux + dist: trusty + jdk: oraclejdk8 + env: + - _JAVA_OPTIONS="-Dtestfx.robot=glass -Dglass.gtk.uiScale=2.0" + # Ubuntu Linux (trusty) / Oracle JDK 8 / Headless + - os: linux + dist: trusty + jdk: oraclejdk8 + env: + - _JAVA_OPTIONS="-Djava.awt.headless=true -Dtestfx.robot=glass -Dtestfx.headless=true -Dprism.order=sw" + # macOS / Oracle JDK 8 / Headless + - os: osx + osx_image: xcode9.4 + jdk: oraclejdk8 + env: + - _JAVA_OPTIONS="-Djava.awt.headless=true -Dtestfx.robot=glass -Dtestfx.headless=true -Dprism.order=sw -Dprism.verbose=true" + # Headed macOS is not currently possible on Travis. + + +addons: + apt: + packages: + - oracle-java8-installer + +before_install: + - if [[ "${TRAVIS_OS_NAME}" == linux ]]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; fi + +install: true + +before_script: + - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then brew update; brew cask reinstall caskroom/versions/java8; fi + +script: +- mvn clean test diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml b/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml index 4a0a271..b271e25 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml +++ b/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml @@ -55,6 +55,68 @@ + + + + org.eclipse.xtext + xtext-maven-plugin + 2.15.0 + + + + generate + + + + + + + net.mydreamy.requirementmodel.REMODELStandaloneSetup + + + src-gen + + + + + + + + net.mydreamy.requirementmodel + net.mydreamy.requirementmodel + 1.0.1-SNAPSHOT + + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + gui.Main + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M1 + + gui.MainTest#integrationTest + + + @@ -71,6 +133,11 @@ 4.0.10-alpha test + + junit + junit + 4.12 + org.apache.commons commons-lang3 @@ -81,6 +148,13 @@ bootstrapfx-core 0.2.4 + + + org.testfx + openjfx-monocle + 8u76-b04 + test + \ No newline at end of file diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/src-gen/gui/MainTest.java b/net.mydreamy.casestudies.cocome.autogui.refined/src/test/java/gui/MainTest.java similarity index 100% rename from net.mydreamy.casestudies.cocome.autogui.refined/src-gen/gui/MainTest.java rename to net.mydreamy.casestudies.cocome.autogui.refined/src/test/java/gui/MainTest.java From f216a92593361db58d3dd2a144473753a4d87f55 Mon Sep 17 00:00:00 2001 From: yylonly Date: Sun, 24 Feb 2019 01:00:33 +0800 Subject: [PATCH 2/8] project with maven, delete reduency projects --- .gitignore | 7 + .../.classpath | 61 +- net.mydreamy.casestudies.atm.autogui/pom.xml | 24 + .../test/java}/gui/MainTest.java | 18 +- net.mydreamy.casestudies.atm/.project | 29 - .../META-INF/MANIFEST.MF | 6 - net.mydreamy.casestudies.atm/build.properties | 1 - .../requirementmodel/atm.aird | 1436 ------- .../requirementmodel/atm.remodel | 165 - .../.settings/org.eclipse.jdt.core.prefs | 1 + .../pom.xml | 6 +- .../src/test/java/gui/MainTest.java | 60 +- .../.classpath | 9 - .../.project | 23 - .../.settings/org.eclipse.jdt.core.prefs | 11 - .../requirementmodel/cocome.aird | 3687 ----------------- .../requirementmodel/cocome.remodel | 940 ----- net.mydreamy.casestudies.cocome/.classpath | 8 - net.mydreamy.casestudies.cocome/.gitignore | 1 - net.mydreamy.casestudies.cocome/.project | 35 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 8 - .../build.properties | 4 - .../requirementmodel/cocome.remodel | 401 -- .../casestudies/cocome/Activator.java | 49 - .../casestudies/cocome/test/MainTest.java | 126 - .../.classpath | 1 + .../.settings/org.eclipse.jdt.core.prefs | 1 + .../pom.xml | 29 +- .../test/java}/gui/MainTest.java | 32 +- net.mydreamy.casestudies.library/.classpath | 8 - net.mydreamy.casestudies.library/.gitignore | 1 - net.mydreamy.casestudies.library/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 8 - .../build.properties | 4 - .../requirementmodel/library.remodel | 629 --- .../casestudies/library/Activator.java | 48 - .../mydreamy/casestudies/test/MainTest.java | 413 -- .../.classpath | 5 + net.mydreamy.casestudies.loan.autogui/pom.xml | 55 + .../test/java}/gui/MainTest.java | 36 +- 42 files changed, 224 insertions(+), 8210 deletions(-) create mode 100644 .gitignore rename net.mydreamy.casestudies.atm.autogui/{src-gen => src/test/java}/gui/MainTest.java (96%) delete mode 100644 net.mydreamy.casestudies.atm/.project delete mode 100644 net.mydreamy.casestudies.atm/META-INF/MANIFEST.MF delete mode 100644 net.mydreamy.casestudies.atm/build.properties delete mode 100644 net.mydreamy.casestudies.atm/requirementmodel/atm.aird delete mode 100644 net.mydreamy.casestudies.atm/requirementmodel/atm.remodel delete mode 100644 net.mydreamy.casestudies.cocome.autogui/.classpath delete mode 100644 net.mydreamy.casestudies.cocome.autogui/.project delete mode 100644 net.mydreamy.casestudies.cocome.autogui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 net.mydreamy.casestudies.cocome.autogui/requirementmodel/cocome.aird delete mode 100644 net.mydreamy.casestudies.cocome.autogui/requirementmodel/cocome.remodel delete mode 100644 net.mydreamy.casestudies.cocome/.classpath delete mode 100644 net.mydreamy.casestudies.cocome/.gitignore delete mode 100644 net.mydreamy.casestudies.cocome/.project delete mode 100644 net.mydreamy.casestudies.cocome/.settings/org.eclipse.jdt.core.prefs delete mode 100644 net.mydreamy.casestudies.cocome/META-INF/MANIFEST.MF delete mode 100644 net.mydreamy.casestudies.cocome/build.properties delete mode 100644 net.mydreamy.casestudies.cocome/requirementmodel/cocome.remodel delete mode 100644 net.mydreamy.casestudies.cocome/src/net/mydreamy/casestudies/cocome/Activator.java delete mode 100644 net.mydreamy.casestudies.cocome/src/net/mydreamy/casestudies/cocome/test/MainTest.java rename net.mydreamy.casestudies.library.autogui/{src-gen => src/test/java}/gui/MainTest.java (94%) delete mode 100644 net.mydreamy.casestudies.library/.classpath delete mode 100644 net.mydreamy.casestudies.library/.gitignore delete mode 100644 net.mydreamy.casestudies.library/.project delete mode 100644 net.mydreamy.casestudies.library/.settings/org.eclipse.jdt.core.prefs delete mode 100644 net.mydreamy.casestudies.library/META-INF/MANIFEST.MF delete mode 100644 net.mydreamy.casestudies.library/build.properties delete mode 100644 net.mydreamy.casestudies.library/requirementmodel/library.remodel delete mode 100644 net.mydreamy.casestudies.library/src/net/mydreamy/casestudies/library/Activator.java delete mode 100644 net.mydreamy.casestudies.library/src/net/mydreamy/casestudies/test/MainTest.java rename net.mydreamy.casestudies.loan.autogui/{src-gen => src/test/java}/gui/MainTest.java (89%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a981232 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.jar +.DS_Store +**/target/ +src-gen +!MainTest.java +!ThirdPartServices.java +!ThirdPartServicesImpl.java \ No newline at end of file diff --git a/net.mydreamy.casestudies.atm.autogui/.classpath b/net.mydreamy.casestudies.atm.autogui/.classpath index 311fb7c..5877937 100644 --- a/net.mydreamy.casestudies.atm.autogui/.classpath +++ b/net.mydreamy.casestudies.atm.autogui/.classpath @@ -1,34 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net.mydreamy.casestudies.atm.autogui/pom.xml b/net.mydreamy.casestudies.atm.autogui/pom.xml index 748ab38..1fc40ed 100644 --- a/net.mydreamy.casestudies.atm.autogui/pom.xml +++ b/net.mydreamy.casestudies.atm.autogui/pom.xml @@ -55,6 +55,30 @@ + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + gui.Main + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M1 + + gui.MainTest + + + diff --git a/net.mydreamy.casestudies.atm.autogui/src-gen/gui/MainTest.java b/net.mydreamy.casestudies.atm.autogui/src/test/java/gui/MainTest.java similarity index 96% rename from net.mydreamy.casestudies.atm.autogui/src-gen/gui/MainTest.java rename to net.mydreamy.casestudies.atm.autogui/src/test/java/gui/MainTest.java index a257a1d..4af0e01 100644 --- a/net.mydreamy.casestudies.atm.autogui/src-gen/gui/MainTest.java +++ b/net.mydreamy.casestudies.atm.autogui/src/test/java/gui/MainTest.java @@ -16,6 +16,7 @@ import org.testfx.matcher.control.TableViewMatchers; import org.testfx.matcher.control.TextMatchers; +import gui.Main; import javafx.scene.control.TextField; import javafx.scene.control.TitledPane; import javafx.scene.input.KeyCode; @@ -42,8 +43,7 @@ public class MainTest extends ApplicationTest { } - @Test - @Ignore + public void TestTwoTabs() { //add delay for less power computer @@ -53,7 +53,7 @@ public void TestTwoTabs() { sleep(1000); - clickOn("System Status"); + clickOn("System State"); sleep(1000); @@ -93,7 +93,7 @@ public void a_TestPrepareData() { sleep(1000); - clickOn("System Status"); + clickOn("System State"); clickOn("User"); @@ -136,7 +136,7 @@ public void a_TestPrepareData() { sleep(1000); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.UP); @@ -182,8 +182,8 @@ public void b_TestWithDraw() { FxAssert.verifyThat((TitledPane)lookup("#operation_return_pane").query(), NodeMatchers.isNotNull()); FxAssert.verifyThat(((TitledPane)lookup("#operation_return_pane").query()).getContent(), NodeMatchers.hasText("true")); - //check system status of balances - clickOn("System Status").clickOn("BankCard").sleep(1000); + //check System State of balances + clickOn("System State").clickOn("BankCard").sleep(1000); //print recipt clickOn("System Function").clickOn("printReceipt").clickOn("#execute").sleep(1000); @@ -226,8 +226,8 @@ public void c_TestDeposit() { FxAssert.verifyThat((TitledPane)lookup("#operation_return_pane").query(), NodeMatchers.isNotNull()); FxAssert.verifyThat(((TitledPane)lookup("#operation_return_pane").query()).getContent(), NodeMatchers.hasText("true")); - //check system status of balances - clickOn("System Status").clickOn("BankCard").sleep(1000); + //check System State of balances + clickOn("System State").clickOn("BankCard").sleep(1000); //print recipt clickOn("System Function").clickOn("printReceipt").clickOn("#execute").sleep(1000); diff --git a/net.mydreamy.casestudies.atm/.project b/net.mydreamy.casestudies.atm/.project deleted file mode 100644 index b0cbeb1..0000000 --- a/net.mydreamy.casestudies.atm/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - net.mydreamy.casestudies.atm - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.sirius.nature.modelingproject - org.eclipse.pde.PluginNature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/net.mydreamy.casestudies.atm/META-INF/MANIFEST.MF b/net.mydreamy.casestudies.atm/META-INF/MANIFEST.MF deleted file mode 100644 index 50b5202..0000000 --- a/net.mydreamy.casestudies.atm/META-INF/MANIFEST.MF +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Atm -Bundle-SymbolicName: net.mydreamy.casestudies.atm -Bundle-Version: 1.0.0.qualifier -Bundle-ActivationPolicy: lazy diff --git a/net.mydreamy.casestudies.atm/build.properties b/net.mydreamy.casestudies.atm/build.properties deleted file mode 100644 index 5f22cdd..0000000 --- a/net.mydreamy.casestudies.atm/build.properties +++ /dev/null @@ -1 +0,0 @@ -bin.includes = META-INF/ diff --git a/net.mydreamy.casestudies.atm/requirementmodel/atm.aird b/net.mydreamy.casestudies.atm/requirementmodel/atm.aird deleted file mode 100644 index 6fac46d..0000000 --- a/net.mydreamy.casestudies.atm/requirementmodel/atm.aird +++ /dev/null @@ -1,1436 +0,0 @@ - - - - atm.remodel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - italic - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - italic - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - italic - bold - - - - - - - - - bold - - - - - - - - - - bold - - - - - - - - - - bold - - - - - - - - - - - diff --git a/net.mydreamy.casestudies.atm/requirementmodel/atm.remodel b/net.mydreamy.casestudies.atm/requirementmodel/atm.remodel deleted file mode 100644 index 13255fe..0000000 --- a/net.mydreamy.casestudies.atm/requirementmodel/atm.remodel +++ /dev/null @@ -1,165 +0,0 @@ -Actor User { - - UC::WithdrawCash() include cardIdentification - UC::CheckBalance() include cardIdentification - UC::depositFunds() - -} - -Actor Administrator { - - UC::createBankCard() - UC::queryBankCard() - UC::modifyBankCard() - UC::deleteBankCard() - - UC::createUser() - UC::queryUser() - UC::modifyUser() - UC::deleteUser() - -} - -UC::cardIdentification() - - -Service ATMSystem { - - [Operation] - checkBalance() - deposit(quantity) - inputCard(cardID) - inputPassword(password) - printReceipt() - ejectCard() - withDraw(quantity) - - [TempProperty] - CardIDValidated : Boolean - PasswordValidated : Boolean - InputCard : BankCard - WithdrawedNumber : Integer - -} - -Service EntityCURDService { - - [Operation] - createBankCard(cardid, password, cardstatus, balance) - queryBankCard(CardID) - modifyBankCard(cardid, password, cardstatus, balance) - deleteBankCard(CardID) - - createUser(userid, name, address) - queryUser(UserID) - modifyUser(userid, name, address) - deleteUser(UserID) - -} - - -Interaction WithdrawCashInteraction { - - [Participants: User ATMSystem] - - CallMessage::callMessage1(inputCard callMessage1SendingEnd -> execution1StartEnd) - ReturnMessage::callMessage1Return(execution1FinishEnd -> callMessage1ReturnReceivingEnd callMessage1) - CallMessage::callMessage3(inputPassword callMessage3SendingEnd -> execution2StartEnd) - ReturnMessage::callMessage3Return(execution2FinishEnd -> callMessage3ReturnReceivingEnd callMessage3) - CallMessage::callMessage5(withDraw callMessage5SendingEnd -> execution3StartEnd) - ReturnMessage::callMessage5Return(execution3FinishEnd -> callMessage5ReturnReceivingEnd callMessage5) - CallMessage::callMessage7(printReceipt callMessage7SendingEnd -> execution4StartEnd) - ReturnMessage::callMessage7Return(execution4FinishEnd -> callMessage7ReturnReceivingEnd callMessage7) - CallMessage::callMessage9(ejectCard callMessage9SendingEnd -> execution5StartEnd) - ReturnMessage::callMessage9Return(execution5FinishEnd -> callMessage9ReturnReceivingEnd callMessage9) - - Execution::execution1(ATMSystem execution1StartEnd execution1FinishEnd) - Execution::execution2(ATMSystem execution2StartEnd execution2FinishEnd) - Execution::execution3(ATMSystem execution3StartEnd execution3FinishEnd) - Execution::execution4(ATMSystem execution4StartEnd execution4FinishEnd) - Execution::execution5(ATMSystem execution5StartEnd execution5FinishEnd) - - CombinedFragment:: combinedFragement1 -> alt { - - [Participants: User ATMSystem] - - combinedFragement1StartEnd -> combinedFragement1FinishEnd - - Operand::condition1(condition1End condition3End) - Operand::condition2(condition2End combinedFragement1FinishEnd) - Operand::condition3(condition3End combinedFragement1FinishEnd) - } - - MessageEnd::callMessage1SendingEnd(User callMessage1) - ExecutionEnd::execution1StartEnd(ATMSystem execution1) - ExecutionEnd::execution1FinishEnd(ATMSystem execution1) - MessageEnd::callMessage1ReturnReceivingEnd(User callMessage1Return) - MessageEnd::callMessage3SendingEnd(User callMessage3) - ExecutionEnd::execution2StartEnd(ATMSystem execution2) - ExecutionEnd::execution2FinishEnd(ATMSystem execution2) - MessageEnd::callMessage3ReturnReceivingEnd(User callMessage3Return) - MessageEnd::callMessage5SendingEnd(User callMessage5) - ExecutionEnd::execution3StartEnd(ATMSystem execution3) - ExecutionEnd::execution3FinishEnd(ATMSystem execution3) - MessageEnd::callMessage5ReturnReceivingEnd(User callMessage5Return) - MessageEnd::callMessage7SendingEnd(User callMessage7) - ExecutionEnd::execution4StartEnd(ATMSystem execution4) - ExecutionEnd::execution4FinishEnd(ATMSystem execution4) - MessageEnd::callMessage7ReturnReceivingEnd(User callMessage7Return) - MessageEnd::callMessage9SendingEnd(User callMessage9) - ExecutionEnd::execution5StartEnd(ATMSystem execution5) - ExecutionEnd::execution5FinishEnd(ATMSystem execution5) - MessageEnd::callMessage9ReturnReceivingEnd(User callMessage9Return) - CombinedFragmentEnd::combinedFragement1StartEnd(combinedFragement1) - OperandEnd::condition1End(condition1) - OperandEnd::condition3End(condition3) - OperandEnd::condition2End(condition2) - CombinedFragmentEnd::combinedFragement1FinishEnd(combinedFragement1) - -} - -@AutoCRUD -Entity BankCard { - - CardID : String - Password : String - CardStatus : CardStatus[NORMAL|SUSPEND|CANNEL] - balance : Real - - [Refer] - belongedUser : User - has : Transcation* - -} - -Entity DespositCard extends BankCard { - -} - -Entity CreditCard extends BankCard { - -} - -@AutoCRUD -Entity User { - - UserID : Integer - Name : String - Address : String - - [Refer] - ownedCard : BankCard* - -} - -Entity Transcation { - - WithdrawedNum : Integer - BalanceAfterWithdraw : Real - - [Refer] - involvedCard : BankCard - -} - - diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/.settings/org.eclipse.jdt.core.prefs b/net.mydreamy.casestudies.cocome.autogui.refined/.settings/org.eclipse.jdt.core.prefs index 672496e..8445b6b 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/.settings/org.eclipse.jdt.core.prefs +++ b/net.mydreamy.casestudies.cocome.autogui.refined/.settings/org.eclipse.jdt.core.prefs @@ -9,4 +9,5 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml b/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml index b271e25..f0704aa 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml +++ b/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml @@ -5,7 +5,7 @@ 1.0.0-SNAPSHOT src-gen - + src-gen @@ -89,10 +89,6 @@ - - - - org.codehaus.mojo exec-maven-plugin diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/src/test/java/gui/MainTest.java b/net.mydreamy.casestudies.cocome.autogui.refined/src/test/java/gui/MainTest.java index 7d89595..242c2d6 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/src/test/java/gui/MainTest.java +++ b/net.mydreamy.casestudies.cocome.autogui.refined/src/test/java/gui/MainTest.java @@ -65,7 +65,7 @@ public void TestTwoTabs() { sleep(1000); - clickOn("System Status"); + clickOn("System State"); sleep(1000); @@ -150,7 +150,7 @@ public void returnTable(String attribute, String value, int order) { public void loadData() { - clickOn("System Status"); + clickOn("System State"); clickOn("Load Status"); sleep(1000); type(KeyCode.DOWN); @@ -160,7 +160,7 @@ public void loadData() { public void saveData() { - clickOn("System Status"); + clickOn("System State"); clickOn("Save Status"); sleep(2000); type(KeyCode.C); @@ -176,7 +176,7 @@ public void saveData() { public void saveDataFinal() { - clickOn("System Status"); + clickOn("System State"); clickOn("Save Status"); sleep(2000); type(KeyCode.C); @@ -205,14 +205,17 @@ public void test_PrepareData() { //create cashdesk new FxRobot().doubleClickOn("manageCashDesk").clickOn("createCashDesk").type(KeyCode.TAB).type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("CashDeskA").clickOn("#execute"); returnTrue(); + new FxRobot().doubleClickOn("manageCashDesk"); //create cashdesk new FxRobot().doubleClickOn("manageCashier").clickOn("createCashier").type(KeyCode.TAB).type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("Alice").clickOn("#execute"); returnTrue(); + new FxRobot().doubleClickOn("manageCashier"); //create catalog new FxRobot().doubleClickOn("manageProductCatalog").clickOn("createProductCatalog").type(KeyCode.TAB).type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("Fruits").clickOn("#execute"); returnTrue(); + new FxRobot().doubleClickOn("manageProductCatalog"); //create item new FxRobot().doubleClickOn("manageItem").clickOn("createItem").type(KeyCode.TAB).type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("Apple").type(KeyCode.TAB).write("10").type(KeyCode.TAB).write("1000").type(KeyCode.TAB).write("6").clickOn("#execute"); @@ -221,6 +224,7 @@ public void test_PrepareData() { returnTrue(); new FxRobot().clickOn("createItem").type(KeyCode.TAB).type(KeyCode.TAB).write("3").type(KeyCode.TAB).write("Peach").type(KeyCode.TAB).write("12").type(KeyCode.TAB).write("0").type(KeyCode.TAB).write("8").clickOn("#execute"); returnTrue(); + new FxRobot().doubleClickOn("manageItem"); //create supplier new FxRobot().doubleClickOn("manageSupplier").clickOn("createSupplier").type(KeyCode.TAB).type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("UM").clickOn("#execute"); @@ -228,7 +232,7 @@ public void test_PrepareData() { //Check value - clickOn("System Status"); + clickOn("System State"); clickOn("Store"); validateAttribute("Id", "1"); @@ -272,7 +276,7 @@ public void test_OpenStoreAndCashiDesk() { clickOn("System Function"); new FxRobot().clickOn("#storemanager").sleep(1000).clickOn("openStore").doubleClickOn("#operation_paras").write("1").clickOn("#execute").sleep(500); returnTrue(); - clickOn("System Status"); + clickOn("System State"); clickOn("Store"); validateAttribute("IsOpened", "true"); sleep(1500); @@ -281,7 +285,7 @@ public void test_OpenStoreAndCashiDesk() { clickOn("System Function"); new FxRobot().clickOn("#cashier").sleep(1000).clickOn("openCashDesk").clickOn("#operation_paras").write("1").clickOn("#execute").sleep(500); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN); @@ -302,7 +306,7 @@ public void test_ProcessSale_CashPay() { clickOn("System Function"); new FxRobot().clickOn("#storemanager").sleep(1000).clickOn("openStore").doubleClickOn("#operation_paras").write("1").clickOn("#execute").sleep(500); returnTrue(); - clickOn("System Status"); + clickOn("System State"); clickOn("Store"); validateAttribute("IsOpened", "true"); sleep(1500); @@ -311,7 +315,7 @@ public void test_ProcessSale_CashPay() { clickOn("System Function"); new FxRobot().clickOn("#cashier").sleep(1000).clickOn("openCashDesk").clickOn("#operation_paras").write("1").clickOn("#execute").sleep(500); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN); @@ -324,7 +328,7 @@ public void test_ProcessSale_CashPay() { clickOn("System Function"); new FxRobot().doubleClickOn("processSale").clickOn("makeNewSale").clickOn("#execute"); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN); @@ -336,7 +340,7 @@ public void test_ProcessSale_CashPay() { clickOn("System Function"); new FxRobot().clickOn("enterItem").clickOn("#operation_paras").write("1").type(KeyCode.TAB).write("10").clickOn("#execute"); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN); @@ -348,7 +352,7 @@ public void test_ProcessSale_CashPay() { clickOn("System Function"); new FxRobot().clickOn("enterItem").doubleClickOn("#operation_paras").write("2").type(KeyCode.TAB).write("2").clickOn("#execute"); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.UP); @@ -362,7 +366,7 @@ public void test_ProcessSale_CashPay() { new FxRobot().clickOn("endSale").clickOn("#execute"); returnValue("160.0"); sleep(1000); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.UP); @@ -377,7 +381,7 @@ public void test_ProcessSale_CashPay() { new FxRobot().clickOn("makeCashPayment").doubleClickOn("#operation_paras").write("200").clickOn("#execute"); returnTrue(); sleep(1000); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN, 5); @@ -393,7 +397,7 @@ public void test_ProcessSale_CashPay() { } - @Test + public void test_ProcessSale_CardPay() { if (integrationTest == false) { @@ -405,7 +409,7 @@ public void test_ProcessSale_CardPay() { clickOn("System Function"); new FxRobot().clickOn("#storemanager").sleep(1000).clickOn("openStore").doubleClickOn("#operation_paras").write("1").clickOn("#execute").sleep(500); returnTrue(); - clickOn("System Status"); + clickOn("System State"); clickOn("Store"); validateAttribute("IsOpened", "true"); sleep(1500); @@ -414,7 +418,7 @@ public void test_ProcessSale_CardPay() { clickOn("System Function"); new FxRobot().clickOn("#cashier").sleep(1000).clickOn("openCashDesk").clickOn("#operation_paras").write("1").clickOn("#execute").sleep(500); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN); @@ -427,7 +431,7 @@ public void test_ProcessSale_CardPay() { clickOn("System Function"); new FxRobot().doubleClickOn("processSale").clickOn("makeNewSale").clickOn("#execute"); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN); @@ -439,7 +443,7 @@ public void test_ProcessSale_CardPay() { clickOn("System Function"); new FxRobot().clickOn("enterItem").clickOn("#operation_paras").write("1").type(KeyCode.TAB).write("10").clickOn("#execute"); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN); @@ -451,7 +455,7 @@ public void test_ProcessSale_CardPay() { clickOn("System Function"); new FxRobot().clickOn("enterItem").doubleClickOn("#operation_paras").write("2").type(KeyCode.TAB).write("2").clickOn("#execute"); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.UP); @@ -465,7 +469,7 @@ public void test_ProcessSale_CardPay() { new FxRobot().clickOn("endSale").clickOn("#execute"); returnValue("160.0"); sleep(1000); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.UP); @@ -480,7 +484,7 @@ public void test_ProcessSale_CardPay() { new FxRobot().clickOn("makeCardPayment").type(KeyCode.TAB, 4).write("23124331222122316540").type(KeyCode.TAB).write("2018-08-10").type(KeyCode.TAB).write("40").clickOn("#execute"); returnTrue(); sleep(1000); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB); type(KeyCode.TAB); type(KeyCode.DOWN, 6); @@ -497,7 +501,7 @@ public void test_ProcessSale_CardPay() { } - @Test + public void test_ProductManagers() { if (integrationTest == false) { @@ -518,7 +522,7 @@ public void test_ProductManagers() { returnTrue(); //check order - clickOn("System Status"); + clickOn("System State"); clickOn("OrderProduct"); validateAttribute("OrderStatus", "NEW"); sleep(1000); @@ -533,7 +537,7 @@ public void test_ProductManagers() { returnTrue(); //check order item - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB, 2); type(KeyCode.UP, 2); validateAttribute("Quantity", "1000"); @@ -545,7 +549,7 @@ public void test_ProductManagers() { new FxRobot().clickOn("chooseSupplier").doubleClickOn("#operation_paras").write("1").clickOn("#execute").sleep(1000); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB, 2); type(KeyCode.DOWN, 2); validateAssociation("Supplier", 1); @@ -556,7 +560,7 @@ public void test_ProductManagers() { new FxRobot().clickOn("placeOrder").clickOn("#execute").sleep(1000); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB, 2); type(KeyCode.UP, 1); type(KeyCode.DOWN, 1); @@ -568,7 +572,7 @@ public void test_ProductManagers() { new FxRobot().clickOn("receiveOrderedProduct").doubleClickOn("#operation_paras").write("1").clickOn("#execute").sleep(1000); returnTrue(); - clickOn("System Status"); + clickOn("System State"); type(KeyCode.TAB, 2); type(KeyCode.UP, 1); type(KeyCode.DOWN, 1); diff --git a/net.mydreamy.casestudies.cocome.autogui/.classpath b/net.mydreamy.casestudies.cocome.autogui/.classpath deleted file mode 100644 index c3f9fe8..0000000 --- a/net.mydreamy.casestudies.cocome.autogui/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/net.mydreamy.casestudies.cocome.autogui/.project b/net.mydreamy.casestudies.cocome.autogui/.project deleted file mode 100644 index 5770f7c..0000000 --- a/net.mydreamy.casestudies.cocome.autogui/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - net.mydreamy.casestudies.cocome.autogui - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/net.mydreamy.casestudies.cocome.autogui/.settings/org.eclipse.jdt.core.prefs b/net.mydreamy.casestudies.cocome.autogui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 3a21537..0000000 --- a/net.mydreamy.casestudies.cocome.autogui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/net.mydreamy.casestudies.cocome.autogui/requirementmodel/cocome.aird b/net.mydreamy.casestudies.cocome.autogui/requirementmodel/cocome.aird deleted file mode 100644 index 357aa4d..0000000 --- a/net.mydreamy.casestudies.cocome.autogui/requirementmodel/cocome.aird +++ /dev/null @@ -1,3687 +0,0 @@ - - - - cocome.remodel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - italic - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - italic - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - italic - bold - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - italic - bold - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - italic - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - borderSize - borderLineStyle - bold - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - italic - bold - - - - - - - - - bold - - - - - - - - - - - italic - bold - - - - - - - - - bold - - - - - - - - - - bold - - - - - - - - - - - - - bold - - - - - - - - - - - - bold - - - - - - - - - - - - bold - - - - - - - - - - - - bold - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - bold - - - - - - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - - - - - - - - - bold - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/net.mydreamy.casestudies.cocome.autogui/requirementmodel/cocome.remodel b/net.mydreamy.casestudies.cocome.autogui/requirementmodel/cocome.remodel deleted file mode 100644 index 26f7fb5..0000000 --- a/net.mydreamy.casestudies.cocome.autogui/requirementmodel/cocome.remodel +++ /dev/null @@ -1,940 +0,0 @@ -Actor Cashier { - - UC::processSale() - -} - -Actor Administrator { - - UC::createStore() - UC::queryStore() - UC::modifyStore() - UC::deleteStore() - - UC::createProductCatalog() - UC::queryProductCatalog() - UC::modifyProductCatalog() - UC::deleteProductCatalog() - - UC::createCashDesk() - UC::queryCashDesk() - UC::modifyCashDesk() - UC::deleteCashDesk() - - UC::createCashier() - UC::queryCashier() - UC::modifyCashier() - UC::deleteCashier() - - UC::createItem() - UC::queryItem() - UC::modifyItem() - UC::deleteItem() - -} - - -Service CoCoMEProcessSale { - - [Operation] - makeNewSale() - enterItem(barcode, quantity) - endSale() - makeCashPayment(amount) - makeCardPayment(cardAccountNumber, expiryDate) - - [TempProperty] - currentSaleLine : SalesLineItem - currentSale : Sale - currentCashDesk : CashDesk - currentStore : Store - currentPaymentMethod : PaymentMethod[CASH|CARD] - - [WorkFlow] - ProcessSaleWF -} - -Service ThridPartServices { - - [Operation] - thirdPartyCardPaymentService(cdp, expiryDate, fee) - -} - -Service EntityCURDService { - - [Operation] - createStore(id, name, address) - queryStore(Id) - modifyStore(id, name, address) - deleteStore(Id) - - createProductCatalog(id, name) - queryProductCatalog(Id) - modifyProductCatalog(id, name) - deleteProductCatalog(Id) - - createCashDesk(id) - queryCashDesk(Id) - modifyCashDesk(id) - deleteCashDesk(Id) - - createCashier(id, name) - queryCashier(Id) - modifyCashier(id, name) - deleteCashier(Id) - - createItem(barcode, description, price) - queryItem(Barcode) - modifyItem(barcode, description, price) - deleteItem(Barcode) - -} - - -/* System Work Flow, Not for runing, protocol for Actor inter-active with System */ -Workflow ProcessSaleWF { - - [Cashier ThridPartServices] - - Cashier { - - ActivityStart - - makeNewSale - - Loop -> hasMoreItems { - - enterItem - } - - endSale - - Switch -> newCondition { - - case: cash -> makeCashPayment - case: card -> makeCardPayment - } - - ActivityFinal - - } - - ThridPartServices { - - thirdPartyCardPaymentService - - } - -} - -//Workflow ProcessSaleWF { -// -// [Cashier ThridPartServices] -// -// Cashier { -// -// ActivityStart -// -// makeNewSale -// -// endSale -// -// ForkNode -> (createCashDesk createStore hasMoreItems newCondition) -// -// createCashDesk -// -// createStore -// -// Loop -> hasMoreItems { -// -// enterItem -// } -// -// Switch -> newCondition { -// -// case: case1 -> createProductCatalog -// case: case2 -> createProductCatalog -// } -// -// (createCashDesk createProductCatalog createProductCatalog hasMoreItems createStore) -> JoinNode -// -// ActivityFinal -// -// } -// -// ThridPartServices { -// -// thirdPartyCardPaymentService -// -// } -// -//} -Interaction ProcessSaleInteraction { - - [Participants: Cashier CoCoMEProcessSale] - - CallMessage::makeNewSale(makeNewSale makeNewSaleSender->makeNewSaleStart) - ReturnMessage::makeNewSaleReturn(makeNewSaleFinish->makeNewSaleReturnReceiver makeNewSale) - CallMessage::enterItem(enterItem enterItemSender->enterItemStart) - ReturnMessage::enterItemReturn(enterItemFinish->enterItemReturnReceiver enterItem) - CallMessage::endSale(endSale endSaleSender->endSaleStart) - ReturnMessage::endSaleReturn(endSaleFinish->endSaleReturnReceiver endSale) - CallMessage::makeCashPayment(makeCashPayment makeCashPaymentSender->makeCashPaymentStart) - ReturnMessage::makeCashPaymentReturn(makeCashPaymentFinish->makeCashPaymentReturnReceiver makeCashPayment) - CallMessage::makeCardPayment(makeCardPayment makeCardPaymentSender->makeCardPaymentStart) - ReturnMessage::makeCardPaymentReturn(makeCardPaymentFinish->makeCardPaymentReturnReceiver makeCardPayment) - - Execution::makeNewSale(CoCoMEProcessSale makeNewSaleStart makeNewSaleFinish) - Execution::enterItem(CoCoMEProcessSale enterItemStart enterItemFinish) - Execution::endSale(CoCoMEProcessSale endSaleStart endSaleFinish) - Execution::makeCashPayment(CoCoMEProcessSale makeCashPaymentStart makeCashPaymentFinish) - Execution::makeCardPayment(CoCoMEProcessSale makeCardPaymentStart makeCardPaymentFinish) - - CombinedFragment::enterItemLoop->loop { - - [Participants: Cashier CoCoMEProcessSale] - - enterItemLoopStart->enterItemLoopFinish - - Operand::hasMoreItems(hasMoreItemsStart enterItemLoopFinish) - } - - CombinedFragment::PaymentMethodAlt->alt { - - [Participants: Cashier CoCoMEProcessSale] - - PaymentMethodAltStart->PaymentMethodAltFinish - - Operand::Cash(CashStart CardStart) - Operand::Card(CardStart PaymentMethodAltFinish) - } - - MessageEnd::makeNewSaleSender(Cashier makeNewSale) - ExecutionEnd::makeNewSaleStart(CoCoMEProcessSale makeNewSale) - ExecutionEnd::makeNewSaleFinish(CoCoMEProcessSale makeNewSale) - MessageEnd::makeNewSaleReturnReceiver(Cashier makeNewSaleReturn) - CombinedFragmentEnd::enterItemLoopStart(enterItemLoop) - OperandEnd::hasMoreItemsStart(hasMoreItems) - MessageEnd::enterItemSender(Cashier enterItem) - ExecutionEnd::enterItemStart(CoCoMEProcessSale enterItem) - ExecutionEnd::enterItemFinish(CoCoMEProcessSale enterItem) - MessageEnd::enterItemReturnReceiver(Cashier enterItemReturn) - CombinedFragmentEnd::enterItemLoopFinish(enterItemLoop) - MessageEnd::endSaleSender(Cashier endSale) - ExecutionEnd::endSaleStart(CoCoMEProcessSale endSale) - ExecutionEnd::endSaleFinish(CoCoMEProcessSale endSale) - MessageEnd::endSaleReturnReceiver(Cashier endSaleReturn) - CombinedFragmentEnd::PaymentMethodAltStart(PaymentMethodAlt) - OperandEnd::CashStart(Cash) - MessageEnd::makeCashPaymentSender(Cashier makeCashPayment) - ExecutionEnd::makeCashPaymentStart(CoCoMEProcessSale makeCashPayment) - ExecutionEnd::makeCashPaymentFinish(CoCoMEProcessSale makeCashPayment) - MessageEnd::makeCashPaymentReturnReceiver(Cashier makeCashPaymentReturn) - OperandEnd::CardStart(Card) - MessageEnd::makeCardPaymentSender(Cashier makeCardPayment) - ExecutionEnd::makeCardPaymentStart(CoCoMEProcessSale makeCardPayment) - ExecutionEnd::makeCardPaymentFinish(CoCoMEProcessSale makeCardPayment) - MessageEnd::makeCardPaymentReturnReceiver(Cashier makeCardPaymentReturn) - CombinedFragmentEnd::PaymentMethodAltFinish(PaymentMethodAlt) - -} - -@AutoCRUD -Entity Store { - - Id : Integer - Name : String - Address : String - - [Refer] - Cashdeskes : CashDesk* - Productcatalogs : ProductCatalog* - Items : Item* - Cashiers : Cashier* - Sales : Sale* - -} - -@AutoCRUD -Entity ProductCatalog { - - Id : Integer - Name : String - - [Refer] - ContainedItems : Item* - -} - -@AutoCRUD -Entity CashDesk { - - Id : Integer - - [Refer] - ContainedSales : Sale* - BelongedStore : Store - -} - -Entity Sale { - - Time : Date - IsComplete: Boolean - Amount : Real - IsReadytoPay : Boolean - - [Refer] - Belongedstore : Store - BelongedCashDesk : CashDesk - ContainedSalesLine : SalesLineItem* - AssoicatedPayment : Payment - -} - -@AutoCRUD -Entity Cashier { - - Id : Integer - Name : String - - [Refer] - WorkedStore : Store - -} - -Entity SalesLineItem { - - Quantity : Integer - Subamount : Real - - [Refer] - BelongedSale : Sale - BelongedItem : Item - -} - -@AutoCRUD -Entity Item { - - Barcode : Integer - Description : String - Price : Real - - StockNumber : Integer - - [Refer] - BelongedCatalog : ProductCatalog - -} - -Entity Payment { - - AmountTendered : Real - - [Refer] - BelongedSale : Sale - -} - -Entity CashPayment extends Payment { - - Balance : Real - -} - -Entity CardPayment extends Payment { - - CardAccountNumber : String - ExpiryDate : Date - -} - -Contract CoCoMEProcessSale::makeNewSale() : Boolean { - - /* preconditions: none */ - precondition: - true - - /* postconditions: - * A sale instance s was created (instance creation). - * s was associated with the current CashDesk (association formed) - * Attribute IsComplete of s was initialized as false. (object initialization) - * currentSale became s - */ - postcondition: - let s:Sale in - s.oclIsNew() and - s.BelongedCashDesk = currentCashDesk and - currentCashDesk.ContainedSales->includes(s) and - s.IsComplete = false and - s.IsReadytoPay = false and - self.currentSale = s and - result = true -} - -Contract CoCoMEProcessSale::enterItem(barcode : Integer, quantity : Integer) : Boolean { - - /* Definition: find specific Item instance by barcode */ - definition: - item:Item = Item.allInstance()->any(i:Item | i.Barcode = barcode) - - /* Precondition: there is a sale underway */ - precondition: - currentSale.IsComplete = false - - /** - * A salesLineItem instance sli was created (instance creation). - * sli was associated with the current Sale (association formed). - * sli.quantity became quantity (attribute modification). - * sli was associated with a Item (association formed). - * subamount became item.price * quantity - */ - postcondition: - let sli:SalesLineItem in - sli.oclIsNew() and - self.currentSaleLine = sli and - sli.BelongedSale = currentSale and - currentSale.ContainedSalesLine->includes(sli) and - sli.Quantity = quantity and - sli.BelongedItem = item and - sli.Subamount = item.Price * quantity and - result = true - -} - -Contract CoCoMEProcessSale::endSale() : Boolean { - - /* Precondition: there is a sale underway and no more items. */ - precondition: - currentSale.IsComplete = false and - currentSale.IsReadytoPay = false - - /** - * Postcondition: - * add all sub amount of SalesLineItem up to the Amount of currentSale (compute amount). - * currentSale.IsReadytoPay became true - */ - postcondition: - currentSale.ContainedSalesLine->forAll(sl:SalesLineItem | - currentSale.Amount = currentSale.Amount@pre + sl.Subamount) - and - currentSale.IsReadytoPay = true and - result = true -} - -Contract CoCoMEProcessSale::makeCashPayment(amount : Real) : Boolean { - - /* Precondition: There is a sale underway, the sale is ready to pay, and tendered amount is greater than or equal to the amount of current Sale*/ - precondition: - currentSale.IsComplete = false and - currentSale.IsReadytoPay = true and - amount >= currentSale.Amount - - /** - * A CashPayment instance cp was created (instance creation). - * cp.amountTendered became amount (attribute modification). - * cp was associated with the current Sale (association formed). - * The current Sale was associated with the Store (association formed). - * Sale.isComplete became true (attribute modification). - * Sale.time became now (attribute modification). - * cp.Balance became the value of tendered amount minus current Sale amount - */ - postcondition: - let cp:CashPayment in - cp.oclIsNew() and - cp.AmountTendered = amount and - cp.BelongedSale = currentSale and - currentSale.AssoicatedPayment = cp and - currentSale.Belongedstore = currentStore and - currentStore.Sales->includes(currentSale) and - currentSale.IsComplete = true and - currentSale.Time = Now and - cp.Balance = amount - currentSale.Amount and - result = true - -} - -Contract CoCoMEProcessSale::makeCardPayment(cardAccountNumber : String, expiryDate : Date, fee: Real) : Boolean { - - /* Precondition: An underway sale exists and all items have been entered. */ - precondition: - currentSale.IsComplete = false and - currentSale.IsReadytoPay = true - - /** - * a CardPayment cdp was created - * cdp was associated with the current Sale - * cdp.CardAccountNumber = cardAccountNumber, cdp.expiryDate = expiryDate - * invoke third party card payment service - * sale was associated with the Store as a completed sale - * The current sale is complete - * Sale.time became now - */ - postcondition: - let cdp:CardPayment in - cdp.oclIsNew() and - cdp.BelongedSale = currentSale and - currentSale.AssoicatedPayment = cdp and - cdp.CardAccountNumber = cardAccountNumber and - cdp.ExpiryDate = expiryDate and - thirdPartyCardPaymentService(cardAccountNumber, expiryDate, fee) and - currentSale.Belongedstore = currentStore and - currentStore.Sales->includes(currentSale) and - currentSale.IsComplete = true and - currentSale.Time = Now and - result = true - -} - -Contract ThridPartServices::thirdPartyCardPaymentService(cardAccountNumber : String, expiryDate : Date, fee : Real) : Boolean { - - precondition: - true - postcondition: - result = true -} - -//Contract CoCoMEManagement::createStore(store : Store) : Boolean { -// -// precondition: -// Store.allInstance()->excludes(store) -// postcondition: -// Store.allInstance()->includes(store) and -// result = true -// -//} -// -//Contract CoCoMEManagement::createCashDesk(cashdesk : CashDesk, storeid : Integer) : Boolean { -// -// definition: -// store:Store = Store.allInstance()->any(s:Store | s.Id = storeid) -// -// precondition: -// store.oclIsUndefined() = false and -// store.Cashdeskes->excludes(cashdesk) and -// CashDesk.allInstance()->excludes(cashdesk) -// postcondition: -// store.Cashdeskes->includes(cashdesk) and -// cashdesk.BelongedStore = store and -// CashDesk.allInstance()->includes(cashdesk) and -// result = true -// -//} -// -//Contract CoCoMEManagement::createProductCatalog(catalog : ProductCatalog) : Boolean { -// -// precondition: -// ProductCatalog.allInstance()->excludes(catalog) -// postcondition: -// ProductCatalog.allInstance()->includes(catalog) and -// result = true -//} -// -//Contract CoCoMEManagement::createItem(item : Item, catalogid : Integer) : Boolean { -// -// definition: -// catalog:ProductCatalog = ProductCatalog.allInstance()->any(pc:ProductCatalog | pc.Id = catalogid) -// -// precondition: -// catalog.oclIsUndefined() = false and -// catalog.ContainedItems->excludes(item) and -// Item.allInstance()->excludes(item) -// postcondition: -// item.BelongedCatalog = catalog and -// catalog.ContainedItems->includes(item) and -// Item.allInstance()->includes(item) and -// result = true -//} -// -// -//entity create operation -Contract EntityCURDService::createStore(id : Integer, name : String, address : String) : Boolean { - - /* definition: find specific Store instance by id */ - definition: - store:Store = Store.allInstance()->any(sto:Store | sto.Id = id) - - /* precondition: the instance store was not found in the system */ - precondition: - store.oclIsUndefined() = true - - /* postcondition: - * A Store instance sto was created. - * all properties of sto became the same values as inputs. - */ - postcondition: - let sto:Store in - sto.oclIsNew() and - sto.Id = id and - sto.Name = name and - sto.Address = address and - Store.allInstance()->includes(sto) and - result = true -} - -//entity query operation -Contract EntityCURDService::queryStore(id : Integer) : Store { - - /* definition: find specific Store instance by id */ - definition: - store:Store = Store.allInstance()->any(sto:Store | sto.Id = id) - - /* precondition: the instance store was found in the system */ - precondition: - store.oclIsUndefined() = false - - /* postcondition: return found the instance store */ - postcondition: - result = store -} - - -//entity modify operation -Contract EntityCURDService::modifyStore(id : Integer, name : String, address : String) : Boolean { - - /* definition: find specific Store instance by id */ - definition: - store:Store = Store.allInstance()->any(sto:Store | sto.Id = id) - - /* precondition: the instance store was found in the system */ - precondition: - store.oclIsUndefined() = false - - /* postcondition: all properties of sto became the same values as inputs. */ - postcondition: - store.Id = id and - store.Name = name and - store.Address = address and - result = true -} - -//entity delete operation -Contract EntityCURDService::deleteStore(id : Integer) : Boolean { - - /* definition: find specific Store instance by id */ - definition: - store:Store = Store.allInstance()->any(sto:Store | sto.Id = id) - - /* precondition: the instance store was found in the system */ - precondition: - store.oclIsUndefined() = false and - Store.allInstance()->includes(store) - - /* postcondition: the instance store was deleted from the system */ - postcondition: - Store.allInstance()->excludes(store) and - result = true -} - -//entity create operation -Contract EntityCURDService::createProductCatalog(id : Integer, name : String) : Boolean { - - /* definition: find specific ProductCatalog instance by id */ - definition: - productcatalog:ProductCatalog = ProductCatalog.allInstance()->any(pro:ProductCatalog | pro.Id = id) - - /* precondition: the instance productcatalog was not found in the system */ - precondition: - productcatalog.oclIsUndefined() = true - - /* postcondition: - * A ProductCatalog instance pro was created. - * all properties of pro became the same values as inputs. - */ - postcondition: - let pro:ProductCatalog in - pro.oclIsNew() and - pro.Id = id and - pro.Name = name and - ProductCatalog.allInstance()->includes(pro) and - result = true -} - -//entity query operation -Contract EntityCURDService::queryProductCatalog(id : Integer) : ProductCatalog { - - /* definition: find specific ProductCatalog instance by id */ - definition: - productcatalog:ProductCatalog = ProductCatalog.allInstance()->any(pro:ProductCatalog | pro.Id = id) - - /* precondition: the instance productcatalog was found in the system */ - precondition: - productcatalog.oclIsUndefined() = false - - /* postcondition: return found the instance productcatalog */ - postcondition: - result = productcatalog -} - - -//entity modify operation -Contract EntityCURDService::modifyProductCatalog(id : Integer, name : String) : Boolean { - - /* definition: find specific ProductCatalog instance by id */ - definition: - productcatalog:ProductCatalog = ProductCatalog.allInstance()->any(pro:ProductCatalog | pro.Id = id) - - /* precondition: the instance productcatalog was found in the system */ - precondition: - productcatalog.oclIsUndefined() = false - - /* postcondition: all properties of pro became the same values as inputs. */ - postcondition: - productcatalog.Id = id and - productcatalog.Name = name and - result = true -} - -//entity delete operation -Contract EntityCURDService::deleteProductCatalog(id : Integer) : Boolean { - - /* definition: find specific ProductCatalog instance by id */ - definition: - productcatalog:ProductCatalog = ProductCatalog.allInstance()->any(pro:ProductCatalog | pro.Id = id) - - /* precondition: the instance productcatalog was found in the system */ - precondition: - productcatalog.oclIsUndefined() = false and - ProductCatalog.allInstance()->includes(productcatalog) - - /* postcondition: the instance productcatalog was deleted from the system */ - postcondition: - ProductCatalog.allInstance()->excludes(productcatalog) and - result = true -} - -//entity create operation -Contract EntityCURDService::createCashDesk(id : Integer) : Boolean { - - /* definition: find specific CashDesk instance by id */ - definition: - cashdesk:CashDesk = CashDesk.allInstance()->any(cas:CashDesk | cas.Id = id) - - /* precondition: the instance cashdesk was not found in the system */ - precondition: - cashdesk.oclIsUndefined() = true - - /* postcondition: - * A CashDesk instance cas was created. - * all properties of cas became the same values as inputs. - */ - postcondition: - let cas:CashDesk in - cas.oclIsNew() and - cas.Id = id and - CashDesk.allInstance()->includes(cas) and - result = true -} - -//entity query operation -Contract EntityCURDService::queryCashDesk(id : Integer) : CashDesk { - - /* definition: find specific CashDesk instance by id */ - definition: - cashdesk:CashDesk = CashDesk.allInstance()->any(cas:CashDesk | cas.Id = id) - - /* precondition: the instance cashdesk was found in the system */ - precondition: - cashdesk.oclIsUndefined() = false - - /* postcondition: return found the instance cashdesk */ - postcondition: - result = cashdesk -} - - -//entity modify operation -Contract EntityCURDService::modifyCashDesk(id : Integer) : Boolean { - - /* definition: find specific CashDesk instance by id */ - definition: - cashdesk:CashDesk = CashDesk.allInstance()->any(cas:CashDesk | cas.Id = id) - - /* precondition: the instance cashdesk was found in the system */ - precondition: - cashdesk.oclIsUndefined() = false - - /* postcondition: all properties of cas became the same values as inputs. */ - postcondition: - cashdesk.Id = id and - result = true -} - -//entity delete operation -Contract EntityCURDService::deleteCashDesk(id : Integer) : Boolean { - - /* definition: find specific CashDesk instance by id */ - definition: - cashdesk:CashDesk = CashDesk.allInstance()->any(cas:CashDesk | cas.Id = id) - - /* precondition: the instance cashdesk was found in the system */ - precondition: - cashdesk.oclIsUndefined() = false and - CashDesk.allInstance()->includes(cashdesk) - - /* postcondition: the instance cashdesk was deleted from the system */ - postcondition: - CashDesk.allInstance()->excludes(cashdesk) and - result = true -} - -//entity create operation -Contract EntityCURDService::createCashier(id : Integer, name : String) : Boolean { - - /* definition: find specific Cashier instance by id */ - definition: - cashier:Cashier = Cashier.allInstance()->any(cas:Cashier | cas.Id = id) - - /* precondition: the instance cashier was not found in the system */ - precondition: - cashier.oclIsUndefined() = true - - /* postcondition: - * A Cashier instance cas was created. - * all properties of cas became the same values as inputs. - */ - postcondition: - let cas:Cashier in - cas.oclIsNew() and - cas.Id = id and - cas.Name = name and - Cashier.allInstance()->includes(cas) and - result = true -} - -//entity query operation -Contract EntityCURDService::queryCashier(id : Integer) : Cashier { - - /* definition: find specific Cashier instance by id */ - definition: - cashier:Cashier = Cashier.allInstance()->any(cas:Cashier | cas.Id = id) - - /* precondition: the instance cashier was found in the system */ - precondition: - cashier.oclIsUndefined() = false - - /* postcondition: return found the instance cashier */ - postcondition: - result = cashier -} - - -//entity modify operation -Contract EntityCURDService::modifyCashier(id : Integer, name : String) : Boolean { - - /* definition: find specific Cashier instance by id */ - definition: - cashier:Cashier = Cashier.allInstance()->any(cas:Cashier | cas.Id = id) - - /* precondition: the instance cashier was found in the system */ - precondition: - cashier.oclIsUndefined() = false - - /* postcondition: all properties of cas became the same values as inputs. */ - postcondition: - cashier.Id = id and - cashier.Name = name and - result = true -} - -//entity delete operation -Contract EntityCURDService::deleteCashier(id : Integer) : Boolean { - - /* definition: find specific Cashier instance by id */ - definition: - cashier:Cashier = Cashier.allInstance()->any(cas:Cashier | cas.Id = id) - - /* precondition: the instance cashier was found in the system */ - precondition: - cashier.oclIsUndefined() = false and - Cashier.allInstance()->includes(cashier) - - /* postcondition: the instance cashier was deleted from the system */ - postcondition: - Cashier.allInstance()->excludes(cashier) and - result = true -} - -//entity create operation -Contract EntityCURDService::createItem(barcode : Integer, description : String, price : Real) : Boolean { - - /* definition: find specific Item instance by barcode */ - definition: - item:Item = Item.allInstance()->any(ite:Item | ite.Barcode = barcode) - - /* precondition: the instance item was not found in the system */ - precondition: - item.oclIsUndefined() = true - - /* postcondition: - * A Item instance ite was created. - * all properties of ite became the same values as inputs. - */ - postcondition: - let ite:Item in - ite.oclIsNew() and - ite.Barcode = barcode and - ite.Description = description and - ite.Price = price and - Item.allInstance()->includes(ite) and - result = true -} - -//entity query operation -Contract EntityCURDService::queryItem(barcode : Integer) : Item { - - /* definition: find specific Item instance by barcode */ - definition: - item:Item = Item.allInstance()->any(ite:Item | ite.Barcode = barcode) - - /* precondition: the instance item was found in the system */ - precondition: - item.oclIsUndefined() = false - - /* postcondition: return found the instance item */ - postcondition: - result = item -} - - -//entity modify operation -Contract EntityCURDService::modifyItem(barcode : Integer, description : String, price : Real) : Boolean { - - /* definition: find specific Item instance by barcode */ - definition: - item:Item = Item.allInstance()->any(ite:Item | ite.Barcode = barcode) - - /* precondition: the instance item was found in the system */ - precondition: - item.oclIsUndefined() = false - - /* postcondition: all properties of ite became the same values as inputs. */ - postcondition: - item.Barcode = barcode and - item.Description = description and - item.Price = price and - result = true -} - -//entity delete operation -Contract EntityCURDService::deleteItem(barcode : Integer) : Boolean { - - /* definition: find specific Item instance by barcode */ - definition: - item:Item = Item.allInstance()->any(ite:Item | ite.Barcode = barcode) - - /* precondition: the instance item was found in the system */ - precondition: - item.oclIsUndefined() = false and - Item.allInstance()->includes(item) - - /* postcondition: the instance item was deleted from the system */ - postcondition: - Item.allInstance()->excludes(item) and - result = true -} - - - diff --git a/net.mydreamy.casestudies.cocome/.classpath b/net.mydreamy.casestudies.cocome/.classpath deleted file mode 100644 index 4cc715d..0000000 --- a/net.mydreamy.casestudies.cocome/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/net.mydreamy.casestudies.cocome/.gitignore b/net.mydreamy.casestudies.cocome/.gitignore deleted file mode 100644 index ae3c172..0000000 --- a/net.mydreamy.casestudies.cocome/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/net.mydreamy.casestudies.cocome/.project b/net.mydreamy.casestudies.cocome/.project deleted file mode 100644 index ed8bcad..0000000 --- a/net.mydreamy.casestudies.cocome/.project +++ /dev/null @@ -1,35 +0,0 @@ - - - net.mydreamy.casestudies.cocome - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.sirius.nature.modelingproject - - diff --git a/net.mydreamy.casestudies.cocome/.settings/org.eclipse.jdt.core.prefs b/net.mydreamy.casestudies.cocome/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 295926d..0000000 --- a/net.mydreamy.casestudies.cocome/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/net.mydreamy.casestudies.cocome/META-INF/MANIFEST.MF b/net.mydreamy.casestudies.cocome/META-INF/MANIFEST.MF deleted file mode 100644 index 9a230b7..0000000 --- a/net.mydreamy.casestudies.cocome/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Library Management System -Bundle-SymbolicName: net.mydreamy.casestudies.library -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: net.mydreamy.casestudies.library.Activator -Require-Bundle: org.eclipse.core.runtime -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/net.mydreamy.casestudies.cocome/build.properties b/net.mydreamy.casestudies.cocome/build.properties deleted file mode 100644 index 41eb6ad..0000000 --- a/net.mydreamy.casestudies.cocome/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/net.mydreamy.casestudies.cocome/requirementmodel/cocome.remodel b/net.mydreamy.casestudies.cocome/requirementmodel/cocome.remodel deleted file mode 100644 index c55f9c5..0000000 --- a/net.mydreamy.casestudies.cocome/requirementmodel/cocome.remodel +++ /dev/null @@ -1,401 +0,0 @@ - -Actor Cashier { - - UC::processSale() - -} - -Service CoCoMEProcessSale { - - [Operation] - makeNewSale() - enterItem(barcode, quantity) - endSale() - makeCashPayment(amount) - makeCardPayment(cardAccountNumber, expiryDate) - - [TempProperty] - currentSaleLine : SalesLineItem - currentSale : Sale - currentCashDesk : CashDesk - currentStore : Store - currentPaymentMethod : PaymentMethod[CASH|CARD] - - [WorkFlow] - ProcessSaleWF -} - -Service CoCoMEManagement { - - [Operation] - createStore(store) - createCashDesk(cashdesk) - createProductCatalog(catalog) - createItem(item) - - [TempProperty] - [WorkFlow] -} - -Service ThridPartServices { - - [Operation] - thirdPartyCardPaymentService(cdp, expiryDate, currentSale) - -} - -/* System Work Flow, Not for runing, protocol for Actor inter-active with System */ -Workflow ProcessSaleWF { - - [Cashier ThridPartServices] - - Cashier { - - ActivityStart - - makeNewSale - - - - endSale - - ForkNode -> (createCashDesk createStore hasMoreItems newCondition) - - createCashDesk - - - createStore - - Loop -> hasMoreItems { - - enterItem - } - - Switch -> newCondition { - - case: case1 -> createItem - case: case2 -> createProductCatalog - } - - (createCashDesk createItem createProductCatalog hasMoreItems createStore) -> JoinNode - - ActivityFinal - - - } - - ThridPartServices { - - thirdPartyCardPaymentService - - } - - - -} - -Interaction ProcessSaleInteraction { - - [Participants: Cashier CoCoMEProcessSale] - - CallMessage::makeNewSale(makeNewSale makeNewSaleSender->makeNewSaleStart) - ReturnMessage::makeNewSaleReturn(makeNewSaleFinish->makeNewSaleReturnReceiver makeNewSale) - CallMessage::enterItem(enterItem enterItemSender->enterItemStart) - ReturnMessage::enterItemReturn(enterItemFinish->enterItemReturnReceiver enterItem) - CallMessage::endSale(endSale endSaleSender->endSaleStart) - ReturnMessage::endSaleReturn(endSaleFinish->endSaleReturnReceiver endSale) - CallMessage::makeCashPayment(makeCashPayment makeCashPaymentSender->makeCashPaymentStart) - ReturnMessage::makeCashPaymentReturn(makeCashPaymentFinish->makeCashPaymentReturnReceiver makeCashPayment) - CallMessage::makeCardPayment(makeCardPayment makeCardPaymentSender->makeCardPaymentStart) - ReturnMessage::makeCardPaymentReturn(makeCardPaymentFinish->makeCardPaymentReturnReceiver makeCardPayment) - - Execution::makeNewSale(CoCoMEProcessSale makeNewSaleStart makeNewSaleFinish) - Execution::enterItem(CoCoMEProcessSale enterItemStart enterItemFinish) - Execution::endSale(CoCoMEProcessSale endSaleStart endSaleFinish) - Execution::makeCashPayment(CoCoMEProcessSale makeCashPaymentStart makeCashPaymentFinish) - Execution::makeCardPayment(CoCoMEProcessSale makeCardPaymentStart makeCardPaymentFinish) - - CombinedFragment::enterItemLoop->loop { - - [Participants: Cashier CoCoMEProcessSale] - - enterItemLoopStart->enterItemLoopFinish - - Operand::hasMoreItems(hasMoreItemsStart enterItemLoopFinish) - } - - CombinedFragment::PaymentMethodAlt->alt { - - [Participants: Cashier CoCoMEProcessSale] - - PaymentMethodAltStart->PaymentMethodAltFinish - - Operand::Cash(CashStart CardStart) - Operand::Card(CardStart PaymentMethodAltFinish) - } - - MessageEnd::makeNewSaleSender(Cashier makeNewSale) - ExecutionEnd::makeNewSaleStart(CoCoMEProcessSale makeNewSale) - ExecutionEnd::makeNewSaleFinish(CoCoMEProcessSale makeNewSale) - MessageEnd::makeNewSaleReturnReceiver(Cashier makeNewSaleReturn) - CombinedFragmentEnd::enterItemLoopStart(enterItemLoop) - OperandEnd::hasMoreItemsStart(hasMoreItems) - MessageEnd::enterItemSender(Cashier enterItem) - ExecutionEnd::enterItemStart(CoCoMEProcessSale enterItem) - ExecutionEnd::enterItemFinish(CoCoMEProcessSale enterItem) - MessageEnd::enterItemReturnReceiver(Cashier enterItemReturn) - CombinedFragmentEnd::enterItemLoopFinish(enterItemLoop) - MessageEnd::endSaleSender(Cashier endSale) - ExecutionEnd::endSaleStart(CoCoMEProcessSale endSale) - ExecutionEnd::endSaleFinish(CoCoMEProcessSale endSale) - MessageEnd::endSaleReturnReceiver(Cashier endSaleReturn) - CombinedFragmentEnd::PaymentMethodAltStart(PaymentMethodAlt) - OperandEnd::CashStart(Cash) - MessageEnd::makeCashPaymentSender(Cashier makeCashPayment) - ExecutionEnd::makeCashPaymentStart(CoCoMEProcessSale makeCashPayment) - ExecutionEnd::makeCashPaymentFinish(CoCoMEProcessSale makeCashPayment) - MessageEnd::makeCashPaymentReturnReceiver(Cashier makeCashPaymentReturn) - OperandEnd::CardStart(Card) - MessageEnd::makeCardPaymentSender(Cashier makeCardPayment) - ExecutionEnd::makeCardPaymentStart(CoCoMEProcessSale makeCardPayment) - ExecutionEnd::makeCardPaymentFinish(CoCoMEProcessSale makeCardPayment) - MessageEnd::makeCardPaymentReturnReceiver(Cashier makeCardPaymentReturn) - CombinedFragmentEnd::PaymentMethodAltFinish(PaymentMethodAlt) - -} - -Entity Store { - - Id : Integer - Name : String - Address : String - - [Refer] - Cashdeskes : CashDesk* - Productcatalogs : ProductCatalog* - Items : Item* - Cashiers : Cashier* - Sales : Sale* - -} - -Entity ProductCatalog { - - Id : Integer - Name : String - - [Refer] - ContainedItems : Item* - -} - -Entity CashDesk { - - Id : Integer - - [Refer] - ContainedSales : Sale* - BelongedStore : Store - -} - -Entity Sale { - - Time : Date - IsComplete: Boolean - Amount : Real - IsReadytoPay : Boolean - - [Refer] - Belongedstore : Store - BelongedCashDesk : CashDesk - ContainedSalesLine : SalesLineItem* - AssoicatedPayment : Payment - -} - -Entity Cashier { - - Id : Integer - Name : String - - [Refer] - WorkedStore : Store - -} - -Entity SalesLineItem { - - Quantity : Integer - Subamount : Real - - [Refer] - BelongedSale : Sale - BelongedItem : Item - -} - -Entity Item { - - Barcode : Integer - Description : String - Price : Real - - [Refer] - BelongedCatalog : ProductCatalog - -} - -Entity Payment { - - AmountTendered : Real - - [Refer] - BelongedSale : Sale - -} - -Entity CashPayment extends Payment { - - Balance : Real - -} - -Entity CardPayment extends Payment { - - CardAccountNumber : String - ExpiryDate : Date - -} - -Contract CoCoMEProcessSale::makeNewSale() { - - /* preconditions: none */ - precondition: true - - /* postconditions: - * A sale instance s was created (instance creation). - * s was associated with the current CashDesk (association formed) - * Attribute IsComplete of s was initialized as false. (object initialization) - * currentSale became s - */ - postcondition: let s:Sale in s.oclIsNew() and - s.BelongedCashDesk = currentCashDesk and currentCashDesk.ContainedSales->includes(s) and - s.IsComplete = false and s.IsReadytoPay = false and - self.currentSale = s -} - -Contract CoCoMEProcessSale::enterItem(barcode : Integer, quantity : Integer) { - - /* Definition: find specific Item instance by barcode */ - definition: item:Item = Item.allInstance()->any(i:Item | i.Barcode = barcode) - - /* Precondition: there is a sale underway */ - precondition: currentSale.IsComplete = false - - /** - * A salesLineItem instance sli was created (instance creation). - * sli was associated with the current Sale (association formed). - * sli.quantity became quantity (attribute modification). - * sli was associated with a Item (association formed). - * subamount became item.price * quantity - */ - postcondition : let sli:SalesLineItem in sli.oclIsNew() and self.currentSaleLine = sli and - sli.BelongedSale = currentSale and currentSale.ContainedSalesLine->includes(sli) and - sli.Quantity = quantity and - sli.BelongedItem = item and - sli.Subamount = item.Price * quantity - -} - - -Contract CoCoMEProcessSale::endSale() { - - /* Precondition: there is a sale underway and no more items. */ - precondition: currentSale.IsComplete = false and currentSale.IsReadytoPay = false - - /** - * Postcondition: - * add all sub amount of SalesLineItem up to the Amount of currentSale (compute amount). - * currentSale.IsReadytoPay became true - */ - postcondition: currentSale.ContainedSalesLine->forAll(sl : SalesLineItem | currentSale.Amount = currentSale.Amount@pre + sl.Subamount) and currentSale.IsReadytoPay = true -} - -Contract CoCoMEProcessSale::makeCashPayment(amount : Real) { - - /* Precondition: There is a sale underway, the sale is ready to pay, and tendered amount is greater than or equal to the amount of current Sale*/ - precondition: currentSale.IsComplete = false and currentSale.IsReadytoPay = true and amount >= currentSale.Amount - - /** - * A CashPayment instance cp was created (instance creation). - * cp.amountTendered became amount (attribute modification). - * cp was associated with the current Sale (association formed). - * The current Sale was associated with the Store (association formed). - * Sale.isComplete became true (attribute modification). - * Sale.time became now (attribute modification). - * cp.Balance became the value of tendered amount minus current Sale amount - */ - postcondition: let cp:CashPayment in cp.oclIsNew() and - cp.AmountTendered = amount and - cp.BelongedSale = currentSale and currentSale.AssoicatedPayment = cp - and currentSale.Belongedstore = currentStore and currentStore.Sales->includes(currentSale) and - currentSale.IsComplete = true and currentSale.Time = Now and - cp.Balance = amount - currentSale.Amount - -} - -Contract CoCoMEProcessSale::makeCardPayment(cardAccountNumber : String, expiryDate : Date) { - - /* Precondition: An underway sale exists and all items have been entered. */ - precondition: currentSale.IsComplete = false and currentSale.IsReadytoPay = true - - /** - * a CardPayment cdp was created - * cdp was associated with the current Sale - * cdp.CardAccountNumber = cardAccountNumber, cdp.expiryDate = expiryDate - * invoke third party card payment service - * sale was associated with the Store as a completed sale - * The current sale is complete - * Sale.time became now - */ - postcondition: let cdp:CardPayment in cdp.oclIsNew() and - cdp.BelongedSale = currentSale and currentSale.AssoicatedPayment = cdp and - cdp.CardAccountNumber = cardAccountNumber and cdp.ExpiryDate = expiryDate and - thirdPartyCardPaymentService(cdp, expiryDate, currentSale) and - currentSale.Belongedstore = currentStore and currentStore.Sales->includes(currentSale) and - currentSale.IsComplete = true and currentSale.Time = Now - -} - -Contract ThridPartServices::thirdPartyCardPaymentService(cdp : CardPayment, expiryDate : Date, currentSale : Sale) { - precondition: true - postcondition: true -} - -Contract CoCoMEManagement::createStore(store : Store) { - - precondition: Store.allInstance()->excludes(store) - postcondition: Store.allInstance()->includes(store) - -} - -Contract CoCoMEManagement::createCashDesk(cashdesk : CashDesk, storeid : Integer) { - - definition: store:Store = Store.allInstance()->any(s:Store | s.Id = storeid) - precondition: store.oclIsUndefined() = false and store.Cashdeskes->excludes(cashdesk) and CashDesk.allInstance()->excludes(cashdesk) - postcondition: store.Cashdeskes->includes(cashdesk) and cashdesk.BelongedStore = store and CashDesk.allInstance()->includes(cashdesk) - -} - -Contract CoCoMEManagement::createProductCatalog(catalog : ProductCatalog) { - precondition: ProductCatalog.allInstance()->excludes(catalog) - postcondition: ProductCatalog.allInstance()->includes(catalog) -} - -Contract CoCoMEManagement::createItem(item : Item, catalogid : Integer) { - - definition: catalog:ProductCatalog = ProductCatalog.allInstance()->any(pc:ProductCatalog | pc.Id = catalogid) - precondition: catalog.oclIsUndefined() = false and catalog.ContainedItems->excludes(item) and Item.allInstance()->excludes(item) - postcondition: item.BelongedCatalog = catalog and catalog.ContainedItems->includes(item) and Item.allInstance()->includes(item) -} \ No newline at end of file diff --git a/net.mydreamy.casestudies.cocome/src/net/mydreamy/casestudies/cocome/Activator.java b/net.mydreamy.casestudies.cocome/src/net/mydreamy/casestudies/cocome/Activator.java deleted file mode 100644 index 1883b6a..0000000 --- a/net.mydreamy.casestudies.cocome/src/net/mydreamy/casestudies/cocome/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package net.mydreamy.casestudies.cocome; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -import services.CoCoMEProcessSale; -import services.impl.CoCoMEProcessSaleImpl; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - /* Instance Service */ - CoCoMEProcessSale cocomeservice = new CoCoMEProcessSaleImpl(); - - /* XML to JAXB*/ - - - - /* Register OSGI Services */ - bundleContext.registerService(cocomeservice.getClass().getName(), cocomeservice, null); - - - System.out.println("starting"); - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - - /* JAXB to XML */ - Activator.context = null; - System.out.println("stop"); - } - -} diff --git a/net.mydreamy.casestudies.cocome/src/net/mydreamy/casestudies/cocome/test/MainTest.java b/net.mydreamy.casestudies.cocome/src/net/mydreamy/casestudies/cocome/test/MainTest.java deleted file mode 100644 index 0369103..0000000 --- a/net.mydreamy.casestudies.cocome/src/net/mydreamy/casestudies/cocome/test/MainTest.java +++ /dev/null @@ -1,126 +0,0 @@ -package net.mydreamy.casestudies.cocome.test; - -import java.time.LocalDateTime; - -import entities.*; -import services.*; -import services.impl.CoCoMEManagementImpl; -import services.impl.CoCoMEProcessSaleImpl; - - -public class MainTest { - - public static void main(String[] args) { - // TODO Auto-generated method stub - - CoCoMEManagement manage = new CoCoMEManagementImpl(); - CoCoMEProcessSale processale = new CoCoMEProcessSaleImpl(); - - - /* ----------------- Initial System --------------- */ - System.out.println("----------------- Initial System ---------------"); - /* create new store */ - Store s = new Store(); - s.setId(001); - s.setName("UMStore"); - s.setAddress("Macau"); - System.out.println("create store UMStore: " + manage.createStore(s)); - - /* create cash desk */ - CashDesk cashdesk = new CashDesk(); - cashdesk.setId(001); - System.out.println("create cashdesk 001: " + manage.createCashDesk(cashdesk, 001)); - - /* create Product Catalog*/ - ProductCatalog pc = new ProductCatalog(); - pc.setId(001); - pc.setName("meat"); - System.out.println("create Product Catalog meat: " + manage.createProductCatalog(pc)); - - /* create item beef meat */ - Item beef = new Item(); - beef.setBarcode(000001); - beef.setDescription("beef meat"); - beef.setPrice(20); - System.out.println("create item beef meat: " + manage.createItem(beef, 001)); - - /* create item pock meat */ - Item pock = new Item(); - pock.setBarcode(000002); - pock.setDescription("pock meat"); - pock.setPrice(15); - System.out.println("create item pock meat: " + manage.createItem(pock, 001)); - - /* create Product Catalog milk*/ - ProductCatalog milk = new ProductCatalog(); - pc.setId(002); - pc.setName("milk"); - System.out.println("create Product Catalog milk: " + manage.createProductCatalog(milk)); - - /* create item beef meat */ - Item yoghurt = new Item(); - yoghurt.setBarcode(000003); - yoghurt.setDescription("yoghurt milk"); - yoghurt.setPrice(5); - System.out.println("create yoghurt milk: " + manage.createItem(yoghurt, 002)); - - /* create item pock meat */ - Item strawberry = new Item(); - strawberry.setBarcode(000004); - strawberry.setDescription("strawberry milk"); - strawberry.setPrice(15); - System.out.println("create strawberry milk: " + manage.createItem(strawberry, 002)); - - - /* ----------------- Test Process Sale --------------- */ - - System.out.println("----------------- Inital Process Sale Service ---------------"); - System.out.println("set current store"); - processale.setCurrentStore(s); - System.out.println("set current cashdesk"); - processale.setCurrentCashDesk(cashdesk); - - System.out.println("----------------- Test Process Sale - Cash Payment ----------"); - - System.out.println("makeNewSale: " + processale.makeNewSale()); - System.out.println("enter 2 yoghurt milk: " + processale.enterItem(000003, 2)); - System.out.println("subamount: " + processale.getCurrentSaleLine().getSubamount()); - - System.out.println("enter 5 pock meat: " + processale.enterItem(000002, 5)); - System.out.println("subamount: " + processale.getCurrentSaleLine().getSubamount()); - - System.out.println("endSale: " + processale.endSale()); - - System.out.println("amount: " + processale.getCurrentSale().getAmount()); - - System.out.println("make cash payment: " + processale.makeCashPayment(90)); - - System.out.println("tendered money: " + processale.getCurrentSale().getAssoicatedPayment().getAmountTendered()); - System.out.println("balance: " + ((CashPayment)processale.getCurrentSale().getAssoicatedPayment()).getBalance()); - - System.out.println("Is sale complete: " + processale.getCurrentSale().getIsComplete()); - - System.out.println("----------------- Test Process Sale - Card Payment ----------"); - - System.out.println("makeNewSale: " + processale.makeNewSale()); - System.out.println("enter 2 yoghurt milk: " + processale.enterItem(000003, 2)); - System.out.println("subamount: " + processale.getCurrentSaleLine().getSubamount()); - - System.out.println("enter 3 pock meat: " + processale.enterItem(000002, 3)); - System.out.println("subamount: " + processale.getCurrentSaleLine().getSubamount()); - - System.out.println("endSale: " + processale.endSale()); - - System.out.println("amount: " + processale.getCurrentSale().getAmount()); - - System.out.println("Is sale complete: " + processale.getCurrentSale().getIsComplete()); - - System.out.println("make card payment: " + processale.makeCardPayment("12348765987098731", LocalDateTime.now().plusYears(1))); - - System.out.println("Is sale complete: " + processale.getCurrentSale().getIsComplete()); - - - - } - -} diff --git a/net.mydreamy.casestudies.library.autogui/.classpath b/net.mydreamy.casestudies.library.autogui/.classpath index be108f3..85ae7b1 100644 --- a/net.mydreamy.casestudies.library.autogui/.classpath +++ b/net.mydreamy.casestudies.library.autogui/.classpath @@ -22,6 +22,7 @@ + diff --git a/net.mydreamy.casestudies.library.autogui/.settings/org.eclipse.jdt.core.prefs b/net.mydreamy.casestudies.library.autogui/.settings/org.eclipse.jdt.core.prefs index 672496e..8445b6b 100644 --- a/net.mydreamy.casestudies.library.autogui/.settings/org.eclipse.jdt.core.prefs +++ b/net.mydreamy.casestudies.library.autogui/.settings/org.eclipse.jdt.core.prefs @@ -9,4 +9,5 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 diff --git a/net.mydreamy.casestudies.library.autogui/pom.xml b/net.mydreamy.casestudies.library.autogui/pom.xml index 269b8c7..0105711 100644 --- a/net.mydreamy.casestudies.library.autogui/pom.xml +++ b/net.mydreamy.casestudies.library.autogui/pom.xml @@ -32,16 +32,29 @@ gui.Main - - org.apache.maven.plugins - maven-surefire-plugin - 2.18.1 + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + - - ${java.home}/lib/ext/jfxrt.jar - + gui.Main - + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M1 + + gui.MainTest#test_integration + + maven-clean-plugin 3.1.0 diff --git a/net.mydreamy.casestudies.library.autogui/src-gen/gui/MainTest.java b/net.mydreamy.casestudies.library.autogui/src/test/java/gui/MainTest.java similarity index 94% rename from net.mydreamy.casestudies.library.autogui/src-gen/gui/MainTest.java rename to net.mydreamy.casestudies.library.autogui/src/test/java/gui/MainTest.java index a944595..24166ed 100644 --- a/net.mydreamy.casestudies.library.autogui/src-gen/gui/MainTest.java +++ b/net.mydreamy.casestudies.library.autogui/src/test/java/gui/MainTest.java @@ -106,7 +106,7 @@ public void returnTable(String attribute, String value, int order) { public void loadData() { - clickOn("System Status"); + clickOn("System State"); clickOn("Load Status"); sleep(1000); type(KeyCode.DOWN); @@ -116,7 +116,7 @@ public void loadData() { public void saveData() { - clickOn("System Status"); + clickOn("System State"); clickOn("Save Status"); sleep(2000); type(KeyCode.L); @@ -133,7 +133,7 @@ public void saveData() { public void saveData_borrow() { - clickOn("System Status"); + clickOn("System State"); clickOn("Save Status"); sleep(2000); type(KeyCode.L); @@ -151,7 +151,7 @@ public void saveData_borrow() { public void saveDataFinal() { - clickOn("System Status"); + clickOn("System State"); clickOn("Save Status"); sleep(2000); type(KeyCode.L); @@ -178,23 +178,31 @@ public void test_PrepareData() { returnTrue(); new FxRobot().clickOn("#administrator").sleep(1000).clickOn("createStudent").type(KeyCode.TAB, 5).write("2").type(KeyCode.TAB).write("Alice").type(KeyCode.TAB).type(KeyCode.TAB).write("123456").type(KeyCode.TAB).write("alice@gmail.com").type(KeyCode.TAB).write("FST").type(KeyCode.TAB).write("Software Engineering").type(KeyCode.TAB).type(KeyCode.UP, 2).type(KeyCode.ENTER).type(KeyCode.TAB).type(KeyCode.ENTER).clickOn("#execute"); returnTrue(); + new FxRobot().doubleClickOn("manageUser").sleep(1000); + + //create librarian new FxRobot().sleep(1000).doubleClickOn("manageLibrarian").clickOn("createLibrarian").type(KeyCode.TAB, 5).write("1").type(KeyCode.TAB).write("Alice").type(KeyCode.TAB).write("123456").clickOn("#execute"); returnTrue(); + new FxRobot().sleep(1000).doubleClickOn("manageLibrarian"); //create book new FxRobot().sleep(1000).doubleClickOn("manageBook").clickOn("createBook").type(KeyCode.TAB, 5).write("QA76.758").type(KeyCode.TAB).write("Software engineering").type(KeyCode.TAB).write("6th ed").type(KeyCode.TAB).write("Ian Sommerville").type(KeyCode.TAB).write("Addison-Wesley").type(KeyCode.TAB).write("Computer Science Series").type(KeyCode.TAB).write("9781932159943").type(KeyCode.TAB).write("0").clickOn("#execute"); returnTrue(); + new FxRobot().sleep(1000).doubleClickOn("manageBook"); //create bookcopy new FxRobot().sleep(1000).doubleClickOn("manageBookCopy").clickOn("addBookCopy").type(KeyCode.TAB, 5).write("QA76.758").type(KeyCode.TAB).write("1234567").type(KeyCode.TAB).write("3/F A2 Science & Medicine").clickOn("#execute"); returnTrue(); new FxRobot().sleep(1000).clickOn("addBookCopy").type(KeyCode.TAB, 5).write("QA76.758").type(KeyCode.TAB).write("7654321").type(KeyCode.TAB).write("3/F A2 Science & Medicine").clickOn("#execute"); returnTrue(); + new FxRobot().sleep(1000).doubleClickOn("manageBookCopy").sleep(2000); + + new FxRobot().clickOn("#administrator").sleep(1000); //Check value - clickOn("System Status"); + clickOn("System State"); clickOn("Student"); validateAttribute("UserID", "1"); @@ -238,6 +246,10 @@ public void test_searchBook() { new FxRobot().clickOn("searchBookByAuthor").type(KeyCode.TAB, 6).write("Ian Sommerville").clickOn("#execute").sleep(1000); returnTable("CallNo", "QA76.758", 0); + + new FxRobot().doubleClickOn("searchBook"); + + new FxRobot().clickOn("#student").sleep(1000); } @@ -255,7 +267,7 @@ public void test_borrowBook() { returnTrue(); //Check value - clickOn("System Status"); + clickOn("System State"); clickOn("Loan"); validateAssociation("LoanedUser", 1); @@ -291,7 +303,7 @@ public void test_borrowBook(String ID, String barcode) { returnTrue(); //Check value - clickOn("System Status"); + clickOn("System State"); clickOn("Loan"); // validateAssociation("LoanedUser", 1); @@ -343,7 +355,7 @@ public void test_returnBook() { if (isItegrationTest == false) { //Check value - clickOn("System Status"); + clickOn("System State"); clickOn("BookCopy"); validateAttribute("Status", "AVAILABLE"); @@ -369,7 +381,7 @@ public void test_renewBook() { returnTrue(); //Check value - clickOn("System Status"); + clickOn("System State"); clickOn("Loan"); validateAssociation("LoanedUser", 1); @@ -393,7 +405,7 @@ public void test_reservation() { returnTrue(); //Check value - clickOn("System Status"); + clickOn("System State"); clickOn("BookCopy"); type(KeyCode.UP).type(KeyCode.DOWN); diff --git a/net.mydreamy.casestudies.library/.classpath b/net.mydreamy.casestudies.library/.classpath deleted file mode 100644 index f0c5549..0000000 --- a/net.mydreamy.casestudies.library/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/net.mydreamy.casestudies.library/.gitignore b/net.mydreamy.casestudies.library/.gitignore deleted file mode 100644 index ae3c172..0000000 --- a/net.mydreamy.casestudies.library/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/net.mydreamy.casestudies.library/.project b/net.mydreamy.casestudies.library/.project deleted file mode 100644 index b3cbb01..0000000 --- a/net.mydreamy.casestudies.library/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - net.mydreamy.casestudies.library - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/net.mydreamy.casestudies.library/.settings/org.eclipse.jdt.core.prefs b/net.mydreamy.casestudies.library/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0c68a61..0000000 --- a/net.mydreamy.casestudies.library/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/net.mydreamy.casestudies.library/META-INF/MANIFEST.MF b/net.mydreamy.casestudies.library/META-INF/MANIFEST.MF deleted file mode 100644 index 2fc33de..0000000 --- a/net.mydreamy.casestudies.library/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Library Management System -Bundle-SymbolicName: net.mydreamy.casestudies.library -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: net.mydreamy.casestudies.library.Activator -Require-Bundle: org.eclipse.core.runtime -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/net.mydreamy.casestudies.library/build.properties b/net.mydreamy.casestudies.library/build.properties deleted file mode 100644 index 34d2e4d..0000000 --- a/net.mydreamy.casestudies.library/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/net.mydreamy.casestudies.library/requirementmodel/library.remodel b/net.mydreamy.casestudies.library/requirementmodel/library.remodel deleted file mode 100644 index 39b7541..0000000 --- a/net.mydreamy.casestudies.library/requirementmodel/library.remodel +++ /dev/null @@ -1,629 +0,0 @@ - /* Actors and Use Cases */ -Actor User { - - UC::searchBookByTitle() - UC::searchBookByAuthor() - UC::searchBookByISBN() - UC::searchBookBySubject() - UC::searchBookByKeywords() - - UC::listBorrowHistory() - UC::listHodingBook() - UC::listOverDueBook() - UC::listReservationBook() - - UC::renewBook() - UC::makeReservation() - - UC::recommendBook() - -} - -Actor Student extends User { - - UC::studentLogin() - UC::studentLogout() - -} - -Actor Faculty extends User { - - UC::FacultyLogin() - UC::FacultyLogout() - -} - -Actor Librarian { - - UC::librarianLogin() - UC::librarianLogout() - - UC::searchBookByTitle() - UC::searchBookByAuthor() - UC::searchBookByISBN() - UC::searchBookBySubject() - UC::searchBookByBarCode() - UC::searchBookByKeywords() - - UC::payOverDueFee() - - UC::borrowBook() - UC::renewBook() - UC::returnBook() - UC::listRecommendBook() - - UC::addBook() - UC::modifyBook() - UC::deleteBook() - - UC::createUser() - UC::deleteUser() - UC::queryUser() - UC::modifyUser() - -} - -Actor Administrator { - - UC::AdministratorLogin() - UC::AdministratorLogout() - - UC::createLibrarian() - UC::deleteLibrarian() - UC::queryLibrarian() - UC::modifyLibrarian() -} - -Actor Timer { - - UC::checkOverDueandComputeOverDueFee() - UC::dueSoonNotification() - UC::countDownSuspensionDay() -} - -Actor ThirdPartSystem { - UC::sendNotificationEmail() -} - -/* System Controller */ -Service LibraryManagementSystem { - - [Operation] - //for log in and out - studentLogin(username, password) - studentLogout() - FacultyLogin(username, password) - FacultyLogout() - AdministratorLogin(username, password) - AdministratorLogout() - - //for book - searchBookByBarCode(barcode) - searchBookByTitle(title) - searchBookByAuthor(authorname) - searchBookByISBN(ISBNnumber) - searchBookByKeywords(keywords) - searchBookBySubject(subject) - - - addBook(book) - deleteBook(barcode) - recommendBook(userid, book) - queryBookCopy(barcode) - addBookCopy(callNo, copy) - deleteBookCopy(barcode) - - makeReservation(uid, barcode) - cannelReservation(uid , barcode) - borrowBook(uid, barcode) - renewBook(uid, barcode) - returnBook(barcode) - payOverDueFee(uid, fee, change) - - //list book - listBorrowHistory(userid) - listHodingBook(userid) - listOverDueBook(userid) - listReservationBook(userid) - listRecommendBook(userid) - - //regular checking - checkOverDueandComputeOverDueFee() - dueSoonNotification() - countDownSuspensionDay() - - //user management - createUser(user) - deleteUser(uid) - queryUser(uid) - - createLibrarian(librarian) - deleteLibrarian(librarianid) - queryLibrarian(librarianid) - - [TempProperty] - -} - -Service ThridPartServices { - - [Operation] - sendNotificationEmail(user) -} - -/* Domain Model */ -Entity User { - - /* Basic information */ - UserID : Integer - Name : String - Sex : Sex[M|F] - Password : String - Email : String - Faculty : String - Programme : Programme[BACHELOR|MASTER|PHD] - - /* Library related information */ - LoanedNumber : Integer - BorrowStatus : BorrowStatus[NORMAL|SUSPEND] - SuspensionDays : Integer - OverDueFee : Real - - [Refer] - LoanedBook : Loan* - ReservedBook : Reserve* - RecommendedBook : RecommendBook* - - [INV] - inv: User.allInstance()->forAll(u1, u2 | u1.UserID <> u2.UserID) -} - -Entity Student extends User { - - Major : String - RegistrationStatus : StudentStatus[GRADUATED|PROGRAMMING] - - [INV] - inv: Student.allInstance()->forAll(stu | stu.LoanedNumber < 12) - -} - -Entity Faculty extends User { - - Position : FacultyPosition[ASSISTANTPROFESSORS|ASSOCIATEPROFESSOR|PROFESSOR|CHAIRPROFESSOR] - Status : FacultyStatus[HASRETIRED|INPOSITION] - - [INV] - inv: Student.allInstance()->forAll(stu | stu.LoanedNumber < 24) -} - - -Entity Book { - - CallNo : String - Title : String - Edition : String - Author : String - Publisher : String - Description : String - - ISBn : Integer - CopyNum: Integer - - [Refer] - Copys : BookCopy* - Subject : Subject* - - [INV] - inv: Book.allInstance()->forAll(b1, b2 | b1.CallNo <> b2.CallNo) - inv: Book.allInstance()->forAll(b1, b2 | b1.ISBn <> b2.ISBn) -} - -Entity Subject { - - Name : String - - [Refer] - SuperSubject : Subject - SubSubject : Subject* -} - -Entity BookCopy { - - Barcode : Integer - Status : CopyStatus[AVAILABLE|INPROCESSING|LIBUSEONLY|ONHOLDSHELF|LOANED] - Location : String - IsReserved : Boolean - - [Refer] - BookBelongs : Book - LoanedRecord : Loan* - ReservationRecord : Reserve* - - [INV] - inv: BookCopy.allInstance()->forAll(c1, c2 | c1.Barcode <> c2.Barcode) -} - -Entity Loan { - - LoanDate : Date - RenewDate : Date - DueDate : Date - RenewedTimes : Integer - IsReturned : Boolean // for list loaning book and loaned book - ReturnDate : Date - OverDueFee : Real - - OverDue3Days : Boolean - OverDue10Days : Boolean - OverDue17Days : Boolean - OverDue31Days : Boolean - - [Refer] - LoanedUser : User - LoanedCopy : BookCopy - LoanLibrarian : Librarian - ReturnLibrarian : Librarian -} - -Entity Reserve { - - ReserveDate : Date - IsReserveClosed : Boolean // for list all reserving book and reserved book - - [Refer] - ReservedCopy : BookCopy - ReservedUser : User -} - -Entity RecommendBook extends Book { - - RecommendDate : Date - [Refer] - RecommendUser : User -} - -Entity Administrator { - AdminID : Integer - UserName : String - Password : String -} - -Entity Librarian { - LibrarianID : Integer - UserName : String - Name : String - Password : String -} - - - -/* -------------------- Contracts ----------------------*/ -/* Search book */ -Contract LibraryManagementSystem::searchBookByBarCode(barcode : Integer) : Set(Book) { - precondition: barcode.oclIsTypeOf(Integer) - postcondition: result = Book.allInstance()->select(book:Book | book.Copys->exists(c:BookCopy | c.Barcode = barcode)) -} - -Contract LibraryManagementSystem::searchBookByTitle(title : String) : Set(Book) { - precondition: title <> "" - postcondition: result = Book.allInstance()->select(book:Book | book.Title = title) -} - -Contract LibraryManagementSystem::searchBookByAuthor(authorname : String) : Set(Book) { - precondition: authorname <> "" - postcondition: result = Book.allInstance()->select(book:Book | book.Author = authorname) -} - -Contract LibraryManagementSystem::searchBookByISBN(ISBNnumber : Integer) : Set(Book) { - precondition: ISBNnumber.oclIsTypeOf(Integer) - postcondition: result = Book.allInstance()->select(book:Book | book.ISBn = ISBNnumber) -} - -Contract LibraryManagementSystem::searchBookBySubject(subject : String) : Set(Book) { - precondition: subject.oclIsTypeOf(String) - postcondition: result = Book.allInstance()->select(book:Book| book.Subject->exists(s:Subject | s.Name = subject)) -} - -/* Main functions */ -Contract LibraryManagementSystem::makeReservation(uid : Integer, barcode : Integer) { - - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - copy:BookCopy = BookCopy.allInstance()->any(bc:BookCopy | bc.Barcode = barcode) - - precondition: user.oclIsUndefined() = false and copy.oclIsUndefined() = false and copy.Status = CopyStatus::LOANED and copy.IsReserved = false - - postcondition: let res:Reserve in res.oclIsNew() and copy.IsReserved = true and res.IsReserveClosed = false and res.ReservedUser = user and res.ReservedCopy = copy and user.ReservedBook->includes(res) and - copy.ReservationRecord->includes(res) -} - -Contract LibraryManagementSystem::cannelReservation(uid : Integer, barcode : Integer) { - - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - copy:BookCopy = BookCopy.allInstance()->any(bc:BookCopy | bc.Barcode = barcode), - res:Reserve = Reserve.allInstance()->any(r:Reserve | r.ReservedCopy = copy and r.ReservedUser = user) - - precondition: user.oclIsUndefined() = false and copy.oclIsUndefined() = false and copy.Status = CopyStatus::LOANED and copy.IsReserved = true and res.oclIsUndefined() = false and res.IsReserveClosed = false - - postcondition: copy.IsReserved = false and res.IsReserveClosed = true -} - -Contract LibraryManagementSystem::borrowBook(uid : Integer, barcode: Integer) { - - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - copy:BookCopy = BookCopy.allInstance()->any(bc:BookCopy | bc.Barcode = barcode), - res:Reserve = Reserve.allInstance()->any(r:Reserve | r.ReservedCopy = copy and r.ReservedUser = user and r.IsReserveClosed = false) - - precondition: user.oclIsUndefined() = false and copy.oclIsUndefined() = false and user.BorrowStatus = BorrowStatus::NORMAL and user.SuspensionDays = 0 and - if user.oclIsTypeOf(Student) - then - if user.Programme = Programme::BACHELOR - then - user.LoanedNumber < 20 - else - if user.Programme = Programme::MASTER - then - user.LoanedNumber < 40 - else - user.LoanedNumber < 60 - endif - endif - else - user.LoanedNumber < 60 - endif - and - (copy.Status = CopyStatus::AVAILABLE or (copy.Status = CopyStatus::ONHOLDSHELF and copy.IsReserved = true and res.oclIsUndefined() = false and res.IsReserveClosed = false)) - - postcondition: let loan:Loan in loan.oclIsNew() and loan.LoanedUser = user and loan.LoanedCopy = copy and loan.IsReturned = false - and loan.LoanDate = Today and user.LoanedNumber = user.LoanedNumber@pre + 1 - and user.LoanedBook->includes(loan) and copy.LoanedRecord->includes(loan) and - if user.oclIsTypeOf(Student) - then - loan.DueDate = Today.After(30) - else - loan.DueDate = Today.After(60) - endif - and - if copy.Status@pre = CopyStatus::ONHOLDSHELF - then - copy.IsReserved = false and res.IsReserveClosed = true - endif - and copy.Status = CopyStatus::LOANED - and loan.OverDue3Days = false and loan.OverDue10Days = false and loan.OverDue17Days = false and loan.OverDue31Days = false - -} - -Contract LibraryManagementSystem::returnBook(barcode: Integer) { - - definition: copy:BookCopy = BookCopy.allInstance()->any(bc:BookCopy | bc.Barcode = barcode and bc.Status = CopyStatus::LOANED), - loan:Loan = Loan.allInstance()->any(l:Loan | l.LoanedCopy = copy and l.IsReturned = false), - loans:Set(Loan) = Loan.allInstance()->select(l:Loan | l.LoanedUser = loan.LoanedUser and l.IsReturned = false and l.DueDate.isAfter(Today)), - res:Reserve = copy.ReservationRecord->any(r:Reserve | r.ReservedCopy = copy) - - precondition: copy.oclIsUndefined() = false - - postcondition: loan.LoanedUser.LoanedNumber = loan.LoanedUser.LoanedNumber@pre - 1 and loan.IsReturned = true and loan.ReturnDate = Today and - if copy.IsReserved = true - then - copy.Status = CopyStatus::ONHOLDSHELF and sendNotificationEmail(res.ReservedUser) - else - copy.Status = CopyStatus::AVAILABLE - endif - - -} - -Contract LibraryManagementSystem::renewBook(uid: Integer, barcode: Integer) { - - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - copy:BookCopy = BookCopy.allInstance()->any(bc:BookCopy | bc.Barcode = barcode and bc.Status = CopyStatus::LOANED), - loan:Loan = Loan.allInstance()->any(l:Loan | l.LoanedUser = user and l.LoanedCopy = copy) - - precondition: user.BorrowStatus = BorrowStatus::NORMAL and user.oclIsUndefined() = false and copy.oclIsUndefined() = false and loan.oclIsUndefined() = false and copy.IsReserved = false and loan.DueDate.isAfter(Today) and loan.OverDueFee = 0 and - if user.oclIsTypeOf(Student) - then - loan.RenewedTimes < 3 - else - loan.RenewedTimes < 6 - endif - - postcondition: loan.RenewedTimes = loan.RenewedTimes@pre + 1 and - if user.oclIsTypeOf(Student) - then - if user.Programme = Programme::BACHELOR - then - loan.DueDate = loan.DueDate@pre.After(20) - else - if user.Programme = Programme::MASTER - then - loan.DueDate = loan.DueDate@pre.After(40) - else - loan.DueDate = loan.DueDate@pre.After(60) - endif - endif - else - loan.DueDate = loan.DueDate@pre.After(60) - endif -} - -Contract LibraryManagementSystem::payOverDueFee(uid: Integer, fee: Real) { - - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - loans:Set(Loan) = Loan.allInstance()->select(l:Loan | l.LoanedUser = user and l.DueDate.isBefore(Today) and l.IsReturned = true and l.OverDueFee > 0) - - precondition: user.oclIsUndefined() = false and loans.notEmpty() and fee >= user.OverDueFee - postcondition: user.OverDueFee = 0 and loans->forAll(l:Loan | l.OverDueFee = 0) -} - -Contract LibraryManagementSystem::dueSoonNotification() { - precondition: true - postcondition: let users:Set(User) = User.allInstance()->select(user:User | user.LoanedBook->exists(loan:Loan | loan.IsReturned = false and Today.After(3).isAfter(loan.DueDate))) in - users->forAll(u:User | sendNotificationEmail(u)) -} - -//Contract dueSoonNotification() { -// precondition: true -// postcondition: let users:Set(User) = User.allInstance()->select(user:User | user.LoanedBook->exists(loan:Loan | loan.isReturned = false and Today.After(3) = loan.DueDate)) in -// users->forAll(u:User | sendNotificationEmail(u)) -//} - - - -Contract LibraryManagementSystem::checkOverDueandComputeOverDueFee() { - definition: loans:Set(Loan) = Loan.allInstance()->select(loan:Loan | loan.IsReturned = false and loan.DueDate.isBefore(Today)) - precondition: true - postcondition: - loans->forAll(loan:Loan | loan.IsReturned = false and - if Today.Before(3).isAfter(loan.DueDate) and loan.OverDue3Days = false - then - loan.LoanedUser.BorrowStatus = BorrowStatus::SUSPEND and sendNotificationEmail(loan.LoanedUser) and loan.OverDue3Days = true - endif - and - if Today.Before(10).isAfter(loan.DueDate) and loan.OverDue10Days = false - then - loan.LoanedUser.SuspensionDays = loan.LoanedUser.SuspensionDays@pre + 14 and sendNotificationEmail(loan.LoanedUser) and loan.OverDue10Days = true - endif - and - if Today.Before(17).isAfter(loan.DueDate) and loan.OverDue17Days = false - then - loan.LoanedUser.SuspensionDays = loan.LoanedUser.SuspensionDays@pre + 30 and sendNotificationEmail(loan.LoanedUser) and loan.OverDue17Days = true - endif - and - if Today.Before(31).isAfter(loan.DueDate) and loan.OverDue31Days = false - then - loan.OverDueFee = 60 and sendNotificationEmail(loan.LoanedUser) and loan.OverDue31Days = true and - loan.LoanedUser.OverDueFee = loan.LoanedUser.OverDueFee@pre + loan.OverDueFee - endif - ) -} - -Contract LibraryManagementSystem::countDownSuspensionDay() { - precondition: true - postcondition: let users:Set(User) = User.allInstance()->select(u:User | u.SuspensionDays > 0) in - users->forAll(u:User | u.SuspensionDays = u.SuspensionDays@pre - 1 - and - if u.BorrowStatus = BorrowStatus::SUSPEND and u.OverDueFee = 0 and u.SuspensionDays = 0 - then - u.BorrowStatus = BorrowStatus::NORMAL - endif ) -} - -/* List records */ -Contract LibraryManagementSystem::listBorrowHistory(uid : Integer) : Set(Loan) { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid) - precondition: user.oclIsUndefined() = false - /*postcondition: result = user.LoanedBook->collect(l:Loan| l.LoanedCopy)*/ - postcondition: result = user.LoanedBook -} - -/*Contract listHodingBook(uid : Integer) : Set(BookCopy) { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - loans:Set(Loan) = user.LoanedBook->select(l:Loan | l.isReturned = false) - precondition: user.oclIsUndefined() = false and loans.oclIsUndefined() = false - postcondition: result = loans->collect(l:Loan | l.LoanedCopy) -}*/ - -Contract LibraryManagementSystem::listHodingBook(uid : Integer) : Set(Loan) { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid) - precondition: user.oclIsUndefined() = false - postcondition: result = user.LoanedBook->select(l:Loan | l.IsReturned = false) -} - -Contract LibraryManagementSystem::listOverDueBook(uid : Integer) : Set(BookCopy) { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - loans:Set(Loan) = user.LoanedBook->select(l:Loan | l.IsReturned = false and l.OverDueFee > 0) - precondition: user.oclIsUndefined() = false and loans.oclIsUndefined() = false - postcondition: result = loans->collect(l:Loan | l.LoanedCopy) -} - -Contract LibraryManagementSystem::listReservationBook(uid : Integer) : Set(BookCopy) { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - res:Set(Reserve) = user.ReservedBook - precondition: user.oclIsUndefined() = false and res.oclIsUndefined() = false - postcondition: result = res->collect(r:Reserve| r.ReservedCopy) -} - -Contract LibraryManagementSystem::listRecommendBook(uid : Integer) : Set(RecommendBook) { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid), - rBooks:Set(RecommendBook) = user.RecommendedBook - precondition: user.oclIsUndefined() = false and rBooks.oclIsUndefined() = false - postcondition: result = rBooks -} - -/* For Book and Book Copy*/ -Contract LibraryManagementSystem::recommendBook(uid : Integer, book : RecommendBook) { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid) - precondition: user.oclIsUndefined() = false and Book.allInstance()->excludes(book) and RecommendBook.allInstance()->excludes(book) - postcondition: book.RecommendDate = Today and book.RecommendUser = user and user.RecommendedBook->includes(book) and RecommendBook.allInstance()->includes(book) -} - -Contract LibraryManagementSystem::addBook(book : Book) { - precondition : Book.allInstance()->excludes(book) - postcondition : Book.allInstance()->includes(book) -} - -Contract LibraryManagementSystem::deleteBook(callNo: String) { - definition: book:Book = Book.allInstance()->any(b:Book | b.CallNo = callNo), bookcopys:Set(BookCopy) = book.Copys - precondition: book.oclIsUndefined() = false and Book.allInstance()->includes(book) - postcondition: BookCopy.allInstance()->excludesAll(bookcopys) and Book.allInstance()->excludes(book) -} - -Contract LibraryManagementSystem::queryBookCopy(barcode : Integer) : BookCopy { - precondition: true - postcondition: result = BookCopy.allInstance()->any(copy:BookCopy | copy.Barcode = barcode) -} - -Contract LibraryManagementSystem::addBookCopy(callNo: String, copy: BookCopy) { - definition: book:Book = Book.allInstance()->any(b:Book | b.CallNo = callNo) - precondition: book.oclIsUndefined() = false and book.Copys->excludes(copy) and BookCopy.allInstance()->excludes(copy) - postcondition: book.Copys->includes(copy) and copy.BookBelongs = book and BookCopy.allInstance()->includes(copy) -} - -Contract LibraryManagementSystem::deleteBookCopy(barcode : Integer) { - definition: copy:BookCopy = BookCopy.allInstance()->any(c:BookCopy | c.Barcode = barcode) - precondition: copy.oclIsUndefined() = false and BookCopy.allInstance()->includes(copy) - postcondition: BookCopy.allInstance()->excludes(copy) -} - -/* For user account*/ -Contract LibraryManagementSystem::createUser(user : User) { - precondition: User.allInstance()->excludes(user) - postcondition: User.allInstance()->includes(user) -} - -Contract LibraryManagementSystem::deleteUser(uid : Integer) { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid) - precondition: User.allInstance()->includes(user) - postcondition: User.allInstance()->excludes(user) -} - -Contract LibraryManagementSystem::queryUser(uid : Integer, librarianID : Integer) : User { - definition: user:User = User.allInstance()->any(u:User | u.UserID = uid) - precondition: user.oclIsUndefined() = false - postcondition: result = user -} - -/* For Librarian account */ -Contract LibraryManagementSystem::createLibrarian(lib : Librarian) { - precondition: Librarian.allInstance()->excludes(lib) - postcondition: Librarian.allInstance()->includes(lib) -} - -Contract LibraryManagementSystem::deleteLibrarian(librarianID : Integer) { - definition: librarian:Librarian = Librarian.allInstance()->any(lib:Librarian | lib.LibrarianID = librarianID) - precondition: Librarian.allInstance()->includes(librarian) - postcondition: Librarian.allInstance()->excludes(librarian) -} - -Contract LibraryManagementSystem::queryLibrarian(librarianID : Integer) : Librarian{ - definition: librarian:Librarian = Librarian.allInstance()->any(lib:Librarian | lib.LibrarianID = librarianID) - precondition: librarian.oclIsUndefined() = false - postcondition: result = librarian -} - -Contract LibraryManagementSystem::sendNotificationEmail(user : User) { - precondition: true - postcondition: true -} - - \ No newline at end of file diff --git a/net.mydreamy.casestudies.library/src/net/mydreamy/casestudies/library/Activator.java b/net.mydreamy.casestudies.library/src/net/mydreamy/casestudies/library/Activator.java deleted file mode 100644 index 6992bb4..0000000 --- a/net.mydreamy.casestudies.library/src/net/mydreamy/casestudies/library/Activator.java +++ /dev/null @@ -1,48 +0,0 @@ -package net.mydreamy.casestudies.library; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -import services.LibraryManagementSystem; -import services.impl.LibraryManagementSystemImpl; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - /* Instance Service */ - LibraryManagementSystem libraryservice = new LibraryManagementSystemImpl(); - /* XML to JAXB*/ - - - - /* Register OSGI Services */ - bundleContext.registerService(libraryservice.getClass().getName(), libraryservice, null); - - - System.out.println("starting"); - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - - /* JAXB to XML */ - Activator.context = null; - System.out.println("stop"); - } - -} diff --git a/net.mydreamy.casestudies.library/src/net/mydreamy/casestudies/test/MainTest.java b/net.mydreamy.casestudies.library/src/net/mydreamy/casestudies/test/MainTest.java deleted file mode 100644 index 1d0c3ec..0000000 --- a/net.mydreamy.casestudies.library/src/net/mydreamy/casestudies/test/MainTest.java +++ /dev/null @@ -1,413 +0,0 @@ -package net.mydreamy.casestudies.test; - -import java.time.LocalDateTime; -import java.util.List; - -import entities.*; - -import services.LibraryManagementSystem; -import services.impl.LibraryManagementSystemImpl; - -public class MainTest { - - public static void main(String[] args) { - // TODO Auto-generated method stub - System.out.println("========= Inital LibraryManagementSystem ============="); - - LibraryManagementSystem libraryservice = new LibraryManagementSystemImpl(); - long startTime = System.nanoTime(); - // ... the code being measured ... - /* create student */ - System.out.println("Create student: Yilong Yang"); - Student s = new Student(); - s.setUserID(37418); - s.setName("Yilong Yang"); - s.setSex(Sex.M); - s.setOverDueFee(0); - s.setRegistrationStatus(StudentStatus.PROGRAMMING); - s.setSuspensionDays(0); - s.setEmail("yylonly@gmail.com"); - s.setMajor("Software Engineering"); - s.setPassword("123456"); - s.setBorrowStatus(BorrowStatus.NORMAL); - s.setFaculty("FST"); - s.setProgramme(Programme.PHD); - - libraryservice.createUser(s); - long estimatedTime = System.nanoTime() - startTime; - System.out.println("Create student: Yilong Yang, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - - System.out.println("Create student: Weiru Wang"); - - Student s1 = new Student(); - s1.setUserID(47427); - s1.setName("Weiru Wang"); - s1.setSex(Sex.F); - s1.setOverDueFee(0); - s1.setRegistrationStatus(StudentStatus.PROGRAMMING); - s1.setSuspensionDays(0); - s1.setEmail("belindaxxf@gmail.com"); - s1.setMajor("Machine Learning"); - s1.setPassword("123456"); - s1.setBorrowStatus(BorrowStatus.NORMAL); - s1.setFaculty("FST"); - s1.setProgramme(Programme.PHD); - - libraryservice.createUser(s1); - - startTime = System.nanoTime(); - /* create librarian */ - System.out.println("Create Librarian: Belinda"); - - Librarian lib = new Librarian(); - lib.setLibrarianID(1); - lib.setName("Belinda"); - lib.setPassword("123456"); - - libraryservice.createLibrarian(lib); - estimatedTime = System.nanoTime() - startTime; - System.out.println("create librarian, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - startTime = System.nanoTime(); - - /* add Book */ - System.out.println("add Book: Applying UML and patterns"); - Book b = new Book(); - b.setTitle("Applying UML and patterns"); - b.setAuthor("Craig Larman"); - b.setCopyNum(2); - b.setCallNo("QA76.6-O35"); - b.setEdition("3rd"); - b.setPublisher("Prentice Hall PTR"); - b.setISBn(131489062); - - System.out.println(libraryservice.addBook(b)); - estimatedTime = System.nanoTime() - startTime; - System.out.println("add Book: Applying UML and patterns, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - startTime = System.nanoTime(); - - /* add BookCopy */ - BookCopy bc1 = new BookCopy(); - bc1.setBarcode(123456); - bc1.setLocation("3/F A2 Science"); - bc1.setStatus(CopyStatus.AVAILABLE); - bc1.setIsReserved(false); - - BookCopy bc2 = new BookCopy(); - bc2.setBarcode(123457); - bc2.setLocation("3/F A2 Science"); - bc2.setStatus(CopyStatus.AVAILABLE); - bc2.setIsReserved(false); - System.out.println("add 2 copys of Applying UML and patterns"); - - /* add BookCopy */ - System.out.println(libraryservice.addBookCopy("QA76.6-O35", bc1)); - System.out.println(libraryservice.addBookCopy("QA76.6-O35", bc2)); - estimatedTime = System.nanoTime() - startTime; - System.out.println("add BookCopy, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - startTime = System.nanoTime(); - - /* Search Book */ - System.out.println("========test searchBookByTitle==========="); - System.out.println("Search: Applying UML and patterns"); - List books = libraryservice.searchBookByTitle("Applying UML and patterns"); - estimatedTime = System.nanoTime() - startTime; - System.out.println("Search: Applying UML and patterns, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - - System.out.println("Result:"); - System.out.println("title: " + books.get(0).getTitle()); - System.out.println("author: " + books.get(0).getAuthor()); - System.out.println("copynumber: " + books.get(0).getCopyNum()); - System.out.println("Publisher: " + books.get(0).getPublisher()); - System.out.println("Copy 1 Status: " + books.get(0).getCopys().get(0).getStatus()); - System.out.println("Copy 2 Status: " + books.get(0).getCopys().get(0).getStatus()); - - System.out.println("========test searchBookByTitle==========="); - System.out.println("ISBN: 131489062"); - books = libraryservice.searchBookByISBN(131489062); - System.out.println("Result:"); - System.out.println("title: " + books.get(0).getTitle()); - System.out.println("author: " + books.get(0).getAuthor()); - System.out.println("copynumber: " + books.get(0).getCopyNum()); - System.out.println("Publisher: " + books.get(0).getPublisher()); - System.out.println("Copy 1 Status: " + books.get(0).getCopys().get(0).getStatus()); - System.out.println("Copy 2 Status: " + books.get(0).getCopys().get(0).getStatus()); - - System.out.println("=========== borrow book ==========="); - - System.out.println("student name is " + libraryservice.queryUser(37418, 1).getName()); - System.out.println("student loaned number is " + libraryservice.queryUser(37418, 1).getLoanedNumber()); - startTime = System.nanoTime(); - System.out.println("the status of Book copy 123457 is : " + libraryservice.queryBookCopy(123457).getStatus()); - System.out.println("estimatedTime:" + ((float)(System.nanoTime() - startTime))/100000 + "ms"); - - System.out.print("student with id 37418 borrows book copy 123457: "); - startTime = System.nanoTime(); - - System.out.println(libraryservice.borrowBook(37418, 123457)); - estimatedTime = System.nanoTime() - startTime; - System.out.println("student with id 37418 borrows book copy 123457, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - - System.out.println("student name is " + libraryservice.queryUser(37418, 1).getName()); - System.out.println("student loaned number is " + libraryservice.queryUser(37418, 1).getLoanedNumber()); - - System.out.println("the status of Book copy 123457 is : " + libraryservice.queryBookCopy(123457).getStatus()); - - System.out.print("student with id 37418 borrows book copy 123457 again: "); - System.out.println(libraryservice.borrowBook(37418, 123457)); - - System.out.println("=========== return book ==========="); - - System.out.println("student name is " + libraryservice.queryUser(37418, 1).getName()); - System.out.println("student loaned number is " + libraryservice.queryUser(37418, 1).getLoanedNumber()); - - System.out.println("the status of Book copy 123457 is : " + libraryservice.queryBookCopy(123457).getStatus()); - - System.out.print("return book copy 123457: "); - startTime = System.nanoTime(); - - System.out.println(libraryservice.returnBook(123457)); - estimatedTime = System.nanoTime() - startTime; - System.out.println(" return book, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - - System.out.println("student name is " + libraryservice.queryUser(37418, 1).getName()); - System.out.println("student loaned number is " + libraryservice.queryUser(37418, 1).getLoanedNumber()); - - System.out.println("the status of Book copy 123457 is : " + libraryservice.queryBookCopy(123457).getStatus()); - - System.out.println("=========== reserve book ==========="); - - - System.out.print("Reserve book when it is avaible : "); - startTime = System.nanoTime(); - System.out.println(libraryservice.makeReservation(47427, 123457)); - estimatedTime = System.nanoTime() - startTime; - System.out.println("Reserve book when it is avaible, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - - System.out.println("Brrow book 123457 by student 37418 (Yilong Yang)"); - System.out.println("student name is " + libraryservice.queryUser(37418, 1).getName()); - System.out.println("student loaned number is " + libraryservice.queryUser(37418, 1).getLoanedNumber()); - - System.out.println("the status of Book copy 123457 is : " + libraryservice.queryBookCopy(123457).getStatus()); - - System.out.print("student with id 37418 borrows book copy 123457: "); - System.out.println(libraryservice.borrowBook(37418, 123457)); - - System.out.println("Copy 123457 status is: " + libraryservice.queryBookCopy(123457).getStatus()); - System.out.println("Is reserved: " + libraryservice.queryBookCopy(123457).getIsReserved()); - - System.out.print("Weiru Wang 47427 reserves book copy 123457 brrowed by Yilong Yang: "); - System.out.println(libraryservice.makeReservation(47427, 123457)); - - System.out.println("Is reserved: " + libraryservice.queryBookCopy(123457).getIsReserved()); - - System.out.print("Weiru Wang 47427 cannel this reservation"); - startTime = System.nanoTime(); - - System.out.println(libraryservice.cannelReservation(47427, 123457)); - System.out.println("cannelReservation, estimatedTime:" + ((float)estimatedTime)/100000 + "ms"); - - System.out.println("Is reserved: " + libraryservice.queryBookCopy(123457).getIsReserved()); - - System.out.print("Weiru Wang 47427 reserves book copy 123457 brrowed by Yilong Yang: "); - System.out.println(libraryservice.makeReservation(47427, 123457)); - - System.out.println("Is reserved: " + libraryservice.queryBookCopy(123457).getIsReserved()); - - - System.out.print("return book copy 123457: "); - System.out.println(libraryservice.returnBook(123457)); - System.out.println("Copy 123457 status is: " + libraryservice.queryBookCopy(123457).getStatus()); - - System.out.print("student with id 47427 borrows book copy 123457: "); - System.out.println(libraryservice.borrowBook(47427, 123457)); - System.out.println("the status of Book copy 123457 is : " + libraryservice.queryBookCopy(123457).getStatus()); - - System.out.println("student name is " + libraryservice.queryUser(47427, 1).getName()); - System.out.println("student loaned number is " + libraryservice.queryUser(47427, 1).getLoanedNumber()); - - System.out.println("=========== listBorrowHistory ==========="); - startTime = System.nanoTime(); - - List bhis = libraryservice.listBorrowHistory(37418); - System.out.println("the number of brrowed book of student 37418: " + bhis.size()); - for (Loan bc : bhis) - { - System.out.println("loaned book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + " loaned time: " + bc.getLoanDate() + " return time: " + bc.getReturnDate()); - } - - System.out.println("cannelReservation, estimatedTime:" + ((float)(System.nanoTime() - startTime))/100000 + "ms"); - - bhis = libraryservice.listBorrowHistory(47427); - System.out.println("the number of brrowed book of student 47427: " + bhis.size()); - for (Loan bc : bhis) - { - System.out.println("loaned book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + " loaned time: " + bc.getLoanDate() + " return time: " + bc.getReturnDate()); - } - - System.out.println("=========== listHodingBook ==========="); - startTime = System.nanoTime(); - - List hb = libraryservice.listHodingBook(37418); - System.out.println("the number of hoding book of student 37418: " + hb.size()); - for (Loan bc : hb) - { - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() ); - } - - hb = libraryservice.listHodingBook(47427); - System.out.println("the number of hoding book of student 47427: " + hb.size()); - for (Loan bc : hb) - { - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() ); - System.out.println("change due time as tommorrow"); - bc.setDueDate(LocalDateTime.now().plusDays(1)); - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() ); - } - -// System.out.println("send notification to" + user.getName()); - -// System.out.println(libraryservice.dueSoonNotification()); - -// List hbs = libraryservice.listHodingBook(37418); -// System.out.println("the number of hoding book: " + hbs.size()); -// for (Loan bc : hbs) -// { -// System.out.println("hoding book name: " + bc.getBookBelongs().getTitle()); -// } - - System.out.println("=========== renew book ==========="); - System.out.println("renew copy with barcode 123457"); - startTime = System.nanoTime(); - - System.out.println(libraryservice.renewBook(47427, 123457)); - System.out.println("cannelReservation, estimatedTime:" + ((float)(System.nanoTime() - startTime))/100000 + "ms"); - - hb = libraryservice.listHodingBook(47427); - System.out.println("the number of hoding book of student 47427: " + hb.size()); - for (Loan bc : hb) - { - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() + ", renew times: " + bc.getRenewedTimes()); - - } - - System.out.println("renew copy with barcode 123457"); - System.out.println(libraryservice.renewBook(47427, 123457)); - - hb = libraryservice.listHodingBook(47427); - System.out.println("the number of hoding book of student 47427: " + hb.size()); - for (Loan bc : hb) - { - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() + ", renew times: " + bc.getRenewedTimes()); - - } - - System.out.println("renew copy with barcode 123457"); - System.out.println(libraryservice.renewBook(47427, 123457)); - - hb = libraryservice.listHodingBook(47427); - System.out.println("the number of hoding book of student 47427: " + hb.size()); - for (Loan bc : hb) - { - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() + ", renew times: " + bc.getRenewedTimes()); - - } - - System.out.println("renew copy with barcode 123457"); - System.out.println(libraryservice.renewBook(47427, 123457)); - - hb = libraryservice.listHodingBook(47427); - System.out.println("the number of hoding book of student 47427: " + hb.size()); - for (Loan bc : hb) - { - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() + ", renew times: " + bc.getRenewedTimes()); - System.out.println("change due time as over due status"); - bc.setDueDate(LocalDateTime.now().plusDays(2)); - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() ); - } - - System.out.println("=========== Notification ==========="); - startTime = System.nanoTime(); - System.out.println(libraryservice.dueSoonNotification()); - System.out.println("Notification, estimatedTime:" + ((float)(System.nanoTime() - startTime))/100000 + "ms"); - - - System.out.println("=========== Compute Over Due ==========="); - System.out.println("Regurar check over due"); - startTime = System.nanoTime(); - - System.out.println(libraryservice.checkOverDueandComputeOverDueFee()); - System.out.println("estimatedTime:" + ((float)(System.nanoTime() - startTime))/100000 + "ms"); - - System.out.println("the number of hoding book of student 47427: " + hb.size()); - for (Loan bc : hb) - { - System.out.println("Set overdue 4 days"); - bc.setDueDate(LocalDateTime.now().minusDays(4)); - System.out.println("Regurar check over due again"); - System.out.println(libraryservice.checkOverDueandComputeOverDueFee()); - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() + ", renew times: " + bc.getRenewedTimes()); - System.out.println("overdue3: " + bc.getOverDue3Days() + " overdue10: " + bc.getOverDue10Days() + " overdue17: " + bc.getOverDue17Days() + " overdue31: "+ bc.getOverDue31Days()); - } - - for (Loan bc : hb) - { - System.out.println("Set overdue 11 days"); - bc.setDueDate(LocalDateTime.now().minusDays(11)); - System.out.println("Regurar check over due again"); - System.out.println(libraryservice.checkOverDueandComputeOverDueFee()); - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() + ", renew times: " + bc.getRenewedTimes()); - System.out.println("overdue3: " + bc.getOverDue3Days() + " overdue10: " + bc.getOverDue10Days() + " overdue17: " + bc.getOverDue17Days() + " overdue31: "+ bc.getOverDue31Days()); - } - - for (Loan bc : hb) - { - System.out.println("Set overdue 50 days"); - bc.setDueDate(LocalDateTime.now().minusDays(50)); - System.out.println("Regurar check over due again"); - System.out.println(libraryservice.checkOverDueandComputeOverDueFee()); - System.out.println("hoding book name: " + bc.getLoanedCopy().getBookBelongs().getTitle() + ", loaned time: " + bc.getLoanDate() + ", due time: " + bc.getDueDate() + ", renew times: " + bc.getRenewedTimes()); - System.out.println("overdue3: " + bc.getOverDue3Days() + " overdue10: " + bc.getOverDue10Days() + " overdue17: " + bc.getOverDue17Days() + " overdue31: "+ bc.getOverDue31Days()); - - System.out.println("=========== Check Weiru Status ==========="); - Student stu = (Student) libraryservice.queryUser(47427, 1); - System.out.println("Borrow status: " + stu.getBorrowStatus()); - System.out.println("Suspension day: " + stu.getSuspensionDays()); - System.out.println("OverDueFee: " + stu.getOverDueFee()); - - System.out.print("Count supspension day: "); - System.out.println(libraryservice.countDownSuspensionDay()); - System.out.println("Suspension day: " + stu.getSuspensionDays()); - - - System.out.println("=========== Pay Over Due Fee==========="); - - System.out.println("return book " + libraryservice.returnBook(123457)); - - System.out.print("Pay Over Due Fee 60: "); - startTime = System.nanoTime(); - - System.out.println(libraryservice.payOverDueFee(47427, 60)); - System.out.println("estimatedTime:" + ((float)(System.nanoTime() - startTime))/100000 + "ms"); - - Student stu1 = (Student) libraryservice.queryUser(47427, 1); - System.out.println("OverDueFee: " + stu1.getOverDueFee()); - - - System.out.println("pass 43 days"); - startTime = System.nanoTime(); - - for (int i = 0; i < 43; i++) - libraryservice.countDownSuspensionDay(); - System.out.println("estimatedTime:" + ((float)(System.nanoTime() - startTime))/100000 + "ms"); - - System.out.println("Suspension day: " + stu.getSuspensionDays()); - System.out.println("Borrow status: " + stu.getBorrowStatus()); - - - } - - - - } - -} diff --git a/net.mydreamy.casestudies.loan.autogui/.classpath b/net.mydreamy.casestudies.loan.autogui/.classpath index 43dbc8e..e35c162 100644 --- a/net.mydreamy.casestudies.loan.autogui/.classpath +++ b/net.mydreamy.casestudies.loan.autogui/.classpath @@ -18,5 +18,10 @@ + + + + + diff --git a/net.mydreamy.casestudies.loan.autogui/pom.xml b/net.mydreamy.casestudies.loan.autogui/pom.xml index 632a354..ba3fa7b 100644 --- a/net.mydreamy.casestudies.loan.autogui/pom.xml +++ b/net.mydreamy.casestudies.loan.autogui/pom.xml @@ -32,6 +32,55 @@ gui.Main + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + gui.Main + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M1 + + gui.MainTest + + + + maven-clean-plugin + 3.1.0 + + + + src-gen + + **/*.java + **/*.fxml + **/*.css + **/*.fxgraph + + + **/MainTest.java + **/ThirdPartServices.java + **/ThirdPartServicesImpl.java + + false + + + + + + @@ -48,6 +97,12 @@ 4.0.10-alpha test + + org.testfx + openjfx-monocle + 8u76-b04 + test + junit junit diff --git a/net.mydreamy.casestudies.loan.autogui/src-gen/gui/MainTest.java b/net.mydreamy.casestudies.loan.autogui/src/test/java/gui/MainTest.java similarity index 89% rename from net.mydreamy.casestudies.loan.autogui/src-gen/gui/MainTest.java rename to net.mydreamy.casestudies.loan.autogui/src/test/java/gui/MainTest.java index 960a05c..021bef6 100644 --- a/net.mydreamy.casestudies.loan.autogui/src-gen/gui/MainTest.java +++ b/net.mydreamy.casestudies.loan.autogui/src/test/java/gui/MainTest.java @@ -52,7 +52,7 @@ public void TestTwoTabs() { sleep(1000); - clickOn("System Status"); + clickOn("System State"); sleep(1000); @@ -71,25 +71,25 @@ public void atestSubmitLoanRequest() { clickOn("#applicant").sleep(1000).doubleClickOn("submitLoanRequest").clickOn("enterLoanInformation").type(KeyCode.TAB).type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("Yilong Yang").type(KeyCode.TAB).write("10000").type(KeyCode.TAB).write("Buy Car").type(KeyCode.TAB).write("20000").type(KeyCode.TAB).write("65583353").type(KeyCode.TAB).write("University of Macau").type(KeyCode.TAB).write("100000").type(KeyCode.TAB).write("yylonly@gmail.com").type(KeyCode.TAB).write("work references").type(KeyCode.TAB).write("credit references").type(KeyCode.TAB).write("1111").type(KeyCode.TAB).write("2222").clickOn("#execute").sleep(2000); //check result - clickOn("System Status").clickOn("LoanRequest").sleep(1000); + clickOn("System State").clickOn("LoanRequest").sleep(1000); //creditRequest clickOn("System Function").sleep(1000).clickOn("creditRequest").sleep(1000).clickOn("#execute").sleep(1000); //check result - clickOn("System Status").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.DOWN).type(KeyCode.DOWN).type(KeyCode.DOWN).sleep(1000).clickOn("LoanRequest").sleep(1000).clickOn("RequestedCreditHistory").sleep(2000); + clickOn("System State").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.DOWN).type(KeyCode.DOWN).type(KeyCode.DOWN).sleep(1000).clickOn("LoanRequest").sleep(1000).clickOn("RequestedCreditHistory").sleep(2000); //accountStatusRequest clickOn("System Function").sleep(1000).clickOn("accountStatusRequest").sleep(1000).clickOn("#execute").sleep(1000); //check result - clickOn("System Status").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.DOWN).type(KeyCode.DOWN).sleep(1000).clickOn("LoanRequest").sleep(1000).clickOn("RequestedCAHistory").sleep(2000); + clickOn("System State").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.DOWN).type(KeyCode.DOWN).sleep(1000).clickOn("LoanRequest").sleep(1000).clickOn("RequestedCAHistory").sleep(2000); //accountStatusRequest clickOn("System Function").sleep(1000).clickOn("calculateScore").sleep(1000).clickOn("#execute").sleep(1000); //check result - clickOn("System Status").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); + clickOn("System State").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); } @@ -106,7 +106,7 @@ public void btestEnterValidatedCreditReference() { clickOn("markRequestValid").sleep(1000).clickOn("#execute").sleep(1000); //check result - clickOn("System Status").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); + clickOn("System State").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); } @@ -138,7 +138,7 @@ public void ctestEnterValidatedCreditReference() { clickOn("approveLoanRequest").sleep(1000).clickOn("#execute").sleep(1000); //check result - clickOn("System Status").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); + clickOn("System State").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); } @@ -162,9 +162,9 @@ public void dtestGenerateLoanLetterAndAgreement() { clickOn("printLoanAgreement").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.TAB).write("1").sleep(1000).clickOn("#execute").sleep(1000); //check result -// clickOn("System Status").sleep(1000).clickOn("ApprovalLetter").sleep(2000).clickOn("LoanAgreement").sleep(2000); +// clickOn("System State").sleep(1000).clickOn("ApprovalLetter").sleep(2000).clickOn("LoanAgreement").sleep(2000); // -// clickOn("System Status"); +// clickOn("System State"); // clickOn("Save Status"); // sleep(2000); // type(KeyCode.L); @@ -185,7 +185,7 @@ public void ftestLoanManagementModule() { clickOn("System Function").sleep(1000).clickOn("#loanclerk").sleep(1000).clickOn("bookNewLoan").type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("1").type(KeyCode.TAB).write("2018-02-01").type(KeyCode.TAB).write("2018-03-01").type(KeyCode.TAB).write("30").clickOn("#execute").sleep(1000); //check result - clickOn("System Status").sleep(1000).clickOn("Loan").sleep(2000).clickOn("LoanAccount").sleep(2000); + clickOn("System State").sleep(1000).clickOn("Loan").sleep(2000).clickOn("LoanAccount").sleep(2000); //generateStandardPaymentNotice and generateLateNotice clickOn("System Function").sleep(1000).clickOn("#scheduler").sleep(2000).clickOn("generateStandardPaymentNotice").clickOn("#execute").sleep(1000).clickOn("generateLateNotice").clickOn("#execute").sleep(1000); @@ -194,13 +194,13 @@ public void ftestLoanManagementModule() { clickOn("#loanclerk").sleep(1000).clickOn("loanPayment").type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.TAB).write("1").clickOn("#execute").sleep(1000); //check result - clickOn("System Status").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); + clickOn("System State").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); //generateStandardPaymentNotice and generateLateNotice clickOn("System Function").sleep(1000).clickOn("#loanclerk").sleep(1000).clickOn("closeOutLoan").type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.TAB).write("1").clickOn("#execute").sleep(1000); //check result - clickOn("System Status").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); + clickOn("System State").sleep(1000).type(KeyCode.TAB).type(KeyCode.TAB).type(KeyCode.DOWN).type(KeyCode.UP).sleep(2000); } @@ -223,7 +223,7 @@ public void ftestLoanManagementModule() { // // sleep(1000); // -// clickOn("System Status"); +// clickOn("System State"); // clickOn("User"); // // @@ -265,7 +265,7 @@ public void ftestLoanManagementModule() { // // sleep(1000); // -// clickOn("System Status"); +// clickOn("System State"); // type(KeyCode.TAB); // type(KeyCode.TAB); // type(KeyCode.UP); @@ -303,8 +303,8 @@ public void ftestLoanManagementModule() { // FxAssert.verifyThat((TitledPane)lookup("#operation_return_pane").query(), NodeMatchers.isNotNull()); // FxAssert.verifyThat(((TitledPane)lookup("#operation_return_pane").query()).getContent(), NodeMatchers.hasText("true")); // -// //check system status of balances -// clickOn("System Status").clickOn("BankCard").sleep(1000); +// //check System State of balances +// clickOn("System State").clickOn("BankCard").sleep(1000); // // //print recipt // clickOn("System Function").clickOn("printReceipt").clickOn("#execute").sleep(1000); @@ -347,8 +347,8 @@ public void ftestLoanManagementModule() { // FxAssert.verifyThat((TitledPane)lookup("#operation_return_pane").query(), NodeMatchers.isNotNull()); // FxAssert.verifyThat(((TitledPane)lookup("#operation_return_pane").query()).getContent(), NodeMatchers.hasText("true")); // -// //check system status of balances -// clickOn("System Status").clickOn("BankCard").sleep(1000); +// //check System State of balances +// clickOn("System State").clickOn("BankCard").sleep(1000); // // //print recipt // clickOn("System Function").clickOn("printReceipt").clickOn("#execute").sleep(1000); From 3c19d289cedf132170daf63f56e658d2dd24564c Mon Sep 17 00:00:00 2001 From: yylonly Date: Sun, 24 Feb 2019 01:02:05 +0800 Subject: [PATCH 3/8] add prefs --- .../net.mydreamy.requirementmodel.REMODEL.prefs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 net.mydreamy.casestudies.cocome.autogui.refined/.settings/net.mydreamy.requirementmodel.REMODEL.prefs diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/.settings/net.mydreamy.requirementmodel.REMODEL.prefs b/net.mydreamy.casestudies.cocome.autogui.refined/.settings/net.mydreamy.requirementmodel.REMODEL.prefs new file mode 100644 index 0000000..8b4311c --- /dev/null +++ b/net.mydreamy.casestudies.cocome.autogui.refined/.settings/net.mydreamy.requirementmodel.REMODEL.prefs @@ -0,0 +1,15 @@ +BuilderConfiguration.is_project_specific=true +autobuilding=true +eclipse.preferences.version=1 +outlet.DEFAULT_OUTPUT.cleanDirectory=false +outlet.DEFAULT_OUTPUT.cleanupDerived=true +outlet.DEFAULT_OUTPUT.createDirectory=true +outlet.DEFAULT_OUTPUT.derived=true +outlet.DEFAULT_OUTPUT.description= +outlet.DEFAULT_OUTPUT.directory=src-gen +outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true +outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false +outlet.DEFAULT_OUTPUT.keepLocalHistory=false +outlet.DEFAULT_OUTPUT.name=DEFAULT_OUTPUT +outlet.DEFAULT_OUTPUT.override=true +outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=false From 6479b9e808c6f60fd2067751f21cb627500285c0 Mon Sep 17 00:00:00 2001 From: yylonly Date: Mon, 27 May 2019 22:13:13 +0800 Subject: [PATCH 4/8] update UML to new version --- .../requirementmodel/cocome.aird | 3883 ++++++++--------- .../requirementmodel/cocome.remodel | 397 +- 2 files changed, 2099 insertions(+), 2181 deletions(-) diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.aird b/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.aird index e6abc0a..75f4918 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.aird +++ b/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.aird @@ -1,63 +1,63 @@ - + cocome.remodel - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -680,665 +680,665 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -1682,558 +1682,558 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + italic bold - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + @@ -2241,15 +2241,15 @@ - + - - - + + + - + @@ -3205,25 +3205,25 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + borderSize borderLineStyle bold @@ -3231,13 +3231,13 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + borderSize borderLineStyle bold @@ -3245,659 +3245,659 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -4206,259 +4206,259 @@ - + - - + + - + - + bold - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - + bold - + - - + + italic bold - + - - + + bold - + - - + + italic bold - + - - + + bold - + - - + + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - - + + + - + @@ -4721,221 +4721,221 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + bold - + - + - + bold - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -5154,184 +5154,184 @@ - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + - + - + - + - + - + bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -5810,367 +5810,367 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -6433,191 +6433,191 @@ - + - + - + - + bold - + - + bold - + - + bold - + - + bold - + - + bold - + - + bold - + - + - + - + - + - + bold - + - + - + bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + bold - + - + - + bold - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -6926,513 +6926,260 @@ - + - - + + - + - + bold - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - + bold - + - - + + italic bold - + - - + + bold - + - - + + italic bold - + - - + + bold - + - - + + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -7448,1024 +7195,1172 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + - - + + - - - - - - - - - - - - + + - - - - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + + + + + + + + + + + + + + + + + + + + + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + + + + + + + + + - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - - - - - - - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - + + - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - - - - - - - - - - - - - - - - - - - + + + + - + + - - - + + + - + - - - + + + - + - + - - - + + + - + @@ -8904,638 +8799,638 @@ - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + bold - + - + italic bold - + - + - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + italic bold - + - + - + - + bold - + - + italic bold - + - + - + - + - + - + - + - + @@ -9543,7 +9438,7 @@ - + diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.remodel b/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.remodel index 0082714..13bafd4 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.remodel +++ b/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.remodel @@ -1,38 +1,231 @@ UseCaseModel CoCoME { + UC::processSale() + UC::openCashDesk() + UC::closeCashDesk() + UC::orderProducts() + UC::receiveOrderedProduct() + UC::showStockReports() + UC::changePrice() + UC::listSuppliers() + UC::openStore() + UC::closeStore() + UC::manageStore() + UC::manageProductCatalog() + UC::manageCashDesk() + UC::manageCashier() + UC::manageItem() + UC::manageSupplier() + Actor Cashier { - UC::processSale() - UC::openCashDesk() - UC::closeCashDesk() + processSale + openCashDesk + closeCashDesk } Actor StoreManager { - UC::orderProducts() - UC::receiveOrderedProduct() - UC::showStockReports() - UC::changePrice() - UC::listSuppliers() - UC::openStore() - UC::closeStore() + orderProducts + receiveOrderedProduct + showStockReports + changePrice + listSuppliers + openStore + closeStore } Actor Administrator { - UC::manageStore() - UC::manageProductCatalog() - UC::manageCashDesk() - UC::manageCashier() - UC::manageItem() - UC::manageSupplier() + manageStore + manageProductCatalog + manageCashDesk + manageCashier + manageItem + manageSupplier } + + } +DomainModel CoCoME { + + @AutoCRUD + Entity Store { + + Id : Integer + Name : String + Address : String + IsOpened : Boolean + + [Refer] + AssociationCashdeskes : CashDesk* (Association) + Productcatalogs : ProductCatalog* (Association) + Items : Item* (Association) + Cashiers : Cashier* (Association) + Sales : Sale* ! ( Association) + + [INV] + inv UniqueStoreId : Store.allInstance()->isUnique(s:Store | s.Id) + + } + + @AutoCRUD + Entity ProductCatalog { + + Id : Integer + Name : String + + [Refer] + ContainedItems : Item* (Association) + + [INV] + inv UniqueProductCatalogId : ProductCatalog.allInstance()->isUnique(p:ProductCatalog | p.Id) + + } + + @AutoCRUD + Entity CashDesk { + + Id : Integer + Name : String + IsOpened : Boolean + + [Refer] + ContainedSales : Sale* (Association) + BelongedStore : Store ! ( Association) + + [INV] + inv UniqueCashDeskId : CashDesk.allInstance()->isUnique(c:CashDesk | c.Id) + + } + + Entity Sale { + + Time : Date + IsComplete: Boolean + Amount : Real + IsReadytoPay : Boolean + + [Refer] + Belongedstore : Store (Association) + BelongedCashDesk : CashDesk ! ( Association) + ContainedSalesLine : SalesLineItem* (Association) + AssoicatedPayment : Payment (Association) + + [INV] + inv AmountGreatAndEqualZero : Amount >= 0 + + } + + @AutoCRUD + Entity Cashier { + + Id : Integer + Name : String + + [Refer] + WorkedStore : Store ! ( Association) + + [INV] + inv UniqueCashierID : Cashier.allInstance()->isUnique(c:Cashier | c.Id) + + } + + Entity SalesLineItem { + + Quantity : Integer + Subamount : Real + + [Refer] + BelongedSale : Sale ! ( Association) + BelongedItem : Item (Association) + + } + + @AutoCRUD + Entity Item { + + Barcode : Integer + Name : String + Price : Real + StockNumber : Integer + OrderPrice : Real + + [Refer] + BelongedCatalog : ProductCatalog ! ( Association) + + [INV] + inv UniqueBarcode : Item.allInstance()->isUnique(u:Item | u.Barcode) + inv PriceGreatThanEqualZero : Price >= 0 + inv StockNumberGreatThanEqualZero : StockNumber >= 0 + + } + + Entity Payment { + + AmountTendered : Real + + [Refer] + BelongedSale : Sale ! ( Association) + + } + + Entity CashPayment extends Payment { + + Balance : Real + + [INV] + inv BalanceGreatAndEqualZero : Balance >= 0 + + } + + Entity CardPayment extends Payment { + + CardAccountNumber : String + ExpiryDate : Date + + } + + Entity OrderEntry { + + Quantity : Integer + SubAmount : Real + + [Refer] + Item : Item (Association) + + } + + @AutoCRUD + Entity Supplier { + + Id : Integer + Name : String + + [INV] + inv UniqueSupplier : Supplier.allInstance()->isUnique(s:Supplier | s.Id) + + } + + Entity OrderProduct { + + Id : Integer + Time : Date + OrderStatus : OrderStatus[NEW|RECEIVED|REQUESTED] + Amount : Real + + [Refer] + Supplier : Supplier (Association) + ContainedEntries : OrderEntry* (Association) + + } + +} Service CoCoMEProcessSale { [Operation] @@ -320,176 +513,6 @@ Interaction ProcessSaleInteraction { } -@AutoCRUD -Entity Store { - - Id : Integer - Name : String - Address : String - IsOpened : Boolean - - [Refer] - Cashdeskes : CashDesk* - Productcatalogs : ProductCatalog* - Items : Item* - Cashiers : Cashier* - Sales : Sale* - - [INV] - inv UniqueStoreId : Store.allInstance()->isUnique(s:Store | s.Id) - -} - -@AutoCRUD -Entity ProductCatalog { - - Id : Integer - Name : String - - [Refer] - ContainedItems : Item* - - [INV] - inv UniqueProductCatalogId : ProductCatalog.allInstance()->isUnique(p:ProductCatalog | p.Id) - -} - -@AutoCRUD -Entity CashDesk { - - Id : Integer - Name : String - IsOpened : Boolean - - [Refer] - ContainedSales : Sale* - BelongedStore : Store - - [INV] - inv UniqueCashDeskId : CashDesk.allInstance()->isUnique(c:CashDesk | c.Id) - -} - -Entity Sale { - - Time : Date - IsComplete: Boolean - Amount : Real - IsReadytoPay : Boolean - - [Refer] - Belongedstore : Store - BelongedCashDesk : CashDesk - ContainedSalesLine : SalesLineItem* - AssoicatedPayment : Payment - - [INV] - inv AmountGreatAndEqualZero : Amount >= 0 - -} - -@AutoCRUD -Entity Cashier { - - Id : Integer - Name : String - - [Refer] - WorkedStore : Store - - [INV] - inv UniqueCashierID : Cashier.allInstance()->isUnique(c:Cashier | c.Id) - -} - -Entity SalesLineItem { - - Quantity : Integer - Subamount : Real - - [Refer] - BelongedSale : Sale - BelongedItem : Item - -} - -@AutoCRUD -Entity Item { - - Barcode : Integer - Name : String - Price : Real - StockNumber : Integer - OrderPrice : Real - - [Refer] - BelongedCatalog : ProductCatalog - - [INV] - inv UniqueBarcode : Item.allInstance()->isUnique(u:Item | u.Barcode) - inv PriceGreatThanEqualZero : Price >= 0 - inv StockNumberGreatThanEqualZero : StockNumber >= 0 - -} - -Entity Payment { - - AmountTendered : Real - - [Refer] - BelongedSale : Sale - -} - -Entity CashPayment extends Payment { - - Balance : Real - - [INV] - inv BalanceGreatAndEqualZero : Balance >= 0 - -} - -Entity CardPayment extends Payment { - - CardAccountNumber : String - ExpiryDate : Date - -} - -Entity OrderEntry { - - Quantity : Integer - SubAmount : Real - - [Refer] - Item : Item - -} - -@AutoCRUD -Entity Supplier { - - Id : Integer - Name : String - - [INV] - inv UniqueSupplier : Supplier.allInstance()->isUnique(s:Supplier | s.Id) - -} - -Entity OrderProduct { - - Id : Integer - Time : Date - OrderStatus : OrderStatus[NEW|RECEIVED|REQUESTED] - Amount : Real - - [Refer] - Supplier : Supplier - ContainedEntries : OrderEntry* - -} Contract CoCoMEProcessSale::openStore(storeID : Integer) : Boolean { @@ -1224,7 +1247,7 @@ Contract ManageItemCRUDService::createItem(barcode : Integer, name : String, pr //entity query operation Contract ManageItemCRUDService::queryItem(barcode : Integer) : Item { - /* definition: find specific Item instance by barcode */ + /* definition: find a specific Item by barcode */ definition: item:Item = Item.allInstance()->any(ite:Item | ite.Barcode = barcode) From c0379a6a313baebab47998eb08129813cf988a04 Mon Sep 17 00:00:00 2001 From: yylonly Date: Mon, 27 May 2019 23:07:18 +0800 Subject: [PATCH 5/8] fix cocome --- .../pom.xml | 4 +- .../requirementmodel/cocome.aird | 119 ++++++++++-------- 2 files changed, 70 insertions(+), 53 deletions(-) diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml b/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml index f0704aa..fc92943 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml +++ b/net.mydreamy.casestudies.cocome.autogui.refined/pom.xml @@ -57,7 +57,7 @@ - + org.codehaus.mojo diff --git a/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.aird b/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.aird index 75f4918..04e1e05 100644 --- a/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.aird +++ b/net.mydreamy.casestudies.cocome.autogui.refined/requirementmodel/cocome.aird @@ -6182,7 +6182,7 @@ - + @@ -6191,7 +6191,7 @@ - + @@ -6200,7 +6200,7 @@ - + @@ -6229,7 +6229,7 @@ - + @@ -6251,7 +6251,7 @@ - + @@ -6262,7 +6262,7 @@ - + @@ -6273,35 +6273,35 @@ - + - + - + - - - + + + - + - + - + - - - + + + @@ -6337,97 +6337,96 @@ - + - + - + - - + - + - + - + - - - + + + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -6443,6 +6442,9 @@ + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO bold @@ -6452,6 +6454,9 @@ + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO bold @@ -6461,6 +6466,9 @@ + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO bold @@ -6488,6 +6496,9 @@ + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO bold @@ -6505,6 +6516,9 @@ + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO @@ -6513,6 +6527,9 @@ + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO bold @@ -7538,19 +7555,19 @@ - + - + - + - + - + From 2ff2f2dc0bef4ab3ccbf9775dc0f8b745195b821 Mon Sep 17 00:00:00 2001 From: yylonly Date: Mon, 27 May 2019 23:20:22 +0800 Subject: [PATCH 6/8] atm fixed --- .../requirementmodel/atm.aird | 1824 +++++++++-------- .../requirementmodel/atm.remodel | 115 +- 2 files changed, 981 insertions(+), 958 deletions(-) diff --git a/net.mydreamy.casestudies.atm.autogui/requirementmodel/atm.aird b/net.mydreamy.casestudies.atm.autogui/requirementmodel/atm.aird index 8171ca0..b4ad514 100644 --- a/net.mydreamy.casestudies.atm.autogui/requirementmodel/atm.aird +++ b/net.mydreamy.casestudies.atm.autogui/requirementmodel/atm.aird @@ -1,59 +1,59 @@ - + atm.remodel - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -420,13 +420,13 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + borderSize borderLineStyle bold @@ -434,13 +434,13 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + borderSize borderLineStyle bold @@ -448,252 +448,252 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -967,428 +967,428 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + - + - + - + @@ -1396,15 +1396,15 @@ - + - - - + + + - + @@ -1557,204 +1557,204 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -2018,207 +2018,207 @@ - + - - + + - + - + bold - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - + bold - + - - + + - + bold - + - - + + - + - + - - + + - + bold - + - - + + - + - + - - + + - + bold - + - - + + - + - + - - + + - + bold - + - - + + - + - + - - + + - + bold - + - - + + - + - + - - - + + + - + @@ -2267,17 +2267,6 @@ - - - - - - - - - - - @@ -2300,6 +2289,17 @@ + + + + + + + + + + + @@ -2366,38 +2366,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2430,175 +2398,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + - - - + + + - + @@ -2677,7 +2677,7 @@ - + @@ -2755,271 +2755,289 @@ + + + + + + + + + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + + + + + + bold + + + + - + - - - + + + - + @@ -3283,559 +3301,555 @@ - + - - + + - + - + bold - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - - + + + - + - - - - - - + + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - - - - + + + + + + - - - + + + - - - + + + - - + + - - + + - - - - - - + + + + + + - - - + + + - - + + - - + + - - - - - - + + + + + + - - - + + + - - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - + + + + + + + - - + + - - + + - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - - KEEP_LOCATION - KEEP_SIZE - KEEP_RATIO - + + + + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + - - - - + + + + - - - - - - - - - - + + - + - - - + + + - + @@ -4056,176 +4070,176 @@ - + - - + + - + - + bold - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - - + + + - + @@ -4489,199 +4503,199 @@ - + - - + + - + - + bold - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + diff --git a/net.mydreamy.casestudies.atm.autogui/requirementmodel/atm.remodel b/net.mydreamy.casestudies.atm.autogui/requirementmodel/atm.remodel index 429180d..932d516 100644 --- a/net.mydreamy.casestudies.atm.autogui/requirementmodel/atm.remodel +++ b/net.mydreamy.casestudies.atm.autogui/requirementmodel/atm.remodel @@ -1,22 +1,78 @@ UseCaseModel AutomatedTellerMachine { + UC::withdrawCash() -> ATMSystem include cardIdentification + UC::checkBalance() -> ATMSystem include cardIdentification + UC::depositFunds() -> ATMSystem + UC::manageBankCard() + UC::manageUser() + UC::cardIdentification() + Actor Customer { - UC::withdrawCash() -> ATMSystem include cardIdentification - UC::checkBalance() -> ATMSystem include cardIdentification - UC::depositFunds() -> ATMSystem + withdrawCash + checkBalance + depositFunds } Actor BankClerk { - UC::manageBankCard() - UC::manageUser() + manageBankCard + manageUser } - UC::cardIdentification() +} + +DomainModel ATM { + @AutoCRUD + Entity BankCard { + + CardID : Integer + CardStatus : CardStatus[NORMAL|SUSPEND|CANNEL] + Catalog : CardCatalog[CREDIT|DESPOSIT] + Password : Integer + Balance : Real + + [Refer] + BelongedUser : User (Association) + Has : Transcation* (Association) + + [INV] + inv UniqueCardID : BankCard.allInstance()->isUnique(b:BankCard | b.CardID) + inv BalanceGreatAndEqualZero : Balance >= 0 + + } + + @AutoCRUD + Entity User { + + UserID : Integer + Name : String + Address : String + + [Refer] + OwnedCard : BankCard* ! ( Association) + + [INV] + inv UniqueUserID : User.allInstance()->isUnique(u:User | u.UserID) + + } + + Entity Transcation { + + WithdrawedNum : Integer + BalanceAfterWithdraw : Real + + [Refer] + InvolvedCard : BankCard ! ( Association) + + [INV] + inv WithdrawedNumGreatAndEqualZero : WithdrawedNum >= 0 + inv BalanceAfterWithdrawGreatAndEqualZero : BalanceAfterWithdraw >= 0 + + } } Service ATMSystem { @@ -229,53 +285,6 @@ Interaction DepositFundsInteraction { } -@AutoCRUD -Entity BankCard { - - CardID : Integer - CardStatus : CardStatus[NORMAL|SUSPEND|CANNEL] - Catalog : CardCatalog[CREDIT|DESPOSIT] - Password : Integer - Balance : Real - - [Refer] - BelongedUser : User - Has : Transcation* - - [INV] - inv UniqueCardID : BankCard.allInstance()->isUnique(b:BankCard | b.CardID) - inv BalanceGreatAndEqualZero : Balance >= 0 - -} - -@AutoCRUD -Entity User { - - UserID : Integer - Name : String - Address : String - - [Refer] - OwnedCard : BankCard* - - [INV] - inv UniqueUserID : User.allInstance()->isUnique(u:User | u.UserID) - -} - -Entity Transcation { - - WithdrawedNum : Integer - BalanceAfterWithdraw : Real - - [Refer] - InvolvedCard : BankCard - - [INV] - inv WithdrawedNumGreatAndEqualZero : WithdrawedNum >= 0 - inv BalanceAfterWithdrawGreatAndEqualZero : BalanceAfterWithdraw >= 0 - -} From 22b037274603fa9d25564463542cffe6ea916a5e Mon Sep 17 00:00:00 2001 From: yylonly Date: Mon, 27 May 2019 23:33:07 +0800 Subject: [PATCH 7/8] fix library --- .../requirementmodel/library.aird | 2678 +++++++++-------- .../requirementmodel/library.remodel | 439 +-- 2 files changed, 1664 insertions(+), 1453 deletions(-) diff --git a/net.mydreamy.casestudies.library.autogui/requirementmodel/library.aird b/net.mydreamy.casestudies.library.autogui/requirementmodel/library.aird index d4a2295..7609def 100644 --- a/net.mydreamy.casestudies.library.autogui/requirementmodel/library.aird +++ b/net.mydreamy.casestudies.library.autogui/requirementmodel/library.aird @@ -1,1391 +1,1571 @@ - + library.remodel - + - + - + - + - + - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + - - - - + + + + - + + - - - - + + + + - + + - - - - - - + + + + + + + - - - - - - + + + + + + + - - - - + + + + - + + - - - - - - + + + + + + + - - - - - - + + + + + + + - - - - + + + + - + + - - - - + + + + - + + - - - + + + - + - - - + + + - + - - - + + + - + - - - - - bold - - - - - - - - - - - - - - - - - - - - - + - - - + + + - + @@ -1753,582 +1933,582 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + @@ -2336,15 +2516,15 @@ - + - - - + + + - + @@ -2980,480 +3160,480 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/net.mydreamy.casestudies.library.autogui/requirementmodel/library.remodel b/net.mydreamy.casestudies.library.autogui/requirementmodel/library.remodel index ea64f33..c3e25d0 100644 --- a/net.mydreamy.casestudies.library.autogui/requirementmodel/library.remodel +++ b/net.mydreamy.casestudies.library.autogui/requirementmodel/library.remodel @@ -1,12 +1,37 @@ UseCaseModel LibraryManagementSystem { + UC::searchBook() + UC::listBookHistory() + UC::makeReservation() + UC::recommendBook() + UC::cancelReservation() + + UC::manageUser() + UC::manageBook() + UC::manageSubject() + UC::manageBookCopy() + UC::manageLibrarian() + UC::listRecommendBook() + + UC::borrowBook() + UC::renewBook() + UC::payOverDueFee() + UC::returnBook() + + UC::checkOverDueandComputeOverDueFee() + UC::dueSoonNotification() + UC::countDownSuspensionDay() + + UC::sendNotificationEmail() + + Actor User { - UC::searchBook() - UC::listBookHistory() - UC::makeReservation() - UC::recommendBook() - UC::cancelReservation() + searchBook + listBookHistory + makeReservation + recommendBook + cancelReservation } @@ -26,38 +51,229 @@ UseCaseModel LibraryManagementSystem { Actor Administrator { - UC::manageUser() - UC::manageBook() - UC::manageSubject() - UC::manageBookCopy() - UC::manageLibrarian() - UC::listRecommendBook() + manageUser + manageBook + manageSubject + manageBookCopy + manageLibrarian + listRecommendBook } Actor Librarian { - UC::borrowBook() - UC::renewBook() - UC::payOverDueFee() - UC::returnBook() + borrowBook + renewBook + payOverDueFee + returnBook } Actor Scheduler { - UC::checkOverDueandComputeOverDueFee() - UC::dueSoonNotification() - UC::countDownSuspensionDay() + checkOverDueandComputeOverDueFee + dueSoonNotification + countDownSuspensionDay } Actor ThirdPartSystem { - UC::sendNotificationEmail() + sendNotificationEmail } +} + +DomainModel LibraryManagementSystem { + + /* Domain Model */ + @AutoCRUD + Entity User { + + /* Basic information */ + UserID : String + Name : String + Sex : Sex[M|F] + Password : String + Email : String + Faculty : String + /* Library related information */ + LoanedNumber : Integer + BorrowStatus : BorrowStatus[NORMAL|SUSPEND] + SuspensionDays : Integer + OverDueFee : Real + + [Refer] + LoanedBook : Loan* (Association) + ReservedBook : Reserve* (Association) + RecommendedBook : RecommendBook* (Association) + + [INV] + inv UniqueUserID : User.allInstance()->isUnique(u:User | u.UserID) + inv OverDueFeeGreatThanEqualZero : OverDueFee >= 0 + inv LoanedNumberGreatThanEqualZero : LoanedNumber >= 0 + inv SuspensionDaysGreatThanEqualZero : SuspensionDays >= 0 + + } + + Entity Student extends User { + + Major : String + Programme : Programme[BACHELOR|MASTER|PHD] + RegistrationStatus : StudentStatus[GRADUATED|PROGRAMMING] + + [INV] + inv StudentLoanLessThanEqualTwelve: Student.allInstance()->forAll(stu : Student | stu.LoanedNumber <= 12) + inv StudentLoanedBookAssociationInvariants : super.LoanedBook.size() <= 12 ASSOCINV + + } + + Entity Faculty extends User { + + Position : FacultyPosition[ASSISTANTPROFESSORS|ASSOCIATEPROFESSOR|PROFESSOR|CHAIRPROFESSOR] + Status : FacultyStatus[HASRETIRED|INPOSITION] + + [INV] + inv FacultyLoanLessthanEqualTwentyFour: Student.allInstance()->forAll(stu : Student | stu.LoanedNumber <= 24) + inv FacultyLoanedBookAssociationInvariants : super.LoanedBook.size() <= 24 ASSOCINV + + } + + @AutoCRUD + Entity Book { + + CallNo : String + Title : String + Edition : String + Author : String + Publisher : String + Description : String + ISBn : String + CopyNum: Integer + + [Refer] + Copys : BookCopy* ! ( Association) + Subject : Subject* (Association) + + [INV] + inv BookCallNoUnique : Book.allInstance()->isUnique(b:Book | b.CallNo) + inv BookISBNUnique : Book.allInstance()->isUnique(b:Book | b.ISBn) + inv BookCopyNumGreatThanEqualZero : CopyNum >= 0 + + } + + @AutoCRUD + Entity Subject { + + Name : String + + [Refer] + SuperSubject : Subject ! ( Association) + SubSubject : Subject* (Association) + + } + + @AutoCRUD + Entity BookCopy { + + Barcode : String + Status : CopyStatus[AVAILABLE|INPROCESSING|LIBUSEONLY|ONHOLDSHELF|LOANED] + Location : String + IsReserved : Boolean + + [Refer] + BookBelongs : Book (Association) + LoanedRecord : Loan* (Association) + ReservationRecord : Reserve* (Association) + + [INV] + inv BarCodeUnique : BookCopy.allInstance()->isUnique(bc:BookCopy | bc.Barcode) + + } + + Entity Loan { + + LoanDate : Date + RenewDate : Date + DueDate : Date + ReturnDate : Date + RenewedTimes : Integer + IsReturned : Boolean // for list loaning book and loaned book + OverDueFee : Real + OverDue3Days : Boolean + OverDue10Days : Boolean + OverDue17Days : Boolean + OverDue31Days : Boolean + + [Refer] + LoanedUser : User ! ( Association) + LoanedCopy : BookCopy ! ( Association) + LoanLibrarian : Librarian (Association) + ReturnLibrarian : Librarian (Association) + + [INV] + inv OverDueFeeGreatThanEqualZero : OverDueFee >= 0 + inv RenewedTimesLessThanEqualSix : RenewedTimes >=0 and RenewedTimes <= 6 + inv LoanOverDueFeeGreatThanEqualZero : OverDueFee >= 0 + inv RenewDataAfterLoanDate : if (RenewDate.oclIsUndefined() = false) then RenewDate.isAfter(LoanDate) endif + inv DueDateAfterLoanDate : DueDate.isAfter(LoanDate) + inv ReturnDateAfterORSameLoanDate : if (ReturnDate.oclIsUndefined() = false) then ReturnDate.isAfter(LoanDate) or ReturnDate.isEqual(LoanDate) endif + inv DueDateAfterORSameRenewDate : if (RenewDate.oclIsUndefined() = false) then DueDate.isAfter(RenewDate) or DueDate.isEqual(RenewDate) endif + inv ReturnDateSameORAfterRenewDate : if (RenewDate.oclIsUndefined() = false and ReturnDate.oclIsUndefined() = false) then ReturnDate.isAfter(RenewDate) or ReturnDate.isEqual(RenewDate) endif + + } + + Entity Reserve { + + ReserveDate : Date + IsReserveClosed : Boolean // for list all reserving book and reserved book + + [Refer] + ReservedCopy : BookCopy ! ( Association) + ReservedUser : User ! ( Association) + + } + + Entity RecommendBook extends Book { + + RecommendDate : Date + + [Refer] + RecommendUser : User ! ( Association) + + [INV] + inv BookCallNoUnique : Book.allInstance()->isUnique(b:Book | b.CallNo) + inv BookISBNUnique : Book.allInstance()->isUnique(b:Book | b.ISBn) + inv BookCopyNumGreatThanEqualZero : super.CopyNum >= 0 + + } + + Entity Administrator { + + AdminID : String + UserName : String + Password : String + + [INV] + inv AdministratorIDUnique : Administrator.allInstance()->isUnique(a : Administrator | a.AdminID) + + } + + @AutoCRUD + Entity Librarian { + + LibrarianID : String + Name : String + Password : String + + [INV] + inv LibrarianIDUnique : Librarian.allInstance()->isUnique(l:Librarian | l.LibrarianID) + + } + + + } /* System Controller */ @@ -170,191 +386,6 @@ Service ManageLibrarianCRUDService { -/* Domain Model */ -@AutoCRUD -Entity User { - - /* Basic information */ - UserID : String - Name : String - Sex : Sex[M|F] - Password : String - Email : String - Faculty : String - /* Library related information */ - LoanedNumber : Integer - BorrowStatus : BorrowStatus[NORMAL|SUSPEND] - SuspensionDays : Integer - OverDueFee : Real - - [Refer] - LoanedBook : Loan* - ReservedBook : Reserve* - RecommendedBook : RecommendBook* - - [INV] - inv UniqueUserID : User.allInstance()->isUnique(u:User | u.UserID) - inv OverDueFeeGreatThanEqualZero : OverDueFee >= 0 - inv LoanedNumberGreatThanEqualZero : LoanedNumber >= 0 - inv SuspensionDaysGreatThanEqualZero : SuspensionDays >= 0 - -} - -Entity Student extends User { - - Major : String - Programme : Programme[BACHELOR|MASTER|PHD] - RegistrationStatus : StudentStatus[GRADUATED|PROGRAMMING] - - [INV] - inv StudentLoanLessThanEqualTwelve: Student.allInstance()->forAll(stu : Student | stu.LoanedNumber <= 12) - inv StudentLoanedBookAssociationInvariants : super.LoanedBook.size() <= 12 ASSOCINV - -} - -Entity Faculty extends User { - - Position : FacultyPosition[ASSISTANTPROFESSORS|ASSOCIATEPROFESSOR|PROFESSOR|CHAIRPROFESSOR] - Status : FacultyStatus[HASRETIRED|INPOSITION] - - [INV] - inv FacultyLoanLessthanEqualTwentyFour: Student.allInstance()->forAll(stu : Student | stu.LoanedNumber <= 24) - inv FacultyLoanedBookAssociationInvariants : super.LoanedBook.size() <= 24 ASSOCINV - -} - -@AutoCRUD -Entity Book { - - CallNo : String - Title : String - Edition : String - Author : String - Publisher : String - Description : String - ISBn : String - CopyNum: Integer - - [Refer] - Copys : BookCopy* - Subject : Subject* - - [INV] - inv BookCallNoUnique : Book.allInstance()->isUnique(b:Book | b.CallNo) - inv BookISBNUnique : Book.allInstance()->isUnique(b:Book | b.ISBn) - inv BookCopyNumGreatThanEqualZero : CopyNum >= 0 - -} - -@AutoCRUD -Entity Subject { - - Name : String - - [Refer] - SuperSubject : Subject - SubSubject : Subject* - -} - -@AutoCRUD -Entity BookCopy { - - Barcode : String - Status : CopyStatus[AVAILABLE|INPROCESSING|LIBUSEONLY|ONHOLDSHELF|LOANED] - Location : String - IsReserved : Boolean - - [Refer] - BookBelongs : Book - LoanedRecord : Loan* - ReservationRecord : Reserve* - - [INV] - inv BarCodeUnique : BookCopy.allInstance()->isUnique(bc:BookCopy | bc.Barcode) - -} - -Entity Loan { - - LoanDate : Date - RenewDate : Date - DueDate : Date - ReturnDate : Date - RenewedTimes : Integer - IsReturned : Boolean // for list loaning book and loaned book - OverDueFee : Real - OverDue3Days : Boolean - OverDue10Days : Boolean - OverDue17Days : Boolean - OverDue31Days : Boolean - - [Refer] - LoanedUser : User - LoanedCopy : BookCopy - LoanLibrarian : Librarian - ReturnLibrarian : Librarian - - [INV] - inv OverDueFeeGreatThanEqualZero : OverDueFee >= 0 - inv RenewedTimesLessThanEqualSix : RenewedTimes >=0 and RenewedTimes <= 6 - inv LoanOverDueFeeGreatThanEqualZero : OverDueFee >= 0 - inv RenewDataAfterLoanDate : if (RenewDate.oclIsUndefined() = false) then RenewDate.isAfter(LoanDate) endif - inv DueDateAfterLoanDate : DueDate.isAfter(LoanDate) - inv ReturnDateAfterORSameLoanDate : if (ReturnDate.oclIsUndefined() = false) then ReturnDate.isAfter(LoanDate) or ReturnDate.isEqual(LoanDate) endif - inv DueDateAfterORSameRenewDate : if (RenewDate.oclIsUndefined() = false) then DueDate.isAfter(RenewDate) or DueDate.isEqual(RenewDate) endif - inv ReturnDateSameORAfterRenewDate : if (RenewDate.oclIsUndefined() = false and ReturnDate.oclIsUndefined() = false) then ReturnDate.isAfter(RenewDate) or ReturnDate.isEqual(RenewDate) endif - -} - -Entity Reserve { - - ReserveDate : Date - IsReserveClosed : Boolean // for list all reserving book and reserved book - - [Refer] - ReservedCopy : BookCopy - ReservedUser : User - -} - -Entity RecommendBook extends Book { - - RecommendDate : Date - - [Refer] - RecommendUser : User - - [INV] - inv BookCallNoUnique : Book.allInstance()->isUnique(b:Book | b.CallNo) - inv BookISBNUnique : Book.allInstance()->isUnique(b:Book | b.ISBn) - inv BookCopyNumGreatThanEqualZero : super.CopyNum >= 0 - -} - -Entity Administrator { - - AdminID : String - UserName : String - Password : String - - [INV] - inv AdministratorIDUnique : Administrator.allInstance()->isUnique(a : Administrator | a.AdminID) - -} - -@AutoCRUD -Entity Librarian { - - LibrarianID : String - Name : String - Password : String - - [INV] - inv LibrarianIDUnique : Librarian.allInstance()->isUnique(l:Librarian | l.LibrarianID) - -} - /* -------------------- Contracts ----------------------*/ /* Search book */ Contract SearchBook::searchBookByBarCode(barcode:String): Set(Book) { From 6c6b4b8d449393defda9f0b7a366978c9bf4df94 Mon Sep 17 00:00:00 2001 From: yylonly Date: Mon, 27 May 2019 23:48:05 +0800 Subject: [PATCH 8/8] fix loadPS --- .../requirementmodel/loan.aird | 2651 +++++++++-------- .../requirementmodel/loan.remodel | 292 +- 2 files changed, 1565 insertions(+), 1378 deletions(-) diff --git a/net.mydreamy.casestudies.loan.autogui/requirementmodel/loan.aird b/net.mydreamy.casestudies.loan.autogui/requirementmodel/loan.aird index f26fd3f..bcf37cf 100644 --- a/net.mydreamy.casestudies.loan.autogui/requirementmodel/loan.aird +++ b/net.mydreamy.casestudies.loan.autogui/requirementmodel/loan.aird @@ -1,39 +1,39 @@ - + loan.remodel - + - + - + - + - + - + - + - - - + + + - + @@ -444,13 +444,13 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + borderLineStyle borderSize bold @@ -458,11 +458,11 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + borderSize borderLineStyle bold @@ -470,25 +470,25 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + borderSize borderLineStyle bold @@ -496,13 +496,13 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + borderSize borderLineStyle bold @@ -510,277 +510,277 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + labelSize - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + labelSize - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + @@ -791,18 +791,18 @@ - + - + - + @@ -813,7 +813,7 @@ - + @@ -860,7 +860,7 @@ - + @@ -871,7 +871,7 @@ - + @@ -882,7 +882,7 @@ - + @@ -893,7 +893,7 @@ - + @@ -904,7 +904,7 @@ - + @@ -915,7 +915,7 @@ - + @@ -926,1280 +926,1439 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + bold - + - + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + bold - + - + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + bold - + - + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + bold - + - + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + bold - + - + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - + + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - - - - + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + - + + + + + + + + + + + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + + + + + + + + + + + + + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + bold + + + + + + + + + + + + + + + + + + + - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - + + + + - + + - - - - - bold - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + + + - + @@ -2553,546 +2712,546 @@ - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + italic bold - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + - + - + - + - + - + KEEP_LOCATION KEEP_SIZE KEEP_RATIO - + bold - + - + italic bold - + - + - + - + - + - + - + - + @@ -3100,38 +3259,16 @@ - + - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - @@ -3231,488 +3368,510 @@ + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - - - - - - + + + + + + + + - + bold - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + bold - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + diff --git a/net.mydreamy.casestudies.loan.autogui/requirementmodel/loan.remodel b/net.mydreamy.casestudies.loan.autogui/requirementmodel/loan.remodel index 6fc6df8..e323d6b 100644 --- a/net.mydreamy.casestudies.loan.autogui/requirementmodel/loan.remodel +++ b/net.mydreamy.casestudies.loan.autogui/requirementmodel/loan.remodel @@ -1,52 +1,192 @@ UseCaseModel LoanProcessingSystem { + @uc_description: "The loan officer reviews the online information about the pending loan request to determine whether the loan should be approved" + UC::evaluateLoanRequest() + UC::manageLoanTerm() + UC::enterValidatedCreditReferences() + + @uc_description: "a loan clerk has the system genereate an approval letter for the applicant" + UC::generateLoanLetterAndAgreement() + + @uc_description: "Once a loan aggrement has been sighed by the customer and returned to the bank, the loan clerk has the system create a loan account based on the agreed-on terms and conditions" + UC::bookNewLoan() + + @uc_description: "Payment is received from the customer, the loan clerk enters the payment into the appropriate loan account" + UC::loanPayment() + + @uc_description: "The loan has been paid in full by the customer, and the loan will be closed" + UC::closeOutLoan() + + @uc_description: "when the monthly billing time occurs, the loan system genereates the bill statements for mailing to the customer" + UC::generateStandardPaymentNotice() + + @uc_description: "The loan system genereates the late notice for mailling to the customer" + UC::generateLateNotice() + + @uc_description: "The applicant fills out a loan application and submits it to the bank for processing" + UC::submitLoanRequest() + + @actor_description:"a loan officer is an officer of the bank who has the designated responsibilitiy of evaluating requests for a loan" Actor LoanOfficer { - UC::evaluateLoanRequest() @uc_description: "The loan officer reviews the online information about the pending loan request to determine whether the loan should be approved" - UC::manageLoanTerm() + evaluateLoanRequest + manageLoanTerm - } + } + @actor_description: "The loan assistant is responsible for manually capturing and entering into the system the credit information" Actor LoanAssistant { - UC::enterValidatedCreditReferences() - + enterValidatedCreditReferences -@uc_description: "The loan assistant enters any credit reference information that was checked manually" - - } + } + @actor_description: "The loan clerk is responsible for booking (recording and setting up) the loan" Actor LoanClerk { - UC::generateLoanLetterAndAgreement() @uc_description: "a loan clerk has the system genereate an approval letter for the applicant" - UC::bookNewLoan() @uc_description: "Once a loan aggrement has been sighed by the customer and returned to the bank, the loan clerk has the system create a loan account based on the agreed-on terms and conditions" - UC::loanPayment() @uc_description: "Payment is received from the customer, the loan clerk enters the payment into the appropriate loan account" - UC::closeOutLoan() + generateLoanLetterAndAgreement + bookNewLoan + loanPayment + closeOutLoan -@uc_description: "The loan has been paid in full by the customer, and the loan will be closed" - - } + } Actor Scheduler { - UC::generateStandardPaymentNotice() @uc_description: "when the monthly billing time occurs, the loan system genereates the bill statements for mailing to the customer" - UC::generateLateNotice() - -@uc_description: "The loan system genereates the late notice for mailling to the customer" + generateStandardPaymentNotice + generateLateNotice } @actor_description: "An applicant is an individual or organization who sumits an application for a loan to the bank" Actor Applicant { - UC::submitLoanRequest() @uc_description: "The applicant fills out a loan application and submits it to the bank for processing" + submitLoanRequest + } + +} + +DomainModel LoanProcessingSystem { + + // Submitted -> READYFORREVIEW -> REFERENCESVALIDATED -> APPROVED + Entity LoanRequest { + + Status : LoanRequestStatus[SUBMITTED|REFERENCESVALIDATED|APPROVED|READYFORREVIEW|INCOMPLETEINFORMATION] + RequestID : Integer + Name : String + LoanAmount : Real + LoanPurpose : String + Income : Real + PhoneNumber : Integer + PostalAddress : String + ZipCode : Integer + Email : String + WorkReferences : String + CreditReferences : String + CheckingAccountNumber : Integer + SecurityNumber : Integer + CreditScore : Integer + + [Refer] + ApprovalLoan : Loan (Association) + RequestedCAHistory : CheckingAccount (Association) + RequestedCreditHistory : CreditHistory (Association) + AttachedApprovalLetter : ApprovalLetter (Association) + AttachedLoanAgreement : LoanAgreement (Association) + AttachedLoanTerms : LoanTerm* (Association) + + [INV] + inv UniqueRequestID : LoanRequest.allInstance()->isUnique(l:LoanRequest | l.RequestID) + inv CreditScoreGreatAndEqualZero : CreditScore >= 0 + + } + + Entity Loan { + + LoanID : Integer + RemainAmountToPay : Real + Status : LoanStatus[LSOPEN|CLOSED] + IsPaidinFull : Boolean + StartDate : Date + EndDate : Date + CurrentOverDueDate : Date + RePaymentDays : Integer + RepaymentAmount : Real + + [Refer] + ReferedLoanRequest : LoanRequest ! ( Association) + BelongedLoanAccount : LoanAccount (Association) + + [INV] + inv UniqueLoanID : Loan.allInstance()->isUnique(l:Loan | l.LoanID) + inv RemainAmountToPayGreatAndEqualZero : RemainAmountToPay >= 0 + inv RepaymentAmountGreatAndEqualZero : RepaymentAmount >= 0 + inv RePaymentDaysGreatAndEqualZero : RePaymentDays >= 0 + + + } + + Entity LoanTerm { + + ItemID : Integer + Content : String + + [INV] + inv UniqueLoanID : Loan.allInstance()->isUnique(l:Loan | l.LoanID) + + } + + Entity CheckingAccount { + + Balance : Real + Status : CheckingAccountStatus[GOODSTANDING|SUSPENDED] + + [INV] + inv BalanceGreatAndEqualZero : Balance >= 0 + + } + + Entity CreditHistory { + + OutstandingDebt : Real + BadDebits : Integer + + [INV] + inv OutstandingDebtGreatAndEqualZero : OutstandingDebt >= 0 + inv BadDebitsGreatAndEqualZero : BadDebits >= 0 + + } + + Entity LoanAccount { + + LoanAccountID : Integer + Balance : Real + Status : LoanAccountStatus[NORMAL|HASPAIDINFULL] + + [INV] + inv UniqueLoanID : Loan.allInstance()->isUnique(l:Loan | l.LoanID) + inv BalanceGreatAndEqualZero : Balance >= 0 + + } + + Entity ApprovalLetter { + + Content : String + + } + + Entity LoanAgreement { + + Content : String + } + } Service SubmitLoanRequestModule { @@ -245,118 +385,6 @@ Interaction InteractionGenerateLoanLetterAndAgreement { } -// Submitted -> READYFORREVIEW -> REFERENCESVALIDATED -> APPROVED -Entity LoanRequest { - - Status : LoanRequestStatus[SUBMITTED|REFERENCESVALIDATED|APPROVED|READYFORREVIEW|INCOMPLETEINFORMATION] - RequestID : Integer - Name : String - LoanAmount : Real - LoanPurpose : String - Income : Real - PhoneNumber : Integer - PostalAddress : String - ZipCode : Integer - Email : String - WorkReferences : String - CreditReferences : String - CheckingAccountNumber : Integer - SecurityNumber : Integer - CreditScore : Integer - - [Refer] - ApprovalLoan : Loan - RequestedCAHistory : CheckingAccount - RequestedCreditHistory : CreditHistory - AttachedApprovalLetter : ApprovalLetter - AttachedLoanAgreement : LoanAgreement - AttachedLoanTerms : LoanTerm* - - [INV] - inv UniqueRequestID : LoanRequest.allInstance()->isUnique(l:LoanRequest | l.RequestID) - inv CreditScoreGreatAndEqualZero : CreditScore >= 0 - -} - -Entity Loan { - - LoanID : Integer - RemainAmountToPay : Real - Status : LoanStatus[LSOPEN|CLOSED] - IsPaidinFull : Boolean - StartDate : Date - EndDate : Date - CurrentOverDueDate : Date - RePaymentDays : Integer - RepaymentAmount : Real - - [Refer] - ReferedLoanRequest : LoanRequest - BelongedLoanAccount : LoanAccount - - [INV] - inv UniqueLoanID : Loan.allInstance()->isUnique(l:Loan | l.LoanID) - inv RemainAmountToPayGreatAndEqualZero : RemainAmountToPay >= 0 - inv RepaymentAmountGreatAndEqualZero : RepaymentAmount >= 0 - inv RePaymentDaysGreatAndEqualZero : RePaymentDays >= 0 - - -} - -Entity LoanTerm { - - ItemID : Integer - Content : String - - [INV] - inv UniqueLoanID : Loan.allInstance()->isUnique(l:Loan | l.LoanID) - -} - -Entity CheckingAccount { - - Balance : Real - Status : CheckingAccountStatus[GOODSTANDING|SUSPENDED] - - [INV] - inv BalanceGreatAndEqualZero : Balance >= 0 - -} - -Entity CreditHistory { - - OutstandingDebt : Real - BadDebits : Integer - - [INV] - inv OutstandingDebtGreatAndEqualZero : OutstandingDebt >= 0 - inv BadDebitsGreatAndEqualZero : BadDebits >= 0 - -} - -Entity LoanAccount { - - LoanAccountID : Integer - Balance : Real - Status : LoanAccountStatus[NORMAL|HASPAIDINFULL] - - [INV] - inv UniqueLoanID : Loan.allInstance()->isUnique(l:Loan | l.LoanID) - inv BalanceGreatAndEqualZero : Balance >= 0 - -} - -Entity ApprovalLetter { - - Content : String - -} - -Entity LoanAgreement { - - Content : String - -} //entity create operation Contract SubmitLoanRequestModule::enterLoanInformation(requestid : Integer, name : String, loanamount : Real, loanpurpose : String, income : Real, phonenumber : Integer, postaladdress : String, zipcode : Integer, email : String, workreferences : String, creditreferences : String, checkingaccountnumber : Integer, securitynumber : Integer) : Boolean {