TestPlayer despotify = new TestPlayer();
despotify.setUp();
Connection connection = despotify.manager.getManagedConnection();
Player player = new Player(connection);
new LoadTracks(despotify.store, despotify.defaultTracks).send(despotify.manager);
player.play(despotify.defaultTracks[0], new PlaybackListener(){
@Override
public void playbackStarted(Track track) {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void playbackStopped(Track track) {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void playbackResumed(Track track) {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void playbackPosition(Track track, int position) {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void playbackFinished(Track track) {
//To change body of implemented methods use File | Settings | File Templates.
}
});
Thread.sleep(10000);
player.stop();
despotify.tearDown();
}