Mercurial > hg > Database > Christie
changeset 33:e7bf1506810c
change test code
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 15 Feb 2018 19:08:55 +0900 |
parents | 307ac87ddcf7 |
children | 7b405f622c5c |
files | src/main/java/christie/annotation/Peek.java src/main/java/christie/datagear/Command/Command.java src/main/java/christie/datagear/LocalDataGearManager.java src/main/java/christie/test/Remote/RemotePutTest.java src/main/java/christie/test/Remote/StartRemotePut.java src/main/java/christie/test/RemoteTake/RemoteTakeTest.java src/main/java/christie/test/TestLocal/StartTest.java src/main/java/christie/test/TestLocal/TestCodeGear.java |
diffstat | 8 files changed, 27 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/christie/annotation/Peek.java Thu Feb 15 15:48:23 2018 +0900 +++ b/src/main/java/christie/annotation/Peek.java Thu Feb 15 19:08:55 2018 +0900 @@ -11,5 +11,4 @@ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface Peek { - String value(); } \ No newline at end of file
--- a/src/main/java/christie/datagear/Command/Command.java Thu Feb 15 15:48:23 2018 +0900 +++ b/src/main/java/christie/datagear/Command/Command.java Thu Feb 15 19:08:55 2018 +0900 @@ -30,4 +30,8 @@ cg.getIdg().setInputs(key, dg); } + public void setDg(Object obj){ + this.dg.setData(obj); + } + }
--- a/src/main/java/christie/datagear/LocalDataGearManager.java Thu Feb 15 15:48:23 2018 +0900 +++ b/src/main/java/christie/datagear/LocalDataGearManager.java Thu Feb 15 19:08:55 2018 +0900 @@ -75,11 +75,11 @@ } private void takeAndSetData(Command cm){ - cm.dg.setData(dataGears.take(cm.key)); + cm.setDg(dataGears.take(cm.key)); } private void peekAndSetData(Command cm){ - cm.dg.setData(dataGears.peek(cm.key)); + cm.setDg(dataGears.peek(cm.key)); } }
--- a/src/main/java/christie/test/Remote/RemotePutTest.java Thu Feb 15 15:48:23 2018 +0900 +++ b/src/main/java/christie/test/Remote/RemotePutTest.java Thu Feb 15 19:08:55 2018 +0900 @@ -1,5 +1,6 @@ package christie.test.Remote; +import christie.annotation.Peek; import christie.annotation.Take; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; @@ -9,7 +10,7 @@ @Take public int count; - @Take + @Peek public int cgmID; @Override @@ -18,7 +19,7 @@ System.out.println(cgmID + " : " + count); cgm.setup(new RemotePutTest()); getDGM("remote").put("count", count + 1); - getDGM("remote").put("cgmID", cgm.cgmID); + //getDGM("remote").put("cgmID", cgm.cgmID); } }
--- a/src/main/java/christie/test/Remote/StartRemotePut.java Thu Feb 15 15:48:23 2018 +0900 +++ b/src/main/java/christie/test/Remote/StartRemotePut.java Thu Feb 15 19:08:55 2018 +0900 @@ -16,11 +16,11 @@ new StartRemotePut(cgm); cgm.setup(new CreateRemotePutTest());//この中身をここに直接書くとなぜか通らない - cgm.createRemoteDGM("remote", "localhost", 10001); + cgm.createRemoteDGM("remote", "localhost", 10000); - CodeGearManager cgm2 = createCGM(10001); - cgm2.setup(new RemotePutTest()); - cgm2.createRemoteDGM("remote", "localhost", 10000); + //CodeGearManager cgm2 = createCGM(10001); + //cgm2.setup(new RemotePutTest()); + //cgm2.createRemoteDGM("remote", "localhost", 10000); } }
--- a/src/main/java/christie/test/RemoteTake/RemoteTakeTest.java Thu Feb 15 15:48:23 2018 +0900 +++ b/src/main/java/christie/test/RemoteTake/RemoteTakeTest.java Thu Feb 15 19:08:55 2018 +0900 @@ -1,5 +1,6 @@ package christie.test.RemoteTake; +import christie.annotation.PeekFrom; import christie.annotation.TakeFrom; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; @@ -9,18 +10,17 @@ @TakeFrom("remote") int count; - @TakeFrom("remote") + @PeekFrom("remote") int cgmID; @Override protected void run(CodeGearManager cgm) { + System.out.println(cgmID + " : " + count); if (count <= 10){ - System.out.println(cgmID + " : " + count); cgm.setup(new RemoteTakeTest()); } - getLocalDGM().put("count", count + 1); - getLocalDGM().put("cgmID", cgm.cgmID); + //getLocalDGM().put("cgmID", cgm.cgmID); } }
--- a/src/main/java/christie/test/TestLocal/StartTest.java Thu Feb 15 15:48:23 2018 +0900 +++ b/src/main/java/christie/test/TestLocal/StartTest.java Thu Feb 15 19:08:55 2018 +0900 @@ -16,6 +16,7 @@ @Override protected void run(CodeGearManager cgm) { cgm.setup(new TestCodeGear()); - getLocalDGM().put("hoge", 1); + getLocalDGM().put("hoge", "hoge!"); + getLocalDGM().put("count", 1); } }
--- a/src/main/java/christie/test/TestLocal/TestCodeGear.java Thu Feb 15 15:48:23 2018 +0900 +++ b/src/main/java/christie/test/TestLocal/TestCodeGear.java Thu Feb 15 19:08:55 2018 +0900 @@ -1,5 +1,6 @@ package christie.test.TestLocal; +import christie.annotation.Peek; import christie.annotation.Take; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; @@ -11,15 +12,18 @@ */ public class TestCodeGear extends CodeGear { + @Peek + String hoge; + @Take - int hoge; + int count; public void run(CodeGearManager cgm){ - System.out.println(hoge); + System.out.println(count + " : " + hoge); - if (hoge != 10){ + if (count != 10){ cgm.setup(new TestCodeGear()); - getLocalDGM().put("hoge", hoge + 1); + getLocalDGM().put("count", count + 1); } }