Package com.pugh.sockso.tests

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


    }

   
    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

    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

   
    private Command cmd;

    @Override
    public void setUp() {
        db = new TestDatabase();
        cmd = new UserList( db );
    }
View Full Code Here

   
    private TestDatabase db;
   
    @Override
    protected void setUp() {
        db = new TestDatabase();
    }
View Full Code Here

        assertEquals( 1, artist.getId() );
        assertEquals( "My Artist", artist.getName() );
    }
   
    public void testFindReturnsNullForInvalidArtistId() throws Exception {
        assertNull( Artist.find(new TestDatabase(),123) );
    }
View Full Code Here

    private TestLocale locale;

    @Override
    public void setUp() {
        p = new StringProperties();
        db = new TestDatabase();
        locale = new TestLocale();
        locale.setString( "con.desc.commands", "Usage:" );
        locale.setString( "con.msg.propertySaved", "property saved" );
        cmd = new CommandExecuter( db, p, null, locale, new CommandParser() );
    }
View Full Code Here

   
    private Database db;
   
    @Override
    public void setUp() throws Exception {
        db = new TestDatabase();
        db.update( "insert into collection ( id, path ) values ( 1, '/foo/bar/' )" );
        db.update( "insert into collection ( id, path ) values ( 2, 'C:\\foo\\bar\\' )" );
    }
View Full Code Here

    @Override
    public void setUp() {
        locale = new TestLocale();
        locale.setString( "con.msg.userUpdated", "user updated" );
        locale.setString( "con.err.errorUpdatingUser", "error updating user" );
        db = new TestDatabase();
        cmd = new UserAdmin( db, locale );
    }
View Full Code Here

       
    }
   
    public void testGetLatestArtistsQuery() throws Exception {
       
        final Database db = new TestDatabase();
        final Latester b = new Latester();
       
        b.setProperties( new StringProperties() );
        b.setDatabase( db );
        b.getLatestArtists();
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.