From ec1b626779698938bcfaa5f1e64a69afcd6393a9 Mon Sep 17 00:00:00 2001 From: sakshee-19 Date: Tue, 18 Sep 2018 18:07:42 +0530 Subject: [PATCH] Fixes #1580: Add Unit Test for UTF8.java file --- test/org/loklak/tools/UTF8Test.java | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/org/loklak/tools/UTF8Test.java diff --git a/test/org/loklak/tools/UTF8Test.java b/test/org/loklak/tools/UTF8Test.java new file mode 100644 index 000000000..639d3d6df --- /dev/null +++ b/test/org/loklak/tools/UTF8Test.java @@ -0,0 +1,52 @@ +package org.loklak.tools; + +import org.loklak.tools.UTF8; +import org.junit.Test; +import static org.junit.Assert.assertEquals; +/** + * These unit-tests test org.loklak.tools.UTF8.java + */ +public class UTF8Test{ + + @Test + public void testGetBytes(){ + UTF8 utf8 = new UTF8(); + String str = "loklak-server"; + byte [] returnVal = utf8.getBytes(str); + String s = ""; + for(int i=0; i