1
package org.jaudiotagger.audio.asf;
3
import junit.framework.TestCase;
4
import org.jaudiotagger.audio.asf.data.AsfHeader;
5
import org.jaudiotagger.audio.asf.tag.AsfFieldKey;
6
import org.jaudiotagger.audio.asf.tag.AsfTag;
7
import org.jaudiotagger.tag.FieldKey;
10
* This test covers some mistakes that could be made by changing the implementation.<br>
11
* For example, constants which are assigned at class loading being <code>null</code>.
13
* @author Christian Laireiter
15
public class AsfCodeCheckTest extends TestCase
19
* Tests the correct implementation of {@link AsfTag}.<br>
20
* For example if {@link AsfTag#createAlbumField(String)} returns a field whose {@link org.jaudiotagger.tag.TagField#getId()}
21
* equals {@link org.jaudiotagger.audio.asf.tag.AsfFieldKey#ALBUM}s }.
23
public void testAsfTagImpl() throws Exception
25
final AsfTag asfTag = new AsfTag();
26
assertEquals(asfTag.createField(FieldKey.ALBUM,new String()).getId(), AsfFieldKey.ALBUM.getFieldName());
27
assertEquals(asfTag.createField(FieldKey.ARTIST,new String()).getId(), AsfFieldKey.AUTHOR.getFieldName());
28
assertEquals(asfTag.createField(FieldKey.COMMENT,new String()).getId(), AsfFieldKey.DESCRIPTION.getFieldName());
29
assertEquals(asfTag.createField(FieldKey.GENRE,new String()).getId(), AsfFieldKey.GENRE.getFieldName());
30
assertEquals(asfTag.createField(FieldKey.TITLE,new String()).getId(), AsfFieldKey.TITLE.getFieldName());
31
assertEquals(asfTag.createField(FieldKey.TRACK,new String()).getId(), AsfFieldKey.TRACK.getFieldName());
32
assertEquals(asfTag.createField(FieldKey.YEAR,new String()).getId(), AsfFieldKey.YEAR.getFieldName());
36
* Tests some constants which must have values.
38
public void testConstants()
40
// UTF16-LE by specification
41
assertEquals("ONLY \"UTF-16LE\" text encoding specified", "UTF-16LE", AsfHeader.ASF_CHARSET.name()); // $NON-NLS-1$ //$NON-NLS-2$
1
package org.jaudiotagger.audio.asf;
3
import junit.framework.TestCase;
4
import org.jaudiotagger.audio.asf.data.AsfHeader;
5
import org.jaudiotagger.tag.asf.AsfFieldKey;
6
import org.jaudiotagger.tag.asf.AsfTag;
7
import org.jaudiotagger.tag.FieldKey;
10
* This test covers some mistakes that could be made by changing the implementation.<br>
11
* For example, constants which are assigned at class loading being <code>null</code>.
13
* @author Christian Laireiter
15
public class AsfCodeCheckTest extends TestCase
19
* Tests the correct implementation of {@link AsfTag}.<br>
20
* For example if {@link AsfTag#createAlbumField(String)} returns a field whose {@link org.jaudiotagger.tag.TagField#getId()}
21
* equals {@link org.jaudiotagger.tag.asf.AsfFieldKey#ALBUM}s }.
23
public void testAsfTagImpl() throws Exception
25
final AsfTag asfTag = new AsfTag();
26
assertEquals(asfTag.createField(FieldKey.ALBUM,new String()).getId(), AsfFieldKey.ALBUM.getFieldName());
27
assertEquals(asfTag.createField(FieldKey.ARTIST,new String()).getId(), AsfFieldKey.AUTHOR.getFieldName());
28
assertEquals(asfTag.createField(FieldKey.COMMENT,new String()).getId(), AsfFieldKey.DESCRIPTION.getFieldName());
29
assertEquals(asfTag.createField(FieldKey.GENRE,new String()).getId(), AsfFieldKey.GENRE.getFieldName());
30
assertEquals(asfTag.createField(FieldKey.TITLE,new String()).getId(), AsfFieldKey.TITLE.getFieldName());
31
assertEquals(asfTag.createField(FieldKey.TRACK,new String()).getId(), AsfFieldKey.TRACK.getFieldName());
32
assertEquals(asfTag.createField(FieldKey.YEAR,new String()).getId(), AsfFieldKey.YEAR.getFieldName());
36
* Tests some constants which must have values.
38
public void testConstants()
40
// UTF16-LE by specification
41
assertEquals("ONLY \"UTF-16LE\" text encoding specified", "UTF-16LE", AsfHeader.ASF_CHARSET.name()); // $NON-NLS-1$ //$NON-NLS-2$