public void testSetFrameAcrossTags() throws Exception {
MP3File mp3file = new MP3File();
String testString = "Test String";
AbstractID3v2Frame frame;
AbstractID3v2FrameBody frameBody;
frameBody = new FrameBodyTALB((byte) 0, testString);
frame = new ID3v2_4Frame(frameBody);
// nulls
mp3file.setFrameAcrossTags(null);
mp3file.setID3v1Tag(null);
mp3file.setID3v2Tag(null);
mp3file.setLyrics3Tag(null);
mp3file.setFilenameTag(null);
mp3file.setFrameAcrossTags(frame);
assertNull(mp3file.getID3v1Tag());
assertNull(mp3file.getID3v2Tag());
assertNull(mp3file.getLyrics3Tag());
assertNull(mp3file.getFilenameTag());
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(null);
mp3file.setLyrics3Tag(null);
mp3file.setFilenameTag(null);
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getAlbum().equals(testString);
assertNull(mp3file.getID3v2Tag());
assertNull(mp3file.getLyrics3Tag());
assertNull(mp3file.getFilenameTag());
mp3file.setID3v1Tag(null);
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(null);
mp3file.setFilenameTag(null);
mp3file.setFrameAcrossTags(frame);
assertNull(mp3file.getID3v1Tag());
((FrameBodyTALB) mp3file.getID3v2Tag().getFrame("TALB").getBody()).getText().equals(testString);
assertNull(mp3file.getLyrics3Tag());
assertNull(mp3file.getFilenameTag());
mp3file.setID3v1Tag(null);
mp3file.setID3v2Tag(null);
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(null);
mp3file.setFrameAcrossTags(frame);
assertNull(mp3file.getID3v1Tag());
assertNull(mp3file.getID3v2Tag());
((FieldBodyEAL) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("EAL").getBody()).getAlbum().equals(testString);
assertNull(mp3file.getFilenameTag());
mp3file.setID3v1Tag(null);
mp3file.setID3v2Tag(null);
mp3file.setLyrics3Tag(null);
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
mp3file.setFrameAcrossTags(frame);
assertNull(mp3file.getID3v1Tag());
assertNull(mp3file.getID3v2Tag());
assertNull(mp3file.getLyrics3Tag());
((FrameBodyTALB) mp3file.getFilenameTag().getFrame("TALB").getBody()).getText().equals(testString);
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(null);
mp3file.setFilenameTag(null);
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getAlbum().equals(testString);
((FrameBodyTALB) mp3file.getID3v2Tag().getFrame("TALB").getBody()).getText().equals(testString);
assertNull(mp3file.getLyrics3Tag());
assertNull(mp3file.getFilenameTag());
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(null);
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(null);
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getAlbum().equals(testString);
assertNull(mp3file.getID3v2Tag());
((FieldBodyEAL) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("EAL").getBody()).getAlbum().equals(testString);
assertNull(mp3file.getFilenameTag());
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(null);
mp3file.setLyrics3Tag(null);
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getAlbum().equals(testString);
assertNull(mp3file.getID3v2Tag());
assertNull(mp3file.getLyrics3Tag());
((FrameBodyTALB) mp3file.getFilenameTag().getFrame("TALB").getBody()).getText().equals(testString);
mp3file.setID3v1Tag(null);
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(null);
mp3file.setFrameAcrossTags(frame);
assertNull(mp3file.getID3v1Tag());
((FrameBodyTALB) mp3file.getID3v2Tag().getFrame("TALB").getBody()).getText().equals(testString);
((FieldBodyEAL) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("EAL").getBody()).getAlbum().equals(testString);
assertNull(mp3file.getFilenameTag());
mp3file.setID3v1Tag(null);
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(null);
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
mp3file.setFrameAcrossTags(frame);
assertNull(mp3file.getID3v1Tag());
((FrameBodyTALB) mp3file.getID3v2Tag().getFrame("TALB").getBody()).getText().equals(testString);
assertNull(mp3file.getLyrics3Tag());
((FrameBodyTALB) mp3file.getFilenameTag().getFrame("TALB").getBody()).getText().equals(testString);
mp3file.setID3v1Tag(null);
mp3file.setID3v2Tag(null);
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
mp3file.setFrameAcrossTags(frame);
assertNull(mp3file.getID3v1Tag());
assertNull(mp3file.getID3v2Tag());
((FieldBodyEAL) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("EAL").getBody()).getAlbum().equals(testString);
((FrameBodyTALB) mp3file.getFilenameTag().getFrame("TALB").getBody()).getText().equals(testString);
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(null);
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getAlbum().equals(testString);
((FrameBodyTALB) mp3file.getID3v2Tag().getFrame("TALB").getBody()).getText().equals(testString);
((FieldBodyEAL) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("EAL").getBody()).getAlbum().equals(testString);
assertNull(mp3file.getFilenameTag());
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(null);
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getAlbum().equals(testString);
((FrameBodyTALB) mp3file.getID3v2Tag().getFrame("TALB").getBody()).getText().equals(testString);
assertNull(mp3file.getLyrics3Tag());
((FrameBodyTALB) mp3file.getFilenameTag().getFrame("TALB").getBody()).getText().equals(testString);
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(null);
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getAlbum().equals(testString);
assertNull(mp3file.getID3v2Tag());
((FieldBodyEAL) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("EAL").getBody()).getAlbum().equals(testString);
((FrameBodyTALB) mp3file.getFilenameTag().getFrame("TALB").getBody()).getText().equals(testString);
mp3file.setID3v1Tag(null);
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
mp3file.setFrameAcrossTags(frame);
assertNull(mp3file.getID3v1Tag());
((FrameBodyTALB) mp3file.getID3v2Tag().getFrame("TALB").getBody()).getText().equals(testString);
((FieldBodyEAL) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("EAL").getBody()).getAlbum().equals(testString);
((FrameBodyTALB) mp3file.getFilenameTag().getFrame("TALB").getBody()).getText().equals(testString);
// test all
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
frameBody = new FrameBodyTIT2();
((FrameBodyTIT2) frameBody).setText(testString);
frame.setBody(frameBody);
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getTitle().equals(testString);
((FrameBodyTIT2) mp3file.getID3v2Tag().getFrame("TIT2").getBody()).getText().equals(testString);
((FieldBodyETT) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("ETT").getBody()).getTitle().equals(testString);
((FrameBodyTIT2) mp3file.getFilenameTag().getFrame("TIT2").getBody()).getText().equals(testString);
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
frameBody = new FrameBodyTPE1();
((FrameBodyTPE1) frameBody).setText(testString);
frame.setBody(frameBody);
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getArtist().equals(testString);
((FrameBodyTPE1) mp3file.getID3v2Tag().getFrame("TPE1").getBody()).getText().equals(testString);
((FieldBodyEAR) ((Lyrics3v2) mp3file.getLyrics3Tag()).getField("EAR").getBody()).getArtist().equals(testString);
((FrameBodyTPE1) mp3file.getFilenameTag().getFrame("TPE1").getBody()).getText().equals(testString);
mp3file.setID3v1Tag(new ID3v1_1());
mp3file.setID3v2Tag(new ID3v2_4());
mp3file.setLyrics3Tag(new Lyrics3v2());
mp3file.setFilenameTag(FilenameTagBuilder.createEmptyFilenameTag());
frameBody = new FrameBodyTALB();
((FrameBodyTALB) frameBody).setText(testString);
frame.setBody(frameBody);
mp3file.setFrameAcrossTags(frame);
mp3file.getID3v1Tag().getAlbum().equals(testString);
((FrameBodyTALB) mp3file.getID3v2Tag().getFrame("TALB").getBody()).getText().equals(testString);