From 5b96104a087c252dab1efbfebd21b4a15a0789b3 Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 21 Jun 2022 15:36:43 +0200 Subject: [PATCH] Test: Add --- .../pEp/jniadapter/test/jni178/Makefile | 34 ++++++++++++++ .../pEp/jniadapter/test/jni178/TestAlice.java | 45 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 test/java/foundation/pEp/jniadapter/test/jni178/Makefile create mode 100644 test/java/foundation/pEp/jniadapter/test/jni178/TestAlice.java diff --git a/test/java/foundation/pEp/jniadapter/test/jni178/Makefile b/test/java/foundation/pEp/jniadapter/test/jni178/Makefile new file mode 100644 index 0000000..6a6e642 --- /dev/null +++ b/test/java/foundation/pEp/jniadapter/test/jni178/Makefile @@ -0,0 +1,34 @@ +include ../../../../../../../Makefile.conf +include ../Makefile.conf + +TEST_UNIT_NAME=jni178 + +JAVA_CLASSES+= \ + TestAlice.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 -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 diff --git a/test/java/foundation/pEp/jniadapter/test/jni178/TestAlice.java b/test/java/foundation/pEp/jniadapter/test/jni178/TestAlice.java new file mode 100644 index 0000000..14a977f --- /dev/null +++ b/test/java/foundation/pEp/jniadapter/test/jni178/TestAlice.java @@ -0,0 +1,45 @@ +package foundation.pEp.jniadapter.test.jni178; + +import foundation.pEp.jniadapter.Engine; +import foundation.pEp.jniadapter.Identity; +import foundation.pEp.jniadapter.test.utils.AdapterTestUtils; +import foundation.pEp.jniadapter.test.utils.CTXBase; +import foundation.pEp.pitytest.AbstractTestContext; +import foundation.pEp.pitytest.TestContextInterface; +import foundation.pEp.pitytest.TestSuite; +import foundation.pEp.pitytest.TestUnit; +import foundation.pEp.pitytest.utils.TestUtils; + +import static foundation.pEp.pitytest.TestLogger.log; + + +/* +JNI-178 - Add provision_user() from signedpkg + +Expected Behaviour +*/ + + +class CTXNull extends AbstractTestContext { + @Override + public TestContextInterface init() throws Throwable { + return this; + } +} + +class TestAlice { + public static void main(String[] args) throws Exception { + TestSuite.getDefault().setVerbose(true); + TestSuite.getDefault().setTestColor(TestUtils.TermColor.GREEN); + Engine.setDebugLogEnabled(true); + CTXNull ctxNull = new CTXNull(); + + new TestUnit("provision", ctxNull, ctx -> { + Engine.provision("update://updateserver.pEp.test"); + }); + + TestSuite.getDefault().run(); + } +} + +