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

Examples of org.apache.beehive.netui.tools.testrecorder.shared.config.Config


        String uri = genUri( "http", server.getHostname(), server.getPort(), webapp.getServletUri() );
        HttpMethod method = new GetMethod( uri );
        queryParams[2] = configParam;
        method.setQueryString( queryParams );
        InputStream is = executeXMLRequest( method, uri, Constants.CONFIG_FILE );
        Config config = null;
        try {
            config = XMLHelper.getConfig( is, Constants.CONFIG_FILE );
        }
        catch ( Exception e ) {
            String msg = "ERROR: encountered exception processing resource( " + Constants.CONFIG_FILE + " )";
            log.fatal( msg, e );
            if ( e instanceof ConfigException ) {
                throw (ConfigException) e;
            }
            throw new ConfigException( msg, e );
        }
        finally {
            try {
                if ( is != null ) {
                    is.close();
                }
            }
            catch ( IOException e ) {
                if ( log.isWarnEnabled() ) {
                    log.warn( "WARNING: received exception closing HTTP stream for( " + Constants.CONFIG_FILE +
                            " )", e );
                }
                //ignore
            }
            method.releaseConnection();
        }
        if ( log.isInfoEnabled() ) {
            log.info( "config( " + config + " )" );
        }

        method = new GetMethod( uri );
        queryParams[2] = webappParam;
        method.setQueryString( queryParams );
        is = executeXMLRequest( method, uri, Constants.WEBAPPS_FILE );
        Webapps webapps = null;
        try {
            webapps = XMLHelper.getWebapps( is, Constants.WEBAPPS_FILE, config );
        }
        catch ( Exception e ) {
            String msg = "ERROR: encountered exception processing resource( " + Constants.WEBAPPS_FILE + " )";
            log.fatal( msg, e );
            if ( e instanceof ConfigException ) {
                throw (ConfigException) e;
            }
            throw new ConfigException( msg, e );
        }
        finally {
            try {
                if ( is != null ) {
                    is.close();
                }
            }
            catch ( IOException e ) {
                if ( log.isWarnEnabled() ) {
                    log.warn( "WARNING: received exception closing HTTP stream for( " + Constants.WEBAPPS_FILE +
                            " )", e );
                }
                // ignore
            }
            method.releaseConnection();
        }
        if ( log.isInfoEnabled() ) {
            log.info( "webapps( " + webapps + " )" );
        }

        method = new GetMethod( uri );
        queryParams[2] = testsParam;
        method.setQueryString( queryParams );
        is = executeXMLRequest( method, uri, Constants.TESTS_FILE );
        TestDefinitions testDefinitions = null;
        try {
            testDefinitions = XMLHelper.getTestDefinitionsInstance( is, Constants.TESTS_FILE, webapps,
                    config.getBaseDirectory().getAbsolutePath() );
        }
        catch ( Exception e ) {
            String msg = "ERROR: encountered exception processing resource( " + Constants.TESTS_FILE + " )";
            log.fatal( msg, e );
            if ( e instanceof ConfigException ) {
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.tools.testrecorder.shared.config.Config

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.