diff --git a/_scripts/postPumlsToServer.py b/_scripts/postPumlsToServer.py index 3929b3c86..107ea1988 100644 --- a/_scripts/postPumlsToServer.py +++ b/_scripts/postPumlsToServer.py @@ -1,6 +1,6 @@ # # The MIT License -# Copyright (c) 2014 Ilkka Seppälä +# Copyright (c) 2014-2016 Ilkka Seppälä # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/abstract-document/etc/abstract-document.urm.puml b/abstract-document/etc/abstract-document.urm.puml index fa15eb3c7..0c6ffc5ec 100644 --- a/abstract-document/etc/abstract-document.urm.puml +++ b/abstract-document/etc/abstract-document.urm.puml @@ -1,33 +1,29 @@ @startuml package com.iluwatar.abstractdocument.domain { - class Part { - + Part(properties : Map) - } - interface HasPrice { - + PROPERTY : String {static} - + getPrice() : Optional - } - interface HasParts { - + PROPERTY : String {static} - + getParts() : Stream - } class Car { + Car(properties : Map) } - interface HasType { - + PROPERTY : String {static} - + getType() : Optional - } interface HasModel { + PROPERTY : String {static} + getModel() : Optional } + interface HasParts { + + PROPERTY : String {static} + + getParts() : Stream + } + interface HasPrice { + + PROPERTY : String {static} + + getPrice() : Optional + } + interface HasType { + + PROPERTY : String {static} + + getType() : Optional + } + class Part { + + Part(properties : Map) + } } package com.iluwatar.abstractdocument { - class App { - + App() - + main(args : String[]) {static} - } abstract class AbstractDocument { - properties : Map # AbstractDocument(properties : Map) @@ -36,24 +32,28 @@ package com.iluwatar.abstractdocument { + put(key : String, value : Object) + toString() : String } + class App { + - LOGGER : Logger {static} + + App() + + main(args : String[]) {static} + } interface Document { + children(String, Function, T>) : Stream {abstract} + get(String) : Object {abstract} + put(String, Object) {abstract} } } -AbstractDocument --+ Map -Part ..|> HasType -Part ..|> HasModel -Part ..|> HasPrice -Part --|> AbstractDocument AbstractDocument ..|> Document -HasPrice --|> Document -HasParts --|> Document Car ..|> HasModel Car ..|> HasPrice Car ..|> HasParts Car --|> AbstractDocument -HasType --|> Document HasModel --|> Document +HasParts --|> Document +HasPrice --|> Document +HasType --|> Document +Part ..|> HasType +Part ..|> HasModel +Part ..|> HasPrice +Part --|> AbstractDocument @enduml \ No newline at end of file diff --git a/abstract-document/pom.xml b/abstract-document/pom.xml index 1ab6d5a2b..0d7a31340 100644 --- a/abstract-document/pom.xml +++ b/abstract-document/pom.xml @@ -2,7 +2,7 @@ "-castle" Castle App --> "-king" King App --> "-army" Army -OrcKingdomFactory ..|> KingdomFactory -ElfCastle ..|> Castle -OrcCastle ..|> Castle -ElfKing ..|> King ElfArmy ..|> Army -OrcKing ..|> King -OrcArmy ..|> Army +ElfCastle ..|> Castle +ElfKing ..|> King ElfKingdomFactory ..|> KingdomFactory +OrcArmy ..|> Army +OrcCastle ..|> Castle +OrcKing ..|> King +OrcKingdomFactory ..|> KingdomFactory @enduml \ No newline at end of file diff --git a/abstract-factory/pom.xml b/abstract-factory/pom.xml index 5c3d4d16a..25e00e377 100644 --- a/abstract-factory/pom.xml +++ b/abstract-factory/pom.xml @@ -2,7 +2,7 @@ "-inventoryClient" ProductInventoryClient Aggregator --> "-informationClient" ProductInformationClient -ProductInventoryClientImpl ..|> ProductInventoryClient +Aggregator --> "-inventoryClient" ProductInventoryClient ProductInformationClientImpl ..|> ProductInformationClient +ProductInventoryClientImpl ..|> ProductInventoryClient @enduml \ No newline at end of file diff --git a/aggregator-microservices/etc/inventory-microservice.urm.puml b/aggregator-microservices/etc/inventory-microservice.urm.puml index a07a36306..90f327e07 100644 --- a/aggregator-microservices/etc/inventory-microservice.urm.puml +++ b/aggregator-microservices/etc/inventory-microservice.urm.puml @@ -1,12 +1,12 @@ @startuml package com.iluwatar.inventory.microservice { - class InventoryController { - + InventoryController() - + getProductInventories() : int - } class InventoryApplication { + InventoryApplication() + main(args : String[]) {static} } + class InventoryController { + + InventoryController() + + getProductInventories() : int + } } @enduml \ No newline at end of file diff --git a/aggregator-microservices/information-microservice/pom.xml b/aggregator-microservices/information-microservice/pom.xml index 4cd1916c6..a77e9f65f 100644 --- a/aggregator-microservices/information-microservice/pom.xml +++ b/aggregator-microservices/information-microservice/pom.xml @@ -2,7 +2,7 @@ "-imageClient" ImageClient ApiGateway --> "-priceClient" PriceClient -PriceClientImpl ..|> PriceClient ImageClientImpl ..|> ImageClient +PriceClientImpl ..|> PriceClient @enduml \ No newline at end of file diff --git a/api-gateway/image-microservice/pom.xml b/api-gateway/image-microservice/pom.xml index db25b947b..1e9905f1f 100644 --- a/api-gateway/image-microservice/pom.xml +++ b/api-gateway/image-microservice/pom.xml @@ -2,7 +2,7 @@ "-imp" MagicWeaponImpl +BlindingMagicWeapon --|> MagicWeapon +BlindingMagicWeaponImpl --|> MagicWeaponImpl +Excalibur --|> BlindingMagicWeaponImpl FlyingMagicWeapon --|> MagicWeapon -Stormbringer --|> SoulEatingMagicWeaponImpl FlyingMagicWeaponImpl --|> MagicWeaponImpl +Mjollnir --|> FlyingMagicWeaponImpl SoulEatingMagicWeapon --|> MagicWeapon SoulEatingMagicWeaponImpl --|> MagicWeaponImpl -Excalibur --|> BlindingMagicWeaponImpl -Mjollnir --|> FlyingMagicWeaponImpl -BlindingMagicWeaponImpl --|> MagicWeaponImpl -BlindingMagicWeapon --|> MagicWeapon +Stormbringer --|> SoulEatingMagicWeaponImpl @enduml \ No newline at end of file diff --git a/bridge/pom.xml b/bridge/pom.xml index 4960dbd08..7b98867a0 100644 --- a/bridge/pom.xml +++ b/bridge/pom.xml @@ -2,7 +2,7 @@ "-profession" Profession Builder ..+ Hero Hero --> "-armor" Armor -App --+ Hero Builder --> "-weapon" Weapon -Builder --> "-hairColor" HairColor Builder --> "-hairType" HairType +Builder --> "-hairColor" HairColor Hero --> "-hairColor" HairColor Builder --> "-profession" Profession Hero --> "-weapon" Weapon diff --git a/builder/pom.xml b/builder/pom.xml index 030990fa2..ddfc07aac 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -2,7 +2,7 @@ "-head" Node +Node --+ LruCache Node --> "-previous" Node AppManager --> "-cachingPolicy" CachingPolicy Node --> "-userAccount" UserAccount diff --git a/caching/pom.xml b/caching/pom.xml index 07347e5c7..121ea698a 100644 --- a/caching/pom.xml +++ b/caching/pom.xml @@ -2,7 +2,7 @@ "-next" RequestHandler -Request --> "-requestType" RequestType OrcKing --> "-chain" RequestHandler -OrcSoldier --|> RequestHandler +Request --> "-requestType" RequestType OrcCommander --|> RequestHandler OrcOfficer --|> RequestHandler +OrcSoldier --|> RequestHandler @enduml \ No newline at end of file diff --git a/chain/pom.xml b/chain/pom.xml index 5593d3e73..affe2c945 100644 --- a/chain/pom.xml +++ b/chain/pom.xml @@ -2,7 +2,7 @@ "-size" Size Wizard --> "-undoStack" Command @@ -78,7 +80,7 @@ ShrinkSpell --> "-oldSize" Size InvisibilitySpell --> "-target" Target ShrinkSpell --> "-target" Target Target --> "-visibility" Visibility -InvisibilitySpell --|> Command Goblin --|> Target +InvisibilitySpell --|> Command ShrinkSpell --|> Command @enduml \ No newline at end of file diff --git a/command/pom.xml b/command/pom.xml index 406c6d100..15f80a754 100644 --- a/command/pom.xml +++ b/command/pom.xml @@ -2,7 +2,7 @@ "-children" LetterComposite -Word --|> LetterComposite Letter --|> LetterComposite Sentence --|> LetterComposite +Word --|> LetterComposite @enduml \ No newline at end of file diff --git a/composite/pom.xml b/composite/pom.xml index 48d693d2f..1a21d5034 100644 --- a/composite/pom.xml +++ b/composite/pom.xml @@ -2,7 +2,7 @@ "-decorated" Hostile -Troll ..|> Hostile -SmartHostile ..|> Hostile +TrollDecorator --> "-decorated" Troll +ClubbedTroll --|> TrollDecorator +SimpleTroll ..|> Troll +TrollDecorator ..|> Troll @enduml \ No newline at end of file diff --git a/decorator/pom.xml b/decorator/pom.xml index 36c3eef01..b8d52f66c 100644 --- a/decorator/pom.xml +++ b/decorator/pom.xml @@ -2,7 +2,7 @@ "-printer" Printer -HpPrinter ..|> Printer PrinterController ..|> Printer -EpsonPrinter ..|> Printer CanonPrinter ..|> Printer +EpsonPrinter ..|> Printer +HpPrinter ..|> Printer @enduml \ No newline at end of file diff --git a/delegation/pom.xml b/delegation/pom.xml index ed5f6608e..368e4d2bb 100644 --- a/delegation/pom.xml +++ b/delegation/pom.xml @@ -2,7 +2,7 @@ "-tobacco" OldTobyTobacco AdvancedWizard --> "-tobacco" Tobacco GuiceWizard --> "-tobacco" Tobacco AdvancedWizard ..|> Wizard -RivendellTobacco --|> Tobacco -SimpleWizard ..|> Wizard -OldTobyTobacco --|> Tobacco -SecondBreakfastTobacco --|> Tobacco GuiceWizard ..|> Wizard +OldTobyTobacco --|> Tobacco +RivendellTobacco --|> Tobacco +SecondBreakfastTobacco --|> Tobacco +SimpleWizard ..|> Wizard @enduml \ No newline at end of file diff --git a/dependency-injection/pom.xml b/dependency-injection/pom.xml index ab4619b63..66f05381d 100644 --- a/dependency-injection/pom.xml +++ b/dependency-injection/pom.xml @@ -2,7 +2,7 @@ "-observers" EventObserver -LordVarys --|> EventEmitter KingJoffrey ..|> EventObserver -LordBaelish --|> EventEmitter KingsHand ..|> EventObserver KingsHand --|> EventEmitter +LordBaelish --|> EventEmitter +LordVarys --|> EventEmitter Scout --|> EventEmitter @enduml \ No newline at end of file diff --git a/event-aggregator/pom.xml b/event-aggregator/pom.xml index 29d99ca2b..2c81ff65e 100644 --- a/event-aggregator/pom.xml +++ b/event-aggregator/pom.xml @@ -1,7 +1,7 @@ "-eventListener" ThreadCompleteListener -EventManager --+ Map Event ..|> IEvent EventManager ..|> ThreadCompleteListener @enduml \ No newline at end of file diff --git a/event-asynchronous/pom.xml b/event-asynchronous/pom.xml index 1bc4549d4..0855736a9 100644 --- a/event-asynchronous/pom.xml +++ b/event-asynchronous/pom.xml @@ -2,7 +2,7 @@ "-user" User UserCreatedEvent --> "-user" User +UserUpdatedEvent --> "-user" User AbstractEvent ..|> Event UserCreatedEvent --|> AbstractEvent -UserCreatedEventHandler ..|> Handler UserUpdatedEvent --|> AbstractEvent +UserCreatedEventHandler ..|> Handler UserUpdatedEventHandler ..|> Handler @enduml \ No newline at end of file diff --git a/event-driven-architecture/pom.xml b/event-driven-architecture/pom.xml index 149ca7409..6ef837a93 100644 --- a/event-driven-architecture/pom.xml +++ b/event-driven-architecture/pom.xml @@ -2,7 +2,7 @@ "-workers" DwarvenMineWorker Action ..+ DwarvenMineWorker +DwarvenCartOperator --|> DwarvenMineWorker DwarvenGoldDigger --|> DwarvenMineWorker DwarvenTunnelDigger --|> DwarvenMineWorker -DwarvenCartOperator --|> DwarvenMineWorker @enduml \ No newline at end of file diff --git a/facade/pom.xml b/facade/pom.xml index 7816d51e6..9af019df4 100644 --- a/facade/pom.xml +++ b/facade/pom.xml @@ -2,7 +2,7 @@ "-weaponType" WeaponType OrcWeapon --> "-weaponType" WeaponType App --> "-blacksmith" Blacksmith -OrcBlacksmith ..|> Blacksmith ElfBlacksmith ..|> Blacksmith -OrcWeapon ..|> Weapon ElfWeapon ..|> Weapon +OrcBlacksmith ..|> Blacksmith +OrcWeapon ..|> Weapon @enduml \ No newline at end of file diff --git a/factory-method/pom.xml b/factory-method/pom.xml index 74dc91a02..e27bd2444 100644 --- a/factory-method/pom.xml +++ b/factory-method/pom.xml @@ -2,7 +2,7 @@ "-menuItem" MenuItem -Action --> "-type" ActionType MenuStore --> "-selected" MenuItem +Action --> "-type" ActionType Dispatcher --> "-instance" Dispatcher ContentView --> "-content" Content Dispatcher --> "-stores" Store MenuView --> "-selected" MenuItem Store --> "-views" View -ContentAction --> "-content" Content ContentStore --> "-content" Content -ContentStore --|> Store -MenuAction --|> Action -MenuStore --|> Store +ContentAction --> "-content" Content ContentAction --|> Action -MenuView ..|> View +MenuAction --|> Action +ContentStore --|> Store +MenuStore --|> Store ContentView ..|> View +MenuView ..|> View @enduml \ No newline at end of file diff --git a/flux/pom.xml b/flux/pom.xml index 50f5d395a..713732563 100644 --- a/flux/pom.xml +++ b/flux/pom.xml @@ -2,7 +2,7 @@ "-topShelf" Potion HealingPotion ..|> Potion +HolyWaterPotion ..|> Potion InvisibilityPotion ..|> Potion PoisonPotion ..|> Potion StrengthPotion ..|> Potion -HolyWaterPotion ..|> Potion @enduml \ No newline at end of file diff --git a/flyweight/pom.xml b/flyweight/pom.xml index eb168c486..127a92b73 100644 --- a/flyweight/pom.xml +++ b/flyweight/pom.xml @@ -2,7 +2,7 @@ "-playerDetails" PlayerDetails -MongoEventLog --> "-stdOutEventLog" StdOutEventLog -LotteryService --> "-wireTransfers" WireTransfers -LotteryAdministration --> "-notifications" LotteryEventLog -RandomNumberGenerator ..+ PrimitiveIterator LotteryAdministration --> "-wireTransfers" WireTransfers LotteryTicket --> "-id" LotteryTicketId +LotteryTicket --> "-playerDetails" PlayerDetails LotteryService --> "-notifications" LotteryEventLog LotteryAdministration --> "-repository" LotteryTicketRepository LotteryTicket --> "-lotteryNumbers" LotteryNumbers +MongoEventLog --> "-stdOutEventLog" StdOutEventLog +LotteryService --> "-wireTransfers" WireTransfers SampleData --> "-PLAYERS" PlayerDetails -ConsoleLottery --+ LotteryTicketCheckResult +LotteryAdministration --> "-notifications" LotteryEventLog RandomNumberGenerator ..+ LotteryNumbers LotteryService --> "-repository" LotteryTicketRepository -LotteryUtils --+ LotteryTicketCheckResult -LotteryTicketCheckResult --> "-checkResult" CheckResult CheckResult ..+ LotteryTicketCheckResult -MongoTicketRepository ..|> LotteryTicketRepository -MongoBank ..|> WireTransfers +LotteryTicketCheckResult --> "-checkResult" CheckResult InMemoryBank ..|> WireTransfers -StdOutEventLog ..|> LotteryEventLog +MongoBank ..|> WireTransfers InMemoryTicketRepository ..|> LotteryTicketRepository +MongoTicketRepository ..|> LotteryTicketRepository MongoEventLog ..|> LotteryEventLog +StdOutEventLog ..|> LotteryEventLog @enduml \ No newline at end of file diff --git a/hexagonal/etc/layers.png b/hexagonal/etc/layers.png new file mode 100644 index 000000000..cb5a9c90b Binary files /dev/null and b/hexagonal/etc/layers.png differ diff --git a/hexagonal/etc/ports_and_adapters.png b/hexagonal/etc/ports_and_adapters.png new file mode 100644 index 000000000..d285045de Binary files /dev/null and b/hexagonal/etc/ports_and_adapters.png differ diff --git a/hexagonal/etc/ports_and_adapters.xml b/hexagonal/etc/ports_and_adapters.xml new file mode 100644 index 000000000..0e64414b8 --- /dev/null +++ b/hexagonal/etc/ports_and_adapters.xml @@ -0,0 +1 @@ +7Zpdk6I4FIZ/jbdbJAHEyx7nY/diqrqqd2tnLiOJSDUSK6ZHe3/9BkmUfFiDDqBM2TcNBwLxOe85nBOYoPl6/4XjzeorI7SYwIDsJ+jjBEKA4kj+qyzvtWUag9qQ8Zyok06Gl/w/qoyBsr7lhG6NEwVjhcg3pjFlZUlTYdgw52xnnrZkhXnXDc6oY3hJceFa/82JWNXWJApO9j9pnq30nUGgjixw+ppx9laq+00gWh7+6sNrrK+lzt+uMGG7hgl9mqA5Z0zUW+v9nBYVW42tHvf5zNHjvDktRZsBqB7wAxdvVM/4MC/xrlnIKW6qzRXd44yVE/RhQ3m+poLyk/X5ZPqwW+WCvmxwWo3aSYFI20qsC7kH5Ka6I+WC7s/OGhxZSI1RJi/N3+UpagBMFD4lL6D3dydnIa2lVcNRMFZGrASSHa99giQ3FCc/MzhKZmgaGcyOKBrMAPQwO2r7V5iFDrM549ThJgfJEKc/B7LMi2LOCsYP46oYg2kq7VvB2SttHCHxIo7ibhCGATARJshBqDNfk2AXoot+Lrpr4RFMk6UXXpwmdLHsCF5s6W/qwkMe+aEO4MW/GzwEPQmvJ3jT0cMDMxNeGA0GLxk7PDQ1H7VDKm82fnh2zoODwdPlz3jphdCUHoyGkx5oUeRdTS+iCQl99BK4QHFHxUoUWfQ89V5v9Fq0FXdOz9ZeMCC9Nk/ckjxVfa7cK1lJTWJ0n4tvje3vcjuotks5k2/Nne/6rJJ8zqsJHQ7Vd6PE6ZEtenJG7I2n1KhQBeYZFU0duJAbECMPRG3jtMAi/2HOwkdW3eGZ5XJ+Z7vECFjOqWevRjWbZOtCCJkXCu2Cvv7NzoUOjj7+7Ha+b1MwXOz7P6IefQwfPr7Qx33WNYNkR5s60nXuANkR9lnXDEIPWc8WNBvu2aJn+8v5JfDkF/V0Ac2nS3e5J/Hkntkj91yWe7S7O/U/OO/9/nzfWC5/+L6d70dfldsrOSEcbiXHs4R9ZeTUGdEXO41E2mX0TD3Rc1+Vue2gq6Mn6S963BX4Z8bF1hGBlLcwPW/GhFJGM4CUCRd5VsrdVDrz8FaoCpY8xcWTOrDOCSnOBWcH8YVmoYHzGDgNWYS+12pdxJe7SP/PVlKQZ1Q0ltVvtVEfXrRSojD3/w4NALvudd9hAN97x7ALQO6ywN90WwUDzqiS903h2CvFiZucZ32xcdvmv6RqMi6zFCtvjuZY4et851lN6g2N221+xAIv8Pb28RQHJhcwG04yOrU1uHxl6au0kLvBYz3dYOTi6S3doPF2irpKNAqe2I96mIIHWJ6Mr20XgF059dcuoD5axWEEoOsRQwDThwAuFECbfvE+Ox5dlxkCSB4CuFAAXbW8vpcRvldRHT4CfAK46WrhKAXQ5quzOxUAdAWAbrpkOEoBuE35E8Eb2Y//XuseVh+CPP1ZR+secvf0dXftkdMn9OjT/w== \ No newline at end of file diff --git a/hexagonal/etc/presentation.html b/hexagonal/etc/presentation.html new file mode 100644 index 000000000..74361ad27 --- /dev/null +++ b/hexagonal/etc/presentation.html @@ -0,0 +1,103 @@ + + + + Title + + + + + + + + + + diff --git a/hexagonal/pom.xml b/hexagonal/pom.xml index c489c45c4..a02c049ca 100644 --- a/hexagonal/pom.xml +++ b/hexagonal/pom.xml @@ -2,7 +2,7 @@ "-next" Filter DListener --+ Target -FilterChain --> "-chain" Filter FilterManager --> "-filterChain" FilterChain -DepositFilter --|> AbstractFilter -AddressFilter --|> AbstractFilter +FilterChain --> "-chain" Filter AbstractFilter ..|> Filter -NameFilter --|> AbstractFilter +AddressFilter --|> AbstractFilter ContactFilter --|> AbstractFilter +DepositFilter --|> AbstractFilter +NameFilter --|> AbstractFilter OrderFilter --|> AbstractFilter @enduml \ No newline at end of file diff --git a/intercepting-filter/pom.xml b/intercepting-filter/pom.xml index 487ac1c14..77bf04549 100644 --- a/intercepting-filter/pom.xml +++ b/intercepting-filter/pom.xml @@ -2,7 +2,7 @@ "-leftExpression" Expression MinusExpression --> "-leftExpression" Expression PlusExpression --> "-leftExpression" Expression -NumberExpression --|> Expression MinusExpression --|> Expression MultiplyExpression --|> Expression +NumberExpression --|> Expression PlusExpression --|> Expression @enduml \ No newline at end of file diff --git a/interpreter/pom.xml b/interpreter/pom.xml index e2c8f4d4d..c46aa9b39 100644 --- a/interpreter/pom.xml +++ b/interpreter/pom.xml @@ -2,7 +2,7 @@ "-type" ItemType TreasureChest --> "-items" Item diff --git a/iterator/pom.xml b/iterator/pom.xml index 6d589b4a7..17100f9c4 100644 --- a/iterator/pom.xml +++ b/iterator/pom.xml @@ -2,7 +2,7 @@ "-cakeBakingService" CakeBakingService CakeInfo --> "-cakeToppingInfo" CakeToppingInfo @@ -120,6 +121,6 @@ CakeInfo --> "-cakeLayerInfos" CakeLayerInfo App --> "-cakeBakingService" CakeBakingService CakeLayer --> "-cake" Cake Cake --> "-topping" CakeTopping -CakeViewImpl ..|> View CakeBakingServiceImpl ..|> CakeBakingService +CakeViewImpl ..|> View @enduml \ No newline at end of file diff --git a/layers/pom.xml b/layers/pom.xml index 811f5e050..36b30aaf6 100644 --- a/layers/pom.xml +++ b/layers/pom.xml @@ -2,7 +2,7 @@ "-heavy" Heavy HolderThreadSafe --> "-heavy" Heavy diff --git a/lazy-loading/pom.xml b/lazy-loading/pom.xml index d70587395..cc212b86d 100644 --- a/lazy-loading/pom.xml +++ b/lazy-loading/pom.xml @@ -2,7 +2,7 @@ "-members" PartyMember PartyMemberBase --> "-party" Party -Rogue --|> PartyMemberBase +Hobbit --|> PartyMemberBase Hunter --|> PartyMemberBase PartyImpl ..|> Party -Hobbit --|> PartyMemberBase -Wizard --|> PartyMemberBase PartyMemberBase ..|> PartyMember +Rogue --|> PartyMemberBase +Wizard --|> PartyMemberBase @enduml \ No newline at end of file diff --git a/mediator/pom.xml b/mediator/pom.xml index e3b227237..84fc0c550 100644 --- a/mediator/pom.xml +++ b/mediator/pom.xml @@ -2,7 +2,7 @@ "-nourishment" Nourishment GiantController --> "-giant" GiantModel diff --git a/model-view-controller/pom.xml b/model-view-controller/pom.xml index 38e756313..e85f26115 100644 --- a/model-view-controller/pom.xml +++ b/model-view-controller/pom.xml @@ -2,7 +2,7 @@ "-presenter" FileSelectorPresenter FileSelectorStub --> "-presenter" FileSelectorPresenter +FileSelectorJFrame --> "-presenter" FileSelectorPresenter FileSelectorPresenter --> "-loader" FileLoader FileSelectorPresenter --> "-view" FileSelectorView -FileSelectorStub ..|> FileSelectorView FileSelectorJFrame ..|> FileSelectorView +FileSelectorStub ..|> FileSelectorView @enduml \ No newline at end of file diff --git a/model-view-presenter/pom.xml b/model-view-presenter/pom.xml index 6fb7ab31e..88176d5dc 100644 --- a/model-view-presenter/pom.xml +++ b/model-view-presenter/pom.xml @@ -2,7 +2,7 @@ "-sex" Sex diff --git a/monad/pom.xml b/monad/pom.xml index 482cf4e4d..81a5b08e0 100644 --- a/monad/pom.xml +++ b/monad/pom.xml @@ -2,7 +2,7 @@ "-lock" Lock Mutex ..|> Lock diff --git a/mutex/src/main/java/com/iluwatar/mutex/App.java b/mutex/src/main/java/com/iluwatar/mutex/App.java index f6494bd5c..e31e8f4bc 100644 --- a/mutex/src/main/java/com/iluwatar/mutex/App.java +++ b/mutex/src/main/java/com/iluwatar/mutex/App.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/mutex/src/main/java/com/iluwatar/mutex/Jar.java b/mutex/src/main/java/com/iluwatar/mutex/Jar.java index 4fe0a4637..17e6f4c1e 100644 --- a/mutex/src/main/java/com/iluwatar/mutex/Jar.java +++ b/mutex/src/main/java/com/iluwatar/mutex/Jar.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/mutex/src/main/java/com/iluwatar/mutex/Lock.java b/mutex/src/main/java/com/iluwatar/mutex/Lock.java index fef67010e..91c8adde7 100644 --- a/mutex/src/main/java/com/iluwatar/mutex/Lock.java +++ b/mutex/src/main/java/com/iluwatar/mutex/Lock.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/mutex/src/main/java/com/iluwatar/mutex/Mutex.java b/mutex/src/main/java/com/iluwatar/mutex/Mutex.java index 8e08534cd..b3b21d059 100644 --- a/mutex/src/main/java/com/iluwatar/mutex/Mutex.java +++ b/mutex/src/main/java/com/iluwatar/mutex/Mutex.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/mutex/src/main/java/com/iluwatar/mutex/Thief.java b/mutex/src/main/java/com/iluwatar/mutex/Thief.java index d31ec3fa8..d8520a2a6 100644 --- a/mutex/src/main/java/com/iluwatar/mutex/Thief.java +++ b/mutex/src/main/java/com/iluwatar/mutex/Thief.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/mutex/src/test/java/com/iluwatar/mutex/AppTest.java b/mutex/src/test/java/com/iluwatar/mutex/AppTest.java index f3a123519..dfc0de124 100644 --- a/mutex/src/test/java/com/iluwatar/mutex/AppTest.java +++ b/mutex/src/test/java/com/iluwatar/mutex/AppTest.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/mutex/src/test/java/com/iluwatar/mutex/JarTest.java b/mutex/src/test/java/com/iluwatar/mutex/JarTest.java index 97101466a..b9e0c52ca 100644 --- a/mutex/src/test/java/com/iluwatar/mutex/JarTest.java +++ b/mutex/src/test/java/com/iluwatar/mutex/JarTest.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/mutex/src/test/java/com/iluwatar/mutex/MutexTest.java b/mutex/src/test/java/com/iluwatar/mutex/MutexTest.java index 8b3e82cb4..93649002f 100644 --- a/mutex/src/test/java/com/iluwatar/mutex/MutexTest.java +++ b/mutex/src/test/java/com/iluwatar/mutex/MutexTest.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/naked-objects/etc/naked-objects-dom.urm.puml b/naked-objects/etc/naked-objects-dom.urm.puml index 6662a560a..462364099 100644 --- a/naked-objects/etc/naked-objects-dom.urm.puml +++ b/naked-objects/etc/naked-objects-dom.urm.puml @@ -1,26 +1,18 @@ @startuml package domainapp.dom.app.homepage { + class HomePageService { + ~ container : DomainObjectContainer + + HomePageService() + + homePage() : HomePageViewModel + } class HomePageViewModel { ~ simpleObjects : SimpleObjects + HomePageViewModel() + getObjects() : List + title() : String } - class HomePageService { - ~ container : DomainObjectContainer - + HomePageService() - + homePage() : HomePageViewModel - } } package domainapp.dom.modules.simple { - class SimpleObjects { - ~ container : DomainObjectContainer - + SimpleObjects() - + create(name : String) : SimpleObject - + findByName(name : String) : List - + listAll() : List - + title() : TranslatableString - } class SimpleObject { - container : DomainObjectContainer - name : String @@ -34,6 +26,14 @@ package domainapp.dom.modules.simple { + updateName(name : String) : SimpleObject + validateUpdateName(name : String) : TranslatableString } + class SimpleObjects { + ~ container : DomainObjectContainer + + SimpleObjects() + + create(name : String) : SimpleObject + + findByName(name : String) : List + + listAll() : List + + title() : TranslatableString + } } HomePageViewModel --> "-simpleObjects" SimpleObjects @enduml \ No newline at end of file diff --git a/naked-objects/etc/naked-objects-fixture.urm.puml b/naked-objects/etc/naked-objects-fixture.urm.puml index 21e38d710..04b3b1350 100644 --- a/naked-objects/etc/naked-objects-fixture.urm.puml +++ b/naked-objects/etc/naked-objects-fixture.urm.puml @@ -86,7 +86,8 @@ package domainapp.fixture { + getSpecification() : FixtureScriptsSpecification } } -DomainAppFixturesProvider --+ FixtureScripts -DomainAppFixturesProvider --+ FixtureScriptsSpecification +Builder ..+ FixtureScriptsSpecification +DropDownPolicy ..+ FixtureScriptsSpecification +MultipleExecutionStrategy ..+ FixtureScripts HomePageViewModel --> "-simpleObjects" SimpleObjects @enduml \ No newline at end of file diff --git a/naked-objects/etc/naked-objects-integtests.urm.puml b/naked-objects/etc/naked-objects-integtests.urm.puml index 65c44410a..04b3b1350 100644 --- a/naked-objects/etc/naked-objects-integtests.urm.puml +++ b/naked-objects/etc/naked-objects-integtests.urm.puml @@ -1,16 +1,16 @@ @startuml package domainapp.dom.app.homepage { + class HomePageService { + ~ container : DomainObjectContainer + + HomePageService() + + homePage() : HomePageViewModel + } class HomePageViewModel { ~ simpleObjects : SimpleObjects + HomePageViewModel() + getObjects() : List + title() : String } - class HomePageService { - ~ container : DomainObjectContainer - + HomePageService() - + homePage() : HomePageViewModel - } } package domainapp.dom.modules.simple { class SimpleObject { @@ -86,7 +86,8 @@ package domainapp.fixture { + getSpecification() : FixtureScriptsSpecification } } -DomainAppFixturesProvider --+ FixtureScripts -DomainAppFixturesProvider --+ FixtureScriptsSpecification +Builder ..+ FixtureScriptsSpecification +DropDownPolicy ..+ FixtureScriptsSpecification +MultipleExecutionStrategy ..+ FixtureScripts HomePageViewModel --> "-simpleObjects" SimpleObjects @enduml \ No newline at end of file diff --git a/naked-objects/webapp/ide/intellij/launch/README.txt b/naked-objects/webapp/ide/intellij/launch/README.txt index d33eaceb4..6659454ef 100644 --- a/naked-objects/webapp/ide/intellij/launch/README.txt +++ b/naked-objects/webapp/ide/intellij/launch/README.txt @@ -1,6 +1,6 @@ ==== The MIT License - Copyright (c) 2014 Ilkka Seppälä + Copyright (c) 2014-2016 Ilkka Seppälä Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/naked-objects/webapp/ide/intellij/launch/SimpleApp_PROTOTYPE.xml b/naked-objects/webapp/ide/intellij/launch/SimpleApp_PROTOTYPE.xml index e01c95512..9831f9a1f 100644 --- a/naked-objects/webapp/ide/intellij/launch/SimpleApp_PROTOTYPE.xml +++ b/naked-objects/webapp/ide/intellij/launch/SimpleApp_PROTOTYPE.xml @@ -1,7 +1,7 @@ + + 4.0.0 + + com.iluwatar + java-design-patterns + 1.14.0-SNAPSHOT + + object-mother + + + junit + junit + test + + + org.mockito + mockito-core + test + + + \ No newline at end of file diff --git a/object-mother/src/main/java/com/iluwatar/objectmother/King.java b/object-mother/src/main/java/com/iluwatar/objectmother/King.java new file mode 100644 index 000000000..544b0bacb --- /dev/null +++ b/object-mother/src/main/java/com/iluwatar/objectmother/King.java @@ -0,0 +1,66 @@ +/** + * The MIT License + * Copyright (c) 2016 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.objectmother; + +public class King implements Royalty { + boolean isDrunk = false; + boolean isHappy = false; + + @Override + public void makeDrunk() { + isDrunk = true; + } + + @Override + public void makeSober() { + isDrunk = false; + } + + @Override + public void makeHappy() { + isHappy = true; + } + + @Override + public void makeUnhappy() { + isHappy = false; + } + + public boolean isHappy() { + return isHappy; + } + + /** + * Method to flirt to a queen. + * @param queen Queen which should be flirted. + */ + public void flirt(Queen queen) { + boolean flirtStatus = queen.getFlirted(this); + if (flirtStatus == false) { + this.makeUnhappy(); + } else { + this.makeHappy(); + } + + } +} diff --git a/object-mother/src/main/java/com/iluwatar/objectmother/Queen.java b/object-mother/src/main/java/com/iluwatar/objectmother/Queen.java new file mode 100644 index 000000000..3e18fbf3a --- /dev/null +++ b/object-mother/src/main/java/com/iluwatar/objectmother/Queen.java @@ -0,0 +1,69 @@ +/** + * The MIT License + * Copyright (c) 2016 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.objectmother; + +public class Queen implements Royalty { + private boolean isDrunk = false; + private boolean isHappy = false; + private boolean isFlirty = false; + + @Override + public void makeDrunk() { + isDrunk = true; + } + + @Override + public void makeSober() { + isDrunk = false; + } + + @Override + public void makeHappy() { + isHappy = true; + } + + @Override + public void makeUnhappy() { + isHappy = false; + } + + public boolean isFlirty() { + return isFlirty; + } + + public void setFlirtiness(boolean flirtiness) { + this.isFlirty = flirtiness; + } + + /** + * Method which is called when the king is flirting to a queen. + * @param king King who initialized the flirt. + * @return A value which describes if the flirt was successful or not. + */ + public boolean getFlirted(King king) { + if (this.isFlirty && king.isHappy && !king.isDrunk) { + return true; + } + return false; + } +} diff --git a/decorator/src/main/java/com/iluwatar/decorator/Hostile.java b/object-mother/src/main/java/com/iluwatar/objectmother/Royalty.java similarity index 81% rename from decorator/src/main/java/com/iluwatar/decorator/Hostile.java rename to object-mother/src/main/java/com/iluwatar/objectmother/Royalty.java index d3414c9dd..2bebc0939 100644 --- a/decorator/src/main/java/com/iluwatar/decorator/Hostile.java +++ b/object-mother/src/main/java/com/iluwatar/objectmother/Royalty.java @@ -1,38 +1,33 @@ -/** - * The MIT License - * Copyright (c) 2014 Ilkka Seppälä - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package com.iluwatar.decorator; - -/** - * - * Interface for the hostile enemies. - * - */ -public interface Hostile { - - void attack(); - - int getAttackPower(); - - void fleeBattle(); - -} +/** + * The MIT License + * Copyright (c) 2016 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.objectmother; + +public interface Royalty { + void makeDrunk(); + + void makeSober(); + + void makeHappy(); + + void makeUnhappy(); +} diff --git a/object-mother/src/main/java/com/iluwatar/objectmother/RoyaltyObjectMother.java b/object-mother/src/main/java/com/iluwatar/objectmother/RoyaltyObjectMother.java new file mode 100644 index 000000000..624a29132 --- /dev/null +++ b/object-mother/src/main/java/com/iluwatar/objectmother/RoyaltyObjectMother.java @@ -0,0 +1,83 @@ +/** + * The MIT License + * Copyright (c) 2016 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.objectmother; + +public final class RoyaltyObjectMother { + + /** + * Method to create a sober and unhappy king. The standard paramters are set. + * @return An instance of {@link com.iluwatar.objectmother.King} with the standard properties. + */ + public static King createSoberUnhappyKing() { + return new King(); + } + + /** + * Method of the object mother to create a drunk king. + * @return A drunk {@link com.iluwatar.objectmother.King}. + */ + public static King createDrunkKing() { + King king = new King(); + king.makeDrunk(); + return king; + } + + /** + * Method to create a happy king. + * @return A happy {@link com.iluwatar.objectmother.King}. + */ + public static King createHappyKing() { + King king = new King(); + king.makeHappy(); + return king; + } + + /** + * Method to create a happy and drunk king. + * @return A drunk and happy {@link com.iluwatar.objectmother.King}. + */ + public static King createHappyDrunkKing() { + King king = new King(); + king.makeHappy(); + king.makeDrunk(); + return king; + } + + /** + * Method to create a flirty queen. + * @return A flirty {@link com.iluwatar.objectmother.Queen}. + */ + public static Queen createFlirtyQueen() { + Queen queen = new Queen(); + queen.setFlirtiness(true); + return queen; + } + + /** + * Method to create a not flirty queen. + * @return A not flirty {@link com.iluwatar.objectmother.Queen}. + */ + public static Queen createNotFlirtyQueen() { + return new Queen(); + } +} diff --git a/object-mother/src/test/java/com/iluwatar/objectmother/test/RoyaltyObjectMotherTest.java b/object-mother/src/test/java/com/iluwatar/objectmother/test/RoyaltyObjectMotherTest.java new file mode 100644 index 000000000..ebe536d24 --- /dev/null +++ b/object-mother/src/test/java/com/iluwatar/objectmother/test/RoyaltyObjectMotherTest.java @@ -0,0 +1,89 @@ +/** + * The MIT License + * Copyright (c) 2016 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.iluwatar.objectmother.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import com.iluwatar.objectmother.King; +import com.iluwatar.objectmother.Queen; +import com.iluwatar.objectmother.Royalty; +import com.iluwatar.objectmother.RoyaltyObjectMother; + +public class RoyaltyObjectMotherTest { + + @Test + public void unsuccessfulKingFlirt() { + King soberUnhappyKing = RoyaltyObjectMother.createSoberUnhappyKing(); + Queen flirtyQueen = RoyaltyObjectMother.createFlirtyQueen(); + soberUnhappyKing.flirt(flirtyQueen); + assertFalse(soberUnhappyKing.isHappy()); + } + + @Test + public void queenIsBlockingFlirtCauseDrunkKing() { + King drunkUnhappyKing = RoyaltyObjectMother.createDrunkKing(); + Queen notFlirtyQueen = RoyaltyObjectMother.createNotFlirtyQueen(); + drunkUnhappyKing.flirt(notFlirtyQueen); + assertFalse(drunkUnhappyKing.isHappy()); + } + + @Test + public void queenIsBlockingFlirt() { + King soberHappyKing = RoyaltyObjectMother.createHappyKing(); + Queen notFlirtyQueen = RoyaltyObjectMother.createNotFlirtyQueen(); + soberHappyKing.flirt(notFlirtyQueen); + assertFalse(soberHappyKing.isHappy()); + } + + @Test + public void successfullKingFlirt() { + King soberHappyKing = RoyaltyObjectMother.createHappyKing(); + Queen flirtyQueen = RoyaltyObjectMother.createFlirtyQueen(); + soberHappyKing.flirt(flirtyQueen); + assertTrue(soberHappyKing.isHappy()); + } + + @Test + public void testQueenType() { + Royalty flirtyQueen = RoyaltyObjectMother.createFlirtyQueen(); + Royalty notFlirtyQueen = RoyaltyObjectMother.createNotFlirtyQueen(); + assertEquals(flirtyQueen.getClass(), Queen.class); + assertEquals(notFlirtyQueen.getClass(), Queen.class); + } + + @Test + public void testKingType() { + Royalty drunkKing = RoyaltyObjectMother.createDrunkKing(); + Royalty happyDrunkKing = RoyaltyObjectMother.createHappyDrunkKing(); + Royalty happyKing = RoyaltyObjectMother.createHappyKing(); + Royalty soberUnhappyKing = RoyaltyObjectMother.createSoberUnhappyKing(); + assertEquals(drunkKing.getClass(), King.class); + assertEquals(happyDrunkKing.getClass(), King.class); + assertEquals(happyKing.getClass(), King.class); + assertEquals(soberUnhappyKing.getClass(), King.class); + } +} diff --git a/object-pool/etc/object-pool.urm.puml b/object-pool/etc/object-pool.urm.puml index caf0b6d7e..21ef76e0d 100644 --- a/object-pool/etc/object-pool.urm.puml +++ b/object-pool/etc/object-pool.urm.puml @@ -1,15 +1,9 @@ @startuml package com.iluwatar.object.pool { - class OliphauntPool { - + OliphauntPool() - # create() : Oliphaunt - } - class Oliphaunt { - - counter : int {static} - - id : int - + Oliphaunt() - + getId() : int - + toString() : String + class App { + - LOGGER : Logger {static} + + App() + + main(args : String[]) {static} } abstract class ObjectPool { - available : HashSet @@ -20,9 +14,16 @@ package com.iluwatar.object.pool { # create() : T {abstract} + toString() : String } - class App { - + App() - + main(args : String[]) {static} + class Oliphaunt { + - counter : int {static} + - id : int + + Oliphaunt() + + getId() : int + + toString() : String + } + class OliphauntPool { + + OliphauntPool() + # create() : Oliphaunt } } OliphauntPool --|> ObjectPool diff --git a/object-pool/pom.xml b/object-pool/pom.xml index 927570b66..dbd16330a 100644 --- a/object-pool/pom.xml +++ b/object-pool/pom.xml @@ -2,7 +2,7 @@ "-currentWeather" WeatherType GWeather --> "-currentWeather" WeatherType Weather --> "-observers" WeatherObserver -GOrcs ..|> Race -Orcs ..|> WeatherObserver -Race --|> Observer -GWeather --|> Observable -GHobbits ..|> Race Hobbits ..|> WeatherObserver +Orcs ..|> WeatherObserver +GHobbits ..|> Race +GOrcs ..|> Race +GWeather --|> Observable +Race --|> Observer @enduml \ No newline at end of file diff --git a/observer/pom.xml b/observer/pom.xml index 48909e1aa..ba849f4a4 100644 --- a/observer/pom.xml +++ b/observer/pom.xml @@ -2,7 +2,7 @@ "-queue" Message Headers ..+ Message Consumer --> "-queue" MqSubscribePoint Producer --> "-queue" MqPublishPoint -SimpleMessage --+ Message -Producer --+ Message Message --> "-POISON_PILL" Message -Consumer --+ Message MessageQueue --|> MqPublishPoint MessageQueue --|> MqSubscribePoint -SimpleMessageQueue ..|> MessageQueue SimpleMessage ..|> Message +SimpleMessageQueue ..|> MessageQueue @enduml \ No newline at end of file diff --git a/poison-pill/pom.xml b/poison-pill/pom.xml index 432f19547..2e0d8c078 100644 --- a/poison-pill/pom.xml +++ b/poison-pill/pom.xml @@ -2,7 +2,7 @@ "-data" StewData @enduml \ No newline at end of file diff --git a/private-class-data/pom.xml b/private-class-data/pom.xml index 1dc545cb1..11fc40d4b 100644 --- a/private-class-data/pom.xml +++ b/private-class-data/pom.xml @@ -2,7 +2,7 @@ "-queue" ItemQueue Producer --> "-queue" ItemQueue diff --git a/producer-consumer/pom.xml b/producer-consumer/pom.xml index 5ac018f51..66f3de208 100644 --- a/producer-consumer/pom.xml +++ b/producer-consumer/pom.xml @@ -2,7 +2,7 @@ "-src" Promise -ConsumeAction --+ Promise +TransformAction --+ Promise ConsumeAction --> "-src" Promise -Utility --+ Map +ConsumeAction --+ Promise Promise --|> PromiseSupport @enduml \ No newline at end of file diff --git a/promise/pom.xml b/promise/pom.xml index 30a719f13..cc2d9ea42 100644 --- a/promise/pom.xml +++ b/promise/pom.xml @@ -2,7 +2,7 @@ "-prototype" Prototype -Character --> "-type" Type Type ..+ Character +Character --> "-type" Type Character ..|> Prototype @enduml \ No newline at end of file diff --git a/property/pom.xml b/property/pom.xml index af0c9f288..3842cfed7 100644 --- a/property/pom.xml +++ b/property/pom.xml @@ -2,7 +2,7 @@ "-beast" Beast HeroFactoryImpl --> "-warlord" Warlord HeroFactoryImpl --> "-mage" Mage -OrcWarlord --|> Warlord -OrcBeast --|> Beast Beast --|> Prototype -ElfMage --|> Mage -Mage --|> Prototype -ElfWarlord --|> Warlord -OrcMage --|> Mage ElfBeast --|> Beast -Warlord --|> Prototype +ElfMage --|> Mage +ElfWarlord --|> Warlord HeroFactoryImpl ..|> HeroFactory +Mage --|> Prototype +OrcBeast --|> Beast +OrcMage --|> Mage +OrcWarlord --|> Warlord +Warlord --|> Prototype @enduml \ No newline at end of file diff --git a/prototype/pom.xml b/prototype/pom.xml index d0c03c0b6..5093e9715 100644 --- a/prototype/pom.xml +++ b/prototype/pom.xml @@ -2,7 +2,7 @@ "-tower" WizardTower +IvoryTower ..|> WizardTower +WizardTowerProxy ..|> WizardTower @enduml \ No newline at end of file diff --git a/proxy/etc/proxy_1.png b/proxy/etc/proxy_1.png deleted file mode 100644 index ba86fa8d6..000000000 Binary files a/proxy/etc/proxy_1.png and /dev/null differ diff --git a/proxy/pom.xml b/proxy/pom.xml index 7484fc47e..323521bcf 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -2,7 +2,7 @@ "-handler" ChannelHandler UdpLoggingClient ..+ AppClient @@ -140,12 +145,11 @@ NioReactor --> "-dispatcher" Dispatcher App --> "-reactor" NioReactor App --> "-channels" AbstractNioChannel DatagramPacket ..+ NioDatagramChannel -LoggingHandler --+ NioDatagramChannel App --> "-dispatcher" Dispatcher ChangeKeyOpsCommand --+ NioReactor -NioDatagramChannel --|> AbstractNioChannel LoggingHandler ..|> ChannelHandler -ThreadPoolDispatcher ..|> Dispatcher +NioDatagramChannel --|> AbstractNioChannel NioServerSocketChannel --|> AbstractNioChannel SameThreadDispatcher ..|> Dispatcher +ThreadPoolDispatcher ..|> Dispatcher @enduml \ No newline at end of file diff --git a/reactor/pom.xml b/reactor/pom.xml index 5bb577c42..09a2565cc 100644 --- a/reactor/pom.xml +++ b/reactor/pom.xml @@ -2,7 +2,7 @@ "-readerLock" ReadLock ReadLock --+ ReaderWriterLock diff --git a/reader-writer-lock/pom.xml b/reader-writer-lock/pom.xml index f10acb8d7..1f7db8709 100644 --- a/reader-writer-lock/pom.xml +++ b/reader-writer-lock/pom.xml @@ -2,7 +2,7 @@ "-type" FruitType FruitType ..+ Fruit -FruitBowl --+ Fruit -FruitBowl --> "-fruit" Fruit FruitShop --> "-semaphore" Semaphore +FruitBowl --> "-fruit" Fruit Semaphore ..|> Lock @enduml \ No newline at end of file diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/App.java b/semaphore/src/main/java/com/iluwatar/semaphore/App.java index 272de37b0..90b96cc6f 100644 --- a/semaphore/src/main/java/com/iluwatar/semaphore/App.java +++ b/semaphore/src/main/java/com/iluwatar/semaphore/App.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Customer.java b/semaphore/src/main/java/com/iluwatar/semaphore/Customer.java index e0546edbe..9c480cb84 100644 --- a/semaphore/src/main/java/com/iluwatar/semaphore/Customer.java +++ b/semaphore/src/main/java/com/iluwatar/semaphore/Customer.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java b/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java index 0a4224d20..fc01b8329 100644 --- a/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java +++ b/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/FruitBowl.java b/semaphore/src/main/java/com/iluwatar/semaphore/FruitBowl.java index ac2b87ada..4f527f01c 100644 --- a/semaphore/src/main/java/com/iluwatar/semaphore/FruitBowl.java +++ b/semaphore/src/main/java/com/iluwatar/semaphore/FruitBowl.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/FruitShop.java b/semaphore/src/main/java/com/iluwatar/semaphore/FruitShop.java index 315b46986..63c1dfa54 100644 --- a/semaphore/src/main/java/com/iluwatar/semaphore/FruitShop.java +++ b/semaphore/src/main/java/com/iluwatar/semaphore/FruitShop.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Lock.java b/semaphore/src/main/java/com/iluwatar/semaphore/Lock.java index 4b651685c..d4f591754 100644 --- a/semaphore/src/main/java/com/iluwatar/semaphore/Lock.java +++ b/semaphore/src/main/java/com/iluwatar/semaphore/Lock.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Semaphore.java b/semaphore/src/main/java/com/iluwatar/semaphore/Semaphore.java index 2e4a54c7c..01351ad9a 100644 --- a/semaphore/src/main/java/com/iluwatar/semaphore/Semaphore.java +++ b/semaphore/src/main/java/com/iluwatar/semaphore/Semaphore.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/test/java/com/iluwatar/semaphore/AppTest.java b/semaphore/src/test/java/com/iluwatar/semaphore/AppTest.java index 4b286588d..25dba2a6d 100644 --- a/semaphore/src/test/java/com/iluwatar/semaphore/AppTest.java +++ b/semaphore/src/test/java/com/iluwatar/semaphore/AppTest.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/test/java/com/iluwatar/semaphore/FruitBowlTest.java b/semaphore/src/test/java/com/iluwatar/semaphore/FruitBowlTest.java index be31f77ab..30a7dce44 100644 --- a/semaphore/src/test/java/com/iluwatar/semaphore/FruitBowlTest.java +++ b/semaphore/src/test/java/com/iluwatar/semaphore/FruitBowlTest.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/semaphore/src/test/java/com/iluwatar/semaphore/SemaphoreTest.java b/semaphore/src/test/java/com/iluwatar/semaphore/SemaphoreTest.java index 14587a485..b787a3301 100644 --- a/semaphore/src/test/java/com/iluwatar/semaphore/SemaphoreTest.java +++ b/semaphore/src/test/java/com/iluwatar/semaphore/SemaphoreTest.java @@ -1,6 +1,6 @@ /** * The MIT License - * Copyright (c) 2014 Ilkka Seppälä + * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/servant/etc/servant.urm.puml b/servant/etc/servant.urm.puml index b7391f5dd..96dee04bc 100644 --- a/servant/etc/servant.urm.puml +++ b/servant/etc/servant.urm.puml @@ -1,28 +1,7 @@ @startuml package com.iluwatar.servant { - class Servant { - + name : String - + Servant(name : String) - + checkIfYouWillBeHanged(tableGuests : List) : boolean - + feed(r : Royalty) - + giveCompliments(r : Royalty) - + giveWine(r : Royalty) - } - class Queen { - - complimentReceived : boolean - - isDrunk : boolean - - isFlirty : boolean - - isHappy : boolean - - isHungry : boolean - + Queen() - + changeMood() - + getDrink() - + getFed() - + getMood() : boolean - + receiveCompliments() - + setFlirtiness(f : boolean) - } class App { + - LOGGER : Logger {static} ~ jenkins : Servant {static} ~ travis : Servant {static} + App() @@ -41,6 +20,20 @@ package com.iluwatar.servant { + getMood() : boolean + receiveCompliments() } + class Queen { + - complimentReceived : boolean + - isDrunk : boolean + - isFlirty : boolean + - isHappy : boolean + - isHungry : boolean + + Queen() + + changeMood() + + getDrink() + + getFed() + + getMood() : boolean + + receiveCompliments() + + setFlirtiness(f : boolean) + } ~interface Royalty { + changeMood() {abstract} + getDrink() {abstract} @@ -48,8 +41,16 @@ package com.iluwatar.servant { + getMood() : boolean {abstract} + receiveCompliments() {abstract} } + class Servant { + + name : String + + Servant(name : String) + + checkIfYouWillBeHanged(tableGuests : List) : boolean + + feed(r : Royalty) + + giveCompliments(r : Royalty) + + giveWine(r : Royalty) + } } App --> "-jenkins" Servant -Queen ..|> Royalty King ..|> Royalty +Queen ..|> Royalty @enduml \ No newline at end of file diff --git a/servant/pom.xml b/servant/pom.xml index 1e99bc09b..30c02d0b8 100644 --- a/servant/pom.xml +++ b/servant/pom.xml @@ -2,7 +2,7 @@ "-wizardDao" WizardDao MagicServiceImpl --> "-spellbookDao" SpellbookDao MagicServiceImpl --> "-spellDao" SpellDao Spellbook --> "-spells" Spell Spellbook --> "-wizards" Wizard +DaoBaseImpl ..|> Dao +MagicServiceImpl ..|> MagicService +Spell --|> BaseEntity +SpellDao --|> Dao SpellDaoImpl ..|> SpellDao SpellDaoImpl --|> DaoBaseImpl +Spellbook --|> BaseEntity SpellbookDao --|> Dao -WizardDao --|> Dao SpellbookDaoImpl ..|> SpellbookDao SpellbookDaoImpl --|> DaoBaseImpl -MagicServiceImpl ..|> MagicService -SpellDao --|> Dao -Spell --|> BaseEntity -Spellbook --|> BaseEntity Wizard --|> BaseEntity +WizardDao --|> Dao WizardDaoImpl ..|> WizardDao WizardDaoImpl --|> DaoBaseImpl -DaoBaseImpl ..|> Dao @enduml \ No newline at end of file diff --git a/service-layer/pom.xml b/service-layer/pom.xml index 830ced4f6..74fd36624 100644 --- a/service-layer/pom.xml +++ b/service-layer/pom.xml @@ -2,7 +2,7 @@ "-serviceCache" ServiceCache diff --git a/service-locator/pom.xml b/service-locator/pom.xml index 894908f92..058e1b1bc 100644 --- a/service-locator/pom.xml +++ b/service-locator/pom.xml @@ -2,7 +2,7 @@ "-INSTANCE" IvoryTower ThreadSafeDoubleCheckLocking --> "-instance" ThreadSafeDoubleCheckLocking diff --git a/singleton/pom.xml b/singleton/pom.xml index 2ba9fe6d4..ebacac8cc 100644 --- a/singleton/pom.xml +++ b/singleton/pom.xml @@ -2,7 +2,7 @@ "-s" Size AbstractCreature --> "-color" Color MovementSelector --> "-m" Movement @@ -97,10 +98,10 @@ AbstractCreature --> "-movement" Movement AbstractCreature --> "-size" Size ColorSelector --> "-c" Color AbstractCreature ..|> Creature -Troll --|> AbstractCreature -Octopus --|> AbstractCreature -Shark --|> AbstractCreature +Dragon --|> AbstractCreature Goblin --|> AbstractCreature KillerBee --|> AbstractCreature -Dragon --|> AbstractCreature +Octopus --|> AbstractCreature +Shark --|> AbstractCreature +Troll --|> AbstractCreature @enduml \ No newline at end of file diff --git a/specification/pom.xml b/specification/pom.xml index 49e56f3c1..5d9498652 100644 --- a/specification/pom.xml +++ b/specification/pom.xml @@ -2,7 +2,7 @@ "-mammoth" Mammoth PeacefulState --> "-mammoth" Mammoth Mammoth --> "-state" State -PeacefulState ..|> State AngryState ..|> State +PeacefulState ..|> State @enduml \ No newline at end of file diff --git a/state/pom.xml b/state/pom.xml index ec932532d..03f9401c7 100644 --- a/state/pom.xml +++ b/state/pom.xml @@ -2,7 +2,7 @@ "-method" StealingMethod HitAndRunMethod --|> StealingMethod diff --git a/template-method/pom.xml b/template-method/pom.xml index 2098a801f..892c84a7c 100644 --- a/template-method/pom.xml +++ b/template-method/pom.xml @@ -2,7 +2,7 @@ "-task" Task CoffeeMakingTask --|> Task diff --git a/thread-pool/pom.xml b/thread-pool/pom.xml index e1f9a4e49..46b9f3a0d 100644 --- a/thread-pool/pom.xml +++ b/thread-pool/pom.xml @@ -2,7 +2,7 @@