From 14b9b3f1a6046093b61f57c609890690289e6468 Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 10 Mar 2021 21:10:40 +0100 Subject: [PATCH] Test: AdapterTestUtils add makeNewTestBlobList() with dataSize of attachments --- .../jniadapter/test/utils/AdapterTestUtils.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/java/foundation/pEp/jniadapter/test/utils/AdapterTestUtils.java b/test/java/foundation/pEp/jniadapter/test/utils/AdapterTestUtils.java index f2ffdb4..8e3aa96 100644 --- a/test/java/foundation/pEp/jniadapter/test/utils/AdapterTestUtils.java +++ b/test/java/foundation/pEp/jniadapter/test/utils/AdapterTestUtils.java @@ -277,16 +277,27 @@ public class AdapterTestUtils { } // Factory methods to create test objects - public static Vector makeNewTestBlobList(int len) { + public static Vector makeNewTestBlobList(int count) { Vector 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 makeNewTestBlobList(int sizeBytes, String filename, String mime_type, int count) { + Vector 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();