Browse Source

Remove testcase for rejected issue

JNI-104
heck 2 years ago
parent
commit
07a78b4009
6 changed files with 1 additions and 155 deletions
  1. +1
    -0
      .hgignore
  2. +0
    -3
      test/java/foundation/pEp/jniadapter/test/Makefile
  3. +0
    -33
      test/java/foundation/pEp/jniadapter/test/jni85/Makefile
  4. +0
    -58
      test/java/foundation/pEp/jniadapter/test/jni85/Step1.java
  5. +0
    -36
      test/java/foundation/pEp/jniadapter/test/jni85/Step2.java
  6. +0
    -25
      test/java/foundation/pEp/jniadapter/test/jni85/SyncCallbacks.java

+ 1
- 0
.hgignore View File

@ -13,6 +13,7 @@ syntax: glob
*~
.DS_Store
*.db
*.log
# ignore generated files


+ 0
- 3
test/java/foundation/pEp/jniadapter/test/Makefile View File

@ -6,7 +6,6 @@ run: compile
$(MAKE) -C template run
$(MAKE) -C basic run
$(MAKE) -C regression run
#BROKEN $(MAKE) -C jni85 run
$(MAKE) -C jni88 run
$(MAKE) -C jni91 run
$(MAKE) -C jni92 run
@ -16,7 +15,6 @@ compile:
$(MAKE) -C template compile
$(MAKE) -C basic compile
$(MAKE) -C regression compile
#BROKEN $(MAKE) -C jni85 compile
$(MAKE) -C jni88 compile
$(MAKE) -C jni91 compile
$(MAKE) -C jni92 compile
@ -26,7 +24,6 @@ clean:
$(MAKE) -C template clean
$(MAKE) -C basic clean
$(MAKE) -C regression clean
$(MAKE) -C jni85 clean
$(MAKE) -C jni88 clean
$(MAKE) -C jni91 clean
$(MAKE) -C jni92 clean


+ 0
- 33
test/java/foundation/pEp/jniadapter/test/jni85/Makefile View File

@ -1,33 +0,0 @@
include ../../../../../../../Makefile.conf
include ../Makefile.conf
TEST_UNIT_NAME=jni85
JAVA_CLASSES = \
Step1.class \
Step2.class \
../utils/TestUtils.class
.PHONY: compile run test clean
all: compile
$(MAKE) run
run: compile clean-pep-home
cd $(JAVA_CWD);HOME=$(JAVA_PEP_HOME_DIR) $(JAVA) $(JAVA_PKG_BASENAME).$(TEST_UNIT_NAME).TestMain
compile: $(JAVA_CLASSES)
%.class: %.java
cd $(JAVA_CWD);javac -cp $(CLASSPATH) $(JAVA_PKG_BASEPATH)/$(TEST_UNIT_NAME)/$<
clean:
rm -f $(JAVA_CLASSES)
rm -f *.class
rm -f *.log
rm -Rf .gnupg
rm -Rf .lldb
clean-pep-home:
rm -rf $(PEP_HOME_DIR)/*
rm -rf $(PEP_HOME_DIR)/.pEp

+ 0
- 58
test/java/foundation/pEp/jniadapter/test/jni85/Step1.java View File

@ -1,58 +0,0 @@
package foundation.pEp.jniadapter.test.jni85;
import foundation.pEp.jniadapter.*;
import java.util.Vector;
import java.net.URL;
import java.net.URLClassLoader;
import java.lang.Thread;
import java.lang.InterruptedException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
class Step1 {
public static void main(String[] args) {
new Thread(() -> {
Engine e = null;
// load
try {
e = new Engine();
SyncCallbacks callbacks = new SyncCallbacks();
//e.setNotifyHandshakeCallback(callbacks);
e.setMessageToSendCallback(callbacks);
}
catch (pEpException ex) {
System.out.println("Cannot load");
System.exit(-1);
}
System.out.println("Test loaded");
// Keygen
Engine en = new Engine();
System.out.println("Generating keys: ");
Identity user2 = new Identity();
user2.user_id = "pEp_own_userId";
user2.me = true;
user2.username = "Test User 2";
user2.address = "jniTestUser2@peptest.ch";
user2 = en.myself(user2);
System.out.print("Keys generated: ");
System.out.println(user2.fpr);
// it's not necessary - you can just shutdown Sync and that's it
// but for this test give sync a chance to process all messages
try {
Thread.sleep(200);
System.out.println("End wait");
}
catch (InterruptedException ex) { }
}).start();
throw new RuntimeException();
}
}

+ 0
- 36
test/java/foundation/pEp/jniadapter/test/jni85/Step2.java View File

@ -1,36 +0,0 @@
package foundation.pEp.jniadapter.test.jni85;
import foundation.pEp.jniadapter.*;
import java.lang.Thread;
import java.lang.InterruptedException;
class Step2 {
public static void main(String[] args) {
Engine e = null;
// load
try {
e = new Engine();
SyncCallbacks callbacks = new SyncCallbacks();
//e.setNotifyHandshakeCallback(callbacks);
e.setMessageToSendCallback(callbacks);
}
catch (pEpException ex) {
System.out.println("Cannot load");
System.exit(-1);
}
System.out.println("Test loaded");
e.startSync();
//It should crash here.
try {
Thread.sleep(200);
}
catch (InterruptedException ex) { }
System.exit(0);
}
}

+ 0
- 25
test/java/foundation/pEp/jniadapter/test/jni85/SyncCallbacks.java View File

@ -1,25 +0,0 @@
package foundation.pEp.jniadapter.test.jni85;
import foundation.pEp.jniadapter.*;
public class SyncCallbacks implements Sync.MessageToSendCallback, Sync.NotifyHandshakeCallback {
public void messageToSend(Message message)
{
System.out.println("================================");
System.out.println("Message to send called");
System.out.println("From: " + message.getFrom());
System.out.println("To: " + message.getTo());
System.out.println("Subject: " + message.getShortmsg());
System.out.println("================================");
}
public void notifyHandshake(Identity myself, Identity partner, SyncHandshakeSignal signal)
{
System.out.println("================================");
System.out.println("Notify handshake called");
System.out.println("Myself: " + myself);
System.out.println("Partner: " + partner);
System.out.println("Signal: " + signal);
System.out.println("================================");
}
}

Loading…
Cancel
Save