Package com.meterware.servletunit

Examples of com.meterware.servletunit.ServletUnitClient.newInvocation()


        action.setRowCount( 0 );
        action.setRepositoryId( INTERNAL );
        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();

        action.setServletRequest( sc.newInvocation( URL ).getRequest() );
        prepareAction( Collections.<String>emptyList(), Arrays.asList( SNAPSHOTS, INTERNAL ) );

        String result = action.execute();
        assertEquals( Action.INPUT, result );
        assertFalse( action.hasActionErrors() );
View Full Code Here


        action.setRepositoryId( GenerateReportAction.ALL_REPOSITORIES );
        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();

        action.setServletRequest( sc.newInvocation( URL ).getRequest() );
        prepareAction( Collections.<String>emptyList(), Arrays.asList( SNAPSHOTS, INTERNAL ) );

        String result = action.execute();
        assertSuccessResult( result );
View Full Code Here

        action.setGroupId( GROUP_ID );
        action.setRepositoryId( INTERNAL );
        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();

        action.setServletRequest( sc.newInvocation( URL ).getRequest() );
        prepareAction( Collections.<String>emptyList(), Arrays.asList( SNAPSHOTS, INTERNAL ) );

        String result = action.execute();
        assertSuccessResult( result );
View Full Code Here

        action.setGroupId( GROUP_ID );
        action.setRepositoryId( GenerateReportAction.ALL_REPOSITORIES );
        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();

        action.setServletRequest( sc.newInvocation( URL ).getRequest() );
        prepareAction( Collections.<String>emptyList(), Arrays.asList( SNAPSHOTS, INTERNAL ) );

        String result = action.execute();
        assertSuccessResult( result );
View Full Code Here

        action.setGroupId( "not.it" );
        action.setRepositoryId( INTERNAL );
        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();

        action.setServletRequest( sc.newInvocation( URL ).getRequest() );
        prepareAction( Collections.<String>emptyList(), Arrays.asList( SNAPSHOTS, INTERNAL ) );

        String result = action.execute();
        assertEquals( GenerateReportAction.BLANK, result );
        assertFalse( action.hasActionErrors() );
View Full Code Here

        throws Exception
    {
        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();

        action.setServletRequest( sc.newInvocation( "http://localhost/admin/repositories.action" ).getRequest() );
        action.prepare();
        String result = action.execute();
        assertEquals( Action.SUCCESS, result );

        // TODO: for some reason servletunit is not populating the port of the servlet request
View Full Code Here

       
        archivaConfiguration.getConfiguration();
        archivaConfigurationControl.setReturnValue( configuration );
        archivaConfigurationControl.replay();
       
        action.setServletRequest( sc.newInvocation( "http://localhost/admin/repositoryGroups.action" ).getRequest() );
        action.prepare();
        String result = action.execute();
        assertEquals( Action.SUCCESS, result );
       
        assertEquals( "http://localhost:0/repository", action.getBaseUrl() );
View Full Code Here

        throws Exception
    {
        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();

        action.setServletRequest( sc.newInvocation( "http://localhost/admin/repositories.action" ).getRequest() );
        action.prepare();
        String result = action.execute();
        assertEquals( Action.SUCCESS, result );

        // TODO: for some reason servletunit is not populating the port of the servlet request
View Full Code Here

       
        archivaConfiguration.getConfiguration();
        archivaConfigurationControl.setReturnValue( configuration );
        archivaConfigurationControl.replay();
       
        action.setServletRequest( sc.newInvocation( "http://localhost/admin/repositoryGroups.action" ).getRequest() );
        action.prepare();
        String result = action.execute();
        assertEquals( Action.SUCCESS, result );
       
        assertEquals( "http://localhost:0/repository", action.getBaseUrl() );
View Full Code Here

            factory.setRepositorySession( session );

            ServletRunner sr = new ServletRunner();
            ServletUnitClient sc = sr.newClient();

            action.setServletRequest( sc.newInvocation( "http://localhost/admin/repositories.action" ).getRequest() );

            action.prepare();
            String result = action.execute();
            assertEquals( Action.SUCCESS, result );
View Full Code Here

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.