Browse Source

Move new class Pair<> into new pkg framework.utils

JNI-96
heck 5 years ago
parent
commit
46635a46f9
  1. 15
      test/java/foundation/pEp/jniadapter/test/Makefile.conf
  2. 4
      test/java/foundation/pEp/jniadapter/test/framework/TestLogger.java
  3. 4
      test/java/foundation/pEp/jniadapter/test/framework/TestSuite.java
  4. 6
      test/java/foundation/pEp/jniadapter/test/framework/TestUnit.java
  5. 4
      test/java/foundation/pEp/jniadapter/test/framework/examples/Makefile.conf
  6. 1
      test/java/foundation/pEp/jniadapter/test/framework/examples/ctxmembers/TestMain.java
  7. 28
      test/java/foundation/pEp/jniadapter/test/framework/utils/Pair.java
  8. 4
      test/java/foundation/pEp/jniadapter/test/framework/utils/TestUtils.java
  9. 1
      test/java/foundation/pEp/jniadapter/test/templateAlice/TestAlice.java
  10. 1
      test/java/foundation/pEp/jniadapter/test/templateAliceBob/TestAlice.java
  11. 1
      test/java/foundation/pEp/jniadapter/test/templateAliceBob/TestBob.java
  12. 1
      test/java/foundation/pEp/jniadapter/test/templateAliceBobCarol/TestAlice.java
  13. 1
      test/java/foundation/pEp/jniadapter/test/templateAliceBobCarol/TestBob.java
  14. 1
      test/java/foundation/pEp/jniadapter/test/templateAliceBobCarol/TestCarol.java
  15. 2
      test/java/foundation/pEp/jniadapter/test/utils/AdapterTestUtils.java
  16. 5
      test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/FsMQManager.java
  17. 3
      test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/Makefile.conf
  18. 1
      test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/stateless_ping/TestAlice.java
  19. 1
      test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/stateless_ping/TestBob.java
  20. 30
      test/java/foundation/pEp/jniadapter/test/utils/transport/fsmsgqueue/FsMsgQueue.java
  21. 2
      test/java/foundation/pEp/jniadapter/test/utils/transport/fsmsgqueue/test/regression/TestMain.java

15
test/java/foundation/pEp/jniadapter/test/Makefile.conf

@ -19,11 +19,16 @@ CLASSPATH=.:$(REPOROOT)/src
JAVA=java -Xcheck:jni -cp $(CLASSPATH) -Djava.library.path=$(CLASSPATH)
JAVA_CLASSES_FRAMEWORK= \
../framework/TestUnit.class \
../framework/TestContextInterface.class \
../framework/AbstractTestContext.class \
../framework/TestLogger.class \
../framework/TestUtils.class
../framework/TestSuite.class \
../framework/TestUnit.class \
../framework/TestContextInterface.class \
../framework/AbstractTestContext.class \
../framework/TestLogger.class \
../framework/utils/TestUtils.class \
../framework/utils/Pair.class \
../framework/TestState.class \
../framework/TestResult.class
ifdef ENGINE_LIB_PATH

4
test/java/foundation/pEp/jniadapter/test/framework/TestLogger.java

