Browse Source

Updated test app

JNI-44
Edouard Tisserant 6 years ago
parent
commit
b514e4e7e0
5 changed files with 102 additions and 4 deletions
  1. +6
    -0
      .hgignore
  2. +0
    -0
      androidTests/app/assets/0x6FF00E97.asc
  3. +0
    -0
      androidTests/app/assets/0x70DCF575.asc
  4. +0
    -0
      androidTests/app/assets/0xC9C2EE39.asc
  5. +96
    -4
      androidTests/app/src/main/java/com/pep/k9/MainActivity.java

+ 6
- 0
.hgignore View File

@ -41,6 +41,12 @@ android/pEpJNIAdapter.iml
androidTests/.gradle
androidTests/local.properties
androidTests/gradle.properties
androidTests/app/build
androidTests/build
androidTests/.idea
androidTests/androidTests.iml
androidTests/app/app.iml
syntax: regexp
android/external/[^.]*


androidTests/app/assets/6FF00E97_pub.asc → androidTests/app/assets/0x6FF00E97.asc View File


androidTests/app/assets/70DCF575_pub.asc → androidTests/app/assets/0x70DCF575.asc View File


androidTests/app/assets/C9C2EE39_pub.asc → androidTests/app/assets/0xC9C2EE39.asc View File


+ 96
- 4
androidTests/app/src/main/java/com/pep/k9/MainActivity.java View File

@ -46,7 +46,8 @@ public class MainActivity extends AppCompatActivity {
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
try {
testPEp();
testPEpAliceBobJohn();
//testPEpTypes();
}
catch (Exception ex) {
Log.e("PEPTEST", "##################### TEST Exception ####################",ex);
@ -72,8 +73,99 @@ public class MainActivity extends AppCompatActivity {
return new String(buffer);
}
public void testPEpTypes() throws pEpException, IOException {
public void testPEp() throws pEpException, IOException {
Engine e;
Log.d("PEPTEST", "Test loaded");
e = new Engine();
Message msg = new Message();
// Call getter before call to getter
assert msg.getDir()==null;
assert msg.getId()==null;
assert msg.getLongmsg()==null;
assert msg.getLongmsg()==null;
assert msg.getLongmsgFormatted()==null;
assert msg.getAttachments()==null;
assert msg.getSent()==null;
assert msg.getRecv()==null;
assert msg.getFrom()==null;
assert msg.getTo()==null;
assert msg.getRecvBy()==null;
assert msg.getCc()==null;
assert msg.getBcc()==null;
assert msg.getInReplyTo()==null;
assert msg.getReferences()==null;
assert msg.getKeywords()==null;
assert msg.getComments()==null;
assert msg.getOptFields()==null;
assert msg.getEncFormat()==null;
// Call setter with null call to getter
msg.setDir(null);
assert msg.getDir()==null;
msg.setId(null);
assert msg.getId()==null;
msg.setShortmsg(null);
assert msg.getLongmsg()==null;
msg.setLongmsg(null);
assert msg.getLongmsg()==null;
msg.setLongmsgFormatted(null);
assert msg.getLongmsgFormatted()==null;
msg.setAttachments(null);
assert msg.getAttachments()==null;
msg.setSent(null);
assert msg.getSent()==null;
msg.setRecv(null);
assert msg.getRecv()==null;
msg.setFrom(null);
assert msg.getFrom()==null;
msg.setTo(null);
assert msg.getTo()==null;
msg.setRecvBy(null);
assert msg.getRecvBy()==null;
msg.setCc(null);
assert msg.getCc()==null;
msg.setBcc(null);
assert msg.getBcc()==null;
msg.setInReplyTo(null);
assert msg.getInReplyTo()==null;
msg.setReferences(null);
assert msg.getReferences()==null;
msg.setKeywords(null);
assert msg.getKeywords()==null;
msg.setComments(null);
assert msg.getComments()==null;
msg.setOptFields(null);
assert msg.getOptFields()==null;
msg.setEncFormat(null);
assert msg.getEncFormat()==null;
Log.d("PEPTEST", "Test finished");
}
public void testPEpAliceBobJohn() throws pEpException, IOException {
Engine e;
// load
@ -107,7 +199,7 @@ public class MainActivity extends AppCompatActivity {
// pEp Test Bob (test key, don't use) <pep.test.bob@pep-project.org> 
// C9C2EE39
// 59BFF488C9C2EE39
e.importKey(LoadAssetAsString("C9C2EE39_pub.asc"));
e.importKey(LoadAssetAsString("0xC9C2EE39.asc"));
Identity bob = new Identity();
bob.username = "bob Test";
@ -120,7 +212,7 @@ public class MainActivity extends AppCompatActivity {
// pEp Test John (test key, don't use) <pep.test.john@pep-project.org>
// 70DCF575
// 135CD6D170DCF575
e.importKey(LoadAssetAsString("70DCF575_pub.asc"));
e.importKey(LoadAssetAsString("0x70DCF575.asc"));
Identity john = new Identity();
john.username = "john Test";


Loading…
Cancel
Save