Package org.apache.tomcat.maven.common.deployer

Examples of org.apache.tomcat.maven.common.deployer.TomcatManagerResponse


    {
        validateWarFile();

        getLog().info( messagesProvider.getMessage( "AbstractDeployMojo.deployingWar", getDeployedURL() ) );

        TomcatManagerResponse tomcatManagerResponse =
            getManager().deploy( getPath(), warFile, isUpdate(), getTag(), warFile.length() );

        getLog().info( "tomcatManager status code:" + tomcatManagerResponse.getStatusCode() + ", ReasonPhrase:"
                           + tomcatManagerResponse.getReasonPhrase() );

        log( tomcatManagerResponse.getHttpResponseBody() );
    }
View Full Code Here


    public void testDeployWar()
        throws Exception
    {
        uploadServlet.uploadedResources.clear();
        TomcatManager tomcatManager = new TomcatManager( new URL( "http://localhost:" + this.port + "/foo/bar" ) );
        TomcatManagerResponse response =
            tomcatManager.deploy( "foo", new File( getBasedir(), "src/test/resources/test.txt" ) );

        assertEquals( 200, response.getStatusCode() );

        assertEquals( 1, uploadServlet.uploadedResources.size() );
        assertEquals( "/foo/bar/deploy", uploadServlet.uploadedResources.get( 0 ).requestUri );
        FileInputStream fileInputStream = new FileInputStream( uploadServlet.uploadedResources.get( 0 ).uploadedFile );
        try
View Full Code Here

    {
        uploadServlet.uploadedResources.clear();
        TomcatManager tomcatManager =
            new TomcatManager( new URL( "http://localhost:" + this.redirectPort + "/foo/bar" ) );
        redirectServlet.redirectPath = "http://localhost:" + this.port + "/foo/bar/redirected";
        TomcatManagerResponse response =
            tomcatManager.deploy( "foo", new File( getBasedir(), "src/test/resources/test.txt" ) );

        assertEquals( 200, response.getStatusCode() );

        assertEquals( "no request to redirect servlet", 1, redirectServlet.uploadedResources.size() );
        assertEquals( "/foo/bar/deploy", redirectServlet.uploadedResources.get( 0 ).requestUri );
        assertEquals( "no  redirected request to upload servlet", 1, uploadServlet.uploadedResources.size() );
View Full Code Here

    {
        uploadServlet.uploadedResources.clear();
        TomcatManager tomcatManager =
            new TomcatManager( new URL( "http://localhost:" + this.redirectPort + "/foo/bar" ) );
        redirectServlet.redirectPath = "redirectrelative/foo";
        TomcatManagerResponse response =
            tomcatManager.deploy( "foo", new File( getBasedir(), "src/test/resources/test.txt" ) );

        assertEquals( 200, response.getStatusCode() );

        assertEquals( "no request to redirect servlet", 2, redirectServlet.uploadedResources.size() );
        assertEquals( "/foo/bar/deploy", redirectServlet.uploadedResources.get( 0 ).requestUri );
        assertEquals( "found redirected request to upload servlet", 0, uploadServlet.uploadedResources.size() );
View Full Code Here

    {
        getLog().info( messagesProvider.getMessage( "UndeployMojo.undeployingApp", getDeployedURL() ) );

        try
        {
            TomcatManagerResponse tomcatResponse = getManager().undeploy( getPath() );
           
            /* TODO : Tomcat always return http status 200. How check message to know error or not,
             * cause is can be in french, english....      
             */
            checkTomcatResponse( tomcatResponse );

            log( tomcatResponse.getHttpResponseBody() );
        }
        catch ( TomcatManagerException exception )
        {
            if ( failOnError )
            {
View Full Code Here

        else
        {
            getLog().info( messagesProvider.getMessage( "ResourcesMojo.listTypedResources", type, getURL() ) );
        }

        TomcatManagerResponse tomcatResponse = getManager().getResources( type );

        checkTomcatResponse( tomcatResponse );

        log( tomcatResponse.getHttpResponseBody() );         
    }
View Full Code Here

    protected void invokeManager()
        throws MojoExecutionException, TomcatManagerException, IOException
    {
        getLog().info( messagesProvider.getMessage( "ServerInfoMojo.listInfo", getURL() ) );

        TomcatManagerResponse tomcatResponse = getManager().getServerInfo();

        checkTomcatResponse( tomcatResponse );

        log( tomcatResponse.getHttpResponseBody() );               
    }
View Full Code Here

    protected void invokeManager()
        throws MojoExecutionException, TomcatManagerException, IOException
    {
        getLog().info( messagesProvider.getMessage( "StartMojo.startingApp", getDeployedURL() ) );

        TomcatManagerResponse tomcatResponse = getManager().start( getPath() );
       
        /* TODO : Tomcat always return http status 200. How check message to know error or not,
         * cause is can be in french, english....      
         */
        checkTomcatResponse( tomcatResponse );

        log( tomcatResponse.getHttpResponseBody() );           
    }
View Full Code Here

    protected void invokeManager()
        throws MojoExecutionException, TomcatManagerException, IOException
    {
        getLog().info( messagesProvider.getMessage( "SessionsMojo.listSessions", getDeployedURL() ) );

        TomcatManagerResponse tomcatResponse = getManager().getSessions( getPath() );

        checkTomcatResponse( tomcatResponse );

        log( tomcatResponse.getHttpResponseBody() );           
    }
View Full Code Here

    protected void invokeManager()
        throws MojoExecutionException, TomcatManagerException, IOException
    {
        getLog().info( messagesProvider.getMessage( "RolesMojo.listRoles", getURL() ) );

        TomcatManagerResponse tomcatResponse = getManager().getRoles() ;
       
        /* TODO : Tomcat always return http status 200. How check message to know error or not,
         * cause is can be in french, english....      
         */
        checkTomcatResponse( tomcatResponse );

        log( tomcatResponse.getHttpResponseBody() );         
    }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.maven.common.deployer.TomcatManagerResponse

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.