@ -1,9 +1,11 @@
package foundation.pEp.jniadapter.test.framework;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import static foundation.pEp.jniadapter.test.framework.TestUtils.*;
import static foundation.pEp.jniadapter.test.framework.utils.TestUtils.*;
public class TestLogger {
static {

4
test/java/foundation/pEp/jniadapter/test/framework/TestSuite.java

@ -1,8 +1,8 @@
package foundation.pEp.jniadapter.test.framework;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import static foundation.pEp.jniadapter.test.framework.TestUtils.TermColor;
import static foundation.pEp.jniadapter.test.framework.TestUtils.*;
import static foundation.pEp.jniadapter.test.framework.utils.TestUtils.TermColor;
import static foundation.pEp.jniadapter.test.framework.utils.TestUtils.*;
import java.util.ArrayList;

6
test/java/foundation/pEp/jniadapter/test/framework/TestUnit.java

@ -1,8 +1,10 @@
package foundation.pEp.jniadapter.test.framework;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import static foundation.pEp.jniadapter.test.framework.TestUtils.TermColor;
import static foundation.pEp.jniadapter.test.framework.TestUtils.colorString;
import static foundation.pEp.jniadapter.test.framework.utils.TestUtils.TermColor;
import static foundation.pEp.jniadapter.test.framework.utils.TestUtils.colorString;
import java.util.function.Consumer;

4
test/java/foundation/pEp/jniadapter/test/framework/examples/Makefile.conf

@ -9,6 +9,8 @@ JAVA_CLASSES_FRAMEWORK= \
../../TestContextInterface.class \
../../AbstractTestContext.class \
../../TestLogger.class \
../../TestUtils.class \
../../utils/TestUtils.class \
../../utils/Pair.class \
../../TestState.class \
../../TestResult.class

1
test/java/foundation/pEp/jniadapter/test/framework/examples/ctxmembers/TestMain.java

@ -1,6 +1,7 @@
package foundation.pEp.jniadapter.test.framework.examples.ctxmembers;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
// Context member object instantiation

28
test/java/foundation/pEp/jniadapter/test/framework/utils/Pair.java

@ -0,0 +1,28 @@
package foundation.pEp.jniadapter.test.framework.utils;
public class Pair<K, V> {
private K key = null;
private V value = null;
public K getKey() {
return key;
}
public void setKey(K key) {
this.key = key;
}
public V getValue() {
return value;
}
public void setValue(V value) {
this.value = value;
}
public Pair(K f, V s) {
key = f;
value = s;
}
}

4
test/java/foundation/pEp/jniadapter/test/framework/TestUtils.java → test/java/foundation/pEp/jniadapter/test/framework/utils/TestUtils.java

@ -1,4 +1,4 @@
package foundation.pEp.jniadapter.test.framework;
package foundation.pEp.jniadapter.test.framework.utils;
import java.io.File;
import java.io.IOException;
@ -17,6 +17,8 @@ import java.util.stream.Collectors;
//import static foundation.pEp.jniadapter.test.framework.TestLogger.log;
public class TestUtils {
// Pure static class
private TestUtils() { }
/*
System

1
test/java/foundation/pEp/jniadapter/test/templateAlice/TestAlice.java

@ -1,6 +1,7 @@
package foundation.pEp.jniadapter.test.templateAlice;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.*;
class TestAlice {

1
test/java/foundation/pEp/jniadapter/test/templateAliceBob/TestAlice.java

@ -3,6 +3,7 @@ package foundation.pEp.jniadapter.test.templateAliceBob;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.*;
class TestAlice {

1
test/java/foundation/pEp/jniadapter/test/templateAliceBob/TestBob.java

@ -3,6 +3,7 @@ package foundation.pEp.jniadapter.test.templateAliceBob;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.*;
class TestBob {

1
test/java/foundation/pEp/jniadapter/test/templateAliceBobCarol/TestAlice.java

@ -1,6 +1,7 @@
package foundation.pEp.jniadapter.test.templateAliceBobCarol;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.*;
class TestAlice {

1
test/java/foundation/pEp/jniadapter/test/templateAliceBobCarol/TestBob.java

@ -1,6 +1,7 @@
package foundation.pEp.jniadapter.test.templateAliceBobCarol;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.*;
class TestBob {

1
test/java/foundation/pEp/jniadapter/test/templateAliceBobCarol/TestCarol.java

@ -1,6 +1,7 @@
package foundation.pEp.jniadapter.test.templateAliceBobCarol;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.*;
class TestCarol {

2
test/java/foundation/pEp/jniadapter/test/utils/AdapterTestUtils.java

@ -4,7 +4,7 @@ import foundation.pEp.jniadapter.*;
import java.util.ArrayList;
import java.util.Vector;
import static foundation.pEp.jniadapter.test.framework.TestUtils.clipString;
import static foundation.pEp.jniadapter.test.framework.utils.TestUtils.clipString;
public class AdapterTestUtils {
public static String identityToString(Identity i, Boolean full) {

5
test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/FsMQManager.java

@ -1,11 +1,10 @@
package foundation.pEp.jniadapter.test.utils.transport.fsmqmanager;
import foundation.pEp.jniadapter.test.framework.TestUtils;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.transport.fsmsgqueue.FsMsgQueue;
import java.io.*;
import java.util.*;
import java.util.concurrent.TimeoutException;
import static foundation.pEp.jniadapter.test.framework.TestLogger.log;
@ -41,7 +40,7 @@ public class FsMQManager {
}
// Blocking read
// Returns null if no messages available
// Returns null if no messages available within timeout
public FsMQMessage receiveMessage(int timeoutSec) throws IOException, ClassNotFoundException {
FsMQMessage ret = null;
FsMsgQueue onwQueue = identities.getQueueForIdentity(identities.self.getAddress());

3
test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/Makefile.conf

@ -17,7 +17,8 @@ JAVA_CLASSES_FRAMEWORK= \
../../../../../framework/TestContextInterface.class \
../../../../../framework/AbstractTestContext.class \
../../../../../framework/TestLogger.class \
../../../../../framework/TestUtils.class \
../../../../../framework/utils/TestUtils.class \
../../../../../framework/utils/Pair.class \
../../../../../framework/TestState.class \
../../../../../framework/TestResult.class

1
test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/stateless_ping/TestAlice.java

@ -2,6 +2,7 @@ package foundation.pEp.jniadapter.test.utils.transport.fsmqmanager.test.stateles
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.transport.fsmqmanager.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.utils.transport.fsmqmanager.test.ctx.*;

1
test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/stateless_ping/TestBob.java

@ -2,6 +2,7 @@ package foundation.pEp.jniadapter.test.utils.transport.fsmqmanager.test.stateles
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import foundation.pEp.jniadapter.test.framework.utils.TestUtils;
import foundation.pEp.jniadapter.test.utils.transport.fsmqmanager.*;
import foundation.pEp.jniadapter.test.framework.*;
import foundation.pEp.jniadapter.test.utils.transport.fsmqmanager.test.ctx.*;

30
test/java/foundation/pEp/jniadapter/test/utils/transport/fsmsgqueue/FsMsgQueue.java

@ -1,7 +1,9 @@
package foundation.pEp.jniadapter.test.utils.transport.fsmsgqueue;
import foundation.pEp.jniadapter.test.framework.utils.Pair;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import static foundation.pEp.jniadapter.test.framework.TestUtils.*;
import static foundation.pEp.jniadapter.test.framework.utils.TestUtils.*;
import java.io.File;
import java.io.IOException;
@ -273,29 +275,3 @@ public class FsMsgQueue implements Queue<String> {
}
class Pair<K, V> {
private K key = null;
private V value = null;
public K getKey() {
return key;
}
public void setKey(K key) {
this.key = key;
}
public V getValue() {
return value;
}
public void setValue(V value) {
this.value = value;
}
public Pair(K f, V s) {
key = f;
value = s;
}
}

2
test/java/foundation/pEp/jniadapter/test/utils/transport/fsmsgqueue/test/regression/TestMain.java

@ -1,7 +1,7 @@
package foundation.pEp.jniadapter.test.utils.transport.fsmsgqueue.test.regression;
import static foundation.pEp.jniadapter.test.framework.TestLogger.*;
import static foundation.pEp.jniadapter.test.framework.TestUtils.*;
import static foundation.pEp.jniadapter.test.framework.utils.TestUtils.*;
import foundation.pEp.jniadapter.test.utils.transport.fsmsgqueue.*;

Loading…
Cancel
Save