Examples of fixture()


Examples of com.pugh.sockso.tests.TestDatabase.fixture()

    }

    public void testExistingUserIsReturnedWhenDoesntExist() throws Exception {
        final Userer u = new Userer();
        final TestDatabase db = new TestDatabase();
        db.fixture( "singleUser" );
        u.setDatabase( db );
        ///////
        assertTableSize( db, "users", 1 );
        assertNotNull( u.findOrCreateUser( "foo", "q" ) );
        assertTableSize( db, "users", 1 );
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

    private DefaultMutableTreeNode root;

    @Override
    public void setUp() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "musicTree" );
        t = new MusicTree( db );
        t.init();
        model = (DefaultTreeModel) t.getModel();
        root = (DefaultMutableTreeNode) model.getRoot();
    }
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

public class PlaylistPanelTest extends SocksoTestCase {

    public void testCheckingPlaylistExists() throws Exception {
        TestDatabase db = new TestDatabase();
        PlaylistPanel p = new PlaylistPanel( null, db, null );
        db.fixture( "singlePlaylist" );
        assertTrue( p.playlistExists("Foo Bar") );
        assertFalse( p.playlistExists("Bar Foo") );
    }
   
}
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

        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() );
    }
   
    public void testFindingTrackWithNonExistantIdReturnsNull() throws Exception {
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

        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() );
    }
   
    public void testFindingTrackReturnsArtistObjectWithTrack() throws Exception {
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

        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() );
    }

    public void testFindingTrackReturnsAlbumObjectWithTrack() throws Exception {
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

        assertEquals( "My Album", track.getAlbum().getName() );
    }

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

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

        assertEquals( "My Artist", track.getArtist().getName() );
    }
   
    public void testFindallReturnsAllTracksRequested() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "artistsAlbumsAndTracks" );
        List<Track> tracks = Track.findAll( db, 100, 0 );
        assertEquals( 3, tracks.size() );
    }
   
    public void testFindallCanBeLimited() throws Exception {
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

        assertEquals( 3, tracks.size() );
    }
   
    public void testFindallCanBeLimited() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "artistsAlbumsAndTracks" );
        List<Track> tracks = Track.findAll( db, 2, 0 );
        assertEquals( 2, tracks.size() );
    }
   
    public void testFindallCanBeOffset() throws Exception {
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase.fixture()

        assertEquals( 2, tracks.size() );
    }
   
    public void testFindallCanBeOffset() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "artistsAlbumsAndTracks" );
        List<Track> tracks = Track.findAll( db, 100, 1 );
        assertEquals( 2, tracks.size() );
    }
   
    public void testFindallWithLimitOfMinusOneMeansNoLimit() throws Exception {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.