
7 changed files with 58 additions and 28 deletions
@ -1,24 +0,0 @@ |
|||||
package foundation.pEp.jniadapter.test.jni92; |
|
||||
import foundation.pEp.jniadapter.test.utils.TestUtils; |
|
||||
import foundation.pEp.jniadapter.*; |
|
||||
|
|
||||
class SyncCallbacks implements Sync.MessageToSendCallback, Sync.NotifyHandshakeCallback { |
|
||||
public void messageToSend(Message message) |
|
||||
{ |
|
||||
TestUtils.logH2("Message to send called"); |
|
||||
TestUtils.log("From: " + message.getFrom()); |
|
||||
TestUtils.log("To: " + message.getTo()); |
|
||||
TestUtils.log("Subject: " + message.getShortmsg()); |
|
||||
TestUtils.log("Attachement[0]: " + message.getAttachments().get(0).toString()); |
|
||||
TestUtils.logSectEnd(""); |
|
||||
} |
|
||||
|
|
||||
public void notifyHandshake(Identity myself, Identity partner, SyncHandshakeSignal signal) |
|
||||
{ |
|
||||
TestUtils.logH2("Notify handshake called"); |
|
||||
TestUtils.log("Myself: " + myself); |
|
||||
TestUtils.log("Partner: " + partner); |
|
||||
TestUtils.log("Signal: " + signal); |
|
||||
TestUtils.logSectEnd(""); |
|
||||
} |
|
||||
} |
|
@ -1,7 +1,7 @@ |
|||||
include ../../../../../../../Makefile.conf |
include ../../../../../../../Makefile.conf |
||||
include ../Makefile.conf |
include ../Makefile.conf |
||||
|
|
||||
TEST_UNIT_NAME=template |
TEST_UNIT_NAME=templateAlice |
||||
|
|
||||
JAVA_CLASSES = \
|
JAVA_CLASSES = \
|
||||
TestMain.class |
TestMain.class |
@ -1,5 +1,5 @@ |
|||||
package foundation.pEp.jniadapter.test.template; |
package foundation.pEp.jniadapter.test.templateAlice; |
||||
import foundation.pEp.jniadapter.test.framework.*; |
import foundation.pEp.jniadapter.test.framework.*; |
||||
import foundation.pEp.jniadapter.test.utils.AdapterBaseTestContext; |
import foundation.pEp.jniadapter.test.utils.AdapterBaseTestContext; |
||||
|
|
||||
|
|
@ -0,0 +1,33 @@ |
|||||
|
include ../../../../../../../Makefile.conf |
||||
|
include ../Makefile.conf |
||||
|
|
||||
|
TEST_UNIT_NAME=templateAlice |
||||
|
|
||||
|
JAVA_CLASSES = \
|
||||
|
TestMain.class |
||||
|
|
||||
|
JAVA_CLASSES += $(JAVA_CLASSES_FRAMEWORK) |
||||
|
|
||||
|
.PHONY: compile run test clean |
||||
|
|
||||
|
all: compile |
||||
|
$(MAKE) run |
||||
|
|
||||
|
run: compile clean-pep-home |
||||
|
cd $(JAVA_CWD);pwd;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,0 +1,21 @@ |
|||||
|
package foundation.pEp.jniadapter.test.templateAliceBob; |
||||
|
import foundation.pEp.jniadapter.test.framework.*; |
||||
|
import foundation.pEp.jniadapter.test.utils.AdapterBaseTestContext; |
||||
|
|
||||
|
|
||||
|
class TestMain { |
||||
|
public static void main(String[] args) throws Exception { |
||||
|
new TestUnit<AdapterBaseTestContext>("Test Template",new AdapterBaseTestContext() , ctx -> { |
||||
|
// do stuff using the context
|
||||
|
// Test FAILS on unhandled exception, otherwise SUCCESS
|
||||
|
|
||||
|
ctx.alice = ctx.engine.myself(ctx.alice); |
||||
|
|
||||
|
if(ctx.alice.fpr == null) { |
||||
|
throw new RuntimeException(); |
||||
|
} |
||||
|
}).run(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
Loading…
Reference in new issue