Package com.pugh.sockso.tests

Examples of com.pugh.sockso.tests.TestDatabase


   
    private TestResponse res;
   
    @Override
    protected void setUp() throws Exception {
        TestDatabase db = new TestDatabase();
        db.fixture( "playlists" );
        res = new TestResponse();
        action = new PlaylistAction();
        action.setDatabase( db );
        action.setResponse( res );
    }
View Full Code Here


        expect( testProperties.getProperties() ).andReturn( new String[] {} );
        replay( testProperties );
       
        testUser = new User( -1, "foo" );

        db = new TestDatabase();
        p = new StringProperties();
        req = new TestRequest( "" );
        resp = new TestResponse();
        u = new Userer();
        u.addAuthenticator( new DBAuthenticator(db) );
View Full Code Here

    public void testGetNonScrobbledTracksQuery() throws Exception {
       
        final User user = new User( -1, "foo" );
        final Userer u = new Userer();
        final Database db = new TestDatabase();
       
        u.setDatabase( db );
        u.getNonScrobbledTracks( user );

    }
View Full Code Here

   
    public void testMarkUsersTracksScrobbledQuery() throws Exception {
       
        final User user = new User( -1, "foo" );
        final Userer u = new Userer();
        final Database db = new TestDatabase();
       
        u.setDatabase( db );
        u.markUsersTracksScrobbled( user );
       
    }
View Full Code Here

       
    }

    public void testUserIsCreatedIfTheyDontExist() throws Exception {
        final Userer u = new Userer();
        final Database db = new TestDatabase();
        u.setDatabase( db );
        ///////
        assertTableSize( db, "users", 0 );
        u.findOrCreateUser( "foo", "bar" );
        assertTableSize( db, "users", 1 );
View Full Code Here

        assertTableSize( db, "users", 1 );
    }

    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

    private User user;

    @Override
    public void setUp() throws Exception {
        db = new TestDatabase();
        user = new User( "name", "pass", "name@domain.com", true );
        user.save( db );
    }
View Full Code Here

        u.setActive( false );
        assertFalse( u.isActive() );
    }

    public void testNewUserCanBeSavedAsBeingActive() throws Exception {
        Database db = new TestDatabase();
        User u1 = new User( 1, "" );
        u1.save( db );
        User u2 = User.find( db, u1.getId() );
        assertTrue( u2.isActive() );
    }
View Full Code Here

        User u2 = User.find( db, u1.getId() );
        assertTrue( u2.isActive() );
    }

    public void testNewUserCanBeSavedAsBeingInactive() throws Exception {
        Database db = new TestDatabase();
        User u1 = new User( 1, "" );
        u1.setActive( false );
        u1.save( db );
        User u2 = User.find( db, u1.getId() );
        assertFalse( u2.isActive() );
View Full Code Here

    }

    public void testSaveNewUser() throws Exception {
       
        final TestDatabase db = new TestDatabase();
        final String name = Utils.getRandomString(20),
                     pass = Utils.getRandomString(20),
                     email = Utils.getRandomString(20);
        final User newUser = new User( name, pass, email, true );
       
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.