Package org.socialmusicdiscovery.server.plugins.mediaimport

Examples of org.socialmusicdiscovery.server.plugins.mediaimport.TrackData


    }

    @Test
    public void testSimplev2() throws IOException {
        String filename = BaseTestCase.getTestResourceDiretory() + "org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile1v2.mp3";
        TrackData data = new Mp3TagReader(null).getTrackData(new File(filename));
        assert data != null;
        assert data.getFile().equals(filename);
        assert data.getUrl().startsWith("file:/");
        assert data.getUrl().endsWith("testfile1v2.mp3");
        assert data.getFormat().equals("mp3");
        assert data.getSmdID().equals("ab2dbe29c46c1668b89cf4bd17e34a59-000004e4");
        assert data.getTags() != null;
        assert data.getTags().size() == 8;
        boolean foundAlbumArtist = false;
        boolean foundArtist = false;
        for (TagData tagData : data.getTags()) {
            if (tagData.getName().equals("ARTIST") && tagData.getValue().equals("EPMD")) {
                foundArtist = true;
            } else if (tagData.getName().equals("BAND") && tagData.getValue().equals("Kenny \"Dope\" Gonzalez")) {
                foundAlbumArtist = true;
            }
View Full Code Here


    }

    @Test
    public void testMultipleCustomTagsv2() throws IOException {
        String filename = BaseTestCase.getTestResourceDiretory() + "org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile2v2.mp3";
        TrackData data = new Mp3TagReader(null).getTrackData(new File(filename));
        assert data != null;
        assert data.getFile().equals(filename);
        assert data.getUrl().startsWith("file:/");
        assert data.getUrl().endsWith("testfile2v2.mp3");
        assert data.getFormat().equals("mp3");
        assert data.getSmdID().equals("b3ee93a0e9c037d22a2220d994f8a1a4-000004e4");
        assert data.getTags() != null;
        assert data.getTags().size() == 9;
        boolean foundAlbumArtist = false;
        boolean foundArtist = false;
        int foundStyle = 0;
        for (TagData tagData : data.getTags()) {
            if (tagData.getName().equals("ARTIST")) {
                foundArtist = true;
            } else if (tagData.getName().equals("BAND") && tagData.getValue().equals("Model 500")) {
                foundAlbumArtist = true;
            } else if (tagData.getName().equals("STYLE") && tagData.getValue().equals("Techno")) {
View Full Code Here

    }

    @Test
    public void testMultipleSeparatedCustomTagsv2() throws IOException {
        String filename = BaseTestCase.getTestResourceDiretory() + "org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile2v2separated.mp3";
        TrackData data = new Mp3TagReader(";").getTrackData(new File(filename));
        assert data != null;
        assert data.getFile().equals(filename);
        assert data.getUrl().startsWith("file:/");
        assert data.getUrl().endsWith("testfile2v2separated.mp3");
        assert data.getFormat().equals("mp3");
        assert data.getSmdID().equals("b3ee93a0e9c037d22a2220d994f8a1a4-000004e4");
        assert data.getTags() != null;
        assert data.getTags().size() == 9;
        boolean foundAlbumArtist = false;
        boolean foundArtist = false;
        int foundStyle = 0;
        for (TagData tagData : data.getTags()) {
            if (tagData.getName().equals("ARTIST")) {
                foundArtist = true;
            } else if (tagData.getName().equals("BAND") && tagData.getValue().equals("Model 500")) {
                foundAlbumArtist = true;
            } else if (tagData.getName().equals("STYLE") && tagData.getValue().equals("Techno")) {
View Full Code Here

    }

    @Test
    public void testMp3SortTags() throws IOException {
        String filename = BaseTestCase.getTestResourceDiretory() + "org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile1v2withsort.mp3";
        TrackData data = new Mp3TagReader(null).getTrackData(new File(filename));
        assert data != null;
        assert data.getFile().equals(filename);
        assert data.getUrl().startsWith("file:/");
        assert data.getUrl().endsWith("testfile1v2withsort.mp3");
        assert data.getFormat().equals("mp3");
        assert data.getSmdID().equals("ab2dbe29c46c1668b89cf4bd17e34a59-000004e4");
        assert data.getTags() != null;
        assert data.getTags().size() == 10;
        boolean foundAlbumArtist = false;
        boolean foundArtist = false;
        boolean foundPerformer = false;
        boolean foundConductor = false;
        boolean foundComposer = false;
        boolean foundSong = false;
        boolean foundGenre = false;
        boolean foundAlbum = false;
        for (TagData tagData : data.getTags()) {
            if (tagData.getName().equals("ARTIST") && tagData.getValue().equals("The Artist") && tagData.getSortValue().equals("Artist, The")) {
                foundArtist = true;
            } else if (tagData.getName().equals("BAND") && tagData.getValue().equals("The Album Artist") && tagData.getSortValue().equals("Album Artist, The")) {
                foundAlbumArtist = true;
            } else if (tagData.getName().equals("PERFORMER") && tagData.getValue().equals("The Performer") && tagData.getSortValue().equals("Performer, The")) {
View Full Code Here

    }
    }

    @Test
    public void testScanFileFlac() throws IOException {
        TrackData trackData = fileSystem.scanFile(new File(BaseTestCase.getTestResourceDiretory() + "/org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile1.flac"));
        assert trackData != null;
    }
View Full Code Here

        assert trackData != null;
    }

    @Test
    public void testScanFileMp3() throws IOException {
        TrackData trackData = fileSystem.scanFile(new File(BaseTestCase.getTestResourceDiretory() + "/org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile1.mp3"));
        assert trackData != null;
    }
View Full Code Here

public class FlacTagReaderTest {
    @Test
    public void testFlacSimpleFlac() throws IOException {
        String filename = BaseTestCase.getTestResourceDiretory() + "org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile1.flac";
        TrackData data = new FlacTagReader(null).getTrackData(new File(filename));
        assert data != null;
        assert data.getFile().equals(filename);
        assert data.getUrl().startsWith("file:/");
        assert data.getUrl().endsWith("testfile1.flac");
        assert data.getFormat().equals("flc");
        assert data.getSmdID().equals("fa05a51e838417f9ba57185973fd3ff8-000000d3");
        assert data.getTags() != null;
        assert data.getTags().size() == 8;
        boolean foundAlbumArtist = false;
        boolean foundArtist = false;
        for (TagData tagData : data.getTags()) {
            if (tagData.getName().equals("ARTIST") && tagData.getValue().equals("EPMD")) {
                foundArtist = true;
            } else if (tagData.getName().equals("ALBUMARTIST") && tagData.getValue().equals("Kenny \"Dope\" Gonzalez")) {
                foundAlbumArtist = true;
            }
View Full Code Here

    }

    @Test
    public void testFlacMultipleCustomTags() throws IOException {
        String filename = BaseTestCase.getTestResourceDiretory() + "org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile2.flac";
        TrackData data = new FlacTagReader(null).getTrackData(new File(filename));
        assert data != null;
        assert data.getFile().equals(filename);
        assert data.getUrl().startsWith("file:/");
        assert data.getUrl().endsWith("testfile2.flac");
        assert data.getFormat().equals("flc");
        assert data.getSmdID().equals("e8143bb472c39b208a1b8ccb5b6666ad-000000d3");
        assert data.getTags() != null;
        assert data.getTags().size() == 9;
        boolean foundAlbumArtist = false;
        boolean foundArtist = false;
        int foundStyle = 0;
        for (TagData tagData : data.getTags()) {
            if (tagData.getName().equals("ARTIST")) {
                foundArtist = true;
            } else if (tagData.getName().equals("ALBUMARTIST") && tagData.getValue().equals("Model 500")) {
                foundAlbumArtist = true;
            } else if (tagData.getName().equals("STYLE") && tagData.getValue().equals("Techno")) {
View Full Code Here

    }

    @Test
    public void testFlacMultipleSeparatedCustomTags() throws IOException {
        String filename = BaseTestCase.getTestResourceDiretory() + "org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile2separated.flac";
        TrackData data = new FlacTagReader(";").getTrackData(new File(filename));
        assert data != null;
        assert data.getFile().equals(filename);
        assert data.getUrl().startsWith("file:/");
        assert data.getUrl().endsWith("testfile2separated.flac");
        assert data.getFormat().equals("flc");
        assert data.getSmdID().equals("e8143bb472c39b208a1b8ccb5b6666ad-000000d3");
        assert data.getTags() != null;
        assert data.getTags().size() == 9;
        boolean foundAlbumArtist = false;
        boolean foundArtist = false;
        int foundStyle = 0;
        for (TagData tagData : data.getTags()) {
            if (tagData.getName().equals("ARTIST")) {
                foundArtist = true;
            } else if (tagData.getName().equals("ALBUMARTIST") && tagData.getValue().equals("Model 500")) {
                foundAlbumArtist = true;
            } else if (tagData.getName().equals("STYLE") && tagData.getValue().equals("Techno")) {
View Full Code Here

    }

    @Test
    public void testFlacSortTags() throws IOException {
        String filename = BaseTestCase.getTestResourceDiretory() + "org/socialmusicdiscovery/server/plugins/mediaimport/filesystem/testfile1withsort.flac";
        TrackData data = new FlacTagReader(null).getTrackData(new File(filename));
        assert data != null;
        assert data.getFile().equals(filename);
        assert data.getUrl().startsWith("file:/");
        assert data.getUrl().endsWith("testfile1withsort.flac");
        assert data.getFormat().equals("flc");
        assert data.getSmdID().equals("fa05a51e838417f9ba57185973fd3ff8-000000d3");
        assert data.getTags() != null;
        assert data.getTags().size() == 10;
        boolean foundAlbumArtist = false;
        boolean foundArtist = false;
        boolean foundPerformer = false;
        boolean foundConductor = false;
        boolean foundComposer = false;
        boolean foundSong = false;
        boolean foundGenre = false;
        boolean foundAlbum = false;
        for (TagData tagData : data.getTags()) {
            if (tagData.getName().equals("ARTIST") && tagData.getValue().equals("The Artist") && tagData.getSortValue().equals("Artist, The")) {
                foundArtist = true;
            } else if (tagData.getName().equals("ALBUMARTIST") && tagData.getValue().equals("The Album Artist") && tagData.getSortValue().equals("Album Artist, The")) {
                foundAlbumArtist = true;
            } else if (tagData.getName().equals("PERFORMER") && tagData.getValue().equals("The Performer") && tagData.getSortValue().equals("Performer, The")) {
View Full Code Here

TOP

Related Classes of org.socialmusicdiscovery.server.plugins.mediaimport.TrackData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.