Revert "Upgrade jndn to version 0.9 and jndn-mock to 1.0.1-SNAPSHOT"
This reverts commit c898bca4a2e38831e33379adab7c92456ef15675.
Change-Id: I9e123beb1eb9ebf80fecbc6a99fe73fce699b18e
diff --git a/src/test/java/com/intel/jndn/utils/TestHelper.java b/src/test/java/com/intel/jndn/utils/TestHelper.java
index 7b79bf4..fbf931e 100644
--- a/src/test/java/com/intel/jndn/utils/TestHelper.java
+++ b/src/test/java/com/intel/jndn/utils/TestHelper.java
@@ -13,6 +13,7 @@
*/
package com.intel.jndn.utils;
+import com.intel.jndn.mock.MockKeyChain;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -23,12 +24,8 @@
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
-
-import com.intel.jndn.mock.MockFace;
-import com.intel.jndn.mock.MockKeyChain;
import net.named_data.jndn.Data;
import net.named_data.jndn.Face;
-import net.named_data.jndn.Interest;
import net.named_data.jndn.Name;
import net.named_data.jndn.encoding.EncodingException;
import net.named_data.jndn.security.KeyChain;
@@ -43,42 +40,6 @@
*/
public class TestHelper {
- public interface Tester {
- boolean test();
- }
-
- public static void run(Face face, int limit, Tester t) throws IOException, EncodingException, InterruptedException {
- while (t.test() && limit > 0) {
- face.processEvents();
- Thread.sleep(500);
- limit--;
- }
- }
-
- public static void run(Face face, int limit) throws IOException, EncodingException, InterruptedException {
- run(face, limit, new Tester() {
- @Override
- public boolean test() {
- return true;
- }
- });
- }
-
- public static void addDataPublisher(final MockFace face, final int finalBlockId) {
- face.onSendInterest.add(new MockFace.SignalOnSendInterest() {
- @Override
- public void emit(Interest interest) throws EncodingException, SecurityException {
- if (finalBlockId < 0) {
- face.receive(TestHelper.buildData(interest.getName(), "..."));
- }
- else {
- face.receive(TestHelper.buildData(interest.getName(), "...", finalBlockId));
- }
- }
- });
- }
-
-
public static Data retrieve(CompletableFuture<Data> future) {
try {
return future.get(4000, TimeUnit.MILLISECONDS);
@@ -165,4 +126,8 @@
}
}
}
+
+ public static class TestCounter{
+ public int count = 0;
+ }
}