From bd20b218d5e83bfbb4e0f13b98f1b4186712345e Mon Sep 17 00:00:00 2001 From: Legit Cheetah Date: Fri, 5 Jan 2024 21:21:27 +0100 Subject: [PATCH] Initial Commit --- .gitignore | 29 +++++++ .idea/.gitignore | 8 ++ .idea/libraries/junit_jupiter.xml | 17 ++++ .idea/misc.xml | 6 ++ .idea/modules.xml | 8 ++ .idea/uiDesigner.xml | 124 ++++++++++++++++++++++++++++++ Cheetstrap.iml | 12 +++ src/main/Main.java | 7 ++ src/main/html.java | 19 +++++ src/main/htmlTagsEnum.java | 74 ++++++++++++++++++ src/test/htmlTagsEnumTest.java | 71 +++++++++++++++++ src/test/htmlTest.java | 33 ++++++++ 12 files changed, 408 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/libraries/junit_jupiter.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 Cheetstrap.iml create mode 100644 src/main/Main.java create mode 100644 src/main/html.java create mode 100644 src/main/htmlTagsEnum.java create mode 100644 src/test/htmlTagsEnumTest.java create mode 100644 src/test/htmlTest.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/libraries/junit_jupiter.xml b/.idea/libraries/junit_jupiter.xml new file mode 100644 index 0000000..965272a --- /dev/null +++ b/.idea/libraries/junit_jupiter.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b9365bb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..98c2df5 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Cheetstrap.iml b/Cheetstrap.iml new file mode 100644 index 0000000..547dd47 --- /dev/null +++ b/Cheetstrap.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/Main.java b/src/main/Main.java new file mode 100644 index 0000000..60f7101 --- /dev/null +++ b/src/main/Main.java @@ -0,0 +1,7 @@ +package main; + +public class Main { + public static void main(String[] args) { + + } +} diff --git a/src/main/html.java b/src/main/html.java new file mode 100644 index 0000000..ed81635 --- /dev/null +++ b/src/main/html.java @@ -0,0 +1,19 @@ +package main; + +public class html { + public String htmlContentModule(htmlTagsEnum tag, String content){ + return "<"+tag.getTag()+">\n"+content+"\n\n"; + } + + public String htmlInlineModule(htmlTagsEnum tag, String content){ + return "<"+tag.getTag()+">"+content+"\n"; + } + + public String customContentModule(String tag, String content){ + return "<"+tag+">\n"+content+"\n\n"; + } + + public String customInlineModule(String tag, String content){ + return "<"+tag+">"+content+"\n"; + } +} diff --git a/src/main/htmlTagsEnum.java b/src/main/htmlTagsEnum.java new file mode 100644 index 0000000..a666594 --- /dev/null +++ b/src/main/htmlTagsEnum.java @@ -0,0 +1,74 @@ +package main; + +public enum htmlTagsEnum { + //TestTag is only for testing, it is not a valid Html Tag! + TESTTAG("testtag"), + ABBREVIATION("abb"), + ADDRESS("address"), + ARTICLE("article"), + ASIDE("aside"), + BIDIRECTIONALTEXTOVERRIDE("bdo"), + BLINK("blink"), + BODY("body"), + BOLD("b"), + BREAK("br"), + CANVAS("canvas"), + CODE("code"), + DELETE("delete"), + DIV("div"), + FIGURE("figure"), + FIGURECAPTION("figcaption"), + FOOTER("footer"), + FORM("form"), + HEAD("head"), + HEADER("header"), + HEADLINE1("h1"), + HEADLINE2("h2"), + HEADLINE3("h3"), + HEADLINE4("h4"), + HEADLINE5("h5"), + HEADLINE6("h6"), + INPUT("input"), + INTERNETFRAME("iframe"), + INSERT("insert"), + ITALICS("i"), + KEYGEN("keygen"), + LINK("a"), + LISTITEM("li"), + LISTORDERED("ol"), + LISTUNORDERED("ul"), + MAIN("main"), + MARQUEE("marquee"), + MENU("menu"), + META("meta"), + NAVIGATION("nav"), + PARAGRAPH("p"), + RUBY("ruby"), + RUBYPARENTHESIS("rp"), + RUBYTEXT("rt"), + PRETAG("pretag"), + SCRIPT("script"), + SECTION("section"), + SMALL("small"), + SPAN("span"), + STRIKE("s"), + TABLE("table"), + TABLECOLUM("td"), + TABLECOLUMNTITLE("th"), + TABLEROW("tr"), + TEXTAREA("textarea"), + TITLE("title"), + UNDERLINE("u"), + VARIABLE("var"), + WANTEDBREAK("wbr"); + + private String tag; + + public String getTag(){ + return this.tag; + } + + private htmlTagsEnum(String tag){ + this.tag = tag; + } +} diff --git a/src/test/htmlTagsEnumTest.java b/src/test/htmlTagsEnumTest.java new file mode 100644 index 0000000..6951001 --- /dev/null +++ b/src/test/htmlTagsEnumTest.java @@ -0,0 +1,71 @@ +package test; + +import main.htmlTagsEnum; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class htmlTagsEnumTest { + + @Test + void htmlTagsEnumTagsTest(){ + assertEquals(htmlTagsEnum.ABBREVIATION.getTag(),"abb"); + assertEquals(htmlTagsEnum.ADDRESS.getTag(),"address"); + assertEquals(htmlTagsEnum.ARTICLE.getTag(),"article"); + assertEquals(htmlTagsEnum.ASIDE.getTag(),"aside"); + assertEquals(htmlTagsEnum.BLINK.getTag(),"blink"); + assertEquals(htmlTagsEnum.BIDIRECTIONALTEXTOVERRIDE.getTag(),"bdo"); + assertEquals(htmlTagsEnum.BODY.getTag(),"body"); + assertEquals(htmlTagsEnum.BOLD.getTag(),"b"); + assertEquals(htmlTagsEnum.BREAK.getTag(),"br"); + assertEquals(htmlTagsEnum.CANVAS.getTag(),"canvas"); + assertEquals(htmlTagsEnum.CODE.getTag(),"code"); + assertEquals(htmlTagsEnum.DELETE.getTag(),"delete"); + assertEquals(htmlTagsEnum.DIV.getTag(),"div"); + assertEquals(htmlTagsEnum.FIGURE.getTag(),"figure"); + assertEquals(htmlTagsEnum.FIGURECAPTION.getTag(),"figcaption"); + assertEquals(htmlTagsEnum.FOOTER.getTag(),"footer"); + assertEquals(htmlTagsEnum.FORM.getTag(),"form"); + assertEquals(htmlTagsEnum.HEAD.getTag(),"head"); + assertEquals(htmlTagsEnum.HEADER.getTag(),"header"); + assertEquals(htmlTagsEnum.HEADLINE1.getTag(),"h1"); + assertEquals(htmlTagsEnum.HEADLINE2.getTag(),"h2"); + assertEquals(htmlTagsEnum.HEADLINE3.getTag(),"h3"); + assertEquals(htmlTagsEnum.HEADLINE4.getTag(),"h4"); + assertEquals(htmlTagsEnum.HEADLINE5.getTag(),"h5"); + assertEquals(htmlTagsEnum.HEADLINE6.getTag(),"h6"); + assertEquals(htmlTagsEnum.INPUT.getTag(),"input"); + assertEquals(htmlTagsEnum.INSERT.getTag(),"insert"); + assertEquals(htmlTagsEnum.INTERNETFRAME.getTag(),"iframe"); + assertEquals(htmlTagsEnum.ITALICS.getTag(),"i"); + assertEquals(htmlTagsEnum.KEYGEN.getTag(),"keygen"); + assertEquals(htmlTagsEnum.LINK.getTag(),"a"); + assertEquals(htmlTagsEnum.LISTITEM.getTag(),"li"); + assertEquals(htmlTagsEnum.LISTORDERED.getTag(),"ol"); + assertEquals(htmlTagsEnum.LISTUNORDERED.getTag(),"ul"); + assertEquals(htmlTagsEnum.MAIN.getTag(),"main"); + assertEquals(htmlTagsEnum.MARQUEE.getTag(),"marquee"); + assertEquals(htmlTagsEnum.MENU.getTag(),"menu"); + assertEquals(htmlTagsEnum.META.getTag(),"meta"); + assertEquals(htmlTagsEnum.NAVIGATION.getTag(),"nav"); + assertEquals(htmlTagsEnum.PARAGRAPH.getTag(),"p"); + assertEquals(htmlTagsEnum.PRETAG.getTag(),"pretag"); + assertEquals(htmlTagsEnum.RUBY.getTag(),"ruby"); + assertEquals(htmlTagsEnum.RUBYPARENTHESIS.getTag(),"rp"); + assertEquals(htmlTagsEnum.RUBYTEXT.getTag(),"rt"); + assertEquals(htmlTagsEnum.SCRIPT.getTag(),"script"); + assertEquals(htmlTagsEnum.SECTION.getTag(),"section"); + assertEquals(htmlTagsEnum.SMALL.getTag(),"small"); + assertEquals(htmlTagsEnum.SPAN.getTag(),"span"); + assertEquals(htmlTagsEnum.STRIKE.getTag(),"s"); + assertEquals(htmlTagsEnum.TABLE.getTag(),"table"); + assertEquals(htmlTagsEnum.TABLECOLUM.getTag(),"td"); + assertEquals(htmlTagsEnum.TABLECOLUMNTITLE.getTag(),"th"); + assertEquals(htmlTagsEnum.TABLEROW.getTag(),"tr"); + assertEquals(htmlTagsEnum.TEXTAREA.getTag(),"textarea"); + assertEquals(htmlTagsEnum.TITLE.getTag(),"title"); + assertEquals(htmlTagsEnum.UNDERLINE.getTag(),"u"); + assertEquals(htmlTagsEnum.VARIABLE.getTag(),"var"); + assertEquals(htmlTagsEnum.WANTEDBREAK.getTag(),"wbr"); + } +} diff --git a/src/test/htmlTest.java b/src/test/htmlTest.java new file mode 100644 index 0000000..f118c31 --- /dev/null +++ b/src/test/htmlTest.java @@ -0,0 +1,33 @@ +package test; + +import main.html; +import main.htmlTagsEnum; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +class htmlTest { + html html = new main.html(); + + @Test + void htmlContentModuleTest() { + assertEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"content")); + assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"fail")); + assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.PRETAG,"content")); + } + + @Test + void htmlInlineModuleTest() { + assertEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"content")); + assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.TESTTAG,"fail")); + assertNotEquals("\ncontent\n",html.htmlContentModule(htmlTagsEnum.PRETAG,"content")); + } + + @Test + void customContentModuleTest() { + assertEquals("\ncontent\n",html.customContentModule("testtag","content")); + assertNotEquals("\ncontent\n",html.customContentModule("testtag","fail")); + assertNotEquals("\ncontent\n",html.customContentModule("pretag","content")); + } +} \ No newline at end of file