summaryrefslogtreecommitdiffstats
path: root/notFinishedCode
diff options
context:
space:
mode:
Diffstat (limited to 'notFinishedCode')
-rw-r--r--notFinishedCode/clientController.py64
1 files changed, 32 insertions, 32 deletions
diff --git a/notFinishedCode/clientController.py b/notFinishedCode/clientController.py
index 8247eaa..55a867c 100644
--- a/notFinishedCode/clientController.py
+++ b/notFinishedCode/clientController.py
@@ -61,39 +61,39 @@ def receiveMessage(timeout, whoIsWho):
message1 = str(handler2.receiveData(timeout))
message2 = str(handler1.receiveData(timeout))
-
- print 'in receive', message1, message2
-
- if message1 == 'HELLO CONTROLLER' and message2 == 'HELLO CONTROLLER' and lastState == 1:
- outcome = assignJobs(0,455)
-
- elif message1 == 'RECEIVER READY' and message2 == 'CALLER READY' and lastState == 2:
- outcome = startJobs(whoIsWho)
-
- elif message1 == 'CALL OK' and message2 == 'CALL OK' and lastState == 3:
- outcome = terminateConnection()
- #write to db here
- print 'TEST WAS OK'
+ if message1 != '' and message2 !='':
+ print 'in receive', message1, message2
-
- elif message1 == 'CALL NOT OK' and message2 == 'CALL NOT OK' and lastState == 3:
- outcome = terminateConnection()
- #write to db here
- print 'BOTH SIDES FAILED'
-
- elif message1 == 'CALL NOT OK' and message2 == 'CALL OK' and lastState == 3:
- outcome = terminateConnection()
- #write to db here
- print 'ONE SIDE FAILED ', whoIsWho
-
- elif message1 == 'CALL OK' and message2 == 'CALL NOT OK' and lastState == 3:
- outcome = terminateConnection()
- #write to db here
- print 'ONE SIDE FAILED', whoIsWho
-
- else:
- #abort test since they are not initialized
- outcome = other()
+ if message1 == 'HELLO CONTROLLER' and message2 == 'HELLO CONTROLLER' and lastState == 1:
+ outcome = assignJobs(0,455)
+
+ elif message1 == 'RECEIVER READY' and message2 == 'CALLER READY' and lastState == 2:
+ outcome = startJobs(whoIsWho)
+
+ elif message1 == 'CALL OK' and message2 == 'CALL OK' and lastState == 3:
+ outcome = terminateConnection()
+ #write to db here
+ print 'TEST WAS OK'
+
+
+ elif message1 == 'CALL NOT OK' and message2 == 'CALL NOT OK' and lastState == 3:
+ outcome = terminateConnection()
+ #write to db here
+ print 'BOTH SIDES FAILED'
+
+ elif message1 == 'CALL NOT OK' and message2 == 'CALL OK' and lastState == 3:
+ outcome = terminateConnection()
+ #write to db here
+ print 'ONE SIDE FAILED ', whoIsWho
+
+ elif message1 == 'CALL OK' and message2 == 'CALL NOT OK' and lastState == 3:
+ outcome = terminateConnection()
+ #write to db here
+ print 'ONE SIDE FAILED', whoIsWho
+
+ else:
+ #abort test since they are not initialized
+ outcome = other()
def assignJobs(whoIsWho, number):
print 'in assign jobs'