diff --git a/settings.gradle b/settings.gradle index 851bfc3..47d6539 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,6 @@ include 'meerkat-common' include 'voting-booth' +include 'voter-registry' include 'bulletin-board-server' include 'polling-station' include 'restful-api-common' diff --git a/voter-registry/src/main/java/meerkat/AsyncRegistry.java b/voter-registry/src/main/java/meerkat/AsyncRegistry.java index ed77573..6792539 100644 --- a/voter-registry/src/main/java/meerkat/AsyncRegistry.java +++ b/voter-registry/src/main/java/meerkat/AsyncRegistry.java @@ -13,6 +13,8 @@ import meerkat.registry.AsyncRegistryCallbacks.HasVotedCallback; import meerkat.registry.MessageCollectionUtils; import meerkat.registry.RegistryTags; import meerkat.util.BulletinBoardUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.security.SignatureException; @@ -30,17 +32,21 @@ import static meerkat.util.BulletinBoardUtils.signBulletinBoardMessage; */ public class AsyncRegistry implements VoterRegistry{ + final Logger logger = LoggerFactory.getLogger(getClass()); + protected DigitalSignature signer; protected SubscriptionAsyncBulletinBoardClient cachedBulletinBoardClient; @Override public void init(DigitalSignature signer, SubscriptionAsyncBulletinBoardClient communicator) { + logger.debug("Initialized the AsyncRegistry"); this.signer = signer; this.cachedBulletinBoardClient = communicator; } @Override public void addVoter(VoterInfo voterInfo, FutureCallback callback) throws SignatureException { + logger.info("Adding voter : {0}", RegistryTags.ID_TAG); UnsignedBulletinBoardMessage basicMessage = UnsignedBulletinBoardMessage.newBuilder() .addTag(RegistryTags.ID_TAG + voterInfo.getId().getId()) diff --git a/voter-registry/src/test/java/SimpleRegistryTest.java b/voter-registry/src/test/java/SimpleRegistryTest.java index 02a2a58..dd73836 100644 --- a/voter-registry/src/test/java/SimpleRegistryTest.java +++ b/voter-registry/src/test/java/SimpleRegistryTest.java @@ -2,7 +2,7 @@ import com.google.common.util.concurrent.FutureCallback; import meerkat.AsyncRegistry; import meerkat.bulletinboard.BulletinBoardServer; import meerkat.bulletinboard.LocalBulletinBoardClient; -import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer; +import meerkat.bulletinboard.sqlserver.*; import meerkat.comm.CommunicationException; import meerkat.crypto.DigitalSignature; @@ -57,10 +57,8 @@ public class SimpleRegistryTest { public static String CERT1_PEM_EXAMPLE = "/certs/enduser-certs/user1.crt"; public static String KEYFILE_PASSWORD = "secret"; private static final String DB_NAME = "TestDB"; - private static final String LOCALHOST = "127.0.0.1:8000"; private static final int SUBSCRIPTION_DELAY = 3000; private static final int THREAD_NUM = 3; - private static final int FAIL_DELAY = 6000; class DummyRegistryCallBackHandler implements FutureCallback{ public int counter;