Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mpatric/mp3agic
base: 666bcd026e
...
head fork: mpatric/mp3agic
compare: eee04d5014
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
View
55 src/test/java/com/mpatric/mp3agic/Mp3FileTest.java
@@ -98,6 +98,61 @@ public void testShouldInitialiseProperlyWhenNotScanningFile() throws Exception {
assertTrue(mp3File.hasId3v2Tag());
}
+ public void testShouldRemoveId3v1Tag() throws Exception {
+ String filename = MP3_WITH_ID3V1_AND_ID3V23_AND_CUSTOM_TAGS;
+ String saveFilename = filename + ".copy";
+ try {
+ Mp3File mp3File = new Mp3File(filename);
+ assertEquals(6, mp3File.getFrameCount());
+ assertTrue(mp3File.hasId3v1Tag());
+ assertTrue(mp3File.hasId3v2Tag());
+ mp3File.setId3v1Tag(null);
+ mp3File.save(saveFilename);
+ Mp3File newMp3File = new Mp3File(saveFilename);
+ assertFalse(newMp3File.hasId3v1Tag());
+ assertTrue(newMp3File.hasId3v2Tag());
+ } finally {
+ deleteFile(saveFilename);
+ }
+ }
+
+ public void testShouldRemoveId3v2Tag() throws Exception {
+ String filename = MP3_WITH_ID3V1_AND_ID3V23_AND_CUSTOM_TAGS;
+ String saveFilename = filename + ".copy";
+ try {
+ Mp3File mp3File = new Mp3File(filename);
+ assertEquals(6, mp3File.getFrameCount());
+ assertTrue(mp3File.hasId3v1Tag());
+ assertTrue(mp3File.hasId3v2Tag());
+ mp3File.setId3v2Tag(null);
+ mp3File.save(saveFilename);
+ Mp3File newMp3File = new Mp3File(saveFilename);
+ assertTrue(newMp3File.hasId3v1Tag());
+ assertFalse(newMp3File.hasId3v2Tag());
+ } finally {
+ deleteFile(saveFilename);
+ }
+ }
+
+ public void testShouldRemoveId3v1AndId3v2Tags() throws Exception {
+ String filename = MP3_WITH_ID3V1_AND_ID3V23_AND_CUSTOM_TAGS;
+ String saveFilename = filename + ".copy";
+ try {
+ Mp3File mp3File = new Mp3File(filename);
+ assertEquals(6, mp3File.getFrameCount());
+ assertTrue(mp3File.hasId3v1Tag());
+ assertTrue(mp3File.hasId3v2Tag());
+ mp3File.setId3v1Tag(null);
+ mp3File.setId3v2Tag(null);
+ mp3File.save(saveFilename);
+ Mp3File newMp3File = new Mp3File(saveFilename);
+ assertFalse(newMp3File.hasId3v1Tag());
+ assertFalse(newMp3File.hasId3v2Tag());
+ } finally {
+ deleteFile(saveFilename);
+ }
+ }
+
private Mp3File copyAndCheckTestMp3WithCustomTag(String filename, int bufferLength) throws IOException, UnsupportedTagException, InvalidDataException, NotSupportedException {
String saveFilename = null;
try {
View
2  src/test/java/com/mpatric/mp3agic/app/Mp3CatalogTest.java
@@ -4,8 +4,6 @@
import junit.framework.TestCase;
-import java.lang.System;
-
public class Mp3CatalogTest extends TestCase {
private static final String INVALID_FILENAME = "InvalidFile.mp3";

No commit comments for this range

Something went wrong with that request. Please try again.