From b5985fb5667b3ee9b6a4a0675fb57f55e7a288b7 Mon Sep 17 00:00:00 2001 From: sg481n Date: Sun, 1 Oct 2017 21:06:52 +0000 Subject: Improve code coverage for aaf cadi modules Updated few testcases. Issue-ID: AAF-79 Change-Id: If0760b6f3e74d52fa5132224bf1e6f5e3099f0e4 Signed-off-by: sg481n --- .../java/org/onap/aaf/cadi/test/JU_Base64.java | 212 +++++++++++++++++++++ 1 file changed, 212 insertions(+) (limited to 'core/src/test/java/org/onap/aaf/cadi/test/JU_Base64.java') diff --git a/core/src/test/java/org/onap/aaf/cadi/test/JU_Base64.java b/core/src/test/java/org/onap/aaf/cadi/test/JU_Base64.java index 4d49c92..3596619 100644 --- a/core/src/test/java/org/onap/aaf/cadi/test/JU_Base64.java +++ b/core/src/test/java/org/onap/aaf/cadi/test/JU_Base64.java @@ -153,4 +153,216 @@ public class JU_Base64 { assertEquals(toEncode,result); } + + @Test + public void test1() throws Exception { + // Test with different Padding + encode("leas", "bGVhcw=="); + encode("leasu", "bGVhc3U="); + encode("leasur", "bGVhc3Vy"); + encode("leasure", "bGVhc3VyZQ=="); + encode("leasure.","bGVhc3VyZS4="); + + // Test with line ends + encode(encoding, expected); + + int ITER = 2000; + System.out.println("Priming by Encoding Base64 " + ITER + " times"); + long start = System.nanoTime(); + for(int i=0;i