Package com.adito.testcontainer

Examples of com.adito.testcontainer.StrutsExecutionStep


        }
    }

    @SuppressWarnings("unchecked")
    private void showResource() {
        StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), "display", getForwardPath());
        executeStep(executionStep);
       
        ActionForm actionForm = getActionForm();
        assertNotNull("Should not be null", actionForm);
        assertTrue("Should be of type " + actionFormClass.getName(), actionForm.getClass().isAssignableFrom(actionFormClass));
View Full Code Here


    @SuppressWarnings("unchecked")
    public void testUnspecified() throws DuplicateResourceNameException, NoPermissionException {
        T resource = createResource();

        try {
            StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), "display", getForwardPath());
            executeStep(executionStep);

            AbstractResourcesForm<R> resourcesForm = (AbstractResourcesForm<R>) getActionForm();
            TableItemModel<R> model = resourcesForm.getModel();
            final int expectedRowCount = getInitialResourceCount() + 1;
View Full Code Here

     */
    public void testConfirmRemoveResource() throws Exception {
        T resource = createResource();

        try {
            StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), getConfirmDeletePath());
            executionStep.addRequestParameter("actionTarget", "confirmRemove");
            executionStep.addRequestParameter("selectedResource", String.valueOf(resource.getResourceId()));
            executeStep(executionStep);
           
            Collection<T> resources = getResources();
            assertEquals("Should be one resource", getInitialResourceCount() + 1, resources.size());
        } finally {
View Full Code Here

     * @throws Exception
     */
    public void testRemoveResource() throws Exception {
        T resource = createResource();

        StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), getRequestPath());
        executionStep.addRequestParameter("actionTarget", "remove");
        executionStep.addRequestParameter("selectedResource", String.valueOf(resource.getResourceId()));
        executionStep.addMessage(getRemovedMessage());
        executeStep(executionStep);
       
        Collection<T> resources = getResources();
        assertEquals("Should be zero resources", getInitialResourceCount(), resources.size());
    }
View Full Code Here

     */
    public void testViewResource() throws DuplicateResourceNameException, NoPermissionException {
        T resource = createResource();

        try {
            StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), getViewPath());
            executionStep.addRequestParameter("actionTarget", "view");
            executionStep.addRequestParameter("selectedResource", String.valueOf(resource.getResourceId()));
            executeStep(executionStep);
           
            T byId = getResourceById(resource.getResourceId());
            assertEquals("Resource should match", resource, byId);
        } finally {
View Full Code Here

     */
    public void testResourceInformation() throws DuplicateResourceNameException, NoPermissionException {
        T resource = createResource();

        try {
            StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), "/resourceInformation");
            executionStep.addRequestParameter("actionTarget", "information");
            executionStep.addRequestParameter("selectedResource", String.valueOf(resource.getResourceId()));
            executeStep(executionStep);
        } finally {
            deleteResource(resource);
        }
    }
View Full Code Here

     */
    public void testEditResource() throws DuplicateResourceNameException, NoPermissionException {
        T resource = createResource();

        try {
            StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), getEditPath());
            executionStep.addRequestParameter("actionTarget", "edit");
            executionStep.addRequestParameter("selectedResource", String.valueOf(resource.getResourceId()));
            executeStep(executionStep);
           
            T byId = getResourceById(resource.getResourceId());
            assertEquals("Resource should match", resource, byId);
        } finally {
View Full Code Here

    public void testListWithResource() throws DuplicateResourceNameException, NoPermissionException {
        T resource = createResource();

        try {
            performActionVerifyTiles("unspecified");
            StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), "display", getForwardPath());
            executionStep.addRequestParameter("actionTarget", "list");
            executeStep(executionStep);
           
            AbstractResourcesForm<R> resourcesForm = (AbstractResourcesForm<R>) getActionForm();
            TableItemModel<R> model = resourcesForm.getModel();
            final int expectedRowCount = getInitialResourceCount() + 1;
View Full Code Here

     * @throws DuplicateResourceNameException
     * @throws NoPermissionException
     */
    @SuppressWarnings("unchecked")
    public void testViewAsIcons() throws DuplicateResourceNameException, NoPermissionException {
        StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), "display", getForwardPath());
        executionStep.addRequestParameter("actionTarget", "viewIcons");
        executeStep(executionStep);
       
        AbstractResourcesForm<R> resourcesForm = (AbstractResourcesForm<R>) getActionForm();
        assertEquals("Selected view should be list", AbstractResourcesForm.ICONS_VIEW, resourcesForm.getSelectedView());
    }
View Full Code Here

     * @throws DuplicateResourceNameException
     * @throws NoPermissionException
     */
    @SuppressWarnings("unchecked")
    public void testViewAsList() throws DuplicateResourceNameException, NoPermissionException {
        StrutsExecutionStep executionStep = new StrutsExecutionStep(getRequestPath(), "display", getForwardPath());
        executionStep.addRequestParameter("actionTarget", "viewList");
        executeStep(executionStep);

        AbstractResourcesForm<R> resourcesForm = (AbstractResourcesForm<R>) getActionForm();
        assertEquals("Selected view should be list", AbstractResourcesForm.LIST_VIEW, resourcesForm.getSelectedView());
    }
View Full Code Here

TOP

Related Classes of com.adito.testcontainer.StrutsExecutionStep

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.