meerkat-java/voter-registry/src/test/java/SimpleRegistryTest.java

285 lines
12 KiB
Java
Raw Normal View History

import com.google.protobuf.InvalidProtocolBufferException;
import junit.framework.TestCase;
import meerkat.SimpleRegistry;
import meerkat.VoterRegistryMessage;
import meerkat.bulletinboard.SimpleBulletinBoardClient;
import meerkat.crypto.concrete.ECElGamalEncryption;
import meerkat.crypto.concrete.ECElGamalUtils;
import meerkat.protobuf.BulletinBoardAPI;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Voting;
import org.factcenter.qilin.primitives.concrete.ECElGamal;
import org.factcenter.qilin.primitives.concrete.ECGroup;
import util.RegistryTags;
import java.lang.reflect.InvocationTargetException;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.security.spec.InvalidKeySpecException;
import java.util.ArrayList;
import java.util.List;
import static util.CollectionMessagesUtils.ConvertToVoterRegistryMessages;
import static util.CollectionMessagesUtils.GetUnsignedBulletinBoardMessages;
/**
* Created by Vladimir Eliezer Tokarev on 1/16/2016.
* Tests the Simple Registry contents
* NOTE: for most of this tests to pass there should run BulletinBoardServer
* that should be reachable on BULLETIN_BOARD_SERVER_ADDRESS
*/
public class SimpleRegistryTest extends TestCase {
private ECElGamalEncryption signatory;
private SimpleBulletinBoardClient communicator;
private static String BULLETIN_BOARD_SERVER_ADDRESS = "http://localhost:8081";
private SecureRandom random = new SecureRandom();
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
private List<List<String>> votersData;
/**
* Creates the ElGamal encryption object
*/
private void ElGamalSetup() {
try {
ECGroup group = new ECGroup("secp256k1");
BigInteger sk = ECElGamal.generateSecretKey(group, random);
ECElGamal.SK key = new ECElGamal.SK(group, sk);
ConcreteCrypto.ElGamalPublicKey serializedPk = ECElGamalUtils.serializePk(group, key);
signatory = new ECElGamalEncryption();
signatory.init(serializedPk);
} catch (InvalidKeySpecException e) {
assertTrue(false);
}
}
/**
* Creates the communication object (the bulletinBoardClient)
*/
private void CommunicatorSetup() {
communicator = new SimpleBulletinBoardClient();
communicator.init(Voting.BulletinBoardClientParams.newBuilder()
.addBulletinBoardAddress(BULLETIN_BOARD_SERVER_ADDRESS)
.setMinRedundancy((float) 1.0)
.build());
}
private SimpleRegistryCallBackHandlers RegistryAnswersHandlerSetup() {
return new SimpleRegistryCallBackHandlers();
}
/**
* Initialize SimpleRegistry object
*/
public void setUp() {
ElGamalSetup();
CommunicatorSetup();
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
votersData = null;
}
/**
* Checks if the creation of the registry have been successful
*/
public void testSimpleRegistryCreation() {
try {
new SimpleRegistry(signatory, communicator);
} catch (Exception e) {
assert false : "While creating the SimpleRegistry exception have been thrown " + e;
}
}
/**
* Creates list of lists of strings for different testing purposes
* @param actionDataNumber number of string in a list
* @param numberOfInstances number of lists in a list
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
* @return
*/
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
private void setActionsData(int actionDataNumber, int numberOfInstances)
{
System.out.println("- Creating "+ numberOfInstances +" ids and personal data strings for adding different voters.");
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
if (votersData != null){
return;
}
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
votersData = new ArrayList<>();
for (int i = 0 ; i < numberOfInstances ; i++ ){
List<String> data = new ArrayList<>();
for (int j = 0 ; j < actionDataNumber ; j++){
data.add(new BigInteger(130, random).toString(32));
}
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
votersData.add(data);
}
}
/**
* Counts the amount of posted messaages that have their tags in voterData
* @param votersData List<List<String>> of information about voters (tags etc...)
* @param tags List<String> of tags
* @return int
* @throws InvalidProtocolBufferException
*/
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
private int countActualAddedMessages(List<List<String>> votersData, List<String> tags, SimpleRegistry registry) throws InvalidProtocolBufferException {
System.out.println("- Check that the server have the new voters data:");
BulletinBoardAPI.MessageFilterList filters = registry.GetRelevantMessagesFilters(tags);
List<VoterRegistryMessage> messages =
ConvertToVoterRegistryMessages(GetUnsignedBulletinBoardMessages(communicator.readMessages(filters)));
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
assert messages.size() > 0 : " The filtered messages are empty ( wrong filtering or server down)";
int addedMessagesCounter = 0;
for (List<String> voterData : votersData) {
for (VoterRegistryMessage message : messages) {
String addedVoterId = message.GetWantedTagFromBasicMessage(RegistryTags.ID_TAG);
String addedVoterData = new String(message.base.getData().toByteArray());
if (voterData.size() == 2 && addedVoterId.contains(voterData.get(0)) && addedVoterData.contains(voterData.get(1))) {
addedMessagesCounter++;
}
else if (addedVoterId.contains(voterData.get(0)) ){
addedMessagesCounter++;
}
}
}
return addedMessagesCounter;
}
/**
* Call methodToCheck voterData as list of params
* @param methodToCheck the name of the wanted method
* @param numberOfParamsWithoutHandler the amount of params to pass to the wanted method
* @param handler object which method will be called as callback from SimpleRegistry
* @param registry the simpleRegistry object
* @param voterData List of string which is the params to pass to the wantedMethod
*/
private void CallWantedMethod(String methodToCheck, int numberOfParamsWithoutHandler,
SimpleRegistryCallBackHandlers handler, SimpleRegistry registry,
List<String> voterData) {
try {
if (numberOfParamsWithoutHandler == 1)
{
java.lang.reflect.Method method =
registry.getClass().getMethod(methodToCheck,String.class, RegistryCallBack.class);
method.invoke(registry, voterData.get(0), handler);
assertTrue(handler.ActionSucceed);
}else {
java.lang.reflect.Method method =
registry.getClass().getMethod( methodToCheck, String.class, String.class, RegistryCallBack.class);
method.invoke(registry, voterData.get(0), voterData.get(1), handler);
assertTrue(handler.ActionSucceed);
}
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
e.printStackTrace();
}
}
/**
* Creates new Registry information then sends it to the server then checks the server
* have all sent data
* @param methodToCheck the name of the method we want to call in SimpleRegistry
* @param numberOfParamsToPass the number of params to pass to the methodToCheck
* @param numberOfChecks the amount of checks to run
* @param tags list of String that represent the tags to filter on the messages
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
* @return Returns the information that was send in the created messages
* @throws InvalidProtocolBufferException
*/
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
private List<List<String>> checkMessagesPostedSuccessfully(String methodToCheck, int numberOfParamsToPass, int numberOfChecks, List<String> tags) throws InvalidProtocolBufferException {
SimpleRegistryCallBackHandlers handler = RegistryAnswersHandlerSetup();
System.out.println("Starting testing the " + methodToCheck + " capability.");
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
setActionsData(numberOfParamsToPass, numberOfChecks);
SimpleRegistry registry = new SimpleRegistry(signatory, communicator);
System.out.println("- Check that all the callbacks have been called successfully after voters adding:");
for (List<String> voterData : votersData) {
CallWantedMethod(methodToCheck, numberOfParamsToPass, handler, registry, voterData);
}
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
System.out.println("- Check that for every data added, the callback have been called:");
assertEquals(numberOfChecks, handler.counter);
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
int addedMessagesCounter = countActualAddedMessages(votersData, tags, registry);
assert addedMessagesCounter == numberOfChecks : "The number of added messages actually is " + addedMessagesCounter;
System.out.println("Ended addVoter testing.");
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
return votersData;
}
/**
* Test that add voter creates new correct bulletin board message and adds the voter
*/
public void testAddVoter() throws InvalidProtocolBufferException {
checkMessagesPostedSuccessfully("AddVoter", 2, 3,
new ArrayList<String>(){{add(RegistryTags.VOTER_ENTRY_TAG.toString());}});
}
/**
* Test that set voted posts creates correct bulletin board message and sets that the user have been voted
*/
public void testSetVoted() throws InvalidProtocolBufferException {
checkMessagesPostedSuccessfully("SetVoted", 1, 3,
new ArrayList<String>(){{add(RegistryTags.VOTE_ACTION_TAG.toString());}});
}
/**
* Test that add to group creates correct bulletin board message and adds a user to a group
*/
public void testRemoveFromGroup() throws InvalidProtocolBufferException {
checkMessagesPostedSuccessfully("RemoveFromGroup", 2, 3, null);
}
/**
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
* Test that get groups retrieves the right groups the user are in
*/
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
public void testAddToGroup() throws InvalidProtocolBufferException {
checkMessagesPostedSuccessfully("AddToGroup", 2, 4, null);
}
/**
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
* Test that remove from group creates correct bulletin board message and removes the user from a group
*/
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
public void testGetGroups() throws InvalidProtocolBufferException, InterruptedException {
System.out.println("Starting testing the GetGroups capability.");
List<List<String>> votersData = checkMessagesPostedSuccessfully("AddToGroup", 2, 3, null);
SimpleRegistry registry = new SimpleRegistry(signatory, communicator);
SimpleRegistryCallBackHandlers handler = RegistryAnswersHandlerSetup();
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
System.out.println("- Checks that every group id we added to every voter really exists:");
for (List<String> voterData : votersData){
registry.GetGroups(voterData.get(1), handler);
assert handler.ActionSucceed : " The SimpleRegistry could not complete the GetGroups action ";
assert handler.WantedInformation.contains(RegistryTags.GROUP_ID_TAG + voterData.get(1))
: " The SimpleRegistry cloud not get the right group of the user " + voterData.get(1);
}
System.out.println("Ended GetGroups testing.");
}
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
/**
* Test that the personal data outputted about the user is right
*/
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
public void testGetPersonalIDDetails() throws InvalidProtocolBufferException, InterruptedException {
System.out.println("Starting testing the GetPersonIDDetails capability:");
List<List<String>> addedVotersInformation = checkMessagesPostedSuccessfully("AddVoter", 2, 3,
new ArrayList<String>(){{add(RegistryTags.VOTER_ENTRY_TAG.toString());}});
SimpleRegistry registry = new SimpleRegistry(signatory, communicator);
SimpleRegistryCallBackHandlers handler = RegistryAnswersHandlerSetup();
Added The protobufs file and its java representation Those protobufs are representing the messages that the registry will use when communicating with the bulletin-board Summary: D:/Work/Wombat Working/voter-registry/comment-info.txt Changed the location of the protobufs file The location have been changed to create order in the packages Changed the location of the ProtobufsMessages file so that the Registry file could use it freely Changed the location of the Protobufs file and added the Registry class The protobufs files location was changed for the right location of the packages for Registry class be able to use the protobufs files Changed the location of the ProtobufsMessages file for creating more organized project Created the SimpleRegistry file SimpleRegistry expose the ability of manging voters information (their groups, and personal data) Created RegistryTagTypes file this file have the different tags for registry messages Changed the SimpleRegistry file started to implement the different methods of this class (such as created basic messages) Changed the ProtobufMessages file now using only the basic registry messages Changed the SimpleRegistry file Managed to create the signatory and add empty builder Added the AccurateTimestamp file This file converts string timestamp to timestamp and the other way , its used for the SimpleRegistry tags Moved the AccurateTimeStamp and the RegistryTagTypes to package called util This way the project files are more organized Add the MessagesUtil file This file contain helpfull methods for working with messages (such as basicMessage and BulletinBoardMessage) Created VoterRegistryMessage VoterRegistryMessage extending the abilities of the basic message also changed the name of MessagesUtils to CollectionMessagesUtils because its suits more this class destination Changed the simpleRegistry file Edited the GetPersonIDDetails method , and refactored the basic methods of upload data to BulletinBoardServer Added the SimpleRegistryTest This object tests the simple registry functionality Added the SimpleRegistryTest This object tests the simple registry functionality Changed the RegistryTagsType to RegistryTags The Name RegistryTags more indicative Added The Wombat Code And Documentation This file describes the conventions of the wombat project Changed the SimpleRegistry and VoterRegistryMessage Documentation The documentation was partial in part of the methods Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the SimpleRegistry to work with UnsignedBulletinBoardMessage The basicMessage is not needed Changed the VoterRegistryMessage to wrap UnsignedBulletinBoardMessage there is no need to wrap unused basic message when using UnsignedBulletinBoardMessage Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 Re-organized the voter-registry Since there no need for basicMessage i have removed it, and changed few methods to be in language level 7 added the RegistryInstance interface Which gives the basic registry functionality (because there going to be at least two registries) Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Changed the SimpleRegistry The new Simple Registry works according to the RegistryInstance interface Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Added testing to the SimpleRegistryTest class The Test checking that SetVoter AddVoter AddToGroup RemoveFromGroup methods working. Test Plan: The idea is to create number of BulletinBoardMessage's that and post them, then ask from the server for message with relevant filter and check that all the messages that have been posted there. Reviewers: arbel.peled Differential Revision: https://proj-cs.idc.ac.il/D1
2016-01-30 12:19:25 -05:00
System.out.println("- Check that every added voter can be retrieved by SimpleRegistry:");
for (List<String> voterInformation : addedVotersInformation) {
registry.GetPersonIDDetails(voterInformation.get(0), handler);
assert handler.ActionSucceed : " Getting personal data for voter with id : "
+ voterInformation.get(0) + " failed";
assert handler.WantedInformation.get(0).contains(voterInformation.get(0))
: " Voter with id " + voterInformation.get(0) + " have bot been added to the voter db.";
}
assert handler.counter == 3 : " The callback method have not been called 3 times";
System.out.println("Ended the GetPersonIDDetails capability");
}
}