|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
Unit tests for VariableObfuscation. More...

Public Member Functions | |
| VariableObfuscationTest (String method, boolean useTCP, Class< V > domClass) | |
| Constructor that instantiates a test only for the input method. | |
| void | testMerged () throws Exception |
| Tests whenever all name and values are correctly obfuscated in mergeBack mode Also tests that parents send always the same codeName and domain to all of their children. | |
| void | testUnique () throws Exception |
| Tests whenever all name and values are correctly obfuscated without mergeBack mode Also test that all codeNames and domains are different. | |
| 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. | |
| Map< String, QueueOutputPipeInterface > | pipes |
| One output pipe used to send messages to each queue, indexed by the queue's agent name. | |
Private Member Functions | |
| void | randomTest (boolean mergeBack) throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException |
Private Attributes | |
| int | maxNbrVars = 7 |
| Maximum number of variables in the random graph. | |
| int | maxNbrEdges = 35 |
| Maximum number of edges in the random graph. | |
| int | maxNbrAgents = 7 |
| Maximum number of agents. | |
| boolean | mergeBack |
| If mergeBack is used or not. | |
| Map< String, Queue > | queues |
| List of queues, indexed by agent name. | |
| final boolean | useTCP |
| Whether to test using TCP pipes. | |
| final Object | lock = new Object () |
| Lock used to synchronize access to this module's members. | |
| Set< String > | cn |
| A set with all codeNames. | |
| Map< String, String > | cns |
| A map with codeNames used to test if all codeNames are identical in mergeBack mode. | |
| Set< List< V > > | vs |
| A set with all obfuscated domain. | |
| Map< String, List< V > > | vss |
| A map with obfuscated domains used to test if all domains are identical in mergeBack mode. | |
| XCSPparser< V, AddableBigInteger > | parser |
| Parser for the random XCSP problem. | |
| ArrayList< String > | receivedCN |
| List of received codeNames in Obfuscated UTIL messages. | |
| ArrayList< List< V > > | receivedDom |
| List of received domains in Obfuscated UTIL messages. | |
| 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. | |
| Class< V > | domClass |
| The class used for variable values. | |
Unit tests for VariableObfuscation.
| <V> | the type used for variable values |
| frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.VariableObfuscationTest | ( | String | method, |
| boolean | useTCP, | ||
| Class< V > | domClass ) |
| Collection< MessageType > frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.CODE_NAME_TYPE, frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.OBFUSCATED_UTIL_TYPE, and frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.OBFUSCATED_VALUE_TYPE.
| void frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.CODE_NAME_TYPE, frodo2.communication.MessageType.equals(), and notifyIn().
Referenced by notifyIn().

|
private |
| mergeBack | if we are in mergeBack mode or not |
| IOException | if an IO exception occur |
| NoSuchMethodException | if VariableObfuscation does not have a constructor with the required signature |
| InvocationTargetException | if the constructor for VariableObfuscation throws an exception |
| IllegalAccessException | if the constructor for VariableObfuscation is inaccessible |
| InstantiationException | if VariableObfuscation is an abstract class |
| IllegalArgumentException | if the constructor of VariableObfuscation is passed incorrect parameters |
References frodo2.communication.Queue.addIncomingMessagePolicy(), frodo2.communication.Queue.addOutgoingMessagePolicy(), cn, frodo2.algorithms.test.AllTests.createQueueNetwork(), frodo2.communication.Queue.end(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgentNeighborhoods(), 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, mergeBack, nbrAgents, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), pipes, queues, receivedCN, receivedDom, frodo2.communication.Queue.setProblem(), 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, useTCP, and vs.
Referenced by testMerged(), and testUnique().

| void frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.setQueue | ( | Queue | queue | ) |
|
protected |
References cn, cns, frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.RandGraphFactory.getRandGraph(), graph, maxNbrAgents, maxNbrEdges, maxNbrVars, parser, receivedCN, receivedDom, vs, and vss.

|
static |
References VariableObfuscationTest().
Referenced by frodo2.algorithms.dpop.privacy.test.AllTestsP_DPOP.suite().

|
protected |
Ends all queues.
References cn, cns, graph, pipes, queues, receivedCN, receivedDom, vs, and vss.
| void frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.testMerged | ( | ) | throws Exception |
Tests whenever all name and values are correctly obfuscated in mergeBack mode Also tests that parents send always the same codeName and domain to all of their children.
| Exception | if an error occurs |
References randomTest().

| void frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.testUnique | ( | ) | throws Exception |
Tests whenever all name and values are correctly obfuscated without mergeBack mode Also test that all codeNames and domains are different.
| Exception | if an error occurs |
References randomTest().

|
private |
A set with all codeNames.
Referenced by randomTest(), setUp(), and tearDown().
|
private |
A map with codeNames used to test if all codeNames are identical in mergeBack mode.
Variable - CodeName
Referenced by setUp(), and tearDown().
|
private |
The class used for variable values.
Referenced by VariableObfuscationTest().
|
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 randomTest(), setUp(), and tearDown().
|
private |
Lock used to synchronize access to this module's members.
This is required because this module is registered to multiple queues, therefore multiple threads can call notifyIn simultaneously.
|
private |
Maximum number of agents.
Referenced by setUp().
|
private |
Maximum number of edges in the random graph.
Referenced by setUp().
|
private |
|
private |
If mergeBack is used or not.
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 setUp().
|
protected |
One output pipe used to send messages to each queue, indexed by the queue's agent name.
Referenced by randomTest(), and tearDown().
|
private |
List of queues, indexed by agent name.
Referenced by randomTest(), and tearDown().
|
private |
List of received codeNames in Obfuscated UTIL messages.
Referenced by randomTest(), setUp(), and tearDown().
|
private |
List of received domains in Obfuscated UTIL messages.
Referenced by randomTest(), setUp(), and tearDown().
|
private |
Whether to test using TCP pipes.
Referenced by randomTest(), and VariableObfuscationTest().
|
private |
A set with all obfuscated domain.
Referenced by randomTest(), setUp(), and tearDown().
|
private |
A map with obfuscated domains used to test if all domains are identical in mergeBack mode.
CodeName - Obfuscated Domain
Referenced by setUp(), and tearDown().