Package com.pugh.sockso.music

Examples of com.pugh.sockso.music.Album


        final Downloader d = new Downloader();
       
        d.setProperties( p );
       
        final Artist artist = TestUtils.getArtist();
        final Album album = TestUtils.getAlbum(artist);
        final Genre genre = TestUtils.getGenre();
        final Track track = new Track.Builder()
                .artist( artist )
                .album( album )
                .genre( genre )
                .id(3)
                .name("track")
                .number(4)
                .path("")
                .dateAdded(new Date())
                .build();

        final String path = d.getTrackZipPath( track );
       
        assertTrue( path.contains(artist.getName()) );
        assertTrue( path.contains(album.getName()) );
        assertTrue( path.contains(track.getName()) );
        assertTrue( path.contains("04") ); // tens should be padded
       
    }
View Full Code Here


    private Track getTrack( final String artistName, final String albumName, final String albumYear ) {
        final Artist artist = new Artist.Builder()
                .id(1)
                .name(artistName)
                .build();
        final Album album = new Album.Builder()
                .artist(artist)
                .id(1)
                .name(albumName)
                .year(albumYear)
                .build();
View Full Code Here

            rs = st.executeQuery();

            node.removeAllChildren();

            while ( rs.next() ) {
                final Album album = new Album.Builder()
                        .artist(artist)
                        .id(rs.getInt("id"))
                        .name(rs.getString("name"))
                        .year(rs.getString("year"))
                        .build();
View Full Code Here

                Artist artist = (Artist) item;
                sql = Track.getSelectFromSql() +
                        " where t.artist_id = '" + artist.getId() + "' ";
            }
            else if ( type.equals(MusicItem.ALBUM) ) {
                Album album = (Album) item;
                sql = Track.getSelectFromSql() +
                        " where t.album_id = '" + album.getId() + "' ";
            }
            else if ( type.equals(MusicItem.TRACK) ) {
                Track track = (Track) item;
                sql = Track.getSelectFromSql() +
                        " where t.id = '" + track.getId() + "' ";
View Full Code Here

     */
   
    public void handleRequest() throws SQLException, BadRequestException, IOException {
       
        final int albumId = Integer.parseInt( getRequest().getUrlParam(2) );
        final Album album = Album.find( getDatabase(), albumId );
       
        if ( album == null ) {
            throw new BadRequestException( "Invalid album id" );
        }
       
View Full Code Here

     *
     */
   
    public void handleRequest() throws BadRequestException, IOException, SQLException {

        final Album album = Album.find(
            getDatabase(),
            Integer.parseInt(getRequest().getUrlParam(2))
        );
       
        if ( album == null ) {
View Full Code Here

        final List<Track> tracks = new ArrayList<Track>();
        final List<Artist> artists = new ArrayList<Artist>();
        final List<Album> albums = new ArrayList<Album>();

        final Artist artist = TestUtils.getArtist();
        final Album album = TestUtils.getAlbum(artist);
        final Genre genre = TestUtils.getGenre();
        final Track track = TestUtils.getTrack(artist, album, genre);

        tracks.add( track );
        artists.add( artist );
View Full Code Here

    @Override
    public void handleRequest() throws IOException, SQLException, BadRequestException {
       
        final Request req = getRequest();
        final int id = Integer.parseInt( req.getUrlParam(2)  );
        final Album album = getAlbum ( id );
        final List<Track> tracks = getAlbumTracks( id );
       
        showAlbum( album, tracks );
       
    }
View Full Code Here

        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final Albumer b = new Albumer();
        b.setDatabase( db );
        final Album album = b.getAlbum( 123 );
       
        assertNotNull( album );
       
        verify( db );
        verify( st );
View Full Code Here

        final TestResponse res = new TestResponse();
        final Albumer b = new Albumer();
        final List<Track> tracks = new ArrayList<Track>();

        final Artist artist = TestUtils.getArtist();
        final Album album = TestUtils.getAlbum(artist);
        final Genre genre = TestUtils.getGenre();
        final Track track = TestUtils.getTrack(artist, album, genre);
       
        tracks.add( track );
       
        b.setResponse( res );
        b.showAlbum( album, tracks );
       
        final String data = res.getOutput();

        assertTrue( data.contains(artist.getName()) );
        assertTrue( data.contains(album.getName()) );
        assertTrue( data.contains(track.getName()) );
       
    }
View Full Code Here

TOP

Related Classes of com.pugh.sockso.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.