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 2013/07/16 12:53:17 UTC
[1/2] ISIS-463: sorting out ToDo app specs and integ tests.
Updated Branches:
refs/heads/master a9bea733e -> 789022471
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
new file mode 100644
index 0000000..9c6d96b
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
@@ -0,0 +1,70 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_notes extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ // given
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ final String newNotes = "Lorem ipsum yada yada";
+
+ // when
+ toDoItem.setNotes(newNotes);
+
+ // then
+ assertThat(toDoItem.getNotes(), is(newNotes));
+ }
+
+ @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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
new file mode 100644
index 0000000..fface0b
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
@@ -0,0 +1,53 @@
+/*
+ * 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 integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_ownedBy extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_attachment.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_attachment.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_attachment.java
deleted file mode 100644
index eec163c..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_attachment.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.nio.charset.Charset;
-import java.util.List;
-
-import javax.activation.MimeType;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.value.Blob;
-
-public class ToDoItem_attachment extends ToDoIntegTest {
-
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
-
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- byte[] bytes = "{\"foo\": \"bar\"}".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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_category.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_category.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_category.java
deleted file mode 100644
index e65218a..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_category.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import dom.todo.ToDoItem.Category;
-import fixture.todo.ToDoItemsFixture;
-
-import org.joda.time.LocalDate;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.clock.Clock;
-
-public class ToDoItem_category extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- toDoItem.setCategory(Category.Professional);
-
- // then
- assertThat(toDoItem.getCategory(), is(Category.Professional));
-
- // when
- toDoItem.setCategory(Category.Domestic);
-
- // then
- assertThat(toDoItem.getCategory(), is(Category.Domestic));
- }
-
-
- @Test
- public void cannotBeNull() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Mandatory");
- toDoItem.setCategory(null);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_cost.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_cost.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_cost.java
deleted file mode 100644
index 6da6ff1..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_cost.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.math.BigDecimal;
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItem_cost extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private BigDecimal cost;
-
- @Before
- public void setUp() throws Exception {
- // given
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- cost = toDoItem.getCost();
- }
-
- @Test
- public void happyCaseUsingProperty() throws Exception {
-
- final BigDecimal newCost = new BigDecimal("123.45");
-
- // when
- toDoItem.setCost(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.setCost((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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_description.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_description.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_description.java
deleted file mode 100644
index 591ed3a..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_description.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItem_description extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @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);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_dueBy.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_dueBy.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_dueBy.java
deleted file mode 100644
index eca2da9..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_dueBy.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.joda.time.LocalDate;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.clock.Clock;
-
-public class ToDoItem_dueBy extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().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 sixDaysAgo = Clock.getTimeAsLocalDate().plusDays(-6);
-
- // 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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_notes.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_notes.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_notes.java
deleted file mode 100644
index e3cedca..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_notes.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItem_notes extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- // given
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- final String newNotes = "Lorem ipsum yada yada";
-
- // when
- toDoItem.setNotes(newNotes);
-
- // then
- assertThat(toDoItem.getNotes(), is(newNotes));
- }
-
- @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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_ownedBy.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_ownedBy.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_ownedBy.java
deleted file mode 100644
index ccb8275..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItem_ownedBy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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 integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItem_ownedBy extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
new file mode 100644
index 0000000..08461d2
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
@@ -0,0 +1,75 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemsTest_finders extends ToDoIntegTest {
+
+ private int notYetCompletedSize;
+ private int completedSize;
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> notYetCompleteItems = wrap(service(ToDoItems.class)).notYetComplete();
+ final List<ToDoItem> completedItems = wrap(service(ToDoItems.class)).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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
new file mode 100644
index 0000000..3f51963
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
@@ -0,0 +1,53 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import dom.todo.ToDoItem.Category;
+
+import org.junit.Test;
+
+public class ToDoItemsTest_newToDo_and_delete extends ToDoIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ int size = wrap(service(ToDoItems.class)).notYetComplete().size();
+
+ // when
+ final ToDoItem newToDo = wrap(service(ToDoItems.class)).newToDo("new todo", Category.Professional, 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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItems_finders.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItems_finders.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItems_finders.java
deleted file mode 100644
index 1d98c70..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItems_finders.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.hamcrest.Matchers;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItems_finders extends ToDoIntegTest {
-
- private int notYetCompletedSize;
- private int completedSize;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> notYetCompleteItems = wrap(service(ToDoItems.class)).notYetComplete();
- final List<ToDoItem> completedItems = wrap(service(ToDoItems.class)).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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItems_newToDo_and_delete.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItems_newToDo_and_delete.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItems_newToDo_and_delete.java
deleted file mode 100644
index a12b9f5..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/repo/ToDoItems_newToDo_and_delete.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import dom.todo.ToDoItem.Category;
-
-import org.junit.Test;
-
-public class ToDoItems_newToDo_and_delete extends ToDoIntegTest {
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- int size = wrap(service(ToDoItems.class)).notYetComplete().size();
-
- // when
- final ToDoItem newToDo = wrap(service(ToDoItems.class)).newToDo("new todo", Category.Professional, 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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
new file mode 100644
index 0000000..5d46249
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
@@ -0,0 +1,109 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.joda.time.LocalDate;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.applib.clock.Clock;
+
+public class ToDoItemTest_title extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+ private LocalDate dueBy;
+
+
+ @Before
+ public void setUp() throws Exception {
+
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/smoke/ToDoItem_title.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/smoke/ToDoItem_title.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/smoke/ToDoItem_title.java
deleted file mode 100644
index 89b883c..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/smoke/ToDoItem_title.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.joda.time.LocalDate;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.clock.Clock;
-
-public class ToDoItem_title extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private LocalDate dueBy;
-
-
- @Before
- public void setUp() throws Exception {
-
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).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/78902247/example/application/quickstart_wicket_restful_jdo/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/pom.xml b/example/application/quickstart_wicket_restful_jdo/pom.xml
index ad8ca91..c1279da 100644
--- a/example/application/quickstart_wicket_restful_jdo/pom.xml
+++ b/example/application/quickstart_wicket_restful_jdo/pom.xml
@@ -83,13 +83,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.5</version>
+ <version>2.10</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>false</printSummary>
+ <printSummary>true</printSummary>
<outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
</configuration>
</plugin>
@@ -97,10 +104,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.5</version>
+ <version>2.10</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>
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 60f7108..25bcf8c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,6 +92,41 @@
<module>component/viewer/restfulobjects</module>
</modules>
</profile>
+
+ <profile>
+ <id>core</id>
+ <modules>
+ <module>core</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>objectstore-jdo</id>
+ <modules>
+ <module>component/objectstore/jdo</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>viewer-wicket</id>
+ <modules>
+ <module>component/viewer/wicket</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>viewer-restfulobjects</id>
+ <modules>
+ <module>component/viewer/restfulobjects</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>quickstart</id>
+ <modules>
+ <module>example/application/quickstart_wicket_restful_jdo</module>
+ </modules>
+ </profile>
</profiles>
</project>
[2/2] git commit: ISIS-463: sorting out ToDo app specs and integ
tests.
Posted by da...@apache.org.
ISIS-463: sorting out ToDo app specs and integ tests.
* the pom configuration was incorrect
* mandating a consistent naming convention
* adding some simple unit tests in the dom package
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/78902247
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/78902247
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/78902247
Branch: refs/heads/master
Commit: 789022471d873d576f4f075850205e6f5f90e14b
Parents: a9bea73
Author: Dan Haywood <da...@apache.org>
Authored: Tue Jul 16 11:43:24 2013 +0100
Committer: Dan Haywood <da...@apache.org>
Committed: Tue Jul 16 11:43:24 2013 +0100
----------------------------------------------------------------------
.../quickstart_wicket_restful_jdo/dom/pom.xml | 6 +
.../test/java/dom/todo/ToDoTest_completed.java | 48 ++++++++
.../java/dom/todo/ToDoTest_notYetCompleted.java | 48 ++++++++
.../integtests/pom.xml | 32 +++---
.../integration/specs/InMemoryDBForToDoApp.java | 40 +++++++
.../todoitem/BootstrapIntegrationStepDefs.java | 37 -------
.../FindAndCompleteToDoItemsSpec.feature | 38 -------
.../todoitem/FindAndCompleteToDoItemsSpec.java | 37 -------
...dToDoItemAndMarkAsNotYetCompleteSpec.feature | 34 ------
...etedToDoItemAndMarkAsNotYetCompleteSpec.java | 37 -------
.../specs/todoitem/InMemoryDBForToDoApp.java | 40 -------
.../ToDoItemSpec_findAndComplete.feature | 38 +++++++
.../todoitem/ToDoItemSpec_findAndComplete.java | 37 +++++++
...findCompletedAndMarkAsNotYetComplete.feature | 34 ++++++
...ec_findCompletedAndMarkAsNotYetComplete.java | 37 +++++++
.../specs/todoitem/ToDoItemStepDefs.java | 8 +-
.../tests/actions/ToDoItemTest_completed.java | 83 ++++++++++++++
.../tests/actions/ToDoItemTest_duplicate.java | 72 ++++++++++++
.../actions/ToDoItemTest_notYetCompleted.java | 73 +++++++++++++
.../tests/actions/ToDoItem_completed.java | 83 --------------
.../tests/actions/ToDoItem_duplicate.java | 72 ------------
.../tests/actions/ToDoItem_notYetCompleted.java | 73 -------------
.../colls/ToDoItemTest_dependencies_add.java | 89 +++++++++++++++
.../colls/ToDoItemTest_dependencies_remove.java | 93 ++++++++++++++++
.../tests/colls/ToDoItem_dependencies_add.java | 89 ---------------
.../colls/ToDoItem_dependencies_remove.java | 93 ----------------
.../tests/props/ToDoItemTest_attachment.java | 78 +++++++++++++
.../tests/props/ToDoItemTest_category.java | 76 +++++++++++++
.../tests/props/ToDoItemTest_cost.java | 92 ++++++++++++++++
.../tests/props/ToDoItemTest_description.java | 76 +++++++++++++
.../tests/props/ToDoItemTest_dueBy.java | 95 ++++++++++++++++
.../tests/props/ToDoItemTest_notes.java | 70 ++++++++++++
.../tests/props/ToDoItemTest_ownedBy.java | 53 +++++++++
.../tests/props/ToDoItem_attachment.java | 78 -------------
.../tests/props/ToDoItem_category.java | 76 -------------
.../integration/tests/props/ToDoItem_cost.java | 92 ----------------
.../tests/props/ToDoItem_description.java | 76 -------------
.../integration/tests/props/ToDoItem_dueBy.java | 95 ----------------
.../integration/tests/props/ToDoItem_notes.java | 70 ------------
.../tests/props/ToDoItem_ownedBy.java | 53 ---------
.../tests/repo/ToDoItemsTest_finders.java | 75 +++++++++++++
.../repo/ToDoItemsTest_newToDo_and_delete.java | 53 +++++++++
.../tests/repo/ToDoItems_finders.java | 75 -------------
.../repo/ToDoItems_newToDo_and_delete.java | 53 ---------
.../tests/smoke/ToDoItemTest_title.java | 109 +++++++++++++++++++
.../integration/tests/smoke/ToDoItem_title.java | 109 -------------------
.../quickstart_wicket_restful_jdo/pom.xml | 20 +++-
pom.xml | 35 ++++++
48 files changed, 1550 insertions(+), 1430 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/dom/pom.xml b/example/application/quickstart_wicket_restful_jdo/dom/pom.xml
index f9821d4..f5e4550 100644
--- a/example/application/quickstart_wicket_restful_jdo/dom/pom.xml
+++ b/example/application/quickstart_wicket_restful_jdo/dom/pom.xml
@@ -107,6 +107,12 @@
<groupId>org.apache.isis.objectstore</groupId>
<artifactId>isis-objectstore-jdo-applib</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-unittestsupport</artifactId>
+ <scope>true</scope>
+ </dependency>
<!--
GMAP3: uncomment to use https://github.com/danhaywood/isis-wicket-gmap3
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/dom/src/test/java/dom/todo/ToDoTest_completed.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/dom/src/test/java/dom/todo/ToDoTest_completed.java b/example/application/quickstart_wicket_restful_jdo/dom/src/test/java/dom/todo/ToDoTest_completed.java
new file mode 100644
index 0000000..07f53cb
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/dom/src/test/java/dom/todo/ToDoTest_completed.java
@@ -0,0 +1,48 @@
+/**
+ * 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 dom.todo;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoTest_completed {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ toDoItem = new ToDoItem();
+ toDoItem.setComplete(false);
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+ // given
+ assertThat(toDoItem.disableCompleted(), is(nullValue()));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(true));
+ assertThat(toDoItem.disableCompleted(), is(not(nullValue())));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/dom/src/test/java/dom/todo/ToDoTest_notYetCompleted.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/dom/src/test/java/dom/todo/ToDoTest_notYetCompleted.java b/example/application/quickstart_wicket_restful_jdo/dom/src/test/java/dom/todo/ToDoTest_notYetCompleted.java
new file mode 100644
index 0000000..3ab3598
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/dom/src/test/java/dom/todo/ToDoTest_notYetCompleted.java
@@ -0,0 +1,48 @@
+/**
+ * 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 dom.todo;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoTest_notYetCompleted {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ toDoItem = new ToDoItem();
+ toDoItem.setComplete(true);
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+ // given
+ assertThat(toDoItem.disableNotYetCompleted(), is(nullValue()));
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(false));
+ assertThat(toDoItem.disableNotYetCompleted(), is(not(nullValue())));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/pom.xml b/example/application/quickstart_wicket_restful_jdo/integtests/pom.xml
index 553f460..81ead19 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/pom.xml
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/pom.xml
@@ -30,22 +30,22 @@
<name>Quickstart Wicket/Restful/JDO Integration Tests</name>
<build>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/*Test*.java</include>
- <include>**/*Specs*.java</include>
- </includes>
- <excludes>
- <exclude>**/*Abstract*.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
</build>
<dependencies>
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/InMemoryDBForToDoApp.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/InMemoryDBForToDoApp.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/InMemoryDBForToDoApp.java
new file mode 100644
index 0000000..0d66741
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/InMemoryDBForToDoApp.java
@@ -0,0 +1,40 @@
+/**
+ * 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.specs;
+
+import dom.todo.ToDoItem;
+
+import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
+import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
+
+public class InMemoryDBForToDoApp extends InMemoryDB {
+
+ public InMemoryDBForToDoApp(ScenarioExecution scenarioExecution) {
+ super(scenarioExecution);
+ }
+
+ /**
+ * Hook to initialize if possible.
+ */
+ @Override
+ protected void init(Object obj, String str) {
+ if(obj instanceof ToDoItem) {
+ ToDoItem toDoItem = (ToDoItem) obj;
+ toDoItem.setDescription(str);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/BootstrapIntegrationStepDefs.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/BootstrapIntegrationStepDefs.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/BootstrapIntegrationStepDefs.java
deleted file mode 100644
index 6b3f690..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/BootstrapIntegrationStepDefs.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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.specs.todoitem;
-
-import integration.ToDoSystemInitializer;
-import cucumber.api.java.Before;
-
-import org.apache.log4j.PropertyConfigurator;
-
-import org.apache.isis.core.specsupport.scenarios.ScenarioExecutionScope;
-import org.apache.isis.core.specsupport.specs.CukeStepDefsAbstract;
-
-public class BootstrapIntegrationStepDefs extends CukeStepDefsAbstract {
-
- @Before(value={"@integration"}, order=100)
- public void beforeScenarioIntegrationScope() {
- PropertyConfigurator.configure("logging.properties");
- ToDoSystemInitializer.initIsft();
-
- before(ScenarioExecutionScope.INTEGRATION);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindAndCompleteToDoItemsSpec.feature
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindAndCompleteToDoItemsSpec.feature b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindAndCompleteToDoItemsSpec.feature
deleted file mode 100644
index c3e2f29..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindAndCompleteToDoItemsSpec.feature
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# 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.
-#
-Feature: Find And Complete ToDo Items
-
- # the scenario is listed twice here just to demonstrate that it
- # can be run either at @unit-level scope (using mocks) or
- # at @integration-level scope (against the running system).
-
- @unit
- Scenario: Todo items once completed are no longer listed
- Given there are a number of incomplete ToDo items
- When I choose the first of the incomplete items
- And mark the item as complete
- Then the item is no longer listed as incomplete
-
-
- @integration
- Scenario: Todo items once completed are no longer listed
- Given there are a number of incomplete ToDo items
- When I choose the first of the incomplete items
- And mark the item as complete
- Then the item is no longer listed as incomplete
-
-
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindAndCompleteToDoItemsSpec.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindAndCompleteToDoItemsSpec.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindAndCompleteToDoItemsSpec.java
deleted file mode 100644
index 141e8dd..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindAndCompleteToDoItemsSpec.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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.specs.todoitem;
-
-import cucumber.api.junit.Cucumber;
-
-import org.junit.runner.RunWith;
-
-
-/**
- * Runs scenarios in corresponding <tt>.feature</tt> file.
- */
-@RunWith(Cucumber.class)
-@Cucumber.Options(
- format = {
- "html:target/cucumber-html-report"
- },
- strict = true,
- tags = { "~@backlog", "~@ignore" })
-public class FindAndCompleteToDoItemsSpec {
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindCompletedToDoItemAndMarkAsNotYetCompleteSpec.feature
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindCompletedToDoItemAndMarkAsNotYetCompleteSpec.feature b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindCompletedToDoItemAndMarkAsNotYetCompleteSpec.feature
deleted file mode 100644
index d37b2b5..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindCompletedToDoItemAndMarkAsNotYetCompleteSpec.feature
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# 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.
-#
-Feature: Find completed ToDoItem and mark as not yet complete
-
- # the scenario is listed twice here just to demonstrate that it
- # can be run either at @unit-level scope (using mocks) or
- # at @integration-level scope (against the running system).
-
- @unit
- Scenario: Todo items can be uncompleted
- Given a completed item
- When I mark the item as not yet complete
- Then the item is listed as incomplete
-
-
- @integration
- Scenario: Todo items can be uncompleted
- Given a completed ToDo item
- When I mark the item as not yet complete
- Then the item is listed as incomplete
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindCompletedToDoItemAndMarkAsNotYetCompleteSpec.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindCompletedToDoItemAndMarkAsNotYetCompleteSpec.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindCompletedToDoItemAndMarkAsNotYetCompleteSpec.java
deleted file mode 100644
index c9e6508..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/FindCompletedToDoItemAndMarkAsNotYetCompleteSpec.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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.specs.todoitem;
-
-import cucumber.api.junit.Cucumber;
-
-import org.junit.runner.RunWith;
-
-
-/**
- * Runs scenarios in corresponding <tt>.feature</tt> file.
- */
-@RunWith(Cucumber.class)
-@Cucumber.Options(
- format = {
- "html:target/cucumber-html-report"
- },
- strict = true,
- tags = { "~@backlog", "~@ignore" })
-public class FindCompletedToDoItemAndMarkAsNotYetCompleteSpec {
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/InMemoryDBForToDoApp.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/InMemoryDBForToDoApp.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/InMemoryDBForToDoApp.java
deleted file mode 100644
index af09a8d..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/InMemoryDBForToDoApp.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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.specs.todoitem;
-
-import dom.todo.ToDoItem;
-
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
-
-public class InMemoryDBForToDoApp extends InMemoryDB {
-
- public InMemoryDBForToDoApp(ScenarioExecution scenarioExecution) {
- super(scenarioExecution);
- }
-
- /**
- * Hook to initialize if possible.
- */
- @Override
- protected void init(Object obj, String str) {
- if(obj instanceof ToDoItem) {
- ToDoItem toDoItem = (ToDoItem) obj;
- toDoItem.setDescription(str);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
new file mode 100644
index 0000000..c3e2f29
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+Feature: Find And Complete ToDo Items
+
+ # the scenario is listed twice here just to demonstrate that it
+ # can be run either at @unit-level scope (using mocks) or
+ # at @integration-level scope (against the running system).
+
+ @unit
+ Scenario: Todo items once completed are no longer listed
+ Given there are a number of incomplete ToDo items
+ When I choose the first of the incomplete items
+ And mark the item as complete
+ Then the item is no longer listed as incomplete
+
+
+ @integration
+ Scenario: Todo items once completed are no longer listed
+ Given there are a number of incomplete ToDo items
+ When I choose the first of the incomplete items
+ And mark the item as complete
+ Then the item is no longer listed as incomplete
+
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.java
new file mode 100644
index 0000000..2440b7f
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.java
@@ -0,0 +1,37 @@
+/**
+ * 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.specs.todoitem;
+
+import cucumber.api.junit.Cucumber;
+
+import org.junit.runner.RunWith;
+
+
+/**
+ * Runs scenarios in corresponding <tt>.feature</tt> file.
+ */
+@RunWith(Cucumber.class)
+@Cucumber.Options(
+ format = {
+ "html:target/cucumber-html-report"
+ },
+ strict = true,
+ tags = { "~@backlog", "~@ignore" })
+public class ToDoItemSpec_findAndComplete {
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
new file mode 100644
index 0000000..d37b2b5
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
@@ -0,0 +1,34 @@
+#
+# 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.
+#
+Feature: Find completed ToDoItem and mark as not yet complete
+
+ # the scenario is listed twice here just to demonstrate that it
+ # can be run either at @unit-level scope (using mocks) or
+ # at @integration-level scope (against the running system).
+
+ @unit
+ Scenario: Todo items can be uncompleted
+ Given a completed item
+ When I mark the item as not yet complete
+ Then the item is listed as incomplete
+
+
+ @integration
+ Scenario: Todo items can be uncompleted
+ Given a completed ToDo item
+ When I mark the item as not yet complete
+ Then the item is listed as incomplete
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.java
new file mode 100644
index 0000000..4c8b1bb
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.java
@@ -0,0 +1,37 @@
+/**
+ * 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.specs.todoitem;
+
+import cucumber.api.junit.Cucumber;
+
+import org.junit.runner.RunWith;
+
+
+/**
+ * Runs scenarios in corresponding <tt>.feature</tt> file.
+ */
+@RunWith(Cucumber.class)
+@Cucumber.Options(
+ format = {
+ "html:target/cucumber-html-report"
+ },
+ strict = true,
+ tags = { "~@backlog", "~@ignore" })
+public class ToDoItemSpec_findCompletedAndMarkAsNotYetComplete {
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemStepDefs.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemStepDefs.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemStepDefs.java
index 680d79f..2d81b92 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemStepDefs.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/specs/todoitem/ToDoItemStepDefs.java
@@ -18,6 +18,8 @@ package integration.specs.todoitem;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;
+import integration.ToDoSystemInitializer;
+import integration.specs.InMemoryDBForToDoApp;
import java.util.List;
@@ -35,6 +37,7 @@ import dom.todo.ToDoItem;
import dom.todo.ToDoItems;
import fixture.todo.ToDoItemsFixture;
+import org.apache.log4j.PropertyConfigurator;
import org.jmock.Expectations;
import org.junit.Assert;
@@ -52,8 +55,11 @@ public class ToDoItemStepDefs extends CukeStepDefsAbstract {
before(ScenarioExecutionScope.UNIT);
}
- @Before({"@integration"})
+ @Before(value={"@integration"}, order=100)
public void beforeScenarioIntegrationScope() {
+ PropertyConfigurator.configure("logging.properties");
+ ToDoSystemInitializer.initIsft();
+
before(ScenarioExecutionScope.INTEGRATION);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
new file mode 100644
index 0000000..71a4042
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
@@ -0,0 +1,83 @@
+/*
+ * 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.actions;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_completed extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ assertThat(toDoItem.isComplete(), is(false));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(true));
+ }
+
+
+ @Test
+ public void cannotCompleteIfAlreadyCompleted() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Already completed");
+ toDoItem.completed();
+ }
+
+
+ @Test
+ public void cannotSetPropertyDirectly() throws Exception {
+
+ // given
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Always disabled");
+ toDoItem.setComplete(true);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
new file mode 100644
index 0000000..2d3645b
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
@@ -0,0 +1,72 @@
+/*
+ * 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.actions;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.joda.time.LocalDate;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.applib.clock.Clock;
+
+public class ToDoItemTest_duplicate extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+ private ToDoItem duplicateToDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ final LocalDate todaysDate = Clock.getTimeAsLocalDate();
+ toDoItem.setDueBy(todaysDate);
+ toDoItem.setCost(new BigDecimal("123.45"));
+
+ duplicateToDoItem = toDoItem.duplicate(
+ unwrap(toDoItem).default0Duplicate(),
+ unwrap(toDoItem).default1Duplicate(),
+ unwrap(toDoItem).default2Duplicate(),
+ new BigDecimal("987.65"));
+
+ // then
+ assertThat(duplicateToDoItem.getDescription(), is(toDoItem.getDescription() + " - Copy"));
+ assertThat(duplicateToDoItem.getCategory(), is(toDoItem.getCategory()));
+ assertThat(duplicateToDoItem.getDueBy(), is(todaysDate));
+ assertThat(duplicateToDoItem.getCost(), is(new BigDecimal("987.65")));
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
new file mode 100644
index 0000000..616679e
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
@@ -0,0 +1,73 @@
+/*
+ * 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.actions;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_notYetCompleted extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(false));
+ }
+
+
+ @Test
+ public void cannotUndoIfNotYetCompleted() throws Exception {
+
+ // given
+ assertThat(toDoItem.isComplete(), is(false));
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Not yet completed");
+ toDoItem.notYetCompleted();
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_completed.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_completed.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_completed.java
deleted file mode 100644
index e2e8815..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_completed.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.actions;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItem_completed extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.isComplete(), is(false));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(toDoItem.isComplete(), is(true));
- }
-
-
- @Test
- public void cannotCompleteIfAlreadyCompleted() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when, then should fail
- expectedExceptions.expectMessage("Already completed");
- toDoItem.completed();
- }
-
-
- @Test
- public void cannotSetPropertyDirectly() throws Exception {
-
- // given
-
- // when, then should fail
- expectedExceptions.expectMessage("Always disabled");
- toDoItem.setComplete(true);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_duplicate.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_duplicate.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_duplicate.java
deleted file mode 100644
index 71b228a..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_duplicate.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.actions;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.math.BigDecimal;
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.joda.time.LocalDate;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.clock.Clock;
-
-public class ToDoItem_duplicate extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private ToDoItem duplicateToDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- final LocalDate todaysDate = Clock.getTimeAsLocalDate();
- toDoItem.setDueBy(todaysDate);
- toDoItem.setCost(new BigDecimal("123.45"));
-
- duplicateToDoItem = toDoItem.duplicate(
- unwrap(toDoItem).default0Duplicate(),
- unwrap(toDoItem).default1Duplicate(),
- unwrap(toDoItem).default2Duplicate(),
- new BigDecimal("987.65"));
-
- // then
- assertThat(duplicateToDoItem.getDescription(), is(toDoItem.getDescription() + " - Copy"));
- assertThat(duplicateToDoItem.getCategory(), is(toDoItem.getCategory()));
- assertThat(duplicateToDoItem.getDueBy(), is(todaysDate));
- assertThat(duplicateToDoItem.getCost(), is(new BigDecimal("987.65")));
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_notYetCompleted.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_notYetCompleted.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_notYetCompleted.java
deleted file mode 100644
index 0464cd9..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/actions/ToDoItem_notYetCompleted.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.actions;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItem_notYetCompleted extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(toDoItem.isComplete(), is(false));
- }
-
-
- @Test
- public void cannotUndoIfNotYetCompleted() throws Exception {
-
- // given
- assertThat(toDoItem.isComplete(), is(false));
-
- // when, then should fail
- expectedExceptions.expectMessage("Not yet completed");
- toDoItem.notYetCompleted();
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
new file mode 100644
index 0000000..d71e134
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
@@ -0,0 +1,89 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_dependencies_add extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+ private ToDoItem otherToDoItem;
+
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> items = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(items.get(0));
+ otherToDoItem = items.get(1); // wrapping this seems to trip up cglib :-(
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ }
+
+ @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)));
+ }
+
+
+ @Test
+ public void cannotDependOnSelf() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Can't set up a dependency to self");
+ toDoItem.add(toDoItem);
+ }
+
+ @Test
+ public void cannotAddDependencyIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // when, then
+ expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
+ toDoItem.add(otherToDoItem);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
new file mode 100644
index 0000000..d566c1a
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
@@ -0,0 +1,93 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_dependencies_remove extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+ private ToDoItem otherToDoItem;
+ private ToDoItem yetAnotherToDoItem;
+
+
+ @Before
+ public void setUp() throws Exception {
+ // given
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> items = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(items.get(0));
+ otherToDoItem = items.get(1); // wrapping this seems to trip up cglib :-(
+ yetAnotherToDoItem = items.get(2); // wrapping this seems to trip up cglib :-(
+
+ toDoItem.add(otherToDoItem);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ }
+
+ @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 cannotRemoveItemIfNotADepedndency() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Not a dependency");
+ toDoItem.remove(yetAnotherToDoItem);
+ }
+
+ @Test
+ public void cannotRemoveDependencyIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // when, then
+ expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
+ toDoItem.remove(otherToDoItem);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItem_dependencies_add.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItem_dependencies_add.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItem_dependencies_add.java
deleted file mode 100644
index d66c3fa..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItem_dependencies_add.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItem_dependencies_add extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private ToDoItem otherToDoItem;
-
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> items = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(items.get(0));
- otherToDoItem = items.get(1); // wrapping this seems to trip up cglib :-(
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- }
-
- @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)));
- }
-
-
- @Test
- public void cannotDependOnSelf() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Can't set up a dependency to self");
- toDoItem.add(toDoItem);
- }
-
- @Test
- public void cannotAddDependencyIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when, then
- expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
- toDoItem.add(otherToDoItem);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItem_dependencies_remove.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItem_dependencies_remove.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItem_dependencies_remove.java
deleted file mode 100644
index f9bfec0..0000000
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/colls/ToDoItem_dependencies_remove.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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 static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItem_dependencies_remove extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private ToDoItem otherToDoItem;
- private ToDoItem yetAnotherToDoItem;
-
-
- @Before
- public void setUp() throws Exception {
- // given
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> items = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(items.get(0));
- otherToDoItem = items.get(1); // wrapping this seems to trip up cglib :-(
- yetAnotherToDoItem = items.get(2); // wrapping this seems to trip up cglib :-(
-
- toDoItem.add(otherToDoItem);
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- }
-
- @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 cannotRemoveItemIfNotADepedndency() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Not a dependency");
- toDoItem.remove(yetAnotherToDoItem);
- }
-
- @Test
- public void cannotRemoveDependencyIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when, then
- expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
- toDoItem.remove(otherToDoItem);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
new file mode 100644
index 0000000..7607b58
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
@@ -0,0 +1,78 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.nio.charset.Charset;
+import java.util.List;
+
+import javax.activation.MimeType;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.applib.value.Blob;
+
+public class ToDoItemTest_attachment extends ToDoIntegTest {
+
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ byte[] bytes = "{\"foo\": \"bar\"}".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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
new file mode 100644
index 0000000..91214af
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
@@ -0,0 +1,76 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import dom.todo.ToDoItem.Category;
+import fixture.todo.ToDoItemsFixture;
+
+import org.joda.time.LocalDate;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.applib.clock.Clock;
+
+public class ToDoItemTest_category extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ toDoItem.setCategory(Category.Professional);
+
+ // then
+ assertThat(toDoItem.getCategory(), is(Category.Professional));
+
+ // when
+ toDoItem.setCategory(Category.Domestic);
+
+ // then
+ assertThat(toDoItem.getCategory(), is(Category.Domestic));
+ }
+
+
+ @Test
+ public void cannotBeNull() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Mandatory");
+ toDoItem.setCategory(null);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
new file mode 100644
index 0000000..664d7a3
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
@@ -0,0 +1,92 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_cost extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+ private BigDecimal cost;
+
+ @Before
+ public void setUp() throws Exception {
+ // given
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ cost = toDoItem.getCost();
+ }
+
+ @Test
+ public void happyCaseUsingProperty() throws Exception {
+
+ final BigDecimal newCost = new BigDecimal("123.45");
+
+ // when
+ toDoItem.setCost(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.setCost((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/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
new file mode 100644
index 0000000..73e9645
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
@@ -0,0 +1,76 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ToDoItemTest_description extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @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);
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/78902247/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
new file mode 100644
index 0000000..2a608c3
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
@@ -0,0 +1,95 @@
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import integration.tests.ToDoIntegTest;
+
+import java.util.List;
+
+import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
+
+import org.joda.time.LocalDate;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.applib.clock.Clock;
+
+public class ToDoItemTest_dueBy extends ToDoIntegTest {
+
+ private ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ scenarioExecution().install(new ToDoItemsFixture());
+
+ final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().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 sixDaysAgo = Clock.getTimeAsLocalDate().plusDays(-6);
+
+ // 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