aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsaid belhadj <saidbelhadj0312@gmail.com>2021-06-27 16:07:27 +0200
committersaid belhadj <saidbelhadj0312@gmail.com>2021-06-27 16:07:27 +0200
commitf42590f675ec76e8b515aebd2ebf66430435b6bd (patch)
treedc72f8f8e18efc92c5ccabe1bb53593ba5376c0a
parent5dc7dea3ef53a385442c6bfd59054faa4b1d73d9 (diff)
Add unit test for Category and Language
-rw-r--r--src/test/java/musichub/business/CategoryTest.java25
-rw-r--r--src/test/java/musichub/business/LanguageTest.java23
-rw-r--r--target/surefire-reports/TEST-musichub.business.CategoryTest.xml58
-rw-r--r--target/surefire-reports/TEST-musichub.business.LanguageTest.xml58
4 files changed, 164 insertions, 0 deletions
diff --git a/src/test/java/musichub/business/CategoryTest.java b/src/test/java/musichub/business/CategoryTest.java
new file mode 100644
index 0000000..f1fef50
--- /dev/null
+++ b/src/test/java/musichub/business/CategoryTest.java
@@ -0,0 +1,25 @@
+package musichub.business;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+public class CategoryTest {
+
+ @Test
+ void testGetter() {
+
+ String t1 = "t1";
+ String a1 = "a1";
+ int l1 = 1;
+ String c1 = a1+" - "+t1;
+ String lan1 = "french";
+ String cat1 = "novel";
+ AudioBook s1 = new AudioBook(t1, a1, l1, c1, lan1, cat1);
+
+ assertEquals(s1.getCategory(), Category.NOVEL);
+ s1.setCategory("NOVEL");
+ assertEquals(s1.getCategory(), Category.NOVEL);
+ }
+}
diff --git a/src/test/java/musichub/business/LanguageTest.java b/src/test/java/musichub/business/LanguageTest.java
new file mode 100644
index 0000000..93e9d1c
--- /dev/null
+++ b/src/test/java/musichub/business/LanguageTest.java
@@ -0,0 +1,23 @@
+package musichub.business;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class LanguageTest {
+ @Test
+ void testGetter() {
+
+ String t1 = "t1";
+ String a1 = "a1";
+ int l1 = 1;
+ String c1 = a1+" - "+t1;
+ String lan1 = "FRENCH";
+ String cat1 = "novel";
+ AudioBook s1 = new AudioBook(t1, a1, l1, c1, lan1, cat1);
+ assertEquals(s1.getLanguage(), Language.FRENCH);
+ s1.setLanguage("french");
+ assertEquals(s1.getLanguage(), Language.FRENCH);
+ }
+
+}
diff --git a/target/surefire-reports/TEST-musichub.business.CategoryTest.xml b/target/surefire-reports/TEST-musichub.business.CategoryTest.xml
new file mode 100644
index 0000000..706f15d
--- /dev/null
+++ b/target/surefire-reports/TEST-musichub.business.CategoryTest.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="musichub.business.CategoryTest" time="0.044" tests="1" errors="0" skipped="0" failures="0">
+ <properties>
+ <property name="java.specification.version" value="16"/>
+ <property name="sun.jnu.encoding" value="UTF-8"/>
+ <property name="java.class.path" value="/Users/saidbelhadj/Documents/spoteeze/target/test-classes:/Users/saidbelhadj/Documents/spoteeze/target/classes:/Users/saidbelhadj/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.0.2/junit-jupiter-api-5.0.2.jar:/Users/saidbelhadj/.m2/repository/org/opentest4j/opentest4j/1.0.0/opentest4j-1.0.0.jar:/Users/saidbelhadj/.m2/repository/org/junit/platform/junit-platform-commons/1.0.2/junit-platform-commons-1.0.2.jar:/Users/saidbelhadj/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.0.2/junit-jupiter-engine-5.0.2.jar:/Users/saidbelhadj/.m2/repository/org/junit/platform/junit-platform-engine/1.0.2/junit-platform-engine-1.0.2.jar:"/>
+ <property name="java.vm.vendor" value="Homebrew"/>
+ <property name="sun.arch.data.model" value="64"/>
+ <property name="java.vendor.url" value="https://github.com/Homebrew/homebrew-core/issues"/>
+ <property name="os.name" value="Mac OS X"/>
+ <property name="java.vm.specification.version" value="16"/>
+ <property name="sun.java.launcher" value="SUN_STANDARD"/>
+ <property name="user.country" value="FR"/>
+ <property name="sun.boot.library.path" value="/usr/local/Cellar/openjdk/16.0.1/libexec/openjdk.jdk/Contents/Home/lib"/>
+ <property name="sun.java.command" value="/Users/saidbelhadj/Documents/spoteeze/target/surefire/surefirebooter9607216078417480605.jar /Users/saidbelhadj/Documents/spoteeze/target/surefire 2021-06-27T16-03-35_612-jvmRun1 surefire3577178680756599794tmp surefire_06826483022491615857tmp"/>
+ <property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+ <property name="jdk.debug" value="release"/>
+ <property name="surefire.test.class.path" value="/Users/saidbelhadj/Documents/spoteeze/target/test-classes:/Users/saidbelhadj/Documents/spoteeze/target/classes:/Users/saidbelhadj/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.0.2/junit-jupiter-api-5.0.2.jar:/Users/saidbelhadj/.m2/repository/org/opentest4j/opentest4j/1.0.0/opentest4j-1.0.0.jar:/Users/saidbelhadj/.m2/repository/org/junit/platform/junit-platform-commons/1.0.2/junit-platform-commons-1.0.2.jar:/Users/saidbelhadj/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.0.2/junit-jupiter-engine-5.0.2.jar:/Users/saidbelhadj/.m2/repository/org/junit/platform/junit-platform-engine/1.0.2/junit-platform-engine-1.0.2.jar:"/>
+ <property name="sun.cpu.endian" value="little"/>
+ <property name="user.home" value="/Users/saidbelhadj"/>
+ <property name="user.language" value="fr"/>
+ <property name="java.specification.vendor" value="Oracle Corporation"/>
+ <property name="java.version.date" value="2021-04-20"/>
+ <property name="java.home" value="/usr/local/Cellar/openjdk/16.0.1/libexec/openjdk.jdk/Contents/Home"/>
+ <property name="file.separator" value="/"/>
+ <property name="basedir" value="/Users/saidbelhadj/Documents/spoteeze"/>
+ <property name="java.vm.compressedOopsMode" value="Zero based"/>
+ <property name="line.separator" value="&#10;"/>
+ <property name="java.specification.name" value="Java Platform API Specification"/>
+ <property name="java.vm.specification.vendor" value="Oracle Corporation"/>
+ <property name="surefire.real.class.path" value="/Users/saidbelhadj/Documents/spoteeze/target/surefire/surefirebooter9607216078417480605.jar"/>
+ <property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
+ <property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+ <property name="java.runtime.version" value="16.0.1+0"/>
+ <property name="user.name" value="saidbelhadj"/>
+ <property name="path.separator" value=":"/>
+ <property name="os.version" value="11.2.3"/>
+ <property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
+ <property name="file.encoding" value="UTF-8"/>
+ <property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
+ <property name="java.vendor.version" value="Homebrew"/>
+ <property name="localRepository" value="/Users/saidbelhadj/.m2/repository"/>
+ <property name="java.vendor.url.bug" value="https://github.com/Homebrew/homebrew-core/issues"/>
+ <property name="java.io.tmpdir" value="/var/folders/ym/wj3693wx6fdggpnvqkzls90r0000gn/T/"/>
+ <property name="java.version" value="16.0.1"/>
+ <property name="user.dir" value="/Users/saidbelhadj/Documents/spoteeze"/>
+ <property name="os.arch" value="x86_64"/>
+ <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
+ <property name="java.library.path" value="/Users/saidbelhadj/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/>
+ <property name="java.vm.info" value="mixed mode, sharing"/>
+ <property name="java.vendor" value="Homebrew"/>
+ <property name="java.vm.version" value="16.0.1+0"/>
+ <property name="sun.io.unicode.encoding" value="UnicodeBig"/>
+ <property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+ <property name="java.class.version" value="60.0"/>
+ </properties>
+ <testcase name="testGetter" classname="musichub.business.CategoryTest" time="0.041"/>
+</testsuite> \ No newline at end of file
diff --git a/target/surefire-reports/TEST-musichub.business.LanguageTest.xml b/target/surefire-reports/TEST-musichub.business.LanguageTest.xml
new file mode 100644
index 0000000..088ebdd
--- /dev/null
+++ b/target/surefire-reports/TEST-musichub.business.LanguageTest.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="musichub.business.LanguageTest" time="0" tests="1" errors="0" skipped="0" failures="0">
+ <properties>
+ <property name="java.specification.version" value="16"/>
+ <property name="sun.jnu.encoding" value="UTF-8"/>
+ <property name="java.class.path" value="/Users/saidbelhadj/Documents/spoteeze/target/test-classes:/Users/saidbelhadj/Documents/spoteeze/target/classes:/Users/saidbelhadj/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.0.2/junit-jupiter-api-5.0.2.jar:/Users/saidbelhadj/.m2/repository/org/opentest4j/opentest4j/1.0.0/opentest4j-1.0.0.jar:/Users/saidbelhadj/.m2/repository/org/junit/platform/junit-platform-commons/1.0.2/junit-platform-commons-1.0.2.jar:/Users/saidbelhadj/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.0.2/junit-jupiter-engine-5.0.2.jar:/Users/saidbelhadj/.m2/repository/org/junit/platform/junit-platform-engine/1.0.2/junit-platform-engine-1.0.2.jar:"/>
+ <property name="java.vm.vendor" value="Homebrew"/>
+ <property name="sun.arch.data.model" value="64"/>
+ <property name="java.vendor.url" value="https://github.com/Homebrew/homebrew-core/issues"/>
+ <property name="os.name" value="Mac OS X"/>
+ <property name="java.vm.specification.version" value="16"/>
+ <property name="sun.java.launcher" value="SUN_STANDARD"/>
+ <property name="user.country" value="FR"/>
+ <property name="sun.boot.library.path" value="/usr/local/Cellar/openjdk/16.0.1/libexec/openjdk.jdk/Contents/Home/lib"/>
+ <property name="sun.java.command" value="/Users/saidbelhadj/Documents/spoteeze/target/surefire/surefirebooter9607216078417480605.jar /Users/saidbelhadj/Documents/spoteeze/target/surefire 2021-06-27T16-03-35_612-jvmRun1 surefire3577178680756599794tmp surefire_06826483022491615857tmp"/>
+ <property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+ <property name="jdk.debug" value="release"/>
+ <property name="surefire.test.class.path" value="/Users/saidbelhadj/Documents/spoteeze/target/test-classes:/Users/saidbelhadj/Documents/spoteeze/target/classes:/Users/saidbelhadj/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.0.2/junit-jupiter-api-5.0.2.jar:/Users/saidbelhadj/.m2/repository/org/opentest4j/opentest4j/1.0.0/opentest4j-1.0.0.jar:/Users/saidbelhadj/.m2/repository/org/junit/platform/junit-platform-commons/1.0.2/junit-platform-commons-1.0.2.jar:/Users/saidbelhadj/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.0.2/junit-jupiter-engine-5.0.2.jar:/Users/saidbelhadj/.m2/repository/org/junit/platform/junit-platform-engine/1.0.2/junit-platform-engine-1.0.2.jar:"/>
+ <property name="sun.cpu.endian" value="little"/>
+ <property name="user.home" value="/Users/saidbelhadj"/>
+ <property name="user.language" value="fr"/>
+ <property name="java.specification.vendor" value="Oracle Corporation"/>
+ <property name="java.version.date" value="2021-04-20"/>
+ <property name="java.home" value="/usr/local/Cellar/openjdk/16.0.1/libexec/openjdk.jdk/Contents/Home"/>
+ <property name="file.separator" value="/"/>
+ <property name="basedir" value="/Users/saidbelhadj/Documents/spoteeze"/>
+ <property name="java.vm.compressedOopsMode" value="Zero based"/>
+ <property name="line.separator" value="&#10;"/>
+ <property name="java.specification.name" value="Java Platform API Specification"/>
+ <property name="java.vm.specification.vendor" value="Oracle Corporation"/>
+ <property name="surefire.real.class.path" value="/Users/saidbelhadj/Documents/spoteeze/target/surefire/surefirebooter9607216078417480605.jar"/>
+ <property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
+ <property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+ <property name="java.runtime.version" value="16.0.1+0"/>
+ <property name="user.name" value="saidbelhadj"/>
+ <property name="path.separator" value=":"/>
+ <property name="os.version" value="11.2.3"/>
+ <property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
+ <property name="file.encoding" value="UTF-8"/>
+ <property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
+ <property name="java.vendor.version" value="Homebrew"/>
+ <property name="localRepository" value="/Users/saidbelhadj/.m2/repository"/>
+ <property name="java.vendor.url.bug" value="https://github.com/Homebrew/homebrew-core/issues"/>
+ <property name="java.io.tmpdir" value="/var/folders/ym/wj3693wx6fdggpnvqkzls90r0000gn/T/"/>
+ <property name="java.version" value="16.0.1"/>
+ <property name="user.dir" value="/Users/saidbelhadj/Documents/spoteeze"/>
+ <property name="os.arch" value="x86_64"/>
+ <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
+ <property name="java.library.path" value="/Users/saidbelhadj/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/>
+ <property name="java.vm.info" value="mixed mode, sharing"/>
+ <property name="java.vendor" value="Homebrew"/>
+ <property name="java.vm.version" value="16.0.1+0"/>
+ <property name="sun.io.unicode.encoding" value="UnicodeBig"/>
+ <property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+ <property name="java.class.version" value="60.0"/>
+ </properties>
+ <testcase name="testGetter" classname="musichub.business.LanguageTest" time="0"/>
+</testsuite> \ No newline at end of file