From 4b5a7d721d994a49057e9bfb403c7bff1b376660 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Fri, 7 Sep 2018 12:21:34 -0500 Subject: Mass removal of all Tabs (Style Warnings) Issue-ID: AAF-473 Change-Id: Iaf0ef8120882937959bb0065f2f6ba74a021940f Signed-off-by: Instrumental --- .../java/org/onap/aaf/misc/xgen/JU_BackTest.java | 14 +- .../org/onap/aaf/misc/xgen/JU_DynamicCodeTest.java | 40 +-- .../java/org/onap/aaf/misc/xgen/JU_MarkTest.java | 20 +- .../org/onap/aaf/misc/xgen/JU_NullCacheTest.java | 10 +- .../org/onap/aaf/misc/xgen/JU_SectionTest.java | 42 +-- .../onap/aaf/misc/xgen/html/JU_HTML4GenTest.java | 396 ++++++++++----------- .../onap/aaf/misc/xgen/html/JU_HTML5GenTest.java | 134 +++---- .../onap/aaf/misc/xgen/html/JU_ImportsTest.java | 46 +-- .../org/onap/aaf/misc/xgen/html/JU_JSGenTest.java | 342 +++++++++--------- .../onap/aaf/misc/xgen/xml/JU_XMLCacheGenTest.java | 38 +- .../org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java | 40 +-- 11 files changed, 561 insertions(+), 561 deletions(-) (limited to 'misc/xgen/src/test') diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_BackTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_BackTest.java index 6a3eb15e..aa877966 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_BackTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_BackTest.java @@ -26,12 +26,12 @@ import org.junit.Test; public class JU_BackTest { - @Test - public void testBackConstructor() { - Back back = new Back("String", true, false); + @Test + public void testBackConstructor() { + Back back = new Back("String", true, false); - assertEquals(back.str, "String"); - assertEquals(back.dec, true); - assertEquals(back.cr, false); - } + assertEquals(back.str, "String"); + assertEquals(back.dec, true); + assertEquals(back.cr, false); + } } \ No newline at end of file diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_DynamicCodeTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_DynamicCodeTest.java index 5aead073..2a66f851 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_DynamicCodeTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_DynamicCodeTest.java @@ -37,29 +37,29 @@ import org.onap.aaf.misc.xgen.html.State; public class JU_DynamicCodeTest { - @Test - public void test() throws APIException, IOException { - final Cache cache1 = new Cache() { + @Test + public void test() throws APIException, IOException { + final Cache cache1 = new Cache() { - @Override - public void dynamic(HTMLGen hgen, Code code) { - } - }; + @Override + public void dynamic(HTMLGen hgen, Code code) { + } + }; - final HTMLGen xgen1 = new HTML4Gen(new PrintWriter(System.out)); - DynamicCode, Trans> g = new DynamicCode, Trans>() { + final HTMLGen xgen1 = new HTML4Gen(new PrintWriter(System.out)); + DynamicCode, Trans> g = new DynamicCode, Trans>() { - @Override - public void code(State state, Trans trans, Cache cache, HTMLGen xgen) - throws APIException, IOException { - assertNull(state); - assertNull(trans); - assertEquals(cache, cache1); - assertEquals(xgen, xgen1); - } - }; + @Override + public void code(State state, Trans trans, Cache cache, HTMLGen xgen) + throws APIException, IOException { + assertNull(state); + assertNull(trans); + assertEquals(cache, cache1); + assertEquals(xgen, xgen1); + } + }; - g.code(cache1, xgen1); - } + g.code(cache1, xgen1); + } } diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_MarkTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_MarkTest.java index 200bde6e..9a5378a7 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_MarkTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_MarkTest.java @@ -26,16 +26,16 @@ import org.junit.Test; public class JU_MarkTest { - @Test - public void testMark() { - Mark mark = new Mark(); - assertEquals(mark.spot, 0); - assertEquals(mark.comment, null); + @Test + public void testMark() { + Mark mark = new Mark(); + assertEquals(mark.spot, 0); + assertEquals(mark.comment, null); - mark = new Mark("New Comment"); - mark.spot(10); - assertEquals(mark.spot, 10); - assertEquals(mark.comment, "New Comment"); + mark = new Mark("New Comment"); + mark.spot(10); + assertEquals(mark.spot, 10); + assertEquals(mark.comment, "New Comment"); - } + } } \ No newline at end of file diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_NullCacheTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_NullCacheTest.java index 5b5f816a..0f996d5c 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_NullCacheTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_NullCacheTest.java @@ -27,9 +27,9 @@ import org.onap.aaf.misc.xgen.Cache.Null; public class JU_NullCacheTest { - @Test - public void testNullIsSingleton() { - Null singleton = Cache.Null.singleton(); - assertEquals(singleton, Cache.Null.singleton()); - } + @Test + public void testNullIsSingleton() { + Null singleton = Cache.Null.singleton(); + assertEquals(singleton, Cache.Null.singleton()); + } } diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_SectionTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_SectionTest.java index a45ea158..44ca3a14 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_SectionTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/JU_SectionTest.java @@ -34,31 +34,31 @@ import org.onap.aaf.misc.env.APIException; public class JU_SectionTest { - @Mock - private Writer writer; + @Mock + private Writer writer; - @Before - public void setup() { - writer = mock(Writer.class); - } + @Before + public void setup() { + writer = mock(Writer.class); + } - @Test - @SuppressWarnings({ "rawtypes", "unchecked" }) - public void test() throws APIException, IOException { - Section section = new Section(); - section.forward = "Forward"; - section.backward = "Backward"; + @Test + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void test() throws APIException, IOException { + Section section = new Section(); + section.forward = "Forward"; + section.backward = "Backward"; - section.setIndent(10); - section.forward(writer); - section.back(writer); + section.setIndent(10); + section.forward(writer); + section.back(writer); - assertEquals(section.use(null, null, null), section); - assertEquals(section.getIndent(), 10); - assertEquals(section.toString(), "Forward"); + assertEquals(section.use(null, null, null), section); + assertEquals(section.getIndent(), 10); + assertEquals(section.toString(), "Forward"); - verify(writer).write("Forward"); - verify(writer).write("Backward"); - } + verify(writer).write("Forward"); + verify(writer).write("Backward"); + } } diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java index 9160095d..6fa2afb8 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java @@ -36,280 +36,280 @@ import org.mockito.Mock; public class JU_HTML4GenTest { - private final static String DOCTYPE = ""; + private final static String DOCTYPE = ""; - private String charset = "utf-8"; + private String charset = "utf-8"; - private final String CHARSET_LINE = ""; + private final String CHARSET_LINE = ""; - @Mock - Writer w; + @Mock + Writer w; - @Before - public void setUp() throws Exception { + @Before + public void setUp() throws Exception { - w = mock(Writer.class); - } + w = mock(Writer.class); + } - @Test - public void testHTML() throws IOException { + @Test + public void testHTML() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.html("attributes"); + gen.html("attributes"); - Map map = new TreeMap<>(); - for (char ch : DOCTYPE.toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + Map map = new TreeMap<>(); + for (char ch : DOCTYPE.toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "html".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "html".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - verify(w, atLeast(1)).write(anyInt()); - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + verify(w, atLeast(1)).write(anyInt()); + } - @Test - public void testHead() throws IOException { + @Test + public void testHead() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.head(); + gen.head(); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "head".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "head".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testBody() throws IOException { + @Test + public void testBody() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.body("attributes"); + gen.body("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "body".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } - for (char ch : "attributes".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "body".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } + for (char ch : "attributes".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testCharSet() throws IOException { + @Test + public void testCharSet() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.charset(charset); + gen.charset(charset); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : CHARSET_LINE.toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : CHARSET_LINE.toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testHeader() throws IOException { + @Test + public void testHeader() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.header("attributes"); + gen.header("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "header".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "header".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "div".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "div".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "attributes".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "attributes".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testFooter() throws IOException { + @Test + public void testFooter() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.footer("attributes"); + gen.footer("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "footer".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "footer".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "div".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "div".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "attributes".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "attributes".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testSection() throws IOException { + @Test + public void testSection() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.section("attributes"); + gen.section("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "section".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "section".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "div".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "div".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "attributes".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "attributes".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testArticle() throws IOException { + @Test + public void testArticle() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.article("attributes"); + gen.article("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "attrib".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "attrib".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "div".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "div".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "attributes".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "attributes".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testAside() throws IOException { + @Test + public void testAside() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.aside("attributes"); + gen.aside("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "aside".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "aside".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "div".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "div".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "attributes".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "attributes".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testNav() throws IOException { + @Test + public void testNav() throws IOException { - HTML4Gen gen = new HTML4Gen(w); + HTML4Gen gen = new HTML4Gen(w); - gen.nav("attributes"); + gen.nav("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "nav".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "nav".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "div".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "div".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : "attributes".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "attributes".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } } diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java index 69ebf89b..6426fae5 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java @@ -36,100 +36,100 @@ import org.mockito.Mock; public class JU_HTML5GenTest { -// private final static String DOCTYPE = ""; +// private final static String DOCTYPE = ""; - private String charset = "utf-8"; + private String charset = "utf-8"; - private final String CHARSET_LINE = ""; + private final String CHARSET_LINE = ""; - @Mock - Writer w; + @Mock + Writer w; - @Before - public void setUp() throws Exception { + @Before + public void setUp() throws Exception { - w = mock(Writer.class); - } + w = mock(Writer.class); + } - @Test - public void testHTML() throws IOException { + @Test + public void testHTML() throws IOException { - HTML5Gen gen = new HTML5Gen(w); + HTML5Gen gen = new HTML5Gen(w); - gen.html("attributes"); + gen.html("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "html".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "html".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - verify(w, atLeast(1)).write(anyInt()); - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + verify(w, atLeast(1)).write(anyInt()); + } - @Test - public void testHead() throws IOException { + @Test + public void testHead() throws IOException { - HTML5Gen gen = new HTML5Gen(w); + HTML5Gen gen = new HTML5Gen(w); - gen.head(); + gen.head(); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "head".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "head".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testBody() throws IOException { + @Test + public void testBody() throws IOException { - HTML5Gen gen = new HTML5Gen(w); + HTML5Gen gen = new HTML5Gen(w); - gen.body("attributes"); + gen.body("attributes"); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : "body".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } - for (char ch : "attributes".toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : "body".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } + for (char ch : "attributes".toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } - @Test - public void testCharSet() throws IOException { + @Test + public void testCharSet() throws IOException { - HTML5Gen gen = new HTML5Gen(w); + HTML5Gen gen = new HTML5Gen(w); - gen.charset(charset); + gen.charset(charset); - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - for (char ch : CHARSET_LINE.toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : CHARSET_LINE.toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(w, atLeast(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(w, atLeast(map.get(ch))).write(ch); + } + } } diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_ImportsTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_ImportsTest.java index 4a6ce6b8..c9de2d14 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_ImportsTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_ImportsTest.java @@ -27,28 +27,28 @@ import org.junit.Test; public class JU_ImportsTest { - @Before - public void setUp() throws Exception { - } - - @Test - public void test() { - Imports imports = new Imports(2); - imports.css("styles.css"); - imports.js("main.js"); - imports.theme("New Theme"); - - assertEquals("New Theme", imports.themeResolve(null)); - assertEquals("New Theme", imports.themeResolve("")); - assertEquals("The Theme", imports.themeResolve("The Theme")); - - assertEquals("build/../../", imports.dots(new StringBuilder("build/")).toString()); - assertEquals("../../Theme/", imports.themePath("Theme")); - assertEquals("../../New Theme/", imports.themePath("")); - assertEquals("../../New Theme/", imports.themePath(null)); - - imports.theme(null); - assertEquals("../../", imports.themePath(null)); - } + @Before + public void setUp() throws Exception { + } + + @Test + public void test() { + Imports imports = new Imports(2); + imports.css("styles.css"); + imports.js("main.js"); + imports.theme("New Theme"); + + assertEquals("New Theme", imports.themeResolve(null)); + assertEquals("New Theme", imports.themeResolve("")); + assertEquals("The Theme", imports.themeResolve("The Theme")); + + assertEquals("build/../../", imports.dots(new StringBuilder("build/")).toString()); + assertEquals("../../Theme/", imports.themePath("Theme")); + assertEquals("../../New Theme/", imports.themePath("")); + assertEquals("../../New Theme/", imports.themePath(null)); + + imports.theme(null); + assertEquals("../../", imports.themePath(null)); + } } diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_JSGenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_JSGenTest.java index 8bf811be..a52dae3d 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_JSGenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_JSGenTest.java @@ -39,176 +39,176 @@ import org.onap.aaf.misc.xgen.Mark; public class JU_JSGenTest { - @Mock - private HTMLGen hg; - @Mock - private Mark mark; - @Mock - private IndentPrintWriter writer; - @Mock - private Mark jm; - - @Before - public void setup() { - MockitoAnnotations.initMocks(this); - } - - @Test - public void testFileNotFoundException() { - JSGen gen = new JSGen(mark, hg); - - try { - gen.inline("JSScript", 2); - fail("This file should not be found."); - } catch (Exception e) { - - } - } - - @Test - public void testJSRead() throws IOException { - when(hg.getWriter()).thenReturn(writer); - JSGen gen = new JSGen(mark, hg); - - gen.inline("./sampletest.js", 2); - - verify(writer).print("function myFunction() {"); - verify(writer).print("document.getElementById(\"demo\").innerHTML = \"Paragraph changed.\";"); - verify(writer).print("}"); - verify(writer, times(0)).println(); - } - - @Test - public void testJSReadPrettyPrint() throws IOException { - when(hg.getWriter()).thenReturn(writer); - hg.pretty = true; - JSGen gen = new JSGen(mark, hg); - - gen.inline("./sampletest.js", 2); - - verify(writer).print("function myFunction() {"); - verify(writer).print("document.getElementById(\"demo\").innerHTML = \"Paragraph changed.\";"); - verify(writer).print("}"); - verify(writer, times(3)).println(); - verify(hg).setIndent(0); - } - - @Test - public void testPst() throws IOException { - when(hg.getWriter()).thenReturn(writer); - when(hg.pushBack(any(Back.class))).thenReturn(3); - hg.pretty = true; - JSGen gen = new JSGen(mark, hg); - - gen.pst("line 1", "line 2"); - - verify(writer).append('('); - verify(writer).append("line 1"); - verify(writer).print("line 2"); - verify(writer, times(1)).print(", "); - } - - @Test - public void testPstWithMark() throws IOException { - when(hg.getWriter()).thenReturn(writer); - when(hg.pushBack(any(Back.class))).thenReturn(3); - JSGen gen = new JSGen(mark, hg); - - gen.pst(jm, "line 1", "line 2"); - - verify(writer).append('('); - verify(writer).append("line 1"); - verify(writer).print("line 2"); - verify(writer, times(1)).print(", "); - } - - @Test - public void testPstWithNoLines() throws IOException { - when(hg.getWriter()).thenReturn(writer); - when(hg.pushBack(any(Back.class))).thenReturn(3); - JSGen gen = new JSGen(mark, hg); - - gen.pst(jm); - - verify(writer).append('('); - } - - @Test - public void testLi() throws IOException { - when(hg.getWriter()).thenReturn(writer); - when(writer.getIndent()).thenReturn(3); - - JSGen gen = new JSGen(mark, hg); - - gen.li("line 1", "line 2"); - - verify(writer).setIndent(3); - verify(writer).inc(); - verify(writer).println(); - verify(writer).print("line 1"); - verify(writer).print("line 2"); - - hg.pretty = true; - gen.li("line 1", "line 2"); - verify(writer, times(3)).println(); - } - - @Test - public void testText() throws IOException { - when(hg.getWriter()).thenReturn(writer); - hg.pretty = true; - JSGen gen = new JSGen(mark, hg); - - gen.text("line 1"); - - verify(writer).append("line 1"); - verify(writer).println(); - - hg.pretty = false; - gen.text("line 1"); - - verify(writer, times(2)).append("line 1"); - } - - @Test - public void testFunction() throws IOException { - when(hg.getWriter()).thenReturn(writer); - when(hg.pushBack(any(Back.class))).thenReturn(3); - hg.pretty = true; - JSGen gen = new JSGen(mark, hg); - - gen.function("line 1", "line 2", "line 3"); - - verify(writer).print("function "); - verify(writer).print("line 1"); - verify(writer).print('('); - - verify(writer).print("line 2"); - verify(writer).print("line 3"); - verify(writer, times(1)).print(", "); - verify(writer).print(") {"); - verify(writer).inc(); - verify(writer).println(); - } - - @Test - public void testFunctionWithMark() throws IOException { - when(hg.getWriter()).thenReturn(writer); - when(hg.pushBack(any(Back.class))).thenReturn(3); - JSGen gen = new JSGen(mark, hg); - - gen.function(jm, "line 1", "line 2", "line 3"); - - verify(writer).print("function "); - verify(writer).print("line 1"); - verify(writer).print('('); - - verify(writer).print("line 2"); - verify(writer).print("line 3"); - verify(writer, times(1)).print(", "); - verify(writer).print(") {"); - verify(writer, times(0)).inc(); - verify(writer, times(0)).println(); - } + @Mock + private HTMLGen hg; + @Mock + private Mark mark; + @Mock + private IndentPrintWriter writer; + @Mock + private Mark jm; + + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void testFileNotFoundException() { + JSGen gen = new JSGen(mark, hg); + + try { + gen.inline("JSScript", 2); + fail("This file should not be found."); + } catch (Exception e) { + + } + } + + @Test + public void testJSRead() throws IOException { + when(hg.getWriter()).thenReturn(writer); + JSGen gen = new JSGen(mark, hg); + + gen.inline("./sampletest.js", 2); + + verify(writer).print("function myFunction() {"); + verify(writer).print("document.getElementById(\"demo\").innerHTML = \"Paragraph changed.\";"); + verify(writer).print("}"); + verify(writer, times(0)).println(); + } + + @Test + public void testJSReadPrettyPrint() throws IOException { + when(hg.getWriter()).thenReturn(writer); + hg.pretty = true; + JSGen gen = new JSGen(mark, hg); + + gen.inline("./sampletest.js", 2); + + verify(writer).print("function myFunction() {"); + verify(writer).print("document.getElementById(\"demo\").innerHTML = \"Paragraph changed.\";"); + verify(writer).print("}"); + verify(writer, times(3)).println(); + verify(hg).setIndent(0); + } + + @Test + public void testPst() throws IOException { + when(hg.getWriter()).thenReturn(writer); + when(hg.pushBack(any(Back.class))).thenReturn(3); + hg.pretty = true; + JSGen gen = new JSGen(mark, hg); + + gen.pst("line 1", "line 2"); + + verify(writer).append('('); + verify(writer).append("line 1"); + verify(writer).print("line 2"); + verify(writer, times(1)).print(", "); + } + + @Test + public void testPstWithMark() throws IOException { + when(hg.getWriter()).thenReturn(writer); + when(hg.pushBack(any(Back.class))).thenReturn(3); + JSGen gen = new JSGen(mark, hg); + + gen.pst(jm, "line 1", "line 2"); + + verify(writer).append('('); + verify(writer).append("line 1"); + verify(writer).print("line 2"); + verify(writer, times(1)).print(", "); + } + + @Test + public void testPstWithNoLines() throws IOException { + when(hg.getWriter()).thenReturn(writer); + when(hg.pushBack(any(Back.class))).thenReturn(3); + JSGen gen = new JSGen(mark, hg); + + gen.pst(jm); + + verify(writer).append('('); + } + + @Test + public void testLi() throws IOException { + when(hg.getWriter()).thenReturn(writer); + when(writer.getIndent()).thenReturn(3); + + JSGen gen = new JSGen(mark, hg); + + gen.li("line 1", "line 2"); + + verify(writer).setIndent(3); + verify(writer).inc(); + verify(writer).println(); + verify(writer).print("line 1"); + verify(writer).print("line 2"); + + hg.pretty = true; + gen.li("line 1", "line 2"); + verify(writer, times(3)).println(); + } + + @Test + public void testText() throws IOException { + when(hg.getWriter()).thenReturn(writer); + hg.pretty = true; + JSGen gen = new JSGen(mark, hg); + + gen.text("line 1"); + + verify(writer).append("line 1"); + verify(writer).println(); + + hg.pretty = false; + gen.text("line 1"); + + verify(writer, times(2)).append("line 1"); + } + + @Test + public void testFunction() throws IOException { + when(hg.getWriter()).thenReturn(writer); + when(hg.pushBack(any(Back.class))).thenReturn(3); + hg.pretty = true; + JSGen gen = new JSGen(mark, hg); + + gen.function("line 1", "line 2", "line 3"); + + verify(writer).print("function "); + verify(writer).print("line 1"); + verify(writer).print('('); + + verify(writer).print("line 2"); + verify(writer).print("line 3"); + verify(writer, times(1)).print(", "); + verify(writer).print(") {"); + verify(writer).inc(); + verify(writer).println(); + } + + @Test + public void testFunctionWithMark() throws IOException { + when(hg.getWriter()).thenReturn(writer); + when(hg.pushBack(any(Back.class))).thenReturn(3); + JSGen gen = new JSGen(mark, hg); + + gen.function(jm, "line 1", "line 2", "line 3"); + + verify(writer).print("function "); + verify(writer).print("line 1"); + verify(writer).print('('); + + verify(writer).print("line 2"); + verify(writer).print("line 3"); + verify(writer, times(1)).print(", "); + verify(writer).print(") {"); + verify(writer, times(0)).inc(); + verify(writer, times(0)).println(); + } } diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLCacheGenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLCacheGenTest.java index c8014dda..5e15fa67 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLCacheGenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLCacheGenTest.java @@ -34,30 +34,30 @@ import org.onap.aaf.misc.xgen.Code; public class JU_XMLCacheGenTest { - @Mock - Writer writer; + @Mock + Writer writer; - @Mock - Code code; + @Mock + Code code; - @Before - public void setup() { + @Before + public void setup() { - code = mock(Code.class); - writer = mock(Writer.class); - } + code = mock(Code.class); + writer = mock(Writer.class); + } - @Test - public void test() throws APIException, IOException { - XMLCacheGen cacheGen = new XMLCacheGen(0, code); - assertEquals(cacheGen.PRETTY, 1); + @Test + public void test() throws APIException, IOException { + XMLCacheGen cacheGen = new XMLCacheGen(0, code); + assertEquals(cacheGen.PRETTY, 1); - XMLGen xgen = cacheGen.create(1, writer); - assertEquals(0, xgen.getIndent()); + XMLGen xgen = cacheGen.create(1, writer); + assertEquals(0, xgen.getIndent()); - xgen.setIndent(10); - assertEquals(10, xgen.getIndent()); - xgen.comment("Comment"); - } + xgen.setIndent(10); + assertEquals(10, xgen.getIndent()); + xgen.comment("Comment"); + } } diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java index 1c00b452..18b82393 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java @@ -36,31 +36,31 @@ import org.mockito.Mock; public class JU_XMLGenTest { - @Mock - private Writer writer; + @Mock + private Writer writer; - String XML_TAG = ""; + String XML_TAG = ""; - Map map = new TreeMap<>(); + Map map = new TreeMap<>(); - @Before - public void setUp() throws Exception { - writer = mock(Writer.class); - } + @Before + public void setUp() throws Exception { + writer = mock(Writer.class); + } - @Test - public void testXMLGenWriter() throws IOException { - XMLGen xmlGen = new XMLGen(writer); + @Test + public void testXMLGenWriter() throws IOException { + XMLGen xmlGen = new XMLGen(writer); - xmlGen.xml(); + xmlGen.xml(); - for (char ch : XML_TAG.toCharArray()) { - Integer times = map.get(ch); - map.put(ch, (times == null ? 0 : times) + 1); - } + for (char ch : XML_TAG.toCharArray()) { + Integer times = map.get(ch); + map.put(ch, (times == null ? 0 : times) + 1); + } - for (char ch : map.keySet()) { - verify(writer, times(map.get(ch))).write(ch); - } - } + for (char ch : map.keySet()) { + verify(writer, times(map.get(ch))).write(ch); + } + } } \ No newline at end of file -- cgit