Package name.pehl.karaka.shared.model

Examples of name.pehl.karaka.shared.model.Activities


    }


    public Activities month(int numberOfActivities)
    {
        Activities activities = newActivities(MONTH);
        DateTime start = new MutableDateTime().dayOfMonth().set(1).hourOfDay().set(8).toDateTime();
        for (int i = 0; i < numberOfActivities; i++)
        {
            DateTime end = start.plusHours(1);
            activities.add(newActivity(start, end));
            start = start.plusDays(1);
        }
        return activities;
    }
View Full Code Here


    }


    public Activities week(int numberOfActivities)
    {
        Activities activities = newActivities(WEEK);
        DateTime start = new MutableDateTime().dayOfWeek().set(1).hourOfDay().set(8).toDateTime();
        for (int i = 0; i < numberOfActivities; i++)
        {
            DateTime end = start.plusHours(1);
            activities.add(newActivity(start, end));
            start = start.plusDays(1);
        }
        return activities;
    }
View Full Code Here

    }


    public Activities day(int numberOfActivities)
    {
        Activities activities = newActivities(DAY);
        DateTime start = new MutableDateTime().dayOfMonth().set(1).hourOfDay().set(8).toDateTime();
        for (int i = 0; i < numberOfActivities; i++)
        {
            DateTime end = start.plusHours(1);
            activities.add(newActivity(start, end));
            start = end.plusHours(1);
        }
        return activities;
    }
View Full Code Here


    public Activities newActivities(TimeUnit unit)
    {
        DateMidnight now = new DateMidnight();
        return new Activities(now.getYear(), now.getMonthOfYear(), now.getWeekOfWeekyear(), now.getDayOfMonth(), unit);
    }
View Full Code Here

        method.send(new KarakaJsonCallback<Activities, GetActivitiesResult>(activitiesReader, resultCallback)
        {
            @Override
            protected GetActivitiesResult extractResult(final Method method, JsonReader<Activities> reader, JSONObject json)
            {
                Activities activities = activitiesReader.read(json);
                activities.setLinks(readHeaderLinks(method));
                return new GetActivitiesResult(activities);
            }
        });
    }
View Full Code Here

    @Test
    @SuppressWarnings("unchecked")
    public void getActivities()
    {
        // GetActivitiesCommand - success
        Activities activities = td.newActivities(MONTH);
        PlaceRequest placeRequest = new PlaceRequest(NameTokens.dashboard).with("path", "2000/1");
        ActivitiesRequest activitiesRequest = new TestableActivitiesRequest(placeRequest);
        GetActivitiesAction getActivitiesAction = new GetActivitiesAction(activitiesRequest);
        final GetActivitiesResult getActivitiesResult = new GetActivitiesResult(activities);
        Answer<Object> getActivitiesAnswerSuccess = new Answer<Object>()
View Full Code Here

    // ------------------------------------------------------------------ tests

    @Test
    public void onActivitiesLoaded()
    {
        Activities activities = td.newActivities(WEEK);
        cut.onActivitiesLoaded(new ActivitiesLoadedEvent(activities));
        verify(view).updateActivities(activities);
    }
View Full Code Here

    @Test
    public void onActivityChanged()
    {
        Activity activity = td.newActivity();
        Activities activities = td.newActivities(MONTH);
        activities.add(activity);
        cut.onActivityChanged(td.newActivityChangedEvent(CHANGED, activity, activities));
        verify(view).updateActivities(activities);

        reset(view);
        activities = td.newActivities(WEEK);
        activities.add(activity);
        cut.onActivityChanged(td.newActivityChangedEvent(CHANGED, activity, activities));
        verify(view).updateActivities(activities);

        reset(view);
        cut.onActivityChanged(td.newActivityChangedEvent(DELETE));
View Full Code Here

    @Test
    public void onTick()
    {
        Activity activity = td.newActivity();
        Activities activities = td.newActivities(MONTH);
        activities.add(activity);
        cut.onTick(td.newTickEvent(activity, activities));
        verify(view).updateActivities(activities);

        reset(view);
        activities = td.newActivities(WEEK);
        activities.add(activity);
        cut.onTick(td.newTickEvent(activity, activities));
        verify(view).updateActivities(activities);
    }
View Full Code Here

    @Test
    public void onDeleteCurrentActivity()
    {
        prepareGetMinutes();
        Activity activity = td.newActivity();
        Activities activities = td.newActivities(WEEK);
        cut.currentActivity = activity;
        cut.onActivityChanged(td.newActivityChangedEvent(DELETE, activity, activities));
        assertNull(cut.currentActivity);
        verify(view).updateStatus(null);
        verifyGetDurations();
View Full Code Here

TOP

Related Classes of name.pehl.karaka.shared.model.Activities

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.