merge in JNI-119 Release_2.1.0-RC14
authorheck <heck@pep.foundation>
Sun, 13 Sep 2020 23:14:09 +0200
changeset 954fd93edee3198
parent 951 1a58a324e354
parent 953 f8f484ddfccc
child 955 6a9e0b40b627
merge in JNI-119
     1.1 --- a/src/codegen/pEp.yml2	Sun Sep 13 22:42:08 2020 +0200
     1.2 +++ b/src/codegen/pEp.yml2	Sun Sep 13 23:14:09 2020 +0200
     1.3 @@ -246,6 +246,9 @@
     1.4                  in CipherSuite suite
     1.5              );
     1.6  
     1.7 +        method enter_device_group(
     1.8 +                in identitylist identities const
     1.9 +            );
    1.10  
    1.11          // "basic" methods are generated on the java side, but
    1.12          // on the C++ side, manually implemented in basic_api.cc
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/test/java/foundation/pEp/jniadapter/test/jni119/Makefile	Sun Sep 13 23:14:09 2020 +0200
     2.3 @@ -0,0 +1,37 @@
     2.4 +include ../../../../../../../Makefile.conf
     2.5 +include ../Makefile.conf
     2.6 +
     2.7 +TEST_UNIT_NAME=jni119
     2.8 +
     2.9 +JAVA_CLASSES = \
    2.10 + 	TestAlice.class \
    2.11 + 	../utils/AdapterBaseTestContext.class \
    2.12 + 	../utils/AdapterTestUtils.class \
    2.13 + 	../utils/TestCallbacks.class
    2.14 +
    2.15 +.PHONY: pitytest compile alice test clean
    2.16 +
    2.17 +all: alice compile
    2.18 +
    2.19 +pitytest:
    2.20 +	$(MAKE) -C $(PITYTEST_DIR)
    2.21 +
    2.22 +alice: compile clean-pep-home-alice
    2.23 +	cd $(JAVA_CWD);pwd;HOME=$(JAVA_PEP_HOME_DIR_ALICE) $(JAVA) $(JAVA_PKG_BASENAME).$(TEST_UNIT_NAME).TestAlice
    2.24 +
    2.25 +compile: $(JAVA_CLASSES) pitytest
    2.26 +
    2.27 +%.class: %.java
    2.28 +	cd $(JAVA_CWD);$(JAVAC_CMD) -cp $(CLASSPATH) $(JAVA_PKG_BASEPATH)/$(TEST_UNIT_NAME)/$<
    2.29 +
    2.30 +clean:
    2.31 +	rm -f $(JAVA_CLASSES)
    2.32 +	rm -f *.class
    2.33 +	rm -f *.log
    2.34 +	rm -Rf .gnupg
    2.35 +	rm -Rf .lldb
    2.36 +
    2.37 +clean-pep-home: clean-pep-home-alice
    2.38 +
    2.39 +clean-pep-home-alice:
    2.40 +	rm -rf $(PEP_HOME_DIR_ALICE)/.pEp
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/java/foundation/pEp/jniadapter/test/jni119/TestAlice.java	Sun Sep 13 23:14:09 2020 +0200
     3.3 @@ -0,0 +1,37 @@
     3.4 +package foundation.pEp.jniadapter.test.jni119;
     3.5 +
     3.6 +import foundation.pEp.jniadapter.Identity;
     3.7 +import foundation.pEp.jniadapter.test.utils.AdapterBaseTestContext;
     3.8 +import foundation.pEp.pitytest.TestSuite;
     3.9 +import foundation.pEp.pitytest.TestUnit;
    3.10 +import foundation.pEp.pitytest.utils.TestUtils;
    3.11 +
    3.12 +import java.util.Vector;
    3.13 +
    3.14 +
    3.15 +class TestAlice {
    3.16 +    public static void main(String[] args) throws Throwable {
    3.17 +        TestSuite.getDefault().setVerbose(true);
    3.18 +        TestSuite.getDefault().setTestColor(TestUtils.TermColor.GREEN);
    3.19 +
    3.20 +        new TestUnit<AdapterBaseTestContext>("enter_device_group() no exception with no identities", new AdapterBaseTestContext(), ctx -> {
    3.21 +            ctx.alice = ctx.engine.myself(ctx.alice);
    3.22 +            ctx.engine.enter_device_group(new Vector<Identity>());
    3.23 +        });
    3.24 +
    3.25 +        new TestUnit<AdapterBaseTestContext>("enter_device_group() no exception with 2 identities", new AdapterBaseTestContext(), ctx -> {
    3.26 +            ctx.alice = ctx.engine.myself(ctx.alice);
    3.27 +            ctx.bob = ctx.engine.myself(ctx.bob);
    3.28 +
    3.29 +            Vector<Identity> grpIdents = new Vector<Identity>();
    3.30 +            grpIdents.add(ctx.alice);
    3.31 +            grpIdents.add(ctx.bob);
    3.32 +
    3.33 +            ctx.engine.enter_device_group(grpIdents);
    3.34 +        });
    3.35 +
    3.36 +        TestSuite.getDefault().run();
    3.37 +    }
    3.38 +}
    3.39 +
    3.40 +