Package in.partake.controller

Examples of in.partake.controller.ActionProxy


import org.junit.Test;

public class StaticContactPageActionTest extends ActionControllerTest {
    @Test
    public void testToExecute() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/contact");
        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);

        proxy.execute();
        assertResultSuccess(proxy);
    }
View Full Code Here


        assertResultSuccess(proxy);
    }

    @Test
    public void testToExecuteWithoutLogin() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/contact");

        proxy.execute();
        assertResultSuccess(proxy);
    }
View Full Code Here

import in.partake.controller.ActionProxy;

public class ToppageActionTest extends ActionControllerTest {
    @Test
    public void testToExecute() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/");
        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);

        proxy.execute();
        assertResultSuccess(proxy);
    }
View Full Code Here

        assertResultSuccess(proxy);
    }

    @Test
    public void testToExecuteWithoutLogin() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/");

        proxy.execute();
        assertResultSuccess(proxy);
    }
View Full Code Here

import org.junit.Test;

public class StaticTermOfUsePageActionTest extends ActionControllerTest {
    @Test
    public void testToExecute() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/termofuse");
        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);

        proxy.execute();
        assertResultSuccess(proxy);
    }
View Full Code Here

        assertResultSuccess(proxy);
    }

    @Test
    public void testToExecuteWithoutLogin() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/termofuse");

        proxy.execute();
        assertResultSuccess(proxy);
    }
View Full Code Here

public class CategoryCalendarTest extends ActionControllerTest {

    @Test
    public void testWithValidCategory() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/calendars/category/" + EventCategory.getCategories().get(0).getKey());
        proxy.execute();

        assertThat(Helpers.contentType(proxy.getResult()), is("text/calendar"));
        assertThat(Helpers.charset(proxy.getResult()), is("utf-8"));
        assertThat(Helpers.header("Content-Disposition", proxy.getResult()), is("inline"));

        CalendarBuilder builder = new CalendarBuilder();
        Calendar calendar = builder.build(new ByteArrayInputStream(Helpers.contentAsBytes(proxy.getResult())));

        ComponentList list = calendar.getComponents(Component.VEVENT);
        List<String> uids = new ArrayList<String>();
        for (Object obj : list) {
            VEvent vEvent = (VEvent) obj;
View Full Code Here

        assertThat(uids, not(hasItem(TestDataProvider.PRIVATE_EVENT_ID)));
    }

    @Test
    public void testWithInvalidCategory() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/calendars/category/invalidCateogry");
        proxy.execute();

        assertResultNotFound(proxy);
    }
View Full Code Here

public class ShowCalendarTest extends ActionControllerTest {

    @Test
    public void testWithValidCalendarId() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/calendars/" + ENROLLED_USER_CALENDAR_ID);
        proxy.execute();

        assertThat(Helpers.contentType(proxy.getResult()), is("text/calendar"));
        assertThat(Helpers.charset(proxy.getResult()), is("utf-8"));
        assertThat(Helpers.header("Content-Disposition", proxy.getResult()), is("inline"));

        CalendarBuilder builder = new CalendarBuilder();
        Calendar calendar = builder.build(new ByteArrayInputStream(Helpers.contentAsBytes(proxy.getResult())));

        ComponentList list = calendar.getComponents(Component.VEVENT);
        List<String> uids = new ArrayList<String>();
        for (Object obj : list) {
            VEvent vEvent = (VEvent) obj;
View Full Code Here

        assertThat(uids, hasItem(TestDataProvider.PRIVATE_EVENT_ID));
   }

    @Test
    public void testWithInvalidCalendarId() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/calendars/" + INVALID_CALENDAR_ID);
        proxy.execute();

        assertResultNotFound(proxy);
    }
View Full Code Here

TOP

Related Classes of in.partake.controller.ActionProxy

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.