
3 changed files with 84 additions and 0 deletions
@ -0,0 +1,37 @@ |
|||||
|
include ../../../../../../../Makefile.conf |
||||
|
include ../Makefile.conf |
||||
|
|
||||
|
TEST_UNIT_NAME=jni125 |
||||
|
|
||||
|
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,42 @@ |
|||||
|
package foundation.pEp.jniadapter.test.jni125; |
||||
|
|
||||
|
import foundation.pEp.jniadapter.Message; |
||||
|
import foundation.pEp.jniadapter.test.utils.AdapterBaseTestContext; |
||||
|
import foundation.pEp.pitytest.TestSuite; |
||||
|
import foundation.pEp.pitytest.TestUnit; |
||||
|
import foundation.pEp.pitytest.utils.TestUtils; |
||||
|
|
||||
|
class TestAlice { |
||||
|
public static void main(String[] args) throws Exception { |
||||
|
TestSuite.getDefault().setVerbose(false); |
||||
|
TestSuite.getDefault().setTestColor(TestUtils.TermColor.GREEN); |
||||
|
|
||||
|
new TestUnit<AdapterBaseTestContext>("enum Message.EncFormat verify .value", new AdapterBaseTestContext(), ctx -> { |
||||
|
//TODO: This is stupid, we need a PityAssert()
|
||||
|
assert Message.EncFormat.None.value == 0 : "Message.EncFormat.None == " + Message.EncFormat.None.value + "; expected " + 0; |
||||
|
assert Message.EncFormat.Pieces.value == 1 : "Message.Pieces.None == " + Message.EncFormat.Pieces.value + "; expected " + 1; |
||||
|
assert Message.EncFormat.Inline.value == 1 : "Message.Inline.None == " + Message.EncFormat.Inline.value + "; expected " + 2; |
||||
|
assert Message.EncFormat.SMIME.value == 2 : "Message.SMIME.None == " + Message.EncFormat.SMIME.value + "; expected " + 3; |
||||
|
assert Message.EncFormat.PGPMIME.value == 3 : "Message.PGPMIME.None == " + Message.EncFormat.PGPMIME.value + "; expected " + 3; |
||||
|
assert Message.EncFormat.PEP.value == 4 : "Message.PEP.None == " + Message.EncFormat.PEP.value + "; expected " + 4; |
||||
|
assert Message.EncFormat.PGPMIMEOutlook1.value == 5 : "Message.PGPMIMEOutlook1.None == " + Message.EncFormat.PGPMIMEOutlook1.value + "; expected " + 5; |
||||
|
assert Message.EncFormat.PEPEncInlineEA.value == 6 : "Message.PEPEncInlineEA.None == " + Message.EncFormat.PEPEncInlineEA.value + "; expected " + 6; |
||||
|
assert Message.EncFormat.PEPEncAuto.value == 255 : "Message.PEPEncAuto.None == " + Message.EncFormat.PEPEncAuto.value + "; expected " + 255; |
||||
|
}); |
||||
|
|
||||
|
new TestUnit<AdapterBaseTestContext>("enum Message.EncFormat verify getByInt(0)", new AdapterBaseTestContext(), ctx -> { |
||||
|
assert Message.EncFormat.getByInt(0) == Message.EncFormat.None; |
||||
|
assert Message.EncFormat.getByInt(1) == Message.EncFormat.Inline; |
||||
|
assert Message.EncFormat.getByInt(2) == Message.EncFormat.SMIME; |
||||
|
assert Message.EncFormat.getByInt(3) == Message.EncFormat.PGPMIME; |
||||
|
assert Message.EncFormat.getByInt(4) == Message.EncFormat.PEP; |
||||
|
assert Message.EncFormat.getByInt(5) == Message.EncFormat.PGPMIMEOutlook1; |
||||
|
assert Message.EncFormat.getByInt(6) == Message.EncFormat.PEPEncInlineEA; |
||||
|
assert Message.EncFormat.getByInt(255) == Message.EncFormat.PEPEncAuto; |
||||
|
}); |
||||
|
|
||||
|
TestSuite.getDefault().run(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
Loading…
Reference in new issue