|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
JUnit test for the SecureRerooting module. More...

Public Member Functions | |
| SecureRerootingTest (boolean useTCP) | |
| Constructor. | |
| void | randomTest () throws IOException, ClassNotFoundException, NoSuchMethodException |
| Test for SecureRerooting module. | |
| synchronized void | notifyIn (Message msg) |
| Collection< MessageType > | getMsgTypes () |
| void | setQueue (Queue queue) |
| Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T > | |
| default void | notifyIn (Message msg, Object toAgent) |
| Notifies the listener of an incoming message. | |
Static Public Member Functions | |
| static TestSuite | suite () |
Protected Member Functions | |
| void | setUp () |
| void | tearDown () throws Exception |
| Ends all queues. | |
Protected Attributes | |
| RandGraphFactory.Graph | graph |
| Random graph used to generate a constraint graph. | |
Private Member Functions | |
| synchronized boolean | testNextComponent () |
| Send a rerooting msg to a not tested component of the graph. | |
| void | sendReroot (String dest) |
| Send a Reroot request to the destination variable dest. | |
| void | end () |
| Send to all agent an AgentFinish message. | |
| synchronized void | testResult () |
| Test if the result is correct. | |
Private Attributes | |
| int | maxVar = 9 |
| The maximum number of variables in this problem. | |
| int | maxAgent = 5 |
| The maximum number of agents in this problem. | |
| int | maxEdge = 40 |
| The maximum number of constraints in this problem. | |
| XCSPparser< AddableInteger, AddableInteger > | parser |
| Parser for the random XCSP problem. | |
| List< List< String > > | components |
| The components of the graph still to test. | |
| Map< String, Queue > | queues |
| List of queues, indexed by agent name. | |
| Map< String, QueueOutputPipeInterface > | pipes |
| One output pipe used to send messages to each queue, indexed by agent name. | |
| boolean | useTCP |
| Whether to use TCP or SharedMemory pipes. | |
| int | remainingOutput |
| number of remaining DFSoutput to wait for | |
| Map< String, Integer > | rounds |
| number of iterations of the algorithm on a variable | |
| Set< String > | roots |
| The marked roots. | |
| int | nbrAgents |
| The number of agents that have not yet sent their AGENT_FINISHED message. | |
| final ReentrantLock | finished_lock = new ReentrantLock () |
| Used to make the test thread wait. | |
| final Condition | finished = finished_lock.newCondition() |
| Used to wake up the test thread when all agents have finished. | |
| Queue | myQueue |
| The controller's queue. | |
| ArrayList< Message > | pendingMsgs |
| DFS order messages whose processing must be postponed until all key shares have been exchanged. | |
JUnit test for the SecureRerooting module.
| frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.SecureRerootingTest | ( | boolean | useTCP | ) |
|
private |
Send to all agent an AgentFinish message.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, and queues.
Referenced by notifyIn().
| Collection< MessageType > frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.algorithms.dpop.privacy.CollaborativeDecryption< C extends Addable< C >, E extends AddableLimited< C, E, K extends PublicKeyShare >.CRYPTO_SCHEME_TYPE, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, and frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE.
| synchronized void frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, components, frodo2.algorithms.dpop.privacy.CollaborativeDecryption< C extends Addable< C >, E extends AddableLimited< C, E, K extends PublicKeyShare >.CRYPTO_SCHEME_TYPE, end(), frodo2.communication.MessageType.equals(), frodo2.communication.Message.getType(), graph, notifyIn(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, remainingOutput, roots, rounds, sendReroot(), and testNextComponent().
Referenced by notifyIn().

| void frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.randomTest | ( | ) | throws IOException, ClassNotFoundException, NoSuchMethodException |
Test for SecureRerooting module.
| IOException | thrown when failed to create TCP pipes |
| ClassNotFoundException | should never happen |
| NoSuchMethodException | if the CryptoScheme does not have a constructor that takes in an Element |
References frodo2.communication.Queue.addIncomingMessagePolicy(), frodo2.communication.Queue.addOutgoingMessagePolicy(), components, frodo2.algorithms.varOrdering.election.tests.LeaderElectionMaxIDTest< S extends Comparable< S > >.computeLeaders(), frodo2.algorithms.test.AllTests.createQueueNetwork(), frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.RandGraphFactory.getRandGraph(), frodo2.algorithms.dpop.privacy.SecureCircularRouting.getStatsFromQueue(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSubProblem(), graph, maxAgent, maxEdge, maxVar, myQueue, nbrAgents, frodo2.algorithms.dpop.privacy.SecureRerooting< C extends Addable< C >, E extends AddableLimited< C, E >.OUTPUT, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), parser, pipes, queues, frodo2.algorithms.dpop.privacy.test.FakeCryptoScheme.resetCounter(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.ROOT_VAR_MSG_TYPE, rounds, frodo2.communication.Queue.sendMessageToSelf(), frodo2.communication.Queue.setProblem(), frodo2.algorithms.dpop.privacy.SecureCircularRouting.setSilent(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.setSilent(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, and testResult().

|
private |
Send a Reroot request to the destination variable dest.
| dest | the destination of the reroot request message |
References graph.
Referenced by notifyIn(), and testNextComponent().
| void frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
|
protected |
References pendingMsgs, roots, and rounds.
|
static |
References SecureRerootingTest().
Referenced by frodo2.algorithms.dpop.privacy.test.AllTestsP_DPOP.suite().

|
protected |
|
private |
Send a rerooting msg to a not tested component of the graph.
References components, remainingOutput, sendReroot(), and testNextComponent().
Referenced by notifyIn(), and testNextComponent().

|
private |
|
private |
The components of the graph still to test.
Referenced by notifyIn(), randomTest(), and testNextComponent().
|
private |
Used to wake up the test thread when all agents have finished.
|
private |
Used to make the test thread wait.
|
protected |
Random graph used to generate a constraint graph.
Referenced by notifyIn(), randomTest(), sendReroot(), tearDown(), and testResult().
|
private |
The maximum number of agents in this problem.
Referenced by randomTest().
|
private |
The maximum number of constraints in this problem.
Referenced by randomTest().
|
private |
The maximum number of variables in this problem.
Referenced by randomTest().
|
private |
The controller's queue.
Referenced by randomTest().
|
private |
The number of agents that have not yet sent their AGENT_FINISHED message.
Referenced by randomTest().
|
private |
Parser for the random XCSP problem.
Referenced by randomTest().
|
private |
DFS order messages whose processing must be postponed until all key shares have been exchanged.
Referenced by setUp().
|
private |
One output pipe used to send messages to each queue, indexed by agent name.
Referenced by randomTest(), and tearDown().
|
private |
List of queues, indexed by agent name.
Referenced by end(), randomTest(), and tearDown().
|
private |
number of remaining DFSoutput to wait for
Referenced by notifyIn(), and testNextComponent().
|
private |
The marked roots.
Referenced by notifyIn(), setUp(), tearDown(), and testResult().
|
private |
number of iterations of the algorithm on a variable
Referenced by notifyIn(), randomTest(), setUp(), and tearDown().
|
private |
Whether to use TCP or SharedMemory pipes.
Referenced by SecureRerootingTest().