Package com.pugh.sockso.music.indexing

Source Code of com.pugh.sockso.music.indexing.TrackIndexerTest

package com.pugh.sockso.music.indexing;

import com.pugh.sockso.tests.SocksoTestCase;
import com.pugh.sockso.tests.TestDatabase;

import java.sql.ResultSet;

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();

        final long total = System.currentTimeMillis() - start;

        System.out.println( "Target: " +target+ ", Actual: " +total );

        if ( total > target ) {
            fail( "Did not meet target: " +target+ ", actual: " +total );
        }

    }

    public void testGetIndex() throws Exception {

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

        assertNotNull( rs );

    }

    public void testGetDirectories() throws Exception {

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

        assertNotNull( rs );

    }

}
TOP

Related Classes of com.pugh.sockso.music.indexing.TrackIndexerTest

TOP
Copyright © 2018 www.massapi.com. 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.