Initial Commit

This commit is contained in:
Legit Cheetah 2024-01-05 21:21:27 +01:00
commit bd20b218d5
12 changed files with 408 additions and 0 deletions

29
.gitignore vendored Normal file
View File

@ -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

8
.idea/.gitignore vendored Normal file
View File

@ -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

View File

@ -0,0 +1,17 @@
<component name="libraryTable">
<library name="junit.jupiter" type="repository">
<properties maven-id="org.junit.jupiter:junit-jupiter:5.9.1" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.9.1/junit-jupiter-5.9.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.9.1/junit-jupiter-api-5.9.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.9.1/junit-platform-commons-1.9.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.9.1/junit-jupiter-params-5.9.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.9.1/junit-jupiter-engine-5.9.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.9.1/junit-platform-engine-1.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

6
.idea/misc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbrsdk-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Cheetstrap.iml" filepath="$PROJECT_DIR$/Cheetstrap.iml" />
</modules>
</component>
</project>

124
.idea/uiDesigner.xml Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

12
Cheetstrap.iml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="junit.jupiter" level="project" />
</component>
</module>

7
src/main/Main.java Normal file
View File

@ -0,0 +1,7 @@
package main;
public class Main {
public static void main(String[] args) {
}
}

19
src/main/html.java Normal file
View File

@ -0,0 +1,19 @@
package main;
public class html {
public String htmlContentModule(htmlTagsEnum tag, String content){
return "<"+tag.getTag()+">\n"+content+"\n</"+tag.getTag()+">\n";
}
public String htmlInlineModule(htmlTagsEnum tag, String content){
return "<"+tag.getTag()+">"+content+"</"+tag.getTag()+">\n";
}
public String customContentModule(String tag, String content){
return "<"+tag+">\n"+content+"\n</"+tag+">\n";
}
public String customInlineModule(String tag, String content){
return "<"+tag+">"+content+"</"+tag+">\n";
}
}

View File

@ -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;
}
}

View File

@ -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");
}
}

33
src/test/htmlTest.java Normal file
View File

@ -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("<testtag>\ncontent\n</testtag>",html.htmlContentModule(htmlTagsEnum.TESTTAG,"content"));
assertNotEquals("<testtag>\ncontent\n</testtag>",html.htmlContentModule(htmlTagsEnum.TESTTAG,"fail"));
assertNotEquals("<testtag>\ncontent\n</testtag>",html.htmlContentModule(htmlTagsEnum.PRETAG,"content"));
}
@Test
void htmlInlineModuleTest() {
assertEquals("<testtag>\ncontent\n</testtag>",html.htmlContentModule(htmlTagsEnum.TESTTAG,"content"));
assertNotEquals("<testtag>\ncontent\n</testtag>",html.htmlContentModule(htmlTagsEnum.TESTTAG,"fail"));
assertNotEquals("<testtag>\ncontent\n</testtag>",html.htmlContentModule(htmlTagsEnum.PRETAG,"content"));
}
@Test
void customContentModuleTest() {
assertEquals("<testtag>\ncontent\n</testtag>",html.customContentModule("testtag","content"));
assertNotEquals("<testtag>\ncontent\n</testtag>",html.customContentModule("testtag","fail"));
assertNotEquals("<testtag>\ncontent\n</testtag>",html.customContentModule("pretag","content"));
}
}