Package com.pugh.sockso.tests

Examples of com.pugh.sockso.tests.TestDatabase


   
    private JComboBox formats;
   
    @Override
    protected void setUp() throws Exception {
        db = new TestDatabase();
        db.fixture( "requestLogs" );
        formats = new JComboBox( DBExporter.Format.values() );
        action = new RequestLogExport( null, db, null, formats );
        action.addListener(new RequestLogChangeListener() {
            public void requestLogChanged() { eventFired = true; }
View Full Code Here


        File saveFile1 = File.createTempFile( "testLog1", "log" );
        formats.setSelectedIndex( 1 );
        action.exportRequestLog( saveFile1 );
        File saveFile2 = File.createTempFile( "testLog2", "log" );
        // table cleared after previous log, so need to reset db (can't truncate)
        TestDatabase db2 = new TestDatabase();
        db2.fixture( "requestLogs" );
        action = new RequestLogExport( null, db2, null, formats );
        formats.setSelectedIndex( 2 );
        action.exportRequestLog( saveFile1 );
        assertFilesNotEqual( saveFile1, saveFile2 );
    }
View Full Code Here

    private Streamer s;

    @Override
    protected void setUp() {
        db = new TestDatabase();
        res = new TestResponse();
        s = new Streamer();
        s.setDatabase( db );
        s.setResponse( res );
        s.setProperties( new StringProperties() );
View Full Code Here

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

public class TrackIndexerTest extends SocksoTestCase {

    public void testPerformance() throws Exception {

        final BaseIndexer indexer = new TrackIndexer( new TestDatabase() );
        final long start = System.currentTimeMillis();
        final long target = 7000;

        indexer.scan();
View Full Code Here

    }

    public void testGetIndex() throws Exception {

        final BaseIndexer indexer = new TrackIndexer( new TestDatabase() );
        final ResultSet rs = indexer.getFiles();

        assertNotNull( rs );

    }
View Full Code Here

    }

    public void testGetDirectories() throws Exception {

        final BaseIndexer indexer = new TrackIndexer( new TestDatabase() );
        final ResultSet rs = indexer.getDirectories();

        assertNotNull( rs );

    }
View Full Code Here

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

import com.pugh.sockso.tests.TestDatabase;

public class DbRequestLoggerTest extends SocksoTestCase {

    public void testLoggingARequestAddsARecordToTheDatabase() throws Exception {
        final Database db = new TestDatabase();
        final RequestLogger logger = new DbRequestLogger( db );
        final String ipAddress = "1.2.3.4",
                     requestUrl = "some resource",
                     userAgent = "this user agent",
                     referer = "some referer",
View Full Code Here

    private TestResponse res;
   
    @Override
    protected void setUp() throws Exception {
        res = new TestResponse();
        TestDatabase db = new TestDatabase();
        db.fixture( "artistsAlbumsAndTracks" );
        action = new ArtistAction();
        action.setDatabase( db );
        action.setResponse( res );
    }
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.