Package org.apache.beehive.netui.tools.testrecorder.shared

Examples of org.apache.beehive.netui.tools.testrecorder.shared.RequestData


                String msg = "Failed processing file for record session( " + test.getName() + " ), file( " +
                        recFile.getAbsolutePath() + " )";
                forward( request, response, msg, Constants.ERROR_PAGE, true );
                return;
            }
            RequestData rd = bean.getRequestData( 0 );
            if ( rd == null ) {
                String msg = "Unable to find the first request in the test ( " + test.getName() + " ), file( " +
                        recFile.getAbsolutePath() + " )";
                forward( request, response, msg, Constants.ERROR_PAGE, true );
                return;
            }
            String host = config.getServer().getHostname();
            if ( host.equals( "localhost" ) )
            {
                host = request.getServerName();
            }
            response.sendRedirect( rd.getUri( host, config.getServer().getPort() ) );
            return;
        }
        catch ( Exception e ) {
            String msg = "ERROR: failed to display test details, exception( " + e.getMessage() +
                    " ), test( " + test.getName() + " )";
View Full Code Here


        testSkipFilter( original );
        testForTestId( original );
        testForTestException();

        // capture request data, this may not be necessary if we aren't recording or playing back.
        reqData = RequestData.populate( (HttpServletRequest) request, new RequestData() );
        if ( log.isDebugEnabled() ) {
            log.debug( "request data( " + reqData + " )" );
        }
    }
View Full Code Here

        }
        return session;
    }

    private void executeRequests() throws PlaybackException {
        RequestData request = null;
        int testNumber = 0;
        try {
            List requestList = getSession().getRequestData();
            if ( log.isDebugEnabled() ) {
                log.debug( "beginning test execution" );
            }
            for ( testNumber = 0; testNumber < requestList.size(); testNumber++ ) {
                request = (RequestData) requestList.get( testNumber );
                if ( log.isDebugEnabled() ) {
                    log.debug( "beginning execution for test number( " + ( testNumber + 1 ) + " )" );
                }
                HttpMethod method = createPlaybackMethod( request, getTest() );
                if ( log.isDebugEnabled() ) {
                    log.debug( "playback URI( " + method.getURI() + " )" );
                }
                ResponseData response = execute( getTestClient(), method );
                if ( log.isDebugEnabled() ) {
                    log.debug( "playback response, status code( " + response.getStatusCode() + " )" );
                    log.debug( "playback response, body(\n" + response.getBody() + " )" );
                }
                String outcome = response.getHeader( Constants.OUTCOME_HEADER );
                if ( log.isDebugEnabled() ) {
                    log.debug( "outcome( " + outcome + " )" );
                }
                if ( response.getStatusCode() >= 400 ) {
                    String msg = "WARNING: unable to access URI( " + method.getURI() +
                            " ), status code( " + response.getStatusCode() + " ) returned";
                    System.out.println( msg );
                    if ( log.isWarnEnabled() ) {
                        log.warn( msg );
                    }
                }
            }
        }
        catch ( Exception e ) {
            String msg = "ERROR: failed executing request for test( " + getTest().getName() +
                    " ), testNumber( " + testNumber + " ), path( " + request.getPath() + " ), exception( "
                    + e.getMessage() + " )";
            log.error( msg, e );
            if ( e instanceof PlaybackException ) {
                throw (PlaybackException) e;
            }
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.tools.testrecorder.shared.RequestData

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.