Mercurial > hg > Database > Christie
changeset 270:1f2e6104b47b
create example Attendance
author | matac42 <matac@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 26 Jun 2021 10:16:05 +0900 |
parents | 8b55a00da2a9 |
children | 7f4be5f204b3 |
files | src/test/java/christie/example/Attendance/CallCodeGear.java src/test/java/christie/example/Attendance/StartAttendance.java src/test/java/christie/example/Attendance/Submission.java |
diffstat | 3 files changed, 53 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/christie/example/Attendance/CallCodeGear.java Sat Jun 26 10:16:05 2021 +0900 @@ -0,0 +1,14 @@ +package christie.example.Attendance; + +import christie.codegear.CodeGear; +import christie.codegear.CodeGearManager; + +public class CallCodeGear extends CodeGear { + @Override + protected void run(CodeGearManager cgm) { +// put("ack", "true"); + getDGM("studentA").put("start", "true"); + System.out.println("hoge"); + cgm.setup(new CallCodeGear()); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/christie/example/Attendance/StartAttendance.java Sat Jun 26 10:16:05 2021 +0900 @@ -0,0 +1,22 @@ +package christie.example.Attendance; + +import christie.codegear.CodeGearManager; +import christie.codegear.StartCodeGear; + +public class StartAttendance extends StartCodeGear { + + public StartAttendance(CodeGearManager cgm) { super(cgm); } + + public static void main(String[] args){ + CodeGearManager teacher = createCGM(10000); + CodeGearManager studentA = createCGM(10001); + CodeGearManager student2 = createCGM(10002); + teacher.setup(new CallCodeGear()); + studentA.setup(new Submission()); + student2.setup(new Submission()); + teacher.createRemoteDGM("studentA","localhost",10001); + teacher.createRemoteDGM("student2","localhost",10002); + studentA.createRemoteDGM("teacher","localhost",10000); + student2.createRemoteDGM("teacher","localhost",10000); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/christie/example/Attendance/Submission.java Sat Jun 26 10:16:05 2021 +0900 @@ -0,0 +1,17 @@ +package christie.example.Attendance; + +import christie.annotation.Take; +import christie.codegear.CodeGear; +import christie.codegear.CodeGearManager; + +public class Submission extends CodeGear { + + @Take + String start; + + @Override + protected void run(CodeGearManager cgm) { + System.out.println(start); + cgm.setup(new Submission()); + } +}