Package com.pugh.sockso

Examples of com.pugh.sockso.Properties


   
    private ResultSet getLatestMusic( final String type, final String totalPropertyName ) throws SQLException {
   
        PreparedStatement st = null;
       
        final Properties p = getProperties();
        final Database db = getDatabase();
        final String sql = " select ar.id, ar.name, max(t.date_added) as mostRecent " +
                    " from tracks t " +
                        " inner join " +type+ "s ar " +
                        " on ar.id = t." +type+ "_id " +
                    " group by ar.id, ar.name " +
                    " order by mostRecent desc " +
                    " limit ? ";
        st = db.prepare( sql );
        st.setInt( 1, (int) p.get(totalPropertyName,10) );

        return st.executeQuery();

    }
View Full Code Here


       
    }
   
    public void testRequiresLoginFalse() {
       
        final Properties p = createMock( Properties.class );
        expect( p.get(Constants.STREAM_REQUIRE_LOGIN) ).andReturn( "" ).times( 1 );
        replay( p );
       
        final Streamer s = new Streamer();
        s.setProperties( p );
       
View Full Code Here

       
    }

    public void testRequiresLoginTrue() {
       
        final Properties p = createMock( Properties.class );
        expect( p.get(Constants.STREAM_REQUIRE_LOGIN) ).andReturn( p.YES ).times( 1 );
        replay( p );
       
        final Streamer s = new Streamer();
        s.setProperties( p );
       
View Full Code Here

import java.text.SimpleDateFormat;

public class SimpleSchedulerTest extends SocksoTestCase {

    public void testShouldRunAt() throws Exception {
        final Properties p = new StringProperties();
        final Scheduler s = new SimpleScheduler( p );
        final DateFormat df = new SimpleDateFormat( "y-M-d H:m:s" );
        p.set( "scheduler.simple.interval", 10 );
        assertTrue( s.shouldRunAt(df.parse("2009-10-10 11:00:00")) );
        assertTrue( s.shouldRunAt(df.parse("2009-10-10 11:10:00")) );
        assertTrue( s.shouldRunAt(df.parse("2009-10-10 12:00:00")) );
        assertFalse( s.shouldRunAt(df.parse("2009-10-10 12:03:00")) );
        assertFalse( s.shouldRunAt(df.parse("2009-10-10 09:31:00")) );
View Full Code Here

       
    }

    public void testFolderBrowsingDisabled() throws SQLException, IOException {
       
        final Properties p = createMock( Properties.class );
        expect( p.get(Constants.WWW_BROWSE_FOLDERS_ENABLED) ).andReturn( "" ).times( 1 );
        replay( p );
       
        final Folderer b = new Folderer();
        boolean gotException = false;
       
View Full Code Here

public class PopularerTest extends SocksoTestCase {

    public void testGetPopularTracks() throws SQLException {
       
        final Properties p = createMock( Properties.class );
        expect( p.get(Constants.WWW_BROWSE_POPULAR_TRACK_COUNT,20) ).andReturn( 20l );
        replay( p );
       
        final ResultSet rs = createNiceMock( ResultSet.class );
        expect( rs.next() ).andReturn( true );
        expect( rs.next() ).andReturn( true );
View Full Code Here

TOP

Related Classes of com.pugh.sockso.Properties

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.