+
+
diff --git a/build/test-results/test/TEST-de.htwberlin.madlib.MadLibTest.xml b/build/test-results/test/TEST-de.htwberlin.madlib.MadLibTest.xml
new file mode 100644
index 0000000..e50f847
--- /dev/null
+++ b/build/test-results/test/TEST-de.htwberlin.madlib.MadLibTest.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/build/test-results/test/binary/output.bin b/build/test-results/test/binary/output.bin
new file mode 100644
index 0000000..e69de29
diff --git a/build/test-results/test/binary/output.bin.idx b/build/test-results/test/binary/output.bin.idx
new file mode 100644
index 0000000..f76dd23
Binary files /dev/null and b/build/test-results/test/binary/output.bin.idx differ
diff --git a/build/test-results/test/binary/results.bin b/build/test-results/test/binary/results.bin
new file mode 100644
index 0000000..b7e47d2
Binary files /dev/null and b/build/test-results/test/binary/results.bin differ
diff --git a/build/tmp/compileJava/source-classes-mapping.txt b/build/tmp/compileJava/source-classes-mapping.txt
new file mode 100644
index 0000000..c74b1d4
--- /dev/null
+++ b/build/tmp/compileJava/source-classes-mapping.txt
@@ -0,0 +1,2 @@
+de/htwberlin/madlib/MadLib.java
+ de.htwberlin.madlib.MadLib
diff --git a/build/tmp/compileTestJava/source-classes-mapping.txt b/build/tmp/compileTestJava/source-classes-mapping.txt
new file mode 100644
index 0000000..3716642
--- /dev/null
+++ b/build/tmp/compileTestJava/source-classes-mapping.txt
@@ -0,0 +1,2 @@
+de/htwberlin/madlib/MadLibTest.java
+ de.htwberlin.madlib.MadLibTest
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index be52383..f371643 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew.bat b/gradlew.bat
index 107acd3..ac1b06f 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,89 +1,89 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/src/.DS_Store b/src/.DS_Store
new file mode 100644
index 0000000..1694b6f
Binary files /dev/null and b/src/.DS_Store differ
diff --git a/src/main/.DS_Store b/src/main/.DS_Store
new file mode 100644
index 0000000..c974e61
Binary files /dev/null and b/src/main/.DS_Store differ
diff --git a/src/main/java/.DS_Store b/src/main/java/.DS_Store
new file mode 100644
index 0000000..2008036
Binary files /dev/null and b/src/main/java/.DS_Store differ
diff --git a/src/main/java/de/.DS_Store b/src/main/java/de/.DS_Store
new file mode 100644
index 0000000..f1e3f53
Binary files /dev/null and b/src/main/java/de/.DS_Store differ
diff --git a/src/main/java/de/htwberlin/.DS_Store b/src/main/java/de/htwberlin/.DS_Store
new file mode 100644
index 0000000..72842f1
Binary files /dev/null and b/src/main/java/de/htwberlin/.DS_Store differ
diff --git a/src/main/java/de/htwberlin/madlib/MadLib.java b/src/main/java/de/htwberlin/madlib/MadLib.java
index 7b6f3d0..745608b 100644
--- a/src/main/java/de/htwberlin/madlib/MadLib.java
+++ b/src/main/java/de/htwberlin/madlib/MadLib.java
@@ -1,5 +1,7 @@
package de.htwberlin.madlib;
+import java.util.Random;
+
public class MadLib {
static final String[] ADJECTIVES = new String[]{"amazing", "exciting", "excellent", "emotional", "easy", "difficult", "curious", "beautiful"};
@@ -8,7 +10,25 @@ public class MadLib {
public String create() {
// TODO: implement this method
+ Random randomNumber = new Random();
+
+ int randomAdjective = randomNumber.nextInt(ADJECTIVES.length);
+ int randomVerb = randomNumber.nextInt(VERBS.length);
+ int otherRandomVerb = randomNumber.nextInt(VERBS.length);
+ int randomFamousPerson = randomNumber.nextInt(VERBS.length);
+
+ return "Java programming is so " + ADJECTIVES[randomAdjective] + "! It makes me so excited all the time because I love to " + VERBS[randomVerb] + ". Stay hydrated and " + VERBS[otherRandomVerb] +" like you are " + FAMOUS_PERSONS[randomFamousPerson]+"!";
+ }
+
+ public static String[] getADJECTIVES() {
+ return ADJECTIVES;
+ }
+
+ public static String[] getVERBS() {
+ return VERBS;
+ }
- return ""; // TODO: this is only here so that the code can be compiled, please replace it with your result
+ public static String[] getFamousPersons() {
+ return FAMOUS_PERSONS;
}
}
diff --git a/src/test/.DS_Store b/src/test/.DS_Store
new file mode 100644
index 0000000..c974e61
Binary files /dev/null and b/src/test/.DS_Store differ
diff --git a/src/test/java/.DS_Store b/src/test/java/.DS_Store
new file mode 100644
index 0000000..2008036
Binary files /dev/null and b/src/test/java/.DS_Store differ
diff --git a/src/test/java/de/.DS_Store b/src/test/java/de/.DS_Store
new file mode 100644
index 0000000..f1e3f53
Binary files /dev/null and b/src/test/java/de/.DS_Store differ
diff --git a/src/test/java/de/htwberlin/.DS_Store b/src/test/java/de/htwberlin/.DS_Store
new file mode 100644
index 0000000..72842f1
Binary files /dev/null and b/src/test/java/de/htwberlin/.DS_Store differ
diff --git a/src/test/java/de/htwberlin/madlib/.DS_Store b/src/test/java/de/htwberlin/madlib/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/src/test/java/de/htwberlin/madlib/.DS_Store differ
diff --git a/src/test/java/de/htwberlin/madlib/MadLibTest.java b/src/test/java/de/htwberlin/madlib/MadLibTest.java
new file mode 100644
index 0000000..64c3c29
--- /dev/null
+++ b/src/test/java/de/htwberlin/madlib/MadLibTest.java
@@ -0,0 +1,48 @@
+package de.htwberlin.madlib;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+@DisplayName("MadLib")
+class MadLibTest{
+
+ @Test
+ @DisplayName("Test 1 MadLib")
+ void createSentence () throws Exception {
+ MadLib sentence = new MadLib();
+
+ String s = sentence.create();
+
+ if (s != null && s.startsWith("Java programming is so")) {
+ } else {
+ throw new Exception("Sentence is null or not starting correctly.");
+ }
+ }
+
+ @Test
+ @DisplayName("Test 2 MadLib")
+ void createSecondSentence () throws Exception {
+ MadLib newSentence = new MadLib();
+
+ String sentence = newSentence.create();
+
+ if (checkString(newSentence.getADJECTIVES(), sentence)==false) {
+ throw new Exception("Adjective is missing in the sentence.");
+ } else if (checkString(newSentence.getVERBS(), sentence)==false) {
+ throw new Exception("Verb is missing in the sentence.");
+ } else if (checkString(newSentence.getFamousPersons(), sentence)==false) {
+ throw new Exception("Famous person is missing in the sentence.");
+ }
+ }
+
+ public boolean checkString (String[] word, String sentence) {
+ boolean wordIsInString = false;
+
+ for (int i = 0; i < word.length; i++) {
+ if (sentence.contains(word[i])) {
+ wordIsInString = true;
+ }
+ }
+ return wordIsInString;
+ }
+}
\ No newline at end of file