diff options
author | Said Belhadj <71043286+Said-Belhadj@users.noreply.github.com> | 2021-06-27 15:43:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 15:43:57 +0200 |
commit | 703425d435ac7d0b6a3337f5730199fbaad82ff1 (patch) | |
tree | 63c26d58a831eec503940ad616533f35b3b3ccfe /target/site/jacoco/musichub.business/AudioElement.java.html | |
parent | 6c977eff192830096d4d5cde27d31bfd21d16b7e (diff) | |
parent | e13eea333d7af2786dbbbb5ed60cea4593d5ee12 (diff) |
Merge branch 'develop' into feature/STZ-0008
Diffstat (limited to 'target/site/jacoco/musichub.business/AudioElement.java.html')
-rw-r--r-- | target/site/jacoco/musichub.business/AudioElement.java.html | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/target/site/jacoco/musichub.business/AudioElement.java.html b/target/site/jacoco/musichub.business/AudioElement.java.html index 4401836..7863e1a 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; -<span class="nc" id="L24"> public AudioElement(String title, String artist, int lengthInSeconds, String id, String content) {</span> -<span class="nc" id="L25"> this.title = title;</span> -<span class="nc" id="L26"> this.artist = artist;</span> -<span class="nc" id="L27"> this.lengthInSeconds = lengthInSeconds;</span> -<span class="nc" id="L28"> this.uuid = UUID.fromString(id);</span> -<span class="nc" id="L29"> this.content = content;</span> -<span class="nc" id="L30"> }</span> - -<span class="nc" id="L32"> public AudioElement(String title, String artist, int lengthInSeconds, String content) {</span> -<span class="nc" id="L33"> this.title = title;</span> -<span class="nc" id="L34"> this.artist = artist;</span> -<span class="nc" id="L35"> this.lengthInSeconds = lengthInSeconds;</span> -<span class="nc" id="L36"> this.content = content;</span> -<span class="nc" id="L37"> this.uuid = UUID.randomUUID();</span> -<span class="nc" id="L38"> }</span> - -<span class="nc" id="L40"> public AudioElement(Element xmlElement) {</span> +<span class="fc" id="L24"> public AudioElement(String title, String artist, int lengthInSeconds, String id, String content) {</span> +<span class="fc" id="L25"> this.title = title;</span> +<span class="fc" id="L26"> this.artist = artist;</span> +<span class="fc" id="L27"> this.lengthInSeconds = lengthInSeconds;</span> +<span class="fc" id="L28"> this.uuid = UUID.fromString(id);</span> +<span class="fc" id="L29"> this.content = content;</span> +<span class="fc" id="L30"> }</span> + +<span class="fc" id="L32"> public AudioElement(String title, String artist, int lengthInSeconds, String content) {</span> +<span class="fc" id="L33"> this.title = title;</span> +<span class="fc" id="L34"> this.artist = artist;</span> +<span class="fc" id="L35"> this.lengthInSeconds = lengthInSeconds;</span> +<span class="fc" id="L36"> this.content = content;</span> +<span class="fc" id="L37"> this.uuid = UUID.randomUUID();</span> +<span class="fc" id="L38"> }</span> + +<span class="fc" id="L40"> public AudioElement(Element xmlElement) {</span> { -<span class="nc" id="L42"> title = xmlElement.getElementsByTagName("title").item(0).getTextContent();</span> -<span class="nc" id="L43"> artist = xmlElement.getElementsByTagName("artist").item(0).getTextContent();</span> -<span class="nc" id="L44"> lengthInSeconds = Integer.parseInt(xmlElement.getElementsByTagName("length").item(0).getTextContent());</span> -<span class="nc" id="L45"> content = xmlElement.getElementsByTagName("content").item(0).getTextContent();</span> -<span class="nc" id="L46"> String uuid = null;</span> +<span class="fc" id="L42"> title = xmlElement.getElementsByTagName("title").item(0).getTextContent();</span> +<span class="fc" id="L43"> artist = xmlElement.getElementsByTagName("artist").item(0).getTextContent();</span> +<span class="fc" id="L44"> lengthInSeconds = Integer.parseInt(xmlElement.getElementsByTagName("length").item(0).getTextContent());</span> +<span class="fc" id="L45"> content = xmlElement.getElementsByTagName("content").item(0).getTextContent();</span> +<span class="fc" id="L46"> String uuid = null;</span> try { -<span class="nc" id="L48"> uuid = xmlElement.getElementsByTagName("UUID").item(0).getTextContent();</span> +<span class="fc" id="L48"> uuid = xmlElement.getElementsByTagName("UUID").item(0).getTextContent();</span> <span class="nc" id="L49"> } catch (Exception ex) {</span> <span class="nc" id="L50"> System.out.println("Empty element UUID, will create a new one");</span> -<span class="nc" id="L51"> }</span> -<span class="nc bnc" id="L52" title="All 4 branches missed."> if ((uuid == null) || (uuid.isEmpty()))</span> +<span class="fc" id="L51"> }</span> +<span class="pc bpc" id="L52" title="2 of 4 branches missed."> if ((uuid == null) || (uuid.isEmpty()))</span> <span class="nc" id="L53"> this.uuid = UUID.randomUUID();</span> -<span class="nc" id="L54"> else this.uuid = UUID.fromString(uuid);</span> +<span class="fc" id="L54"> else this.uuid = UUID.fromString(uuid);</span> } -<span class="nc" id="L56"> }</span> +<span class="fc" id="L56"> }</span> public UUID getUUID() { <span class="nc" id="L59"> return this.uuid;</span> @@ -68,31 +68,31 @@ public abstract class AudioElement { } public String toString() { -<span class="nc" id="L71"> return "Title = " + this.title + ", Artist = " + this.artist + ", Length = " + this.lengthInSeconds + ", Content = " + this.content;</span> +<span class="fc" id="L71"> return "Title = " + this.title + ", Artist = " + this.artist + ", Length = " + this.lengthInSeconds + ", Content = " + this.content;</span> } public void createXMLElement(Document document, Element parentElement) { -<span class="nc" id="L75"> Element nameElement = document.createElement("title");</span> -<span class="nc" id="L76"> nameElement.appendChild(document.createTextNode(title));</span> -<span class="nc" id="L77"> parentElement.appendChild(nameElement);</span> +<span class="fc" id="L75"> Element nameElement = document.createElement("title");</span> +<span class="fc" id="L76"> nameElement.appendChild(document.createTextNode(title));</span> +<span class="fc" id="L77"> parentElement.appendChild(nameElement);</span> -<span class="nc" id="L79"> Element artistElement = document.createElement("artist");</span> -<span class="nc" id="L80"> artistElement.appendChild(document.createTextNode(artist));</span> -<span class="nc" id="L81"> parentElement.appendChild(artistElement);</span> +<span class="fc" id="L79"> Element artistElement = document.createElement("artist");</span> +<span class="fc" id="L80"> artistElement.appendChild(document.createTextNode(artist));</span> +<span class="fc" id="L81"> parentElement.appendChild(artistElement);</span> -<span class="nc" id="L83"> Element lengthElement = document.createElement("length");</span> -<span class="nc" id="L84"> lengthElement.appendChild(document.createTextNode(Integer.valueOf(lengthInSeconds).toString()));</span> -<span class="nc" id="L85"> parentElement.appendChild(lengthElement);</span> +<span class="fc" id="L83"> Element lengthElement = document.createElement("length");</span> +<span class="fc" id="L84"> lengthElement.appendChild(document.createTextNode(Integer.valueOf(lengthInSeconds).toString()));</span> +<span class="fc" id="L85"> parentElement.appendChild(lengthElement);</span> -<span class="nc" id="L87"> Element UUIDElement = document.createElement("UUID");</span> -<span class="nc" id="L88"> UUIDElement.appendChild(document.createTextNode(uuid.toString()));</span> -<span class="nc" id="L89"> parentElement.appendChild(UUIDElement);</span> +<span class="fc" id="L87"> Element UUIDElement = document.createElement("UUID");</span> +<span class="fc" id="L88"> UUIDElement.appendChild(document.createTextNode(uuid.toString()));</span> +<span class="fc" id="L89"> parentElement.appendChild(UUIDElement);</span> -<span class="nc" id="L91"> Element contentElement = document.createElement("content");</span> -<span class="nc" id="L92"> contentElement.appendChild(document.createTextNode(content));</span> -<span class="nc" id="L93"> parentElement.appendChild(contentElement);</span> +<span class="fc" id="L91"> Element contentElement = document.createElement("content");</span> +<span class="fc" id="L92"> contentElement.appendChild(document.createTextNode(content));</span> +<span class="fc" id="L93"> parentElement.appendChild(contentElement);</span> -<span class="nc" id="L95"> }</span> +<span class="fc" id="L95"> }</span> public void manageAudioElement() throws UnsupportedAudioFileException, IOException, LineUnavailableException { |