Browse Source

Test: AdapterTestUtils add makeNewTestBlobList() with dataSize of attachments

JNI-147
heck 1 year ago
parent
commit
14b9b3f1a6
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      test/java/foundation/pEp/jniadapter/test/utils/AdapterTestUtils.java

+ 13
- 2
test/java/foundation/pEp/jniadapter/test/utils/AdapterTestUtils.java View File

@ -277,16 +277,27 @@ public class AdapterTestUtils {
}
// Factory methods to create test objects
public static Vector<Blob> makeNewTestBlobList(int len) {
public static Vector<Blob> makeNewTestBlobList(int count) {
Vector<Blob> blbList = new Vector<>();
for (int i = 0; i < len; i++) {
for (int i = 0; i < count; i++) {
Blob blb = makeNewTestBlob("Attachement nr: " + i + " [TEST DATA]", "testfilename"+i+".txt", "text/plain" );
blbList.add(blb);
}
return blbList;
}
// Factory methods to create test objects
public static Vector<Blob> makeNewTestBlobList(int sizeBytes, String filename, String mime_type, int count) {
Vector<Blob> blbList = new Vector<>();
for (int i = 0; i < count; i++) {
Blob blb = makeNewTestBlob(sizeBytes, filename + Integer.toString(i), mime_type);
blbList.add(blb);
}
return blbList;
}
public static Blob makeNewTestBlob(String data, String filename, String mime_type) {
Blob blb = new Blob();
blb.data = data.getBytes();


Loading…
Cancel
Save