From a9f46e2164f0d9ce416f34ebcb68d532de98cdb2 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Sun, 27 Jun 2021 11:55:45 +0200 Subject: Starting Song tests --- .../jacoco/musichub.business/AudioElement.html | 2 +- .../musichub.business/AudioElement.java.html | 54 +++++++++++----------- target/site/jacoco/musichub.business/Genre.html | 2 +- .../site/jacoco/musichub.business/Genre.java.html | 12 ++--- target/site/jacoco/musichub.business/Song.html | 2 +- .../site/jacoco/musichub.business/Song.java.html | 28 +++++------ target/site/jacoco/musichub.business/index.html | 2 +- .../jacoco/musichub.business/index.source.html | 2 +- 8 files changed, 52 insertions(+), 52 deletions(-) (limited to 'target/site/jacoco/musichub.business') diff --git a/target/site/jacoco/musichub.business/AudioElement.html b/target/site/jacoco/musichub.business/AudioElement.html index 7a6e499..084f53f 100644 --- a/target/site/jacoco/musichub.business/AudioElement.html +++ b/target/site/jacoco/musichub.business/AudioElement.html @@ -1 +1 @@ -AudioElement

AudioElement

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total266 of 2660 %11 of 110 %1616727299
createXMLElement(Document, Element)790 %n/a11161611
manageAudioElement()680 %70 %66242411
AudioElement(Element)630 %40 %33141411
AudioElement(String, String, int, String, String)190 %n/a117711
AudioElement(String, String, int, String)180 %n/a117711
toString()100 %n/a111111
getUUID()30 %n/a111111
getArtist()30 %n/a111111
getTitle()30 %n/a111111
\ No newline at end of file +AudioElement

