Examples of TestDatabase


Examples of com.pugh.sockso.tests.TestDatabase

    }

    public void testSaveAndRemovePlaylist() throws Exception {

        final TestDatabase db = new TestDatabase();
        final DBCollectionManager cm = new DBCollectionManager( db, p, indexer );
        final String name = Utils.getRandomString( 20 );

        db.fixture( "singleTrack" );

        final Track[] tracks = new Track[] {
            cm.getTrack( 1 )
        };
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

    }

    public void testRemoveEmptyArtists() throws Exception {

        final TestDatabase db = new TestDatabase();
        final DBCollectionManager cm = new DBCollectionManager( db, p, indexer );

        // Should delete Artists with no Track or Album references
        db.fixture( "artists" );

        assertTableSize( db, "artists", 3 );
        assertTableSize( db, "albums", 0 );
        assertTableSize( db, "tracks", 0 );
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

    private TestDatabase db;

    @Override
    public void setUp() throws Exception {
        db = new TestDatabase();
        auth = new DBAuthenticator( db );
        db.fixture( "singleUser" );
    }
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

       
    }
   
    public void testUsernameExists() throws Exception {

        TestDatabase db = new TestDatabase();

        Validater v = new Validater( db );
        final String email = "rod@pu-gh.com";

        assertFalse( v.emailExists(email) );

        db.fixture( "singleUser" );

        assertTrue( v.emailExists(email) );
       
    }
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

    }


    public void testDoesNotRemoveArtistsWithAlbums() throws Exception {

        final TestDatabase db = new TestDatabase();
        final DBCollectionManager cm = new DBCollectionManager( db, p, indexer );

        // Should not delete an Artist that has Albums referencing it
        db.fixture( "artistsWithAlbums" );

        assertTableSize( db, "artists", 1 );
        assertTableSize( db, "albums", 1 );
        assertTableSize( db, "tracks", 0 );
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

       
    }
   
    public void testEmailExists() throws Exception {

        TestDatabase db = new TestDatabase();

        Validater v = new Validater( db );
        final String username = "foo";

        assertFalse( v.usernameExists(username) );

        db.fixture( "singleUser" );

        assertTrue( v.usernameExists(username) );
       
    }
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

        assertTableSize( db, "tracks", 0 );
    }

    public void testDoesNotRemoveArtistsWithTracks() throws Exception {

        final TestDatabase db = new TestDatabase();
        final DBCollectionManager cm = new DBCollectionManager( db, p, indexer );

        // Should not delete an Artist that has Tracks referencing it
        db.fixture( "artistsWithTracks" );

        assertTableSize( db, "artists", 1 );
        assertTableSize( db, "albums", 0 );
        assertTableSize( db, "tracks", 1 );
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

    }

   
    public void testRemoveEmptyAlbums() throws Exception {

        final TestDatabase db = new TestDatabase();
        final DBCollectionManager cm = new DBCollectionManager( db, p, indexer );

        // Should delete Albums that have no Tracks referencing them (Artists OK)
        db.fixture( "artistsWithAlbums" );

        assertTableSize( db, "artists", 1 );
        assertTableSize( db, "albums", 1 );
        assertTableSize( db, "tracks", 0 );
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

    }

   
    public void testDoesNotRemoveAlbumsWithTracks() throws Exception {

        final TestDatabase db = new TestDatabase();
        final DBCollectionManager cm = new DBCollectionManager( db, p, indexer );

        // Should not delete an Album that has Tracks referencing it
        db.fixture( "albumsWithTracks" );

        assertTableSize( db, "artists", 0 );
        assertTableSize( db, "albums", 1 );
        assertTableSize( db, "tracks", 1 );
View Full Code Here

Examples of com.pugh.sockso.tests.TestDatabase

    private User user;

    @Override
    public void setUp() {
        db = new TestDatabase();
        locale = new TestLocale();
        cmd = new UserActive( db, locale );
        user = new User( -1, "name", "pass", "email@domain.com" );
    }
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.