Package com.pugh.sockso.tests

Examples of com.pugh.sockso.tests.TestRequest


        String skin = "hsdjkahsdjkahsdk";

        Properties p = new StringProperties();
        p.set( "www.skin", skin );

        Request req = new TestRequest( "GET / HTTP/1.1" );

        Sharer s = new Sharer();
        s.setResponse( res );
        s.setRequest( req );
        s.setLocale( locale );
View Full Code Here


    }

    public void testRenderingTheSharePage() throws Exception {
        TestResponse res = new TestResponse();
        Sharer s = new Sharer();
        s.setRequest(new TestRequest("/") );
        s.setLocale( locale );
        s.setResponse( res );
        s.setUser( new User(-1,"foo") );
        s.setProperties( new StringProperties() );
        s.showSharePage( new String[] { "ar123" } );
View Full Code Here

    public static int runState = 0;

    @Override
    protected void setUp() {
        action = new Coverer();
        action.setRequest( new TestRequest("GET /foo/bar HTTP/1.0") );
    }
View Full Code Here

    }
   
    public void testTracksSpecifedByIdAreIncludedInPlaylist() throws Exception {
       
        Request req = new TestRequest( "GET /xspf/tr1/tr3 HTTP/1.1" );
        pl.setRequest( req );
       
        pl.handleRequest();
       
        assertContains( res.getOutput(), "First Track" );
View Full Code Here

       
    }

    public void testAllTracksFromAlbumsSpecifedByIdAreIncludedInPlaylist() throws Exception {
       
        Request req = new TestRequest( "GET /xspf/al1 HTTP/1.1" );
        pl.setRequest( req );
       
        pl.handleRequest();
       
        assertContains( res.getOutput(), "First Track" );
View Full Code Here

    public void testTracksThatMatchPathSpecifiedAreIncludedInPlaylist() throws Exception {
       
        p.set( Constants.WWW_BROWSE_FOLDERS_ENABLED, p.YES );
       
        Request req = new TestRequest( "GET /xspf/?path=/music/folder HTTP/1.1" );
        pl.setRequest( req );
       
        pl.handleRequest();
       
        assertContains( res.getOutput(), "First Track" );
View Full Code Here

    }
   
    public void testTracksNotReturnedByPathWhenFolderBrowsingNotEnabled() throws Exception {
       
        Request req = new TestRequest( "GET /xspf/?path=/music/folder HTTP/1.1" );
        pl.setRequest( req );
       
        pl.handleRequest();
       
        assertNotContains( res.getOutput(), "First Track" );
View Full Code Here

    public void testFileServerIgnoresLogins() {
        assertFalse( action.requiresLogin() );
    }

    public void testDoubleDotsAreIgnoredInFilePaths() throws Exception {
        TestRequest req = new TestRequest( "GET /file/some/../../..../file.txt HTTP/1.0" );
        action.setRequest( req );
        assertEquals( "htdocs/some/file.txt", action.getPathFromRequest() );
    }
View Full Code Here

       
    }

    public void testGettingAValidTrackDoesntThrowAnException() throws SQLException, IOException {
       
        final TestRequest req = new TestRequest( "GET /stream/1 HTTP/1.1" );

        db.fixture( "singleTrack" );
        db.update( " update tracks set path = '" +System.getProperty("user.dir")+ "/test/data/empty.mp3' " );
       
        try {
View Full Code Here

       
    }
   
    public void testGettingAnInvalidTrackThrowsAnException() throws SQLException, IOException {
       
        final TestRequest req = new TestRequest( "GET /stream/1 HTTP/1.1" );
        boolean gotException = false;

        try {
            s.setRequest( req );
            s.handleRequest();
View Full Code Here

TOP

Related Classes of com.pugh.sockso.tests.TestRequest

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.