You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/07/18 07:27:25 UTC
[36/52] ISIS-839: renaming archetype directories.
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java
new file mode 100644
index 0000000..451904a
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java
@@ -0,0 +1,71 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.colls;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemContributions;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemContributionsTest_similarTo extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+ @Inject
+ private ToDoItemContributions toDoItemContributions;
+
+ private ToDoItemContributions toDoItemContributionsWrapped;
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = this.toDoItems.notYetComplete();
+ toDoItem = wrap(all.get(0));
+
+ toDoItemContributionsWrapped = wrap(toDoItemContributions);
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ List<ToDoItem> similarItems = toDoItemContributionsWrapped.similarTo(toDoItem);
+
+ // then
+ assertThat(similarItems.size(), is(6));
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
new file mode 100644
index 0000000..3423a34
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
@@ -0,0 +1,181 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.colls;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemSubscriptions;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.services.eventbus.CollectionAddedToEvent;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+public class ToDoItemTest_dependencies_add extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+
+ @Inject
+ private ToDoItems toDoItems;
+ @Inject
+ private ToDoItemSubscriptions toDoItemSubscriptions;
+
+ private ToDoItem toDoItem;
+ private ToDoItem otherToDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(items.get(0));
+ otherToDoItem = wrap(items.get(1));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ toDoItemSubscriptions.reset();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDependencies().size(), is(0));
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // then
+ assertThat(toDoItem.getDependencies().size(), is(1));
+ assertThat(toDoItem.getDependencies().first(), is(unwrap(otherToDoItem)));
+
+ // 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)));
+ }
+
+
+ @Test
+ public void cannotDependOnSelf() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("Can't set up a dependency to self");
+
+ // when
+ toDoItem.add(toDoItem);
+ }
+
+ @Test
+ public void cannotAddDependencyIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // then
+ expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AcceptEvents));
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // 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)));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.ThrowOtherException);
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // then
+ // (no expectedExceptions setup, expect to continue)
+ assertTrue(true);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
new file mode 100644
index 0000000..de8fb37
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
@@ -0,0 +1,176 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.colls;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemSubscriptions;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.services.eventbus.CollectionRemovedFromEvent;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+public class ToDoItemTest_dependencies_remove extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+ @Inject
+ private ToDoItemSubscriptions toDoItemSubscriptions;
+
+ private ToDoItem toDoItem;
+ private ToDoItem otherToDoItem;
+ private ToDoItem yetAnotherToDoItem;
+
+
+ @Before
+ public void setUp() throws Exception {
+
+ final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(items.get(0));
+ otherToDoItem = wrap(items.get(1));
+ yetAnotherToDoItem = wrap(items.get(2));
+
+ toDoItem.add(otherToDoItem);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ toDoItemSubscriptions.reset();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDependencies().size(), is(1));
+
+ // when
+ toDoItem.remove(otherToDoItem);
+
+ // then
+ assertThat(toDoItem.getDependencies().size(), is(0));
+ }
+
+
+ @Test
+ public void cannotRemoveItemIfNotADependency() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("Not a dependency");
+
+ // when
+ toDoItem.remove(yetAnotherToDoItem);
+ }
+
+ @Test
+ public void cannotRemoveDependencyIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // then
+ expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AcceptEvents));
+ assertThat(toDoItem.getDependencies().size(), is(1));
+
+ // when
+ toDoItem.remove(otherToDoItem);
+
+ // then
+ @SuppressWarnings("unchecked")
+ final CollectionRemovedFromEvent<ToDoItem,ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionRemovedFromEvent.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)));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.ThrowOtherException);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+
+ // then
+ // (no expectedExceptions setup, expect to continue)
+ assertTrue(true);
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
new file mode 100644
index 0000000..6f358c7
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
@@ -0,0 +1,75 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemContributions;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemContributionsTest_priority extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+ @Inject
+ private ToDoItemContributions toDoItemContributions;
+
+ private List<ToDoItem> notYetComplete;
+
+ @Before
+ public void setUp() throws Exception {
+ notYetComplete = wrap(toDoItems).notYetComplete();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+ assertPriority(0, 1);
+ assertPriority(1, 2);
+ assertPriority(2, 4);
+ assertPriority(3, 6);
+ assertPriority(4, 5);
+ assertPriority(5, 7);
+ assertPriority(6, 9);
+ assertPriority(7, 8);
+ assertPriority(8, 3);
+ assertPriority(9, 10);
+ }
+
+ private void assertPriority(final int n, final int priority) {
+ assertThat(toDoItemContributions.relativePriority(notYetComplete.get(n)), is(Integer.valueOf(priority)));
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
new file mode 100644
index 0000000..0e08405
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
@@ -0,0 +1,82 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.nio.charset.Charset;
+import java.util.List;
+import javax.activation.MimeType;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.value.Blob;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemTest_attachment extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ byte[] bytes = "{${symbol_escape}"foo${symbol_escape}": ${symbol_escape}"bar${symbol_escape}"}".getBytes(Charset.forName("UTF-8"));
+ final Blob newAttachment = new Blob("myfile.json", new MimeType("application/json"), bytes);
+
+ // when
+ toDoItem.setAttachment(newAttachment);
+
+ // then
+ assertThat(toDoItem.getAttachment(), is(newAttachment));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setAttachment((Blob)null);
+
+ // then
+ assertThat(toDoItem.getAttachment(), is((Blob)null));
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
new file mode 100644
index 0000000..75b907b
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
@@ -0,0 +1,62 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.containsString;
+
+public class ToDoItemTest_category extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
+ toDoItem.setCategory(Category.Professional);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
new file mode 100644
index 0000000..f9f2278
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
@@ -0,0 +1,100 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.math.BigDecimal;
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemTest_cost extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+
+ private ToDoItem toDoItem;
+ private BigDecimal cost;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ cost = toDoItem.getCost();
+ }
+
+ @Test
+ public void happyCaseUsingProperty() throws Exception {
+
+ final BigDecimal newCost = new BigDecimal("123.45");
+
+ // when
+ toDoItem.updateCost(newCost);
+
+ // then
+ assertThat(toDoItem.getCost(), is(newCost));
+ }
+
+ @Test
+ public void happyCaseUsingAction() throws Exception {
+
+ final BigDecimal newCost = new BigDecimal("123.45");
+
+ // when
+ toDoItem.updateCost(newCost);
+
+ // then
+ assertThat(toDoItem.getCost(), is(newCost));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.updateCost((BigDecimal)null);
+
+ // then
+ assertThat(toDoItem.getCost(), is((BigDecimal)null));
+ }
+
+ @Test
+ public void defaultForAction() throws Exception {
+
+ // then
+ assertThat(unwrap(toDoItem).default0UpdateCost(), is(cost));
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
new file mode 100644
index 0000000..619520a
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
@@ -0,0 +1,220 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemSubscriptions;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.services.eventbus.PropertyChangedEvent;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+public class ToDoItemTest_description extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+ @Inject
+ private ToDoItemSubscriptions toDoItemSubscriptions;
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ toDoItemSubscriptions.reset();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread and butter"));
+ }
+
+
+ @Test
+ public void failsRegex() throws Exception {
+
+ // when
+ expectedExceptions.expectMessage("Doesn't match pattern");
+ toDoItem.setDescription("exclamation marks are not allowed!!!");
+ }
+
+ @Test
+ public void cannotBeNull() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Mandatory");
+ toDoItem.setDescription(null);
+ }
+
+ @Test
+ public void cannotUseModify() throws Exception {
+
+ expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.modifyDescription("Buy bread and butter");
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+ }
+
+ @Test
+ public void cannotUseClear() throws Exception {
+
+ expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.clearDescription();
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+ }
+
+
+ @Test
+ public void onlyJustShortEnough() throws Exception {
+
+ // when, then
+ toDoItem.setDescription(characters(100));
+ }
+
+ @Test
+ public void tooLong() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("The value proposed exceeds the maximum length of 100");
+
+ // when
+ toDoItem.setDescription(characters(101));
+ }
+
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AcceptEvents));
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // 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"));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ @Test
+ public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.ThrowOtherException);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // then
+ // (no expectedExceptions setup, expect to continue)
+ assertTrue(true);
+ }
+
+
+ private static String characters(final int n) {
+ StringBuffer buf = new StringBuffer();
+ for(int i=0; i<n; i++) {
+ buf.append("a");
+ }
+ return buf.toString();
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
new file mode 100644
index 0000000..f9b043f
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
@@ -0,0 +1,106 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.joda.time.LocalDate;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.services.clock.ClockService;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemTest_dueBy extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ClockService clockService;
+ @Inject
+ private ToDoItems toDoItems;
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ final LocalDate fiveDaysFromNow = clockService.now().plusDays(5);
+ toDoItem.setDueBy(fiveDaysFromNow);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is(fiveDaysFromNow));
+ }
+
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setDueBy((LocalDate)null);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is((LocalDate)null));
+ }
+
+ @Test
+ public void canBeUpToSixDaysInPast() throws Exception {
+
+ final LocalDate nowAsLocalDate = clockService.now();
+ final LocalDate sixDaysAgo = nowAsLocalDate.plusDays(-5);
+
+ // when
+ toDoItem.setDueBy(sixDaysAgo);
+
+ // then
+ assertThat(toDoItem.getDueBy(), is(sixDaysAgo));
+ }
+
+
+ @Test
+ public void cannotBeMoreThanSixDaysInPast() throws Exception {
+
+ final LocalDate sevenDaysAgo = Clock.getTimeAsLocalDate().plusDays(-7);
+
+ // when, then
+ expectedExceptions.expectMessage("Due by date cannot be more than one week old");
+ toDoItem.setDueBy(sevenDaysAgo);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
new file mode 100644
index 0000000..e8b9a00
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
@@ -0,0 +1,90 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItemSubscriptions;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.services.eventbus.PropertyChangedEvent;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemTest_notes extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ private ToDoItem toDoItem;
+ private ToDoItemSubscriptions toDoItemSubscriptions;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ toDoItemSubscriptions = service(ToDoItemSubscriptions.class);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ toDoItemSubscriptions.reset();
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ final String newNotes = "Lorem ipsum yada yada";
+
+ // when
+ toDoItem.setNotes(newNotes);
+
+ // then
+ assertThat(toDoItem.getNotes(), is(newNotes));
+
+ // and then not published so not received
+ @SuppressWarnings("unchecked")
+ final PropertyChangedEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyChangedEvent.class);
+ assertThat(ev, is(nullValue()));
+ }
+
+ @Test
+ public void canBeNull() throws Exception {
+
+ // when
+ toDoItem.setNotes((String)null);
+
+ // then
+ assertThat(toDoItem.getNotes(), is((String)null));
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
new file mode 100644
index 0000000..caeb116
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
@@ -0,0 +1,61 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_ownedBy extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Always hidden");
+ toDoItem.setOwnedBy("other");
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
new file mode 100644
index 0000000..20579b2
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
@@ -0,0 +1,62 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.props;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItem.Subcategory;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.containsString;
+
+public class ToDoItemTest_subcategory extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
+ toDoItem.setSubcategory(Subcategory.Chores);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
new file mode 100644
index 0000000..03681ff
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
@@ -0,0 +1,84 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.repo;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemsTest_finders extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+
+ private int notYetCompletedSize;
+ private int completedSize;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
+ final List<ToDoItem> completedItems = wrap(toDoItems).complete();
+
+ notYetCompletedSize = notYetCompleteItems.size();
+ completedSize = completedItems.size();
+
+ assertThat(notYetCompletedSize, is(Matchers.greaterThan(5)));
+ }
+
+ @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));
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
new file mode 100644
index 0000000..6b8e94d
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
@@ -0,0 +1,68 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.repo;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItem.Category;
+import dom.todo.ToDoItem.Subcategory;
+import dom.todo.ToDoItems;
+import integration.tests.ToDoIntegTest;
+
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemsTest_newToDo_and_delete extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ // none
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // 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));
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
new file mode 100644
index 0000000..afbc6b7
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
@@ -0,0 +1,116 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package integration.tests.smoke;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.joda.time.LocalDate;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.clock.Clock;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemTest_title extends ToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ private ToDoItems toDoItems;
+
+ private ToDoItem toDoItem;
+ private LocalDate dueBy;
+
+ @Before
+ public void setUp() throws Exception {
+
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+
+ dueBy = toDoItem.getDueBy();
+ }
+
+
+ @Test
+ public void includesDescription() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread due by"));
+
+ // when
+ unwrap(toDoItem).setDescription("Buy bread and butter");
+
+ // then
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread and butter due by"));
+ }
+
+ @Test
+ public void includesDueDateIfAny() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), containsString("due by " + dueBy.toString("yyyy-MM-dd")));
+
+ // when
+ final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().plusDays(5);
+ unwrap(toDoItem).setDueBy(fiveDaysFromNow);
+
+ // then
+ assertThat(container().titleOf(toDoItem), containsString("due by " + fiveDaysFromNow.toString("yyyy-MM-dd")));
+ }
+
+
+ @Test
+ public void ignoresDueDateIfNone() throws Exception {
+
+ // when
+ // (since wrapped, will call clearDueBy)
+ toDoItem.setDueBy(null);
+
+ // then
+ assertThat(container().titleOf(toDoItem), not(containsString("due by")));
+ }
+
+ @Test
+ public void usesWhetherCompleted() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), not(containsString("Completed!")));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(container().titleOf(toDoItem), not(containsString("due by")));
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread - Completed!"));
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..1ba2a5a
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,395 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <version>${version}</version>
+
+ <name>Quickstart Wicket/Restful/JDO App</name>
+
+ <packaging>pom</packaging>
+
+ <prerequisites>
+ <maven>3.0.4</maven>
+ </prerequisites>
+
+ <properties>
+ <isis.version>1.5.0</isis.version>
+ <isis-objectstore-jdo.version>1.5.0</isis-objectstore-jdo.version>
+ <isis-viewer-wicket.version>1.5.0</isis-viewer-wicket.version>
+ <isis-viewer-restfulobjects.version>2.3.0</isis-viewer-restfulobjects.version>
+ <isis-security-shiro.version>1.5.0</isis-security-shiro.version>
+
+ <!-- must be consistent with the versions defined by the JDO Objectstore -->
+ <datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
+ <datanucleus-maven-plugin.version>3.3.2</datanucleus-maven-plugin.version>
+
+ <quartz-scheduler.version>2.2.1</quartz-scheduler.version>
+
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshots</name>
+ <url>https://repository.apache.org/content/repositories/snapshots/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ <executions>
+ <execution>
+ <id>source</id>
+ <phase>compile</phase>
+ </execution>
+ <execution>
+ <id>test</id>
+ <phase>test-compile</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ <include>**/*Test_*.java</include>
+ <include>**/*Spec*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Test*.java</exclude>
+ <exclude>**/*ForTesting.java</exclude>
+ <exclude>**/*Abstract*.java</exclude>
+ </excludes>
+ <useFile>true</useFile>
+ <printSummary>true</printSummary>
+ <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ <include>**/*Test_*.java</include>
+ <include>**/*Spec*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Test*.java</exclude>
+ <exclude>**/*ForTesting.java</exclude>
+ <exclude>**/*Abstract*.java</exclude>
+ </excludes>
+ <showSuccess>false</showSuccess>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.5.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.3</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.26</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- http://simplericity.com/2009/11/10/1257880778509.html -->
+ <plugin>
+ <groupId>org.simplericity.jettyconsole</groupId>
+ <artifactId>jetty-console-maven-plugin</artifactId>
+ <!-- update to 1.54 reversed,since seems compiled against 1.7 (major.minor version 51.0) -->
+ <version>1.43</version>
+ </plugin>
+
+ <!-- Apache Release Audit Tool -->
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.10</version>
+ <configuration>
+ <addDefaultLicenseMatchers>true</addDefaultLicenseMatchers>
+ <excludeSubProjects>true</excludeSubProjects>
+ <excludes>
+ <exclude>**/target/**</exclude>
+ <exclude>**/target-ide/**</exclude>
+
+ <exclude>**/*.project</exclude>
+ <exclude>**/.classpath</exclude>
+ <exclude>**/.settings/**</exclude>
+ <exclude>**/*.launch</exclude>
+ <exclude>src/site/resources/ide/eclipse/**</exclude>
+
+ <exclude>**/rebel.xml</exclude>
+ <exclude>**/*.gitignore</exclude>
+ <exclude>**/*.log</exclude>
+ <exclude>**/*.pdn</exclude>
+ <exclude>**/*.svg</exclude>
+ <exclude>**/*.json</exclude>
+ <exclude>**/*.min.js</exclude>
+ <exclude>**/*.js</exclude>
+ </excludes>
+ <licenses>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>AL2</licenseFamilyCategory>
+ <licenseFamilyName>Apache License 2.0</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Licensed to the Apache Software Foundation (ASF) under one</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>JQRY</licenseFamilyCategory>
+ <licenseFamilyName>MIT</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Dual licensed under the MIT or GPL Version 2 licenses.</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>JMOCK</licenseFamilyCategory>
+ <licenseFamilyName>JMock</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Copyright (c) 2000-2007, jMock.org</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>DOCBK</licenseFamilyCategory>
+ <licenseFamilyName>DocBook 4.5</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Permission to copy in any form is granted for use</pattern>
+ <pattern>Permission to use, copy, modify and distribute the DocBook DTD</pattern>
+ <pattern>is hereby granted in perpetuity, provided that the above copyright</pattern>
+ <pattern>This is the catalog data file for DocBook XML V4.5. It is provided as</pattern>
+ <pattern>XML Catalog data for DocBook XML V4.5</pattern>
+ <pattern>DocBook additional general entities V4.5</pattern>
+ <pattern>XML EXCHANGE TABLE MODEL DECLARATION MODULE</pattern>
+ </patterns>
+ </license>
+ <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>W3C</licenseFamilyCategory>
+ <licenseFamilyName>XHTML</licenseFamilyName>
+ <notes />
+ <patterns>
+ <pattern>Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),</pattern>
+ </patterns>
+ </license>
+ </licenses>
+ <licenseFamilies>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>Apache License 2.0</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>MIT</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>JMock</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>DocBook 4.5</familyName>
+ </licenseFamily>
+ <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
+ <familyName>XHTML</familyName>
+ </licenseFamily>
+ </licenseFamilies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis</artifactId>
+ <version>${isis.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.objectstore</groupId>
+ <artifactId>isis-objectstore-jdo</artifactId>
+ <version>${isis-objectstore-jdo.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.viewer</groupId>
+ <artifactId>isis-viewer-wicket</artifactId>
+ <version>${isis-viewer-wicket.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.viewer</groupId>
+ <artifactId>isis-viewer-restfulobjects</artifactId>
+ <version>${isis-viewer-restfulobjects.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.security</groupId>
+ <artifactId>isis-security-shiro</artifactId>
+ <version>${isis-security-shiro.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+
+ <!-- this project's own modules -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-dom</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-fixture</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-webapp</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+
+
+ <!-- quartz scheduler integration -->
+
+ <dependency>
+ <groupId>org.quartz-scheduler</groupId>
+ <artifactId>quartz</artifactId>
+ <version>${quartz-scheduler.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.quartz-scheduler</groupId>
+ <artifactId>quartz-jobs</artifactId>
+ <version>${quartz-scheduler.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+
+ <profiles>
+ <profile>
+ <id>m2e</id>
+ <activation>
+ <property>
+ <name>m2e.version</name>
+ </property>
+ </activation>
+ <build>
+ <directory>target-ide</directory>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
new file mode 100644
index 0000000..358e3d9
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
@@ -0,0 +1,26 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
+ </mapAttribute>
+ <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
+ <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+ <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+ </listAttribute>
+ <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
+ <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
+ <stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
+ <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
+ <stringAttribute value="${jrebel_args} -Drebel.log=false -Drebel.check_class_hash=true -Drebel.packages_exclude=org.apache.isis -Dproject.root=${project_loc}/.. -Dtarget.dir=target-ide -Drebel.plugins=C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar -Disis-jrebel-plugin.packagePrefix=dom.todo,org.apache.isis.objectstore.jdo.applib -Disis-jrebel-plugin.loggingLevel=warn -XX:MaxPermSize=128m" key="org.eclipse.jdt.launching.VM_ARGUMENTS"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
new file mode 100644
index 0000000..3376620
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
@@ -0,0 +1,22 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
+ </mapAttribute>
+ <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
+ <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
+ <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
+ <stringAttribute value="--port 8080 -D isis.persistor.datanucleus.install-fixtures=true --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
+ <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/b6954e56/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
new file mode 100644
index 0000000..4fd7be2
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
@@ -0,0 +1,25 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/isis-core-webserver/src/main/java/org/apache/isis/WebServer.java"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[debug]"/>
+ <mapEntry value="org.eclipse.jdt.launching.localJavaApplication" key="[run]"/>
+ </mapAttribute>
+ <stringAttribute value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" key="org.eclipse.debug.core.source_locator_id"/>
+ <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+ <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+ </listAttribute>
+ <booleanAttribute value="true" key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
+ <stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
+ <stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
+ <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
+</launchConfiguration>