From 16ded678ffe59a4e5bef2a501ba8176f944b82f9 Mon Sep 17 00:00:00 2001 From: scoobycoder Date: Fri, 23 May 2014 09:11:13 -0400 Subject: [PATCH 1/5] starting point for code club kata --- .classpath | 12 +++---- bin/halterman/command/Client.class | Bin 927 -> 775 bytes bin/halterman/command/Command.class | Bin 137 -> 0 bytes .../command/CommandPatternTest.class | Bin 1328 -> 315 bytes bin/halterman/command/Light.class | Bin 658 -> 0 bytes bin/halterman/command/LightOffCommand.class | Bin 576 -> 0 bytes bin/halterman/command/LightOnCommand.class | Bin 572 -> 0 bytes .../{Switch.class => RemoteControl.class} | Bin 594 -> 615 bytes .../halterman/command/CommandPatternTest.java | 32 ------------------ 9 files changed, 4 insertions(+), 40 deletions(-) delete mode 100644 bin/halterman/command/Command.class delete mode 100644 bin/halterman/command/Light.class delete mode 100644 bin/halterman/command/LightOffCommand.class delete mode 100644 bin/halterman/command/LightOnCommand.class rename bin/halterman/command/{Switch.class => RemoteControl.class} (50%) diff --git a/.classpath b/.classpath index 9b67660..bcadf55 100644 --- a/.classpath +++ b/.classpath @@ -3,13 +3,9 @@ - - + + + + - - - - - - diff --git a/bin/halterman/command/Client.class b/bin/halterman/command/Client.class index e0e90243f91140aff337d41560354465e4c7a073..c9106ee1c26151e1634ff7e095e30e3d302ea46c 100644 GIT binary patch literal 775 zcma)4Jx>Bb5Pb`$z=?|Zg;r;W6kcK}#)fEhkpd+#RLik&YwmW*vSR#MRwSBe?~gLh zfssbzH8cBW-n^aNnUBwxHvp$NC?LmBi+F5>Nx1Suosb*&tyl_W3vd`J_k7Czn5&WB z?%#{hGOV6UCG7=6zJA{YNMZr?vS0EJ|&a zjhu}&Z>~KYW@5XjU^gB09>Z?^x4AI59sOWJaV68~uPxT;BpnovKzl>m2ju8P`$D!r z$S2RpuQX;TKF`xG*)$C}SR-3r5Xi3+Dq#bg6iJI4B$@KuS5)q*)fsl)3FWXk=fdyME6}qKjv090qlDT*0p8It;`|J0Qp8%fWX&MQE-Lc~-H<&oSJ(x~tuI!d4U0bk1uib$X*mxs-son}C>y4g((VAYlCX&eJk-~<+R$Kb+#eC9tgO5(% za|O2B(}CmloIvXP>d{bRITP4xuj_x#+7n0m0;T$=_U#;96-a+{-sq)qH+KB)SE&YL z69r_`*bylI-=Qr>V`ZYK5oLjcHHePiiYPHrf~EJ{6WFiEj2spWXWAF2tt&Si{;OAk zr6+ul#{p^r=FC;Am_RkI!z#)iI`1%#N1E*1=fIuK-p!Sok|@IoM&z^@Ll>c*UOFNt zp7$t5-cun|z*@VhKqkb@I&52sf&CpndZ%=6||}21v1~mu*p-00RuUn`3OLJhqo*?vBeji{Ea13w6B&ZTrQ}?C5p87 zJ}gnXJXv7(Vu^}&?!Pvgr#GlJZ}6~b87uF$-4V+I8UAu4e-jp49AX=FO6Y{zc#bk& r@>P%XB5H}pI0|!YJRy#s5^V#=+|NQ4P39$8V+W`7493rhPQd;Hs)pI> diff --git a/bin/halterman/command/Command.class b/bin/halterman/command/Command.class deleted file mode 100644 index a4d8382498c2ca4e283dd68aa3564d013f82d6f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmX^0Z`VEs1_nb0PId++Mh3}@#GI1UqTIwh{p9>yAeEx;458T>SQr@uvJ%S@^>Y&Q z()In5vQm>v7#Y}8D^in7OHvsbm^C!R7#X;N^Gl18Q{6IifI>V_&3YhxY>W&*ML^3K U7#M+Ou`;lMSPbkyl8J!>0BVmP*8l(j diff --git a/bin/halterman/command/CommandPatternTest.class b/bin/halterman/command/CommandPatternTest.class index eb109d623deaafa377d9f1fb1691918e1da4fe76..ec11914b9873318a738f52a6af1762f9dafe3161 100644 GIT binary patch delta 132 zcmdnMwVR3S)W2Q(7#J9g7z8GAImxlvWaed-*fBCNYiNcsGO#%3r=)T*Ff(xSFt9SP zOb8GyREfg}%@%?hM> OfjmYAJ|M}&zz+Z?i4Yb5 literal 1328 zcmZ`&ZBG+H5Pr5T92_SUO68@92#9S}PJGvb3K)z@wJO+zk4IVPV!KD~_AvY`6M2ay z#?SsJ~~AJtve0Hy{04Wn%ksp+g^?KcaEY1 zxxsy9AjOd0a}FH4;mBRPvbD!+ilMI|cI#^Wvrx4^GNjC}~C5=~wezSwH; zWhq_dDB((<&dRR0Yd786C!t*XwbaSqkmXZcR|ui+#FLjbI^7w%5U(T2*%Jo(70Hn6 z5ZfY27Y8pyukRm{uX|BQp`I}$^MxuyYSrE5CX&cl7(m)UmSO5Y^;BdlbuSo3EcC)O zF^n-CInFSV?@&xcq)^o%6BaC7Vi+h3$=?ReE$(eNq*zF^<}|8~C$!yirc_;!gmWFT z#`{Rjx_qua?w@J47Z6Q*h3~i?FPWIdoPp~MlkNS`dQxB7I%eSp@(jINqp(j5*?jrm z@hBCl28s-$aiOBAFi}88Q@(AX3*FkZE!@EZgGp7k%BN~NNp{vh-JU_e?gowRjlh!? z8EQ$>8g@0}r$?CB74X2qL!@bL_dV|WD}hq3H1QZu4Lo7UbYN|vghiT%1MZ2PL(;hu z&p34hG&>`4;$d+nmhi&DvaY1Z4djA^6C8VLp&f?JjD#aW;j@F4bsN6Z!-3w6nT2Qa32u&rcb06crCUS~LKe2R-=YK&WE>l$L SG`-E4Hh}CozzU^FVD%6BXg5&+ diff --git a/bin/halterman/command/Light.class b/bin/halterman/command/Light.class deleted file mode 100644 index fe45db9ce53ee1e188e1b8cda49e3687ad235cfc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 658 zcmZ{hO;6iE5Qg80P5e>g5Fn-W0}}cn${|+IsVXESP8O*Y#G$v1vq=`&>&n@*>d$JW zwi1W_fc~heVv zt!wc`M5)k|s6V`xi6PW-O`uPN`g^67`9QFa-(C^yvwS3dSa=k`flFw_O3RCRHk8Gs z7^af29p{NiuSB8BdU*F~N9K0axtZ52xh&I9b zTyj$Opmn@pSMD%a=}E6N!dt2xk6pYZH1CfYkGlkakk5-mo~zOozY@?bN20?ETKqX| zbGapF7UygypB`5cN8-3~@*DnlPHG7FtXG#dHaQO#4-lfk6|cE!KIPYCb9iF^MDquB sw)cPG*)1ikM!P)NW0HS|7OrTWH8g8UJ6c2AWLn6i##-7dR#U_4{~ls`EC2ui diff --git a/bin/halterman/command/LightOffCommand.class b/bin/halterman/command/LightOffCommand.class deleted file mode 100644 index 72f5198bc7d8032b2150b9293099c67211589e39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 576 zcmZ`#O;5r=6r3%E(pvcvK@<dqP^w#oc6TSMH)hZW(NtK-Vc&*{ z5<{-r8=Ih5HVhOQ%B~E>-Fi6@@dKX(f}!R{9uLMmmI>ZG>dKcZhO=G6{+6b2hIkg< zTG8AlS_Y07nmabJah!xQS5H!TKAA9B_t84`#84(#>i>T9BKb^oD1VMlo(_^VsA_aK zVNu;9G$gE1xB4Hj`{!>czoeWh)e>nzT%DLEY}5!fGByrSCq%l`m66*a@iWgW>dCxf c{}ttTH2xf|R9zuWHFdKy-o}mLgj5>ZzqJ2*F#rGn diff --git a/bin/halterman/command/LightOnCommand.class b/bin/halterman/command/LightOnCommand.class deleted file mode 100644 index eb568faa8ffe42fcf95bb9a8908cb51c9166a4b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 572 zcmZ`#O;5r=6r3%ELM@=6Ac~240!(bYc+q$v;nc`M!+j|mx}>y8S=7H};z#1aAK;HN zzHN!d5Dxp^&Sqxby#4zA_yll)BMSz@alk_*k~xoDKb}*YxSpH_Y8dr1Xu)LIp796n zhCG_O!|_b`%0hvmwXR)>81kWZA&$3BN(Wpq6s~0?)eS?tvys&uF_`^$B5dSPc2Giv zA=l}SN}yN{EEE~4o{Yrpay}NxJs*dHq2|Rt4@W$a8m}Hr703m{>84@7J5x4GJPCiP zXlxTL3;PVs4U0H9(3y&hN2&Z^7%|v)@iOtnK~dhvsYA~Q_c?63TZ(allWRuBh<*)sAHE9=~7olZhOSfJTIy1dBxrf bs&8ogIoheZOqxpS=48B;8^a-~477g$ub+9U diff --git a/bin/halterman/command/Switch.class b/bin/halterman/command/RemoteControl.class similarity index 50% rename from bin/halterman/command/Switch.class rename to bin/halterman/command/RemoteControl.class index 369c23e2122a5a2904d4e9fb37e66aaf443ee0bf..e898830e9912303ecf19124e396d7e4c8d327430 100644 GIT binary patch delta 111 zcmcb_@|;Eg)W2Q(7#J9g7-ZNPm>3!4GZJ%3Qj2mE^YoMRbAeQfeo$&|eo3lxeqKpY Ze$GUVK1D?zLW(YQ@(H16o1DP-2>_2dDMkPQ delta 90 zcmaFPa*0Lb)W2Q(7#J7~8D!WQm>3x(G7@u2Qj2mE^YoMRbAeQfesFnaNpi+S{XQuv SADpuHI@!4)3MZE`egXh}`XICb diff --git a/test/halterman/command/CommandPatternTest.java b/test/halterman/command/CommandPatternTest.java index 3378b24..4842746 100644 --- a/test/halterman/command/CommandPatternTest.java +++ b/test/halterman/command/CommandPatternTest.java @@ -1,38 +1,6 @@ package halterman.command; -import static org.mockito.Mockito.verify; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.mockito.Spy; - public class CommandPatternTest { - @InjectMocks - private Switch lightSwitch; - - @Mock - Light light; - - @Spy - Command lightsOn = new LightOnCommand(light); - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - lightSwitch = new Switch(); - lightSwitch.setCommand(lightsOn); - } - - @Test - public void shouldTurnOnLight() { - lightSwitch.pressButton(); - - verify(light).switchOn(); - } - } From bc0f33fefebbe8da755bbe2dfd07c010e9e12945 Mon Sep 17 00:00:00 2001 From: scoobycoder Date: Fri, 23 May 2014 09:16:00 -0400 Subject: [PATCH 2/5] removing files so we can re-create them --- bin/halterman/command/RemoteControl.class | Bin 615 -> 0 bytes src/halterman/command/Command.java | 6 ------ src/halterman/command/Light.java | 17 ----------------- src/halterman/command/LightOffCommand.java | 19 ------------------- src/halterman/command/LightOnCommand.java | 16 ---------------- src/halterman/command/RemoteControl.java | 15 --------------- src/halterman/command/Switch.java | 15 --------------- 7 files changed, 88 deletions(-) delete mode 100644 bin/halterman/command/RemoteControl.class delete mode 100644 src/halterman/command/Command.java delete mode 100644 src/halterman/command/Light.java delete mode 100644 src/halterman/command/LightOffCommand.java delete mode 100644 src/halterman/command/LightOnCommand.java delete mode 100644 src/halterman/command/RemoteControl.java delete mode 100644 src/halterman/command/Switch.java diff --git a/bin/halterman/command/RemoteControl.class b/bin/halterman/command/RemoteControl.class deleted file mode 100644 index e898830e9912303ecf19124e396d7e4c8d327430..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 615 zcmZ`$O-lk%6g_tw9UZ4EE6a?+ofRhYr!rnnqwhTeZqcY$;6MlX0HIkhJ`G0gyMZH z#^dvelu=kj1v>_|3Dtj>vrttF7~)a56UoNSn`jcd;=)U|Sg>`Z4v0FdW%%|4O-XW= z;hfLFZ-FbDBXP{OUSU3QqQT-fmo#;(aBfWjSVf5|{u!+EtA^W*))cyR_=56$+Dy86 t7AzzTl_@G^Q0&Tz65gB{IZ0~3Y(1m=hAqNxJ}Y6HJ2GdEcG-i5+Bfr1c-#O0 diff --git a/src/halterman/command/Command.java b/src/halterman/command/Command.java deleted file mode 100644 index 9b8899a..0000000 --- a/src/halterman/command/Command.java +++ /dev/null @@ -1,6 +0,0 @@ -package halterman.command; - -//Command -public interface Command { - public void execute(); -} diff --git a/src/halterman/command/Light.java b/src/halterman/command/Light.java deleted file mode 100644 index 81428b9..0000000 --- a/src/halterman/command/Light.java +++ /dev/null @@ -1,17 +0,0 @@ -package halterman.command; - -//Receiver -public class Light { - private boolean on; - - public void switchOn() { - on = true; - System.out.println("Turned Light On."); - } - - public void switchOff() { - on = false; - System.out.println("Turned Light Off."); - } - -} diff --git a/src/halterman/command/LightOffCommand.java b/src/halterman/command/LightOffCommand.java deleted file mode 100644 index 61c9641..0000000 --- a/src/halterman/command/LightOffCommand.java +++ /dev/null @@ -1,19 +0,0 @@ -package halterman.command; - -//Concrete Command -public class LightOffCommand implements Command -{ - //reference to the light - Light light; - - public LightOffCommand(Light light) - { - this.light = light; - } - - public void execute() - { - light.switchOff(); - } - -} diff --git a/src/halterman/command/LightOnCommand.java b/src/halterman/command/LightOnCommand.java deleted file mode 100644 index 47697fd..0000000 --- a/src/halterman/command/LightOnCommand.java +++ /dev/null @@ -1,16 +0,0 @@ -package halterman.command; - -//Concrete Command -public class LightOnCommand implements Command { - // reference to the light - Light light; - - public LightOnCommand(Light light) { - this.light = light; - } - - public void execute() { - light.switchOn(); - } - -} diff --git a/src/halterman/command/RemoteControl.java b/src/halterman/command/RemoteControl.java deleted file mode 100644 index b170df9..0000000 --- a/src/halterman/command/RemoteControl.java +++ /dev/null @@ -1,15 +0,0 @@ -package halterman.command; - -//Invoker -public class RemoteControl { - private Command command; - - public void setCommand(Command command) { - this.command = command; - } - - public void pressButton() { - command.execute(); - } - -} diff --git a/src/halterman/command/Switch.java b/src/halterman/command/Switch.java deleted file mode 100644 index 790d2d2..0000000 --- a/src/halterman/command/Switch.java +++ /dev/null @@ -1,15 +0,0 @@ -package halterman.command; - -//Invoker -public class Switch { - private Command command; - - public void setCommand(Command command) { - this.command = command; - } - - public void pressButton() { - command.execute(); - } - -} From 959e2827e0709e36c2f710b13cbd1ee2d5206583 Mon Sep 17 00:00:00 2001 From: scoobycoder Date: Fri, 23 May 2014 09:17:57 -0400 Subject: [PATCH 3/5] Delete Client.class --- bin/halterman/command/Client.class | Bin 775 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 bin/halterman/command/Client.class diff --git a/bin/halterman/command/Client.class b/bin/halterman/command/Client.class deleted file mode 100644 index c9106ee1c26151e1634ff7e095e30e3d302ea46c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 775 zcma)4Jx>Bb5Pb`$z=?|Zg;r;W6kcK}#)fEhkpd+#RLik&YwmW*vSR#MRwSBe?~gLh zfssbzH8cBW-n^aNnUBwxHvp$NC?LmBi+F5>Nx1Suosb*&tyl_W3vd`J_k7Czn5&WB z?%#{hGOV6UCG7=6zJA{YNMZr?vS0EJ|&a zjhu}&Z>~KYW@5XjU^gB09>Z?^x4AI59sOWJaV68~uPxT;BpnovKzl>m2ju8P`$D!r z$S2RpuQX;TKF`xG*)$C}SR-3r5Xi3+Dq#bg6iJI4B$@KuS5)q*)fsl)3FWX Date: Fri, 23 May 2014 09:18:03 -0400 Subject: [PATCH 4/5] Delete CommandPatternTest.class --- bin/halterman/command/CommandPatternTest.class | Bin 315 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 bin/halterman/command/CommandPatternTest.class diff --git a/bin/halterman/command/CommandPatternTest.class b/bin/halterman/command/CommandPatternTest.class deleted file mode 100644 index ec11914b9873318a738f52a6af1762f9dafe3161..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 315 zcma)%L2JT55QX2w#As@(^y0ZtM0@B$ua#Z|PoXVTyiekyE6E1p+W*y);K3izA0^JJ zw_bXAZ{7?ueDizU9{{|d7b74%uDEczF4?NQD#aFRa`8`gGO#nfaWO(dZ_VGV3bsr2 zk*#&^2+gsv#=Q|5!_k}&PO61Y&_KI`2u(saHCDfG%S_iZ&I(PqPph1ZIoHPLYcq5! zvmp%9|FFCglCNr8=Xz@V#r|L1XHSX;2$y^caq>K(u_SfQK=iaj>qi;^5>Y>fEZm58 P&UGYyD~WI?8lZaus2oYQ From f138234b82a8644d30aeb635ab74604a1e326f8a Mon Sep 17 00:00:00 2001 From: scoobycoder Date: Fri, 23 May 2014 09:18:50 -0400 Subject: [PATCH 5/5] Update build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e142c04..0149d4f 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ sourceCompatibility = 1.5 version = '1.0' jar { manifest { - attributes 'Implementation-Title': 'Spring Vending Machine kata', 'Implementation-Version': version + attributes 'Implementation-Title': 'Design Patterns Gradle file', 'Implementation-Version': version } }