1 package org.farng.mp3.id3;
2 
3 import junit.framework.Test;
4 import junit.framework.TestCase;
5 import junit.framework.TestSuite;
6 import org.farng.mp3.lyrics3.Lyrics3v1;
7 import org.farng.mp3.lyrics3.Lyrics3v2;
8 
9 /**
10  * Created by IntelliJ IDEA. User: Eric Farng Date: Mar 12, 2006 Time: 7:20:28 PM To change this template use File |
11  * Settings | File Templates.
12  */
13 public class AbstractMP3Tag extends TestCase {
14 
15     private String songTitle = "My Song Title";
16     private String leadArtist = "My Lead Artist";
17     private String albumTitle = "My Album Title";
18     private String yearReleased = "1990";
19     private String songComment = "My Comment";
20     private String songGenre = "31";
21     private String trackNumberOnAlbum = "3";
22     private String songLyric = "My Song Lyrics";
23     private String authorComposer = "My Author / Composer";
24 
25     /**
26      *
27      */
AbstractMP3Tag()28     public AbstractMP3Tag() {
29         super();
30     }
31 
32     /**
33      * @param arg0
34      */
AbstractMP3Tag(String arg0)35     public AbstractMP3Tag(String arg0) {
36         super(arg0);
37     }
38 
suite()39     public static Test suite() {
40         return new TestSuite(AbstractMP3Tag.class);
41     }
42 
43     /**
44      *
45      */
setUp()46     protected void setUp() {
47         songTitle = "My Song Title";
48         leadArtist = "My Lead Artist";
49         albumTitle = "My Album Title";
50         yearReleased = "1990";
51         songComment = "My Comment";
52         songGenre = "31";
53         trackNumberOnAlbum = "3";
54         songLyric = "My Song Lyrics";
55         authorComposer = "My Author or Composer";
56     }
57 
58     /**
59      *
60      */
tearDown()61     protected void tearDown() {
62         // none required
63     }
64 
testID3v1()65     public void testID3v1() {
66         ID3v1 tag = new ID3v1();
67         assertEquals("", tag.getSongTitle());
68         assertEquals("", tag.getLeadArtist());
69         assertEquals("", tag.getAlbumTitle());
70         assertEquals("", tag.getYearReleased());
71         assertEquals("", tag.getSongComment());
72         assertEquals("-1", tag.getSongGenre());
73         try {
74             tag.getTrackNumberOnAlbum();
75             fail("Did not throw UnsupportedOperationException");
76         } catch (UnsupportedOperationException ex) {
77         }
78         try {
79             tag.getSongLyric();
80             fail("Did not throw UnsupportedOperationException");
81         } catch (UnsupportedOperationException ex) {
82         }
83         try {
84             tag.getAuthorComposer();
85             fail("Did not throw UnsupportedOperationException");
86         } catch (UnsupportedOperationException ex) {
87         }
88         tag = new ID3v1();
89         tag.setSongTitle(songTitle);
90         tag.setLeadArtist(leadArtist);
91         tag.setAlbumTitle(albumTitle);
92         tag.setYearReleased(yearReleased);
93         tag.setSongComment(songComment);
94         tag.setSongGenre(songGenre);
95         try {
96             tag.setTrackNumberOnAlbum(null);
97             fail("Did not throw UnsupportedOperationException");
98         } catch (UnsupportedOperationException ex) {
99         }
100         try {
101             tag.setSongLyric(null);
102             fail("Did not throw UnsupportedOperationException");
103         } catch (UnsupportedOperationException ex) {
104         }
105         try {
106             tag.setAuthorComposer(null);
107             fail("Did not throw UnsupportedOperationException");
108         } catch (UnsupportedOperationException ex) {
109         }
110         assertEquals(songTitle, tag.getSongTitle());
111         assertEquals(leadArtist, tag.getLeadArtist());
112         assertEquals(albumTitle, tag.getAlbumTitle());
113         assertEquals(yearReleased, tag.getYearReleased());
114         assertEquals(songComment, tag.getSongComment());
115         assertEquals(songGenre, tag.getSongGenre());
116 
117         // run again because it's a different case
118         tag.setSongTitle(songTitle);
119         tag.setLeadArtist(leadArtist);
120         tag.setAlbumTitle(albumTitle);
121         tag.setYearReleased(yearReleased);
122         tag.setSongComment(songComment);
123         tag.setSongGenre(songGenre);
124         assertEquals(songTitle, tag.getSongTitle());
125         assertEquals(leadArtist, tag.getLeadArtist());
126         assertEquals(albumTitle, tag.getAlbumTitle());
127         assertEquals(yearReleased, tag.getYearReleased());
128         assertEquals(songComment, tag.getSongComment());
129         assertEquals(songGenre, tag.getSongGenre());
130         ID3v2_4 convertTag = new ID3v2_4(tag);
131         ID3v1 newTag = new ID3v1(convertTag);
132         assertEquals(tag, newTag);
133         assertEquals(newTag.getSongTitle(), tag.getSongTitle());
134         assertEquals(newTag.getLeadArtist(), tag.getLeadArtist());
135         assertEquals(newTag.getAlbumTitle(), tag.getAlbumTitle());
136         assertEquals(newTag.getYearReleased(), tag.getYearReleased());
137         assertEquals(newTag.getSongComment(), tag.getSongComment());
138         assertEquals(newTag.getSongGenre(), tag.getSongGenre());
139         ID3v1 copyTag = new ID3v1(tag);
140         assertEquals(copyTag, tag);
141     }
142 
testID3v1_1()143     public void testID3v1_1() {
144         ID3v1_1 tag = new ID3v1_1();
145         assertEquals("", tag.getSongTitle());
146         assertEquals("", tag.getLeadArtist());
147         assertEquals("", tag.getAlbumTitle());
148         assertEquals("", tag.getYearReleased());
149         assertEquals("", tag.getSongComment());
150         assertEquals("-1", tag.getSongGenre());
151         assertEquals("-1", tag.getTrackNumberOnAlbum());
152         try {
153             tag.getSongLyric();
154             fail("Did not throw UnsupportedOperationException");
155         } catch (UnsupportedOperationException ex) {
156         }
157         try {
158             tag.getAuthorComposer();
159             fail("Did not throw UnsupportedOperationException");
160         } catch (UnsupportedOperationException ex) {
161         }
162         tag = new ID3v1_1();
163         tag.setSongTitle(songTitle);
164         tag.setLeadArtist(leadArtist);
165         tag.setAlbumTitle(albumTitle);
166         tag.setYearReleased(yearReleased);
167         tag.setSongComment(songComment);
168         tag.setSongGenre(songGenre);
169         tag.setTrackNumberOnAlbum(trackNumberOnAlbum);
170         try {
171             tag.setSongLyric(null);
172             fail("Did not throw UnsupportedOperationException");
173         } catch (UnsupportedOperationException ex) {
174         }
175         try {
176             tag.setAuthorComposer(null);
177             fail("Did not throw UnsupportedOperationException");
178         } catch (UnsupportedOperationException ex) {
179         }
180         assertEquals(songTitle, tag.getSongTitle());
181         assertEquals(leadArtist, tag.getLeadArtist());
182         assertEquals(albumTitle, tag.getAlbumTitle());
183         assertEquals(yearReleased, tag.getYearReleased());
184         assertEquals(songComment, tag.getSongComment());
185         assertEquals(songGenre, tag.getSongGenre());
186         assertEquals(trackNumberOnAlbum, tag.getTrackNumberOnAlbum());
187 
188         // run again because it's a different case
189         tag.setSongTitle(songTitle);
190         tag.setLeadArtist(leadArtist);
191         tag.setAlbumTitle(albumTitle);
192         tag.setYearReleased(yearReleased);
193         tag.setSongComment(songComment);
194         tag.setSongGenre(songGenre);
195         tag.setTrackNumberOnAlbum(trackNumberOnAlbum);
196         assertEquals(songTitle, tag.getSongTitle());
197         assertEquals(leadArtist, tag.getLeadArtist());
198         assertEquals(albumTitle, tag.getAlbumTitle());
199         assertEquals(yearReleased, tag.getYearReleased());
200         assertEquals(songComment, tag.getSongComment());
201         assertEquals(songGenre, tag.getSongGenre());
202         assertEquals(trackNumberOnAlbum, tag.getTrackNumberOnAlbum());
203         ID3v2_4 convertTag = new ID3v2_4(tag);
204         ID3v1_1 newTag = new ID3v1_1(convertTag);
205         assertEquals(tag, newTag);
206         assertEquals(newTag.getSongTitle(), tag.getSongTitle());
207         assertEquals(newTag.getLeadArtist(), tag.getLeadArtist());
208         assertEquals(newTag.getAlbumTitle(), tag.getAlbumTitle());
209         assertEquals(newTag.getYearReleased(), tag.getYearReleased());
210         assertEquals(newTag.getSongComment(), tag.getSongComment());
211         assertEquals(newTag.getSongGenre(), tag.getSongGenre());
212         assertEquals(newTag.getTrackNumberOnAlbum(), tag.getTrackNumberOnAlbum());
213         ID3v1_1 copyTag = new ID3v1_1(tag);
214         assertEquals(copyTag, tag);
215     }
216 
testLyrics3v1()217     public void testLyrics3v1() {
218         Lyrics3v1 tag = new Lyrics3v1();
219         try {
220             tag.getSongTitle();
221             fail("Did not throw UnsupportedOperationException");
222         } catch (UnsupportedOperationException ex) {
223         }
224         try {
225             tag.getLeadArtist();
226             fail("Did not throw UnsupportedOperationException");
227         } catch (UnsupportedOperationException ex) {
228         }
229         try {
230             tag.getAlbumTitle();
231             fail("Did not throw UnsupportedOperationException");
232         } catch (UnsupportedOperationException ex) {
233         }
234         try {
235             tag.getYearReleased();
236             fail("Did not throw UnsupportedOperationException");
237         } catch (UnsupportedOperationException ex) {
238         }
239         try {
240             tag.getSongComment();
241             fail("Did not throw UnsupportedOperationException");
242         } catch (UnsupportedOperationException ex) {
243         }
244         try {
245             tag.getSongGenre();
246             fail("Did not throw UnsupportedOperationException");
247         } catch (UnsupportedOperationException ex) {
248         }
249         try {
250             tag.getTrackNumberOnAlbum();
251             fail("Did not throw UnsupportedOperationException");
252         } catch (UnsupportedOperationException ex) {
253         }
254         assertEquals("", tag.getSongLyric());
255         try {
256             tag.getAuthorComposer();
257             fail("Did not throw UnsupportedOperationException");
258         } catch (UnsupportedOperationException ex) {
259         }
260         tag = new Lyrics3v1();
261         try {
262             tag.setSongTitle(null);
263             fail("Did not throw UnsupportedOperationException");
264         } catch (UnsupportedOperationException ex) {
265         }
266         try {
267             tag.setLeadArtist(null);
268             fail("Did not throw UnsupportedOperationException");
269         } catch (UnsupportedOperationException ex) {
270         }
271         try {
272             tag.setAlbumTitle(null);
273             fail("Did not throw UnsupportedOperationException");
274         } catch (UnsupportedOperationException ex) {
275         }
276         try {
277             tag.setYearReleased(null);
278             fail("Did not throw UnsupportedOperationException");
279         } catch (UnsupportedOperationException ex) {
280         }
281         try {
282             tag.setSongComment(null);
283             fail("Did not throw UnsupportedOperationException");
284         } catch (UnsupportedOperationException ex) {
285         }
286         try {
287             tag.setSongGenre(null);
288             fail("Did not throw UnsupportedOperationException");
289         } catch (UnsupportedOperationException ex) {
290         }
291         try {
292             tag.setTrackNumberOnAlbum(null);
293             fail("Did not throw UnsupportedOperationException");
294         } catch (UnsupportedOperationException ex) {
295         }
296         tag.setSongLyric(songLyric);
297         try {
298             tag.setAuthorComposer(null);
299             fail("Did not throw UnsupportedOperationException");
300         } catch (UnsupportedOperationException ex) {
301         }
302         assertEquals(songLyric, tag.getSongLyric());
303 
304         // run again because it's a different case
305         tag.setSongLyric(songLyric);
306         assertEquals(songLyric, tag.getSongLyric());
307         ID3v2_4 convertTag = new ID3v2_4(tag);
308         Lyrics3v1 newTag = new Lyrics3v1(convertTag);
309         assertEquals(tag, newTag);
310         assertEquals(newTag.getSongLyric(), tag.getSongLyric());
311         Lyrics3v1 copyTag = new Lyrics3v1(tag);
312         assertEquals(copyTag, tag);
313     }
314 
testLyrics3v2()315     public void testLyrics3v2() {
316         Lyrics3v2 tag = new Lyrics3v2();
317         assertEquals("", tag.getSongTitle());
318         assertEquals("", tag.getLeadArtist());
319         assertEquals("", tag.getAlbumTitle());
320         try {
321             tag.getYearReleased();
322             fail("Did not throw UnsupportedOperationException");
323         } catch (UnsupportedOperationException ex) {
324         }
325         try {
326             tag.getSongGenre();
327             fail("Did not throw UnsupportedOperationException");
328         } catch (UnsupportedOperationException ex) {
329         }
330         try {
331             tag.getTrackNumberOnAlbum();
332             fail("Did not throw UnsupportedOperationException");
333         } catch (UnsupportedOperationException ex) {
334         }
335         assertEquals("", tag.getSongLyric());
336         assertEquals("", tag.getAuthorComposer());
337         tag = new Lyrics3v2();
338         tag.setSongTitle(songTitle);
339         tag.setLeadArtist(leadArtist);
340         tag.setAlbumTitle(albumTitle);
341         try {
342             tag.setYearReleased(null);
343             fail("Did not throw UnsupportedOperationException");
344         } catch (UnsupportedOperationException ex) {
345         }
346         tag.setSongComment(songComment);
347         try {
348             tag.setSongGenre(null);
349             fail("Did not throw UnsupportedOperationException");
350         } catch (UnsupportedOperationException ex) {
351         }
352         try {
353             tag.setTrackNumberOnAlbum(null);
354             fail("Did not throw UnsupportedOperationException");
355         } catch (UnsupportedOperationException ex) {
356         }
357         tag.setSongLyric(songLyric);
358         tag.setAuthorComposer(authorComposer);
359         assertEquals(songTitle, tag.getSongTitle());
360         assertEquals(leadArtist, tag.getLeadArtist());
361         assertEquals(albumTitle, tag.getAlbumTitle());
362         assertEquals(songComment, tag.getSongComment());
363         assertEquals(songLyric, tag.getSongLyric());
364         assertEquals(authorComposer, tag.getAuthorComposer());
365 
366         // run again because it's a different case
367         tag.setSongTitle(songTitle);
368         tag.setLeadArtist(leadArtist);
369         tag.setAlbumTitle(albumTitle);
370         tag.setSongComment(songComment);
371         tag.setSongLyric(songLyric);
372         tag.setAuthorComposer(authorComposer);
373         assertEquals(songTitle, tag.getSongTitle());
374         assertEquals(leadArtist, tag.getLeadArtist());
375         assertEquals(albumTitle, tag.getAlbumTitle());
376         assertEquals(songComment, tag.getSongComment());
377         assertEquals(songLyric, tag.getSongLyric());
378         assertEquals(authorComposer, tag.getAuthorComposer());
379         ID3v2_4 convertTag = new ID3v2_4(tag);
380         Lyrics3v2 newTag = new Lyrics3v2(convertTag);
381         assertEquals(tag, newTag);
382         assertEquals(newTag.getSongTitle(), tag.getSongTitle());
383         assertEquals(newTag.getLeadArtist(), tag.getLeadArtist());
384         assertEquals(newTag.getAlbumTitle(), tag.getAlbumTitle());
385         assertEquals(newTag.getSongComment(), tag.getSongComment());
386         assertEquals(newTag.getSongLyric(), tag.getSongLyric());
387         assertEquals(newTag.getAuthorComposer(), tag.getAuthorComposer());
388         Lyrics3v2 copyTag = new Lyrics3v2(tag);
389         assertEquals(copyTag, tag);
390     }
391 
testID3v2_2()392     public void testID3v2_2() {
393         ID3v2_2 tag = new ID3v2_2();
394         assertEquals("", tag.getSongTitle());
395         assertEquals("", tag.getLeadArtist());
396         assertEquals("", tag.getAlbumTitle());
397         assertEquals("", tag.getYearReleased());
398         assertEquals("", tag.getSongComment());
399         assertEquals("", tag.getSongGenre());
400         assertEquals("", tag.getTrackNumberOnAlbum());
401         assertEquals("", tag.getSongLyric());
402         assertEquals("", tag.getAuthorComposer());
403         tag = new ID3v2_2();
404         tag.setSongTitle(songTitle);
405         tag.setLeadArtist(leadArtist);
406         tag.setAlbumTitle(albumTitle);
407         tag.setYearReleased(yearReleased);
408         tag.setSongComment(songComment);
409         tag.setSongGenre(songGenre);
410         tag.setTrackNumberOnAlbum(trackNumberOnAlbum);
411         tag.setSongLyric(songLyric);
412         tag.setAuthorComposer(authorComposer);
413         assertEquals(songTitle, tag.getSongTitle());
414         assertEquals(leadArtist, tag.getLeadArtist());
415         assertEquals(albumTitle, tag.getAlbumTitle());
416         assertEquals(yearReleased, tag.getYearReleased());
417         assertEquals(songComment, tag.getSongComment());
418         assertEquals(songGenre, tag.getSongGenre());
419         assertEquals(trackNumberOnAlbum, tag.getTrackNumberOnAlbum());
420         assertEquals(songLyric, tag.getSongLyric());
421         assertEquals(authorComposer, tag.getAuthorComposer());
422 
423         // run again because it's a different case
424         tag.setSongTitle(songTitle);
425         tag.setLeadArtist(leadArtist);
426         tag.setAlbumTitle(albumTitle);
427         tag.setYearReleased(yearReleased);
428         tag.setSongComment(songComment);
429         tag.setSongGenre(songGenre);
430         tag.setTrackNumberOnAlbum(trackNumberOnAlbum);
431         tag.setSongLyric(songLyric);
432         tag.setAuthorComposer(authorComposer);
433         assertEquals(songTitle, tag.getSongTitle());
434         assertEquals(leadArtist, tag.getLeadArtist());
435         assertEquals(albumTitle, tag.getAlbumTitle());
436         assertEquals(yearReleased, tag.getYearReleased());
437         assertEquals(songComment, tag.getSongComment());
438         assertEquals(songGenre, tag.getSongGenre());
439         assertEquals(trackNumberOnAlbum, tag.getTrackNumberOnAlbum());
440         assertEquals(songLyric, tag.getSongLyric());
441         assertEquals(authorComposer, tag.getAuthorComposer());
442         ID3v2_4 convertTag = new ID3v2_4(tag);
443         ID3v2_2 newTag = new ID3v2_2(convertTag);
444         assertEquals(tag, newTag);
445         assertEquals(newTag.getSongTitle(), tag.getSongTitle());
446         assertEquals(newTag.getLeadArtist(), tag.getLeadArtist());
447         assertEquals(newTag.getAlbumTitle(), tag.getAlbumTitle());
448         assertEquals(newTag.getYearReleased(), tag.getYearReleased());
449         assertEquals(newTag.getSongComment(), tag.getSongComment());
450         assertEquals(newTag.getSongGenre(), tag.getSongGenre());
451         assertEquals(newTag.getTrackNumberOnAlbum(), tag.getTrackNumberOnAlbum());
452         assertEquals(newTag.getSongLyric(), tag.getSongLyric());
453         assertEquals(newTag.getAuthorComposer(), tag.getAuthorComposer());
454         ID3v2_2 copyTag = new ID3v2_2(tag);
455         assertEquals(copyTag, tag);
456     }
457 
testID3v2_3()458     public void testID3v2_3() {
459         ID3v2_3 tag = new ID3v2_3();
460         assertEquals("", tag.getSongTitle());
461         assertEquals("", tag.getLeadArtist());
462         assertEquals("", tag.getAlbumTitle());
463         assertEquals("", tag.getYearReleased());
464         assertEquals("", tag.getSongComment());
465         assertEquals("", tag.getSongGenre());
466         assertEquals("", tag.getTrackNumberOnAlbum());
467         assertEquals("", tag.getSongLyric());
468         assertEquals("", tag.getAuthorComposer());
469         tag = new ID3v2_3();
470         tag.setSongTitle(songTitle);
471         tag.setLeadArtist(leadArtist);
472         tag.setAlbumTitle(albumTitle);
473         tag.setYearReleased(yearReleased);
474         tag.setSongComment(songComment);
475         tag.setSongGenre(songGenre);
476         tag.setTrackNumberOnAlbum(trackNumberOnAlbum);
477         tag.setSongLyric(songLyric);
478         tag.setAuthorComposer(authorComposer);
479         assertEquals(songTitle, tag.getSongTitle());
480         assertEquals(leadArtist, tag.getLeadArtist());
481         assertEquals(albumTitle, tag.getAlbumTitle());
482         assertEquals(yearReleased, tag.getYearReleased());
483         assertEquals(songComment, tag.getSongComment());
484         assertEquals(songGenre, tag.getSongGenre());
485         assertEquals(trackNumberOnAlbum, tag.getTrackNumberOnAlbum());
486         assertEquals(songLyric, tag.getSongLyric());
487         assertEquals(authorComposer, tag.getAuthorComposer());
488 
489         // run again because it's a different case
490         tag.setSongTitle(songTitle);
491         tag.setLeadArtist(leadArtist);
492         tag.setAlbumTitle(albumTitle);
493         tag.setYearReleased(yearReleased);
494         tag.setSongComment(songComment);
495         tag.setSongGenre(songGenre);
496         tag.setTrackNumberOnAlbum(trackNumberOnAlbum);
497         tag.setSongLyric(songLyric);
498         tag.setAuthorComposer(authorComposer);
499         assertEquals(songTitle, tag.getSongTitle());
500         assertEquals(leadArtist, tag.getLeadArtist());
501         assertEquals(albumTitle, tag.getAlbumTitle());
502         assertEquals(yearReleased, tag.getYearReleased());
503         assertEquals(songComment, tag.getSongComment());
504         assertEquals(songGenre, tag.getSongGenre());
505         assertEquals(trackNumberOnAlbum, tag.getTrackNumberOnAlbum());
506         assertEquals(songLyric, tag.getSongLyric());
507         assertEquals(authorComposer, tag.getAuthorComposer());
508         ID3v2_4 convertTag = new ID3v2_4(tag);
509         ID3v2_3 newTag = new ID3v2_3(convertTag);
510         assertEquals(tag, newTag);
511         assertEquals(newTag.getSongTitle(), tag.getSongTitle());
512         assertEquals(newTag.getLeadArtist(), tag.getLeadArtist());
513         assertEquals(newTag.getAlbumTitle(), tag.getAlbumTitle());
514         assertEquals(newTag.getYearReleased(), tag.getYearReleased());
515         assertEquals(newTag.getSongComment(), tag.getSongComment());
516         assertEquals(newTag.getSongGenre(), tag.getSongGenre());
517         assertEquals(newTag.getTrackNumberOnAlbum(), tag.getTrackNumberOnAlbum());
518         assertEquals(newTag.getSongLyric(), tag.getSongLyric());
519         assertEquals(newTag.getAuthorComposer(), tag.getAuthorComposer());
520         ID3v2_3 copyTag = new ID3v2_3(tag);
521         assertEquals(copyTag, tag);
522     }
523 
testID3v2_4()524     public void testID3v2_4() {
525         ID3v2_4 tag = new ID3v2_4();
526         assertEquals("", tag.getSongTitle());
527         assertEquals("", tag.getLeadArtist());
528         assertEquals("", tag.getAlbumTitle());
529         assertEquals("", tag.getYearReleased());
530         assertEquals("", tag.getSongComment());
531         assertEquals("", tag.getSongGenre());
532         assertEquals("", tag.getTrackNumberOnAlbum());
533         assertEquals("", tag.getSongLyric());
534         assertEquals("", tag.getAuthorComposer());
535         tag = new ID3v2_4();
536         tag.setSongTitle(songTitle);
537         tag.setLeadArtist(leadArtist);
538         tag.setAlbumTitle(albumTitle);
539         tag.setYearReleased(yearReleased);
540         tag.setSongComment(songComment);
541         tag.setSongGenre(songGenre);
542         tag.setTrackNumberOnAlbum(trackNumberOnAlbum);
543         tag.setSongLyric(songLyric);
544         tag.setAuthorComposer(authorComposer);
545         assertEquals(songTitle, tag.getSongTitle());
546         assertEquals(leadArtist, tag.getLeadArtist());
547         assertEquals(albumTitle, tag.getAlbumTitle());
548         assertEquals(yearReleased, tag.getYearReleased());
549         assertEquals(songComment, tag.getSongComment());
550         assertEquals(songGenre, tag.getSongGenre());
551         assertEquals(trackNumberOnAlbum, tag.getTrackNumberOnAlbum());
552         assertEquals(songLyric, tag.getSongLyric());
553         assertEquals(authorComposer, tag.getAuthorComposer());
554 
555         // run again because it's a different case
556         tag.setSongTitle(songTitle);
557         tag.setLeadArtist(leadArtist);
558         tag.setAlbumTitle(albumTitle);
559         tag.setYearReleased(yearReleased);
560         tag.setSongComment(songComment);
561         tag.setSongGenre(songGenre);
562         tag.setTrackNumberOnAlbum(trackNumberOnAlbum);
563         tag.setSongLyric(songLyric);
564         tag.setAuthorComposer(authorComposer);
565         assertEquals(songTitle, tag.getSongTitle());
566         assertEquals(leadArtist, tag.getLeadArtist());
567         assertEquals(albumTitle, tag.getAlbumTitle());
568         assertEquals(yearReleased, tag.getYearReleased());
569         assertEquals(songComment, tag.getSongComment());
570         assertEquals(songGenre, tag.getSongGenre());
571         assertEquals(trackNumberOnAlbum, tag.getTrackNumberOnAlbum());
572         assertEquals(songLyric, tag.getSongLyric());
573         assertEquals(authorComposer, tag.getAuthorComposer());
574         ID3v2_4 convertTag = new ID3v2_4(tag);
575         ID3v2_4 newTag = new ID3v2_4(convertTag);
576         assertEquals(tag, newTag);
577         assertEquals(newTag.getSongTitle(), tag.getSongTitle());
578         assertEquals(newTag.getLeadArtist(), tag.getLeadArtist());
579         assertEquals(newTag.getAlbumTitle(), tag.getAlbumTitle());
580         assertEquals(newTag.getYearReleased(), tag.getYearReleased());
581         assertEquals(newTag.getSongComment(), tag.getSongComment());
582         assertEquals(newTag.getSongGenre(), tag.getSongGenre());
583         assertEquals(newTag.getTrackNumberOnAlbum(), tag.getTrackNumberOnAlbum());
584         assertEquals(newTag.getSongLyric(), tag.getSongLyric());
585         assertEquals(newTag.getAuthorComposer(), tag.getAuthorComposer());
586         ID3v2_4 copyTag = new ID3v2_4(tag);
587         assertEquals(copyTag, tag);
588     }
589 }
590