AudioElement

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total174 of 26634 %9 of 1118 %1316477269
createXMLElement(Document, Element)790 %n/a11161611
manageAudioElement()680 %70 %66242411
toString()100 %n/a111111
AudioElement(Element)85587 %2250 %2331401
getUUID()30 %n/a111111
getArtist()30 %n/a111111
getTitle()30 %n/a111111
AudioElement(String, String, int, String, String)19100 %n/a010701
AudioElement(String, String, int, String)18100 %n/a010701
\ No newline at end of file diff --git a/target/site/jacoco/musichub.business/AudioElement.java.html b/target/site/jacoco/musichub.business/AudioElement.java.html index 4401836..28d9e57 100644 --- a/target/site/jacoco/musichub.business/AudioElement.java.html +++ b/target/site/jacoco/musichub.business/AudioElement.java.html @@ -21,39 +21,39 @@ public abstract class AudioElement { protected UUID uuid; protected String content; - public AudioElement(String title, String artist, int lengthInSeconds, String id, String content) { - this.title = title; - this.artist = artist; - this.lengthInSeconds = lengthInSeconds; - this.uuid = UUID.fromString(id); - this.content = content; - } - - public AudioElement(String title, String artist, int lengthInSeconds, String content) { - this.title = title; - this.artist = artist; - this.lengthInSeconds = lengthInSeconds; - this.content = content; - this.uuid = UUID.randomUUID(); - } - - public AudioElement(Element xmlElement) { + public AudioElement(String title, String artist, int lengthInSeconds, String id, String content) { + this.title = title; + this.artist = artist; + this.lengthInSeconds = lengthInSeconds; + this.uuid = UUID.fromString(id); + this.content = content; + } + + public AudioElement(String title, String artist, int lengthInSeconds, String content) { + this.title = title; + this.artist = artist; + this.lengthInSeconds = lengthInSeconds; + this.content = content; + this.uuid = UUID.randomUUID(); + } + + public AudioElement(Element xmlElement) { { - title = xmlElement.getElementsByTagName("title").item(0).getTextContent(); - artist = xmlElement.getElementsByTagName("artist").item(0).getTextContent(); - lengthInSeconds = Integer.parseInt(xmlElement.getElementsByTagName("length").item(0).getTextContent()); - content = xmlElement.getElementsByTagName("content").item(0).getTextContent(); - String uuid = null; + title = xmlElement.getElementsByTagName("title").item(0).getTextContent(); + artist = xmlElement.getElementsByTagName("artist").item(0).getTextContent(); + lengthInSeconds = Integer.parseInt(xmlElement.getElementsByTagName("length").item(0).getTextContent()); + content = xmlElement.getElementsByTagName("content").item(0).getTextContent(); + String uuid = null; try { - uuid = xmlElement.getElementsByTagName("UUID").item(0).getTextContent(); + uuid = xmlElement.getElementsByTagName("UUID").item(0).getTextContent(); } catch (Exception ex) { System.out.println("Empty element UUID, will create a new one"); - } - if ((uuid == null) || (uuid.isEmpty())) + } + if ((uuid == null) || (uuid.isEmpty())) this.uuid = UUID.randomUUID(); - else this.uuid = UUID.fromString(uuid); + else this.uuid = UUID.fromString(uuid); } - } + } public UUID getUUID() { return this.uuid; diff --git a/target/site/jacoco/musichub.business/Genre.html b/target/site/jacoco/musichub.business/Genre.html index 88e0ecd..c7442d4 100644 --- a/target/site/jacoco/musichub.business/Genre.html +++ b/target/site/jacoco/musichub.business/Genre.html @@ -1 +1 @@ -Genre

Genre

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total56 of 560 %0 of 0n/a336633
static {...}450 %n/a112211
Genre(String, int, String)80 %n/a113311
getGenre()30 %n/a111111
\ No newline at end of file +Genre

Genre

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total0 of 56100 %0 of 0n/a030603
static {...}45100 %n/a010201
Genre(String, int, String)8100 %n/a010301
getGenre()3100 %n/a010101
\ No newline at end of file diff --git a/target/site/jacoco/musichub.business/Genre.java.html b/target/site/jacoco/musichub.business/Genre.java.html index 021bb4b..e7196f9 100644 --- a/target/site/jacoco/musichub.business/Genre.java.html +++ b/target/site/jacoco/musichub.business/Genre.java.html @@ -1,15 +1,15 @@ Genre.java

Genre.java

package musichub.business;
 
-public enum Genre {
-    JAZZ("jazz"), CLASSIC("classic"), HIPHOP("hiphop"), ROCK("rock"), POP("pop"), RAP("rap");
+public enum Genre {
+    JAZZ("jazz"), CLASSIC("classic"), HIPHOP("hiphop"), ROCK("rock"), POP("pop"), RAP("rap");
     private final String genre;
 
-    Genre(String genre) {
-        this.genre = genre;
-    }
+    Genre(String genre) {
+        this.genre = genre;
+    }
 
     public String getGenre() {
-        return genre;
+        return genre;
     }
 }
 
\ No newline at end of file diff --git a/target/site/jacoco/musichub.business/Song.html b/target/site/jacoco/musichub.business/Song.html index 4af18c3..6231425 100644 --- a/target/site/jacoco/musichub.business/Song.html +++ b/target/site/jacoco/musichub.business/Song.html @@ -1 +1 @@ -Song

Song

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total105 of 1050 %6 of 60 %1212262677
setGenre(String)330 %60 %668811
createXMLElement(Document, Element)290 %n/a117711
Song(Element)120 %n/a113311
Song(String, String, int, String, String, String)110 %n/a113311
Song(String, String, int, String, String)100 %n/a113311
toString()60 %n/a111111
getGenre()40 %n/a111111
\ No newline at end of file +Song

Song

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total50 of 10552 %4 of 633 %612122627
createXMLElement(Document, Element)290 %n/a117711
setGenre(String)151854 %4233 %464801
toString()60 %n/a111111
Song(Element)12100 %n/a010301
Song(String, String, int, String, String, String)11100 %n/a010301
Song(String, String, int, String, String)10100 %n/a010301
getGenre()4100 %n/a010101
\ No newline at end of file diff --git a/target/site/jacoco/musichub.business/Song.java.html b/target/site/jacoco/musichub.business/Song.java.html index 4f7f01d..86ea1bf 100644 --- a/target/site/jacoco/musichub.business/Song.java.html +++ b/target/site/jacoco/musichub.business/Song.java.html @@ -8,34 +8,34 @@ public class Song extends AudioElement { private Genre genre; public Song(String title, String artist, int length, String uid, String content, String genre) { - super(title, artist, length, uid, content); - this.setGenre(genre); - } + super(title, artist, length, uid, content); + this.setGenre(genre); + } public Song(String title, String artist, int length, String content, String genre) { - super(title, artist, length, content); - this.setGenre(genre); - } + super(title, artist, length, content); + this.setGenre(genre); + } public Song(Element xmlElement) { - super(xmlElement); - this.setGenre(xmlElement.getElementsByTagName("genre").item(0).getTextContent()); - } + super(xmlElement); + this.setGenre(xmlElement.getElementsByTagName("genre").item(0).getTextContent()); + } public String getGenre() { - return genre.getGenre(); + return genre.getGenre(); } public void setGenre(String genre) { - switch (genre.toLowerCase()) { + switch (genre.toLowerCase()) { default -> this.genre = Genre.JAZZ; case "classic" -> this.genre = Genre.CLASSIC; case "hiphop" -> this.genre = Genre.HIPHOP; - case "rock" -> this.genre = Genre.ROCK; - case "pop" -> this.genre = Genre.POP; + case "rock" -> this.genre = Genre.ROCK; + case "pop" -> this.genre = Genre.POP; case "rap" -> this.genre = Genre.RAP; } - } + } public String toString() { return super.toString() + ", Genre = " + getGenre() + "\n"; diff --git a/target/site/jacoco/musichub.business/index.html b/target/site/jacoco/musichub.business/index.html index 421752c..9e86b79 100644 --- a/target/site/jacoco/musichub.business/index.html +++ b/target/site/jacoco/musichub.business/index.html @@ -1 +1 @@ -musichub.business

musichub.business

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total2 063 of 2 0630 %169 of 1690 %17217249949981811515
MusicHub8030 %1140 %7979195195222211
Album3300 %140 %161684849911
AudioElement2660 %110 %161672729911
PlayList2020 %140 %141453537711
AudioBook1640 %100 %171739399911
Song1050 %60 %121226267711
Genre560 %n/a33663311
Language490 %n/a33663311
Category490 %n/a33663311
SortByAuthor90 %n/a22222211
SortByDate90 %n/a22222211
SortByGenre90 %n/a22222211
NoAlbumFoundException0 %n/a11221111
NoPlayListFoundException0 %n/a11221111
NoElementFoundException0 %n/a11221111
\ No newline at end of file +musichub.business

musichub.business

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total1 860 of 2 0639 %165 of 1692 %16017245449970811215
MusicHub8030 %1140 %7979195195222211
Album3300 %140 %161684849911
PlayList2020 %140 %141453537711
AudioElement1749234 %9218 %131647726901
AudioBook1640 %100 %171739399911
Song505552 %4233 %61212262701
Language490 %n/a33663311
Category490 %n/a33663311
SortByAuthor90 %n/a22222211
SortByDate90 %n/a22222211
SortByGenre90 %n/a22222211
NoAlbumFoundException0 %n/a11221111
NoPlayListFoundException0 %n/a11221111
NoElementFoundException0 %n/a11221111
Genre56100 %n/a03060301
\ No newline at end of file diff --git a/target/site/jacoco/musichub.business/index.source.html b/target/site/jacoco/musichub.business/index.source.html index 13ddd53..7ceb0fd 100644 --- a/target/site/jacoco/musichub.business/index.source.html +++ b/target/site/jacoco/musichub.business/index.source.html @@ -1 +1 @@ -musichub.business

musichub.business

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total2 063 of 2 0630 %169 of 1690 %17217249949981811515
MusicHub.java8300 %1140 %8585201201282844
Album.java3300 %140 %161684849911
AudioElement.java2660 %110 %161672729911
PlayList.java2020 %140 %141453537711
AudioBook.java1640 %100 %171739399911
Song.java1050 %60 %121226267711
Genre.java560 %n/a33663311
Language.java490 %n/a33663311
Category.java490 %n/a33663311
NoAlbumFoundException.java0 %n/a11221111
NoPlayListFoundException.java0 %n/a11221111
NoElementFoundException.java0 %n/a11221111
\ No newline at end of file +musichub.business

musichub.business

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total1 860 of 2 0639 %165 of 1692 %16017245449970811215
MusicHub.java8300 %1140 %8585201201282844
Album.java3300 %140 %161684849911
PlayList.java2020 %140 %141453537711
AudioElement.java1749234 %9218 %131647726901
AudioBook.java1640 %100 %171739399911
Song.java505552 %4233 %61212262701
Language.java490 %n/a33663311
Category.java490 %n/a33663311
NoAlbumFoundException.java0 %n/a11221111
NoPlayListFoundException.java0 %n/a11221111
NoElementFoundException.java0 %n/a11221111
Genre.java56100 %n/a03060301
\ No newline at end of file -- cgit v1.2.3