Package com.github.hakko.musiccabinet.domain.model.music

Examples of com.github.hakko.musiccabinet.domain.model.music.Album


      @Override
      protected WebserviceHistoryService getHistoryService() {
        return Mockito.mock(WebserviceHistoryService.class);
      }

    }.getAlbumInfo(new Album(artistName, albumName));
  }
View Full Code Here


    List<Album> albums = browserService.getAlbums(beatlesId, true);
    assertAlbums(albums, theBeatles, "1967-1970");
   
    int albumId = albums.get(0).getId();
    Album album = browserService.getAlbum(albumId);

    assertAlbums(Arrays.asList(album), theBeatles, "1967-1970");
  }
View Full Code Here

    scannerService.add(set(media3));
    List<Album> albums = browserService.getAlbums(artistId, true);
   
    assertAlbums(albums, artist, "Embedded artwork", "Folder artwork");

    Album folderArtAlbum = getAlbum(albums, "Folder artwork");
    Album embeddedArtAlbum = getAlbum(albums, "Embedded artwork");
   
    Assert.assertTrue(embeddedArtAlbum.getCoverArtPath() != null);
    Assert.assertTrue(embeddedArtAlbum.isCoverArtEmbedded());
    Assert.assertTrue(embeddedArtAlbum.getCoverArtURL() == null);

    Assert.assertTrue(folderArtAlbum.getCoverArtPath() != null);
    Assert.assertFalse(folderArtAlbum.isCoverArtEmbedded());
    Assert.assertTrue(folderArtAlbum.getCoverArtURL() == null);
   
    Assert.assertTrue(embeddedArtAlbum.getCoverArtPath().endsWith(
        "Embedded artwork.mp3"));
    Assert.assertTrue(folderArtAlbum.getCoverArtPath().endsWith(
        "folder.png"));
  }
View Full Code Here

   
    Artist artist = new Artist("The Beatles");
    int artistId = musicDao.getArtistId(artist);
   
    List<Album> albums = browserService.getAlbums(artistId, true);
    Album redAlbum = getAlbum(albums, "1962-1966");
   
    List<Track> tracks = browserService.getTracks(redAlbum.getTrackIds());
    List<Track> expectedTracks = new ArrayList<>();
    for (String title : asList("Love Me Do", "Please Please Me", "From Me To You",
        "She Loves You", "Help!")) {
      expectedTracks.add(new Track("The Beatles", title));
    }
View Full Code Here

    int artistId = musicDao.getArtistId(artist);
   
    List<Album> albums = browserService.getAlbums(artistId, true);
    assertAlbums(albums, artist, "Music From Searching For Wrong-Eyed Jesus");
   
    Album album = albums.get(0);
    List<Track> tracks = browserService.getTracks(album.getTrackIds());
    List<Track> expectedTracks = asList(new Track("Harry Crews", "Everything Was Stories"),
        new Track("Jim White", "Still Waters"),
        new Track("The Handsome Family", "My Sister's Tiny Hands"));
    assertTracks(tracks, expectedTracks);
  }
View Full Code Here

    Assert.assertEquals(albumNames.length, albums.size());
    for (Album album : albums) {
      album.setArtist(artist); // not returned by db
    }
    for (String albumName : albumNames) {
      Assert.assertTrue(albums.contains(new Album(artist, albumName)));
    }
  }
View Full Code Here

    int cd1Id = browserService.getRootDirectories().iterator().next().getId();
   
    List<Album> albums = browserService.getAlbums(cd1Id, true, true);
   
    Assert.assertEquals(1, albums.size());
    Album album = albums.get(0);
   
    Assert.assertEquals("The Beatles", album.getArtist().getName());
    Assert.assertEquals("1962-1966", album.getName());
    Assert.assertEquals(4, album.getTrackIds().size());
  }
View Full Code Here

  throws SAXException {
    if (parsing) {
      String chars = characterData.toString();
      if (TAG_NAME.equals(qName)) {
        albumInfo = new AlbumInfo();
        albumInfo.setAlbum(new Album(chars));
      } else if (TAG_ARTIST.equals(qName)) {
        albumInfo.getAlbum().setArtist(new Artist(chars));
      } else if (TAG_IMAGE.equals(qName)) {
        if (ATTR_SMALL.equals(imageSize)) {
          albumInfo.setSmallImageUrl(validateUrl(chars));
View Full Code Here

  public Album mapRow(ResultSet rs, int rowNum) throws SQLException {
    int artistId = rs.getInt(1);
    String artistName = rs.getString(2);
    int albumId = rs.getInt(3);
    String albumName = rs.getString(4);
    return new Album(new Artist(artistId, artistName), albumId, albumName);
  }
View Full Code Here

    if (!coverArtEmbedded) {
      coverArtFile = getFileName(rs.getString(8), rs.getString(9));
    }
    String coverArtURL = rs.getString(10);
    List<Integer> trackIds = asList((Integer[]) rs.getArray(11).getArray());
    return new Album(artistId, artistName, albumId, albumName, year, coverArtFile,
        coverArtEmbedded, coverArtURL, trackIds);
  }
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.domain.model.music.Album

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.