Examples of ToDoItem


Examples of dom.todo.ToDoItem

        // and then
        final ToDoItem.CompletedEvent ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(ToDoItem.CompletedEvent.class);
        assertThat(ev, is(not(nullValue())));

        ToDoItem source = ev.getSource();
        assertThat(source, is(equalTo(unwrap(toDoItem))));
        assertThat(ev.getIdentifier().getMemberName(), is("completed"));
    }
View Full Code Here

Examples of dom.todo.ToDoItem

        // and then
        @SuppressWarnings("unchecked")
        final CollectionAddedToEvent<ToDoItem,ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionAddedToEvent.class);
        assertThat(ev, is(not(nullValue())));
       
        ToDoItem source = ev.getSource();
        assertThat(source, is(equalTo(unwrap(toDoItem))));
        assertThat(ev.getIdentifier().getMemberName(), is("dependencies"));
        assertThat(ev.getValue(), is(unwrap(otherToDoItem)));
    }
View Full Code Here

Examples of dom.todo.ToDoItem

        // then
        @SuppressWarnings("unchecked")
        final CollectionAddedToEvent<ToDoItem,ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionAddedToEvent.class);
        assertThat(ev, is(not(nullValue())));

        ToDoItem source = ev.getSource();
        assertThat(source, is(equalTo(unwrap(toDoItem))));
        assertThat(ev.getIdentifier().getMemberName(), is("dependencies"));
        assertThat(ev.getValue(), is(unwrap(otherToDoItem)));
    }
View Full Code Here

Examples of dom.todo.ToDoItem

       
        // given
        int size = wrap(toDoItems).notYetComplete().size();
       
        // when
        final ToDoItem newToDo = wrap(service(ToDoItems.class)).newToDo("new todo", Category.Professional, Subcategory.OpenSource, null, null);

        // then
        assertThat(newToDo.getDescription(), is("new todo"));
        assertThat(newToDo.getCategory(), is(Category.Professional));
        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size+1));
       
        // when
        newToDo.delete();

        // then
        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size));
    }
View Full Code Here

Examples of dom.todo.ToDoItem

    @Test
    public void complete_and_notYetComplete() throws Exception {
       
        // given
        List<ToDoItem> notYetCompleteItems = wrap(service(ToDoItems.class)).notYetComplete();
        final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
       
        // when
        toDoItem.completed();
       
        // then
        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize-1));
        assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize+1));
       
        // and when
        toDoItem.notYetCompleted();
       
        // then
        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize));
        assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize));
    }
View Full Code Here

Examples of dom.todo.ToDoItem

        // then published and received
        @SuppressWarnings("unchecked")
        final PropertyChangedEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyChangedEvent.class);
        assertThat(ev, is(not(nullValue())));

        ToDoItem source = ev.getSource();
        assertThat(source, is(equalTo(unwrap(toDoItem))));
        assertThat(ev.getIdentifier().getMemberName(), is("description"));
        assertThat(ev.getOldValue(), is("Buy bread"));
        assertThat(ev.getNewValue(), is("Buy bread and butter"));
    }
View Full Code Here

Examples of org.apache.tapestry.integration.app1.data.ToDoItem

        add("Cure Common Cold", Urgency.LOW, 3);
    }

    private void add(String title, Urgency urgency, int order)
    {
        ToDoItem item = new ToDoItem();

        item.setTitle(title);
        item.setUrgency(urgency);
        item.setOrder(order);

        add(item);
    }
View Full Code Here

Examples of org.apache.tapestry.integration.app1.data.ToDoItem

    {
        _database.clear();

        for (int i = 0; i < 20; i++)
        {
            ToDoItem item = new ToDoItem();
            item.setTitle("ToDo # " + (i + 1));
            item.setOrder(i);

            _database.add(item);
        }
    }
View Full Code Here

Examples of org.apache.tapestry.integration.app1.data.ToDoItem

    void onSelectedFromAddNew()
    {
        if (_form.isValid())
        {
            ToDoItem item = new ToDoItem();
            item.setTitle("<New To Do>");
            item.setOrder(_items.size());

            _database.add(item);
        }
    }
View Full Code Here

Examples of org.apache.tapestry.integration.app1.data.ToDoItem

    void onSelectedFromAddNew()
    {
        if (_form.isValid())
        {
            ToDoItem item = new ToDoItem();
            item.setTitle("<New To Do>");
            item.setOrder(_encoder.getValues().size());

            _database.add(item);
        }
    }
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.