Package com.pugh.sockso.music

Examples of com.pugh.sockso.music.Artist


    @Override
    public void handleRequest() throws IOException, SQLException, BadRequestException {
       
        final Request req = getRequest();
        final int id = Integer.parseInt( req.getUrlParam(2)  );
        final Artist artist = getArtist( id );
        final List<Album> albums = getArtistAlbums( id );
       
        showArtist( artist, albums );
       
    }
View Full Code Here


            rs = st.executeQuery();

            final List<Album> albums = new ArrayList<Album>();
           
            while ( rs.next() ) {
                final Artist artist = new Artist.Builder()
                        .id(rs.getInt("artistId"))
                        .name(rs.getString("artistName"))
                        .build();
                albums.add(
                    new Album.Builder()
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

    public void testShowByLetter() throws Exception {
       
        final TestResponse res = new TestResponse();
        final ByLetterer b = new ByLetterer();
        final List<Artist> artists = new ArrayList<Artist>();
        final Artist artist = new Artist.Builder().id(1).name("my artist").build();
        final String letter = "G";

        artists.add( artist );
       
        b.setResponse( res );
        b.showByLetter( letter, artists );
       
        final String data = res.getOutput();

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

        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final Artister b = new Artister();
        b.setDatabase( db );
        final Artist artist = b.getArtist( 123 );
       
        assertNotNull( artist );
       
        verify( db );
        verify( st );
View Full Code Here

    public void testShowArtist() throws Exception {
       
        final TestResponse res = new TestResponse();
        final Artister b = new Artister();
        final List<Album> albums = new ArrayList<Album>();
        final Artist artist = TestUtils.getArtist();
        final Album album = TestUtils.getAlbum(artist);

        albums.add( album );
       
        b.setResponse( res );
        b.showArtist( artist, albums );
       
        final String data = res.getOutput();

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

        final List<Artist> topArtists = new ArrayList<Artist>();
        final List<Album> recentlyPlayedAlbums = new ArrayList<Album>();
        final TestResponse res = new TestResponse( db );
        final Homer h = new Homer();

        final Artist artist = TestUtils.getArtist();
        final Album album = TestUtils.getAlbum(artist);
        final Genre genre = TestUtils.getGenre();
        final Track track = TestUtils.getTrack(artist, album, genre);
       
        recentlyPlayedTracks.add( track );
        recentlyPlayedAlbums.add( album );
        topArtists.add( artist );
       
        h.setResponse( res );
        h.showMain( recentlyPlayedTracks, topArtists, recentlyPlayedAlbums );
       
        final String data = res.getOutput();
       
        assertTrue( data.contains(track.getName()) );
        assertTrue( data.contains(artist.getName()) );
       
    }
View Full Code Here

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

        final Artist artist = new Artist.Builder().id(1).name("my artist").build();
        Track track = new Track.Builder()
                .artist(artist)
                .album(null)
                .genre(null)
                .id(1)
                .name("my track")
                .number(1)
                .path("")
                .dateAdded(null)
                .build();
        tracks.add( track );
       
        b.setResponse( res );
        b.showPopularTracks( tracks );
       
        final String data = res.getOutput();

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

       
        final TestResponse res = new TestResponse();
        final Userer u = new Userer();
        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 );
       
        u.setResponse( res );
        u.showScrobbleLog( tracks );
       
        final String data = res.getOutput();

        // http headers
        assertTrue( data.contains("Content-Disposition") );
        assertTrue( data.contains(".scrobbler.log") );
       
        // file headers
        assertTrue( data.contains("#AUDIOSCROBBLER/1.1") );
        assertTrue( data.contains("#TZ") );
        assertTrue( data.contains("#CLIENT") );
       
        // track info
        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.Artist

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.