Package com.pugh.sockso.db

Examples of com.pugh.sockso.db.Database


       
    }

    public void testGetArtistAlbumsQuery() throws Exception {
       
        final Database db = new TestDatabase();
        final Artister b = new Artister();
       
        b.setDatabase( db );
        b.getArtistAlbums( -1 );
View Full Code Here


                final PreparedStatement st = createNiceMock( PreparedStatement.class );
                expect( st.executeQuery() ).andReturn( rs );
                replay( st );

                final Database mockDb = createNiceMock( Database.class );
                expect( mockDb.prepare((String)anyObject()) ).andReturn( st );
                replay( mockDb );

                setDatabase( mockDb );

            }
View Full Code Here

    }
   
    public void testGetArtistQuery() throws Exception {
       
        final Database db = new TestDatabase();
        final Artister b = new Artister();
       
        b.setDatabase( db );
        try {
            b.getArtist( -1 );
View Full Code Here

        final PreparedStatement st = createNiceMock( PreparedStatement.class );
        expect( st.executeQuery() ).andReturn( rs ).times( 1 );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final HttpResponse res = new HttpResponse( null, db, null, null, null, false );
        final List<User> users = res.getRecentUsers();
       
View Full Code Here

        verify( rs );
       
    }
   
    public void testGetUsersQuery() throws Exception {
        final Database db = new TestDatabase();
        final HttpResponse res = new HttpResponse( null, db, p, null, null, false );
        res.getRecentUsers();
    }
View Full Code Here

        st.setInt( 1, total );
        expect( st.executeQuery() ).andReturn( rs ).times( 1 );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final Homer h = new Homer();
        h.setDatabase( db );
       
View Full Code Here

       
    }

    public void testGetRecentlyPlayedAlbumsQuery() throws Exception {

        final Database db = new TestDatabase();
        final Homer h = new Homer();
       
        h.setDatabase( db );
        h.getRecentlyPlayedAlbums( 10 );
       
View Full Code Here

        st.setInt( 1, (int) total );
        expect( st.executeQuery() ).andReturn( rs ).times( 1 );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final Homer h = new Homer();
        h.setDatabase( db );
       
View Full Code Here

       
    }

    public void testGetRecentlyPlayedTracksQuery() throws Exception {

        final Database db = new TestDatabase();
        final Homer h = new Homer();
       
        h.setDatabase( db );
        h.getRecentlyPlayedTracks( 10 );
       
View Full Code Here

        st.setInt( 1, (int) total );
        expect( st.executeQuery() ).andReturn( rs ).times( 1 );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final Homer h = new Homer();
        h.setDatabase( db );
       
View Full Code Here

TOP

Related Classes of com.pugh.sockso.db.Database

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.