Package com.pugh.sockso.tests

Examples of com.pugh.sockso.tests.TestResponse


       
    }
   
    public void testShowXspfPlayer() throws Exception {
       
        final TestResponse res = new TestResponse();
        final Player player = new Player();
        final String extraArgs = "foo=bar";
        final String[] playArgs = new String[] {};
        final TXspfPlayer tpl = new TXspfPlayer();
       
        player.setProperties( new StringProperties() );
        player.setResponse( res );
        player.showXspfPlayer( tpl, extraArgs, playArgs );
       
        final String data = res.getOutput();
       
        assertTrue( data.length() > 0 );
       
    }
View Full Code Here


       
    }
   
    public void testShowXspfPlayerFlex() throws Exception {
       
        final TestResponse res = new TestResponse();
        final Player player = new Player();
        final String extraArgs = "foo=bar";
        final String[] playArgs = new String[] {};
        final TFlexPlayer tpl = new TFlexPlayer();
       
        player.setProperties( new StringProperties() );
        player.setResponse( res );
        player.showXspfPlayer( tpl, extraArgs, playArgs );
       
        final String data = res.getOutput();
       
        assertTrue( data.length() > 0 );
       
    }
View Full Code Here

       
    }

    public void testShowHtml5Player() throws Exception {
       
        final TestResponse res = new TestResponse();
        final Player player = new Player();
       
        player.setProperties( new StringProperties() );
        player.setResponse( res );
        player.showHtml5Player( new Track[] {}, false );
       
        final String data = res.getOutput();
       
        assertTrue( data.length() > 0 );
       
    }
View Full Code Here

       
    }
   
    public void testShowJplayer() throws Exception {
       
        final TestResponse res = new TestResponse();
        final Player player = new Player();
       
        player.setLocale( new TestLocale() );
        player.setProperties( new StringProperties() );
        player.setResponse( res );
        player.showJplayer( new Track[] {}, false );
       
        final String data = res.getOutput();
       
        assertTrue( data.length() > 0 );
       
    }
View Full Code Here

       
    }

    public void testShowPlaylists() throws Exception {

        final TestResponse res = new TestResponse();
        final Playlistser b = new Playlistser();
        final List<Playlist> sitePlaylists = new ArrayList<Playlist>();
        final List<Playlist> userPlaylists = new ArrayList<Playlist>();
        final User user = new User( 12323, "my user" );
        final Playlist sitePlaylist = new Playlist( 1, "site Play list" );
        final Playlist userPlaylist = new Playlist( 1, "USER Play list", 1, user );

        sitePlaylists.add( sitePlaylist );
        userPlaylists.add( userPlaylist );
       
        b.setResponse( res );
        b.showPlaylists( sitePlaylists, userPlaylists );
       
        final String data = res.getOutput();

        assertTrue( data.contains(sitePlaylist.getName()) );
        assertTrue( data.contains(userPlaylist.getName()) );
        assertTrue( data.contains(user.getName()) );
View Full Code Here

   
    @Override
    protected void setUp() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "playlists" );
        res = new TestResponse();
        action = new Playlister();
        action.setDatabase( db );
        action.setResponse( res );
    }
View Full Code Here

       
    }
   
    public void testShowPopular() throws Exception {
       
        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

TOP

Related Classes of com.pugh.sockso.tests.TestResponse

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.