Package com.pugh.sockso.tests

Examples of com.pugh.sockso.tests.TestDatabase


       
    }
   
    public void testGetCollectionsQuery() throws Exception {
       
        final Database db = new TestDatabase();
        final Folderer b = new Folderer();
       
        b.setDatabase( db );
        b.getCollections();
       
View Full Code Here


    private CollectionManager cm;
    private Database db;

    @Override
    public void setUp() throws Exception {
        db = new TestDatabase();
        db.update( "insert into collection ( id, path ) values ( 1, '/home/user/music' )" );
        cm = createMock( CollectionManager.class );
        cmd = new ColScan( cm, db );
    }
View Full Code Here

    private MyAudioScrobbler as;

    @Override
    public void setUp() throws Exception {
        db = new TestDatabase();
        as = new MyAudioScrobbler( db );
    }
View Full Code Here

       
    }
   
    public void testGetUserPlaylistsQuery() throws Exception {
       
        final Database db = new TestDatabase();
        final Playlistser b = new Playlistser();
       
        b.setDatabase( db );
        b.getUserPlaylists();
       
View Full Code Here

        p.set( Constants.SERVER_BASE_PATH, "/foo" );
        assertContains( track.getStreamUrl(p,user), "/foo/stream/" );
    }
   
    public void testGettingTracksForAPathReturnsThoseInThatFolderAndSubFolders() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "tracksForPath" );
        List<Track> tracks = Track.getTracksFromPath( db, "/music" );
        assertEquals( 2, tracks.size() );
    }
View Full Code Here

       
    }
   
    public void testGetSitePlaylistsQuery() throws Exception {
       
        final Database db = new TestDatabase();
        final Playlistser b = new Playlistser();
       
        b.setDatabase( db );
        b.getSitePlaylists();
       
View Full Code Here

        List<Track> tracks = Track.getTracksFromPath( db, "/music" );
        assertEquals( 2, tracks.size() );
    }
   
    public void testFindingTrackWithNonExistantIdReturnsNull() throws Exception {
        assertNull( Track.find(new TestDatabase(),1) );
    }
View Full Code Here

    public void testFindingTrackWithNonExistantIdReturnsNull() throws Exception {
        assertNull( Track.find(new TestDatabase(),1) );
    }
   
    public void testFindingTrackReturnsIt() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "singleTrack" );
        Track track = Track.find( db, 1 );
        assertEquals( "My Track", track.getName() );
    }
View Full Code Here

    private MyAudioScrobbler as;

    @Override
    public void setUp() throws Exception {
        db = new TestDatabase();
        as = new MyAudioScrobbler( db );
    }
View Full Code Here

        Track track = Track.find( db, 1 );
        assertEquals( "My Track", track.getName() );
    }
   
    public void testFindingTrackReturnsArtistObjectWithTrack() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "singleTrack" );
        Track track = Track.find( db, 1 );
        assertEquals( "My Album", track.getAlbum().getName() );
    }
View Full Code Here

TOP

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

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.