forked from pEp.foundation/pEpJNIAdapter
Add test for JNI-117 - "Export Key"
parent
45ec5a9701
commit
40e8a28ea9
@ -0,0 +1,37 @@
|
||||
include ../../../../../../../Makefile.conf
|
||||
include ../Makefile.conf
|
||||
|
||||
TEST_UNIT_NAME=jni117
|
||||
|
||||
JAVA_CLASSES = \
|
||||
TestAlice.class \
|
||||
../utils/AdapterBaseTestContext.class \
|
||||
../utils/AdapterTestUtils.class \
|
||||
../utils/TestCallbacks.class
|
||||
|
||||
.PHONY: pitytest compile alice test clean
|
||||
|
||||
all: alice compile
|
||||
|
||||
pitytest:
|
||||
$(MAKE) -C $(PITYTEST_DIR)
|
||||
|
||||
alice: compile clean-pep-home-alice
|
||||
cd $(JAVA_CWD);pwd;HOME=$(JAVA_PEP_HOME_DIR_ALICE) $(JAVA) $(JAVA_PKG_BASENAME).$(TEST_UNIT_NAME).TestAlice
|
||||
|
||||
compile: $(JAVA_CLASSES) pitytest
|
||||
|
||||
%.class: %.java
|
||||
cd $(JAVA_CWD);$(JAVAC_CMD) -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: clean-pep-home-alice
|
||||
|
||||
clean-pep-home-alice:
|
||||
rm -rf $(PEP_HOME_DIR_ALICE)/.pEp
|
@ -0,0 +1,23 @@
|
||||
package foundation.pEp.jniadapter.test.jni117;
|
||||
import foundation.pEp.jniadapter.test.utils.AdapterBaseTestContext;
|
||||
import foundation.pEp.pitytest.TestSuite;
|
||||
import foundation.pEp.pitytest.TestUnit;
|
||||
import foundation.pEp.pitytest.utils.TestUtils;
|
||||
|
||||
import static foundation.pEp.pitytest.TestLogger.log;
|
||||
|
||||
class TestAlice {
|
||||
public static void main(String[] args) throws Exception {
|
||||
TestSuite.getDefault().setVerbose(true);
|
||||
TestSuite.getDefault().setTestColor(TestUtils.TermColor.GREEN);
|
||||
|
||||
new TestUnit<AdapterBaseTestContext>("Test Alice",new AdapterBaseTestContext() , ctx -> {
|
||||
ctx.alice = ctx.engine.myself(ctx.alice);
|
||||
log(new String(ctx.engine.export_key(ctx.alice.fpr)));
|
||||
});
|
||||
|
||||
TestSuite.getDefault().run();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue