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/12 19:01:55 UTC

git commit: ISIS-463: simplifying and improving example app integ tests.

Updated Branches:
  refs/heads/master 68136cc7c -> 1e6070f34


ISIS-463: simplifying and improving example app integ tests.

* using new framewor
* using IsisJdoSupport to teardown fixtures
* different fixtures used in different tests.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/1e6070f3
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/1e6070f3
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/1e6070f3

Branch: refs/heads/master
Commit: 1e6070f345324ffbf6be0ea2e4b8f48358613e70
Parents: 68136cc
Author: Dan Haywood <da...@apache.org>
Authored: Fri Jul 12 18:00:36 2013 +0100
Committer: Dan Haywood <da...@apache.org>
Committed: Fri Jul 12 18:00:36 2013 +0100

----------------------------------------------------------------------
 .../java/fixture/todo/ToDoItemsFixture.java     |  46 +++----
 .../integtests/logging.properties               |   2 +-
 .../integtests/pom.xml                          |   2 +-
 .../test/java/integtests/AbstractIntegTest.java | 133 +------------------
 .../test/java/integtests/ToDoItem_title.java    |  38 +++---
 .../java/integtests/ToDoSystemInitializer.java  |  81 +++++++++++
 .../integtests/actions/ToDoItem_completed.java  |  17 +--
 .../integtests/actions/ToDoItem_duplicate.java  |  16 +--
 .../actions/ToDoItem_notYetCompleted.java       |  17 +--
 .../colls/ToDoItem_dependencies_add.java        |  11 +-
 .../colls/ToDoItem_dependencies_remove.java     |  10 +-
 .../integtests/props/ToDoItem_attachment.java   |  19 +--
 .../integtests/props/ToDoItem_category.java     |  17 +--
 .../java/integtests/props/ToDoItem_cost.java    |  15 +--
 .../integtests/props/ToDoItem_description.java  |  18 +--
 .../java/integtests/props/ToDoItem_dueBy.java   |  17 +--
 .../java/integtests/props/ToDoItem_notes.java   |  18 +--
 .../java/integtests/props/ToDoItem_ownedBy.java |   7 +-
 .../java/integtests/repo/ToDoItems_finders.java |  20 +--
 .../repo/ToDoItems_newToDo_and_delete.java      |   9 +-
 20 files changed, 202 insertions(+), 311 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixture.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixture.java b/example/application/quickstart_wicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixture.java
index c34c69f..05a20fc 100644
--- a/example/application/quickstart_wicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixture.java
+++ b/example/application/quickstart_wicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixture.java
@@ -20,33 +20,33 @@
 package fixture.todo;
 
 import java.math.BigDecimal;
-import java.util.List;
-
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.fixtures.AbstractFixture;
-import org.joda.time.LocalDate;
 
 import dom.todo.ToDoItem;
 import dom.todo.ToDoItem.Category;
 import dom.todo.ToDoItems;
-import dom.todo.ToDoItems.NotifyUserIfNone;
+
+import org.joda.time.LocalDate;
+
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.fixtures.AbstractFixture;
+import org.apache.isis.objectstore.jdo.applib.service.support.IsisJdoSupport;
 
 public class ToDoItemsFixture extends AbstractFixture {
 
     @Override
     public void install() {
 
-        removeAllToDosForCurrentUser();
+        final String ownedBy = getContainer().getUser().getName();
+        
+        isisJdoSupport.executeUpdate("delete from TODOITEM where OWNEDBY = '" + ownedBy + "'");
 
-        installFor(getContainer().getUser().getName());
+        installFor(ownedBy);
         
         getContainer().flush();
     }
 
     public void installFor(String user) {
 
-        removeAllToDosFor(user);
-
         createToDoItemForUser("Buy milk", Category.Domestic, user, daysFromToday(0), new BigDecimal("0.75"));
         createToDoItemForUser("Buy bread", Category.Domestic, user, daysFromToday(0), new BigDecimal("1.75"));
         createToDoItemForUser("Buy stamps", Category.Domestic, user, daysFromToday(0), new BigDecimal("10.00"));
@@ -63,21 +63,8 @@ public class ToDoItemsFixture extends AbstractFixture {
         getContainer().flush();
     }
 
-    // {{ helpers
-    private void removeAllToDosForCurrentUser() {
-        
-        final List<ToDoItem> allToDos = toDoItems.allToDos(NotifyUserIfNone.NO);
-        for (final ToDoItem toDoItem : allToDos) {
-            getContainer().remove(toDoItem);
-        }
-    }
 
-    private void removeAllToDosFor(String user) {
-        final List<ToDoItem> items = allMatches(ToDoItem.class, ToDoItem.thoseOwnedBy(user));
-        for (final ToDoItem toDoItem : items) {
-            getContainer().remove(toDoItem);
-        }
-    }
+    // //////////////////////////////////////
 
     private ToDoItem createToDoItemForUser(final String description, final Category category, String user, final LocalDate dueBy, final BigDecimal cost) {
         return toDoItems.newToDo(description, category, user, dueBy, cost);
@@ -88,15 +75,20 @@ public class ToDoItemsFixture extends AbstractFixture {
         return date.plusDays(i);
     }
 
-    // }}
+    
+    // //////////////////////////////////////
+
 
-    // {{ injected: ToDoItems
     private ToDoItems toDoItems;
 
     public void setToDoItems(final ToDoItems toDoItems) {
         this.toDoItems = toDoItems;
     }
-    // }}
+
     
+    private IsisJdoSupport isisJdoSupport;
+    public void injectIsisJdoSupport(IsisJdoSupport isisJdoSupport) {
+        this.isisJdoSupport = isisJdoSupport;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/logging.properties
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/logging.properties b/example/application/quickstart_wicket_restful_jdo/integtests/logging.properties
index a49456b..a465396 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/logging.properties
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/logging.properties
@@ -38,6 +38,7 @@ log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p]  %m%n
 
 # DataNucleus
 log4j.logger.DataNucleus.Datastore.Native=DEBUG, Console
+log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
 
 log4j.logger.DataNucleus.Persistence=WARN, Console
 log4j.logger.DataNucleus.Transaction=WARN, Console
@@ -46,7 +47,6 @@ log4j.logger.DataNucleus.Query=WARN, Console
 log4j.logger.DataNucleus.Cache=WARN, Console
 log4j.logger.DataNucleus.MetaData=WARN, Console
 log4j.logger.DataNucleus.Datastore=WARN, Console
-log4j.logger.DataNucleus.Datastore.Schema=WARN, Console
 log4j.logger.DataNucleus.Datastore.Persist=WARN, Console
 log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console
 log4j.logger.DataNucleus.General=WARN, Console

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/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 f0a44be..71a54ff 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/pom.xml
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/pom.xml
@@ -36,7 +36,7 @@
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                         <includes>
-                            <include>**/*.java</include>
+                            <include>**/*Test*.java</include>
                         </includes>
                         <excludes>
                             <exclude>**/*Abstract*.java</exclude>

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/AbstractIntegTest.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/AbstractIntegTest.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/AbstractIntegTest.java
index 7b3e098..3f0f4b9 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/AbstractIntegTest.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/AbstractIntegTest.java
@@ -18,141 +18,22 @@
  */
 package integtests;
 
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-import objstore.jdo.todo.ToDoItemsJdo;
-
-import org.apache.log4j.Level;
 import org.apache.log4j.PropertyConfigurator;
-import org.junit.Before;
 import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.rules.ExpectedException;
-import org.junit.rules.MethodRule;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.Statement;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.services.wrapper.WrapperFactory;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
-import org.apache.isis.core.integtestsupport.IsisSystemForTest;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-import org.apache.isis.core.wrapper.WrapperFactoryDefault;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusObjectStore;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
-import org.apache.isis.objectstore.jdo.service.RegisterEntities;
 
-public abstract class AbstractIntegTest {
+import org.apache.isis.core.integtestsupport.IntegrationTestAbstract;
+import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForIntegration;
 
-    protected ToDoItems toDoItems;
-    protected WrapperFactory wrapperFactory;
-    protected DomainObjectContainer container;
+public abstract class AbstractIntegTest extends IntegrationTestAbstract {
 
-    @Rule
-    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-    
-    @Rule
-    public IsisSystemForTestRule bootstrapIsis = new IsisSystemForTestRule();
-
-    @Rule
-    public ExpectedException expectedExceptions = ExpectedException.none();
-
-    /**
-     * Same running system returned for all tests, set up with {@link ToDoItemsFixture}.
-     * 
-     * <p>
-     * The database is NOT reset between tests.
-     */
-    public IsisSystemForTest getIsft() {
-        return bootstrapIsis.getIsisSystemForTest();
-    }
-
-    @Before
-    public void init() {
-        toDoItems = getIsft().getService(ToDoItemsJdo.class);
-        wrapperFactory = getIsft().getService(WrapperFactoryDefault.class);
-        container = getIsft().getContainer();
-    }
-
-    protected <T> T wrap(T obj) {
-        return wrapperFactory.wrap(obj);
-    }
-
-    protected <T> T unwrap(T obj) {
-        return wrapperFactory.unwrap(obj);
-    }
-
-
-    ////////////////////////////////////////////////////////////////
-    // Boilerplate
-    ////////////////////////////////////////////////////////////////
     
     @BeforeClass
     public static void initClass() {
         PropertyConfigurator.configure("logging.properties");
-    }
-    
-    private static class ToDoIntegTestBuilder extends IsisSystemForTest.Builder {
-
-        public ToDoIntegTestBuilder() {
-            withFixtures(new ToDoItemsFixture());
-            withLoggingAt(Level.INFO);
-            with(testConfiguration());
-            with(new DataNucleusPersistenceMechanismInstaller());
-            
-            withServices(
-                    new ToDoItemsJdo(),
-                    new WrapperFactoryDefault(),
-                    new RegisterEntities()
-                    );
-        }
-
-        private IsisConfiguration testConfiguration() {
-            final IsisConfigurationDefault testConfiguration = new IsisConfigurationDefault();
-
-            testConfiguration.add("isis.persistor.datanucleus.RegisterEntities.packagePrefix", "dom");
-            testConfiguration.add("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:hsqldb:mem:test");
-            
-            testConfiguration.add("isis.persistor.datanucleus.impl.datanucleus.defaultInheritanceStrategy", "TABLE_PER_CLASS");
-            testConfiguration.add(DataNucleusObjectStore.INSTALL_FIXTURES_KEY , "true");
-            
-            testConfiguration.add("isis.persistor.datanucleus.impl.datanucleus.cache.level2.type","none");
-
-            return testConfiguration;
-        }
-    }
-
-    private static class IsisSystemForTestRule implements MethodRule {
-        private static ThreadLocal<IsisSystemForTest> ISFT = new ThreadLocal<IsisSystemForTest>() {
-            @Override
-            protected IsisSystemForTest initialValue() {
-                return new ToDoIntegTestBuilder().build().setUpSystem();
-            };
-        };
-
-        public IsisSystemForTest getIsisSystemForTest() {
-            // reuse same system for all calls.
-            return ISFT.get();
-        }
+        ToDoSystemInitializer.initIsft();
         
-        @Override
-        public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
-            final IsisSystemForTest isft = getIsisSystemForTest(); // creates and starts running if required
-            return new Statement() {
-                @Override
-                public void evaluate() throws Throwable {
-                    isft.beginTran();
-                    base.evaluate();
-                    // if an exception is thrown by any test, then we don't attempt to cleanup (eg by calling bounceSystem)#
-                    // because - in any case - we only ever install the fixtures once for ALL of the tests.
-                    // therefore, just fix the first test that fails and don't worry about any other test failures beyond that
-                    // (fix them up one by one)
-                    isft.commitTran();
-                }
-            };
-        }
+        // instantiating will install onto ThreadLocal
+        new ScenarioExecutionForIntegration();
     }
-    
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoItem_title.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoItem_title.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoItem_title.java
index 0d757af..f9573c1 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoItem_title.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoItem_title.java
@@ -25,9 +25,10 @@ import static org.junit.Assert.assertThat;
 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;
 
@@ -36,55 +37,46 @@ import org.apache.isis.applib.clock.Clock;
 public class ToDoItem_title extends AbstractIntegTest {
 
     private ToDoItem toDoItem;
-    private String description;
-    private boolean isComplete;
     private LocalDate dueBy;
 
+
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+
+        scenarioExecution().install(new ToDoItemsFixture());
+        
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
         toDoItem = wrap(all.get(0));
 
-        // to reset after
-        description = toDoItem.getDescription();
-        isComplete = toDoItem.isComplete();
         dueBy = toDoItem.getDueBy();
     }
 
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setDescription(description);
-        unwrap(toDoItem).setComplete(isComplete);
-        unwrap(toDoItem).setDueBy(dueBy);
-    }
-    
     
     @Test
     public void includesDescription() throws Exception {
 
         // given
-        assertThat(container.titleOf(toDoItem), containsString("Buy bread due by"));
+        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"));
+        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")));
+        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")));
+        assertThat(container().titleOf(toDoItem), containsString("due by " + fiveDaysFromNow.toString("yyyy-MM-dd")));
     }
 
 
@@ -96,21 +88,21 @@ public class ToDoItem_title extends AbstractIntegTest {
         toDoItem.setDueBy(null);
 
         // then
-        assertThat(container.titleOf(toDoItem), not(containsString("due by")));
+        assertThat(container().titleOf(toDoItem), not(containsString("due by")));
     }
 
     @Test
     public void usesWhetherCompleted() throws Exception {
 
         // given
-        assertThat(container.titleOf(toDoItem), not(containsString("Completed!")));
+        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!"));
+        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/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoSystemInitializer.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoSystemInitializer.java
new file mode 100644
index 0000000..023c967
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/ToDoSystemInitializer.java
@@ -0,0 +1,81 @@
+/*
+ *  Copyright 2012-2013 Eurocommercial Properties NV
+ *
+ *  Licensed 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 integtests;
+
+import objstore.jdo.todo.ToDoItemsJdo;
+
+import org.apache.log4j.Level;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+import org.apache.isis.core.integtestsupport.IsisSystemForTest;
+import org.apache.isis.core.wrapper.WrapperFactoryDefault;
+import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusObjectStore;
+import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
+import org.apache.isis.objectstore.jdo.datanucleus.service.support.IsisJdoSupportImpl;
+import org.apache.isis.objectstore.jdo.service.RegisterEntities;
+
+/**
+ * Holds an instance of an {@link IsisSystemForTest} as a {@link ThreadLocal} on the current thread,
+ * initialized with ToDo app's domain services. 
+ */
+class ToDoSystemInitializer {
+    
+    private ToDoSystemInitializer(){}
+
+    public static IsisSystemForTest initIsft() {
+        IsisSystemForTest isft = IsisSystemForTest.getElseNull();
+        if(isft == null) {
+            isft = new ToDoSystemBuilder().build().setUpSystem();
+            IsisSystemForTest.set(isft);
+        }
+        return isft;
+    }
+
+    private static class ToDoSystemBuilder extends IsisSystemForTest.Builder {
+
+        public ToDoSystemBuilder() {
+            //withFixtures( ... reference data fixtures ...); // if we had any...
+            withLoggingAt(Level.INFO);
+            with(testConfiguration());
+            with(new DataNucleusPersistenceMechanismInstaller());
+            
+            withServices(
+                    new ToDoItemsJdo(),
+                    new WrapperFactoryDefault(),
+                    new RegisterEntities(),
+                    new IsisJdoSupportImpl()
+                    );
+        }
+
+        private IsisConfiguration testConfiguration() {
+            final IsisConfigurationDefault testConfiguration = new IsisConfigurationDefault();
+
+            testConfiguration.add("isis.persistor.datanucleus.RegisterEntities.packagePrefix", "dom");
+            testConfiguration.add("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:hsqldb:mem:test");
+            
+            testConfiguration.add("isis.persistor.datanucleus.impl.datanucleus.defaultInheritanceStrategy", "TABLE_PER_CLASS");
+            testConfiguration.add(DataNucleusObjectStore.INSTALL_FIXTURES_KEY , "true");
+            
+            testConfiguration.add("isis.persistor.datanucleus.impl.datanucleus.cache.level2.type","none");
+
+            return testConfiguration;
+        }
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_completed.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_completed.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_completed.java
index 3180bf2..9189457 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_completed.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_completed.java
@@ -20,36 +20,29 @@ package integtests.actions;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 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_completed extends AbstractIntegTest {
 
     private ToDoItem toDoItem;
-    private boolean isComplete;
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
-        toDoItem = wrap(all.get(0));
+        scenarioExecution().install(new ToDoItemsFixture());
 
-        // to reset after
-        isComplete = toDoItem.isComplete();
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+        toDoItem = wrap(all.get(0));
     }
 
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setComplete(isComplete);
-    }
 
     @Test
     public void happyCase() throws Exception {

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_duplicate.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_duplicate.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_duplicate.java
index 028c645..e8fff69 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_duplicate.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_duplicate.java
@@ -18,20 +18,18 @@
  */
 package integtests.actions;
 
-import static org.hamcrest.CoreMatchers.*;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 import java.math.BigDecimal;
 import java.util.List;
 
 import dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Category;
+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;
 
@@ -44,14 +42,10 @@ public class ToDoItem_duplicate extends AbstractIntegTest {
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
-        toDoItem = wrap(all.get(0));
-    }
+        scenarioExecution().install(new ToDoItemsFixture());
 
-    @After
-    public void tearDown() throws Exception {
-        duplicateToDoItem.delete();
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+        toDoItem = wrap(all.get(0));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_notYetCompleted.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_notYetCompleted.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_notYetCompleted.java
index 0e0202d..fb938c3 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_notYetCompleted.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/actions/ToDoItem_notYetCompleted.java
@@ -20,12 +20,13 @@ package integtests.actions;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 import java.util.List;
 
 import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
 
 import org.junit.After;
 import org.junit.Before;
@@ -34,21 +35,13 @@ import org.junit.Test;
 public class ToDoItem_notYetCompleted extends AbstractIntegTest {
 
     private ToDoItem toDoItem;
-    private boolean isComplete;
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
-        toDoItem = wrap(all.get(0));
+        scenarioExecution().install(new ToDoItemsFixture());
 
-        // to reset after
-        isComplete = toDoItem.isComplete();
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setComplete(isComplete);
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+        toDoItem = wrap(all.get(0));
     }
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_add.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_add.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_add.java
index 97b8199..8d5d5bb 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_add.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_add.java
@@ -25,6 +25,8 @@ import integtests.AbstractIntegTest;
 import java.util.List;
 
 import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
 
 import org.junit.After;
 import org.junit.Before;
@@ -34,23 +36,20 @@ public class ToDoItem_dependencies_add extends AbstractIntegTest {
 
     private ToDoItem toDoItem;
     private ToDoItem otherToDoItem;
-    private boolean isComplete;
     
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+        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 :-(
-        
-        isComplete = toDoItem.isComplete();
     }
 
     @After
     public void tearDown() throws Exception {
         unwrap(toDoItem).getDependencies().clear();
-        unwrap(toDoItem).setComplete(isComplete);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_remove.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_remove.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_remove.java
index 1abfc2c..daa68c7 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_remove.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/colls/ToDoItem_dependencies_remove.java
@@ -25,6 +25,8 @@ import integtests.AbstractIntegTest;
 import java.util.List;
 
 import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
 
 import org.junit.After;
 import org.junit.Before;
@@ -35,26 +37,24 @@ public class ToDoItem_dependencies_remove extends AbstractIntegTest {
     private ToDoItem toDoItem;
     private ToDoItem otherToDoItem;
     private ToDoItem yetAnotherToDoItem;
-    private boolean isComplete;
     
 
     @Before
     public void setUp() throws Exception {
         // given
-        final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+        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);
-
-        isComplete = toDoItem.isComplete();
     }
 
     @After
     public void tearDown() throws Exception {
         unwrap(toDoItem).getDependencies().clear();
-        unwrap(toDoItem).setComplete(isComplete);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_attachment.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_attachment.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_attachment.java
index 4e3b27d..7cb5681 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_attachment.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_attachment.java
@@ -20,7 +20,6 @@ package integtests.props;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 import java.nio.charset.Charset;
@@ -29,6 +28,8 @@ 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;
@@ -38,22 +39,16 @@ import org.apache.isis.applib.value.Blob;
 
 public class ToDoItem_attachment extends AbstractIntegTest {
 
+
     private ToDoItem toDoItem;
-    private Blob attachment;
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+        
+        scenarioExecution().install(new ToDoItemsFixture());
+        
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
         toDoItem = wrap(all.get(0));
-
-        // to reset after
-        attachment = toDoItem.getAttachment();
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setAttachment(attachment);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_category.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_category.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_category.java
index f72ec4c..2ede0a7 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_category.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_category.java
@@ -20,13 +20,14 @@ package integtests.props;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 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;
@@ -38,21 +39,13 @@ import org.apache.isis.applib.clock.Clock;
 public class ToDoItem_category extends AbstractIntegTest {
 
     private ToDoItem toDoItem;
-    private Category category;
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
-        toDoItem = wrap(all.get(0));
+        scenarioExecution().install(new ToDoItemsFixture());
 
-        // to reset after
-        category = toDoItem.getCategory();
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setCategory(category);
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+        toDoItem = wrap(all.get(0));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_cost.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_cost.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_cost.java
index efdb762..e4d5967 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_cost.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_cost.java
@@ -20,15 +20,15 @@ package integtests.props;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 import java.math.BigDecimal;
 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;
 
@@ -40,18 +40,13 @@ public class ToDoItem_cost extends AbstractIntegTest {
     @Before
     public void setUp() throws Exception {
         // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
-        toDoItem = wrap(all.get(0));
+        scenarioExecution().install(new ToDoItemsFixture());
 
-        // to reset after
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+        toDoItem = wrap(all.get(0));
         cost = toDoItem.getCost();
     }
 
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setCost(cost);
-    }
-
     @Test
     public void happyCaseUsingProperty() throws Exception {
         

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_description.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_description.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_description.java
index cad2e75..fa4cdb3 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_description.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_description.java
@@ -20,37 +20,29 @@ package integtests.props;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 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_description extends AbstractIntegTest {
 
     private ToDoItem toDoItem;
-    private String description;
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
-        toDoItem = wrap(all.get(0));
+        scenarioExecution().install(new ToDoItemsFixture());
 
-        // to reset after
-        description = toDoItem.getDescription();
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+        toDoItem = wrap(all.get(0));
     }
 
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setDescription(description);
-    }
-    
     @Test
     public void happyCase() throws Exception {
         

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_dueBy.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_dueBy.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_dueBy.java
index 87420e2..db1acad 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_dueBy.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_dueBy.java
@@ -20,12 +20,13 @@ package integtests.props;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 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;
@@ -37,21 +38,13 @@ import org.apache.isis.applib.clock.Clock;
 public class ToDoItem_dueBy extends AbstractIntegTest {
 
     private ToDoItem toDoItem;
-    private LocalDate dueBy;
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
-        toDoItem = wrap(all.get(0));
+        scenarioExecution().install(new ToDoItemsFixture());
 
-        // to reset after
-        dueBy = toDoItem.getDueBy();
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setDueBy(dueBy);
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+        toDoItem = wrap(all.get(0));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_notes.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_notes.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_notes.java
index 5bba549..889ca3f 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_notes.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_notes.java
@@ -20,36 +20,28 @@ package integtests.props;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
-import java.math.BigDecimal;
 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_notes extends AbstractIntegTest {
 
     private ToDoItem toDoItem;
-    private String notes;
 
     @Before
     public void setUp() throws Exception {
         // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
-        toDoItem = wrap(all.get(0));
+        scenarioExecution().install(new ToDoItemsFixture());
 
-        // to reset after
-        notes = toDoItem.getNotes();
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        unwrap(toDoItem).setNotes(notes);
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
+        toDoItem = wrap(all.get(0));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_ownedBy.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_ownedBy.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_ownedBy.java
index 5094f31..00ade9a 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_ownedBy.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/props/ToDoItem_ownedBy.java
@@ -23,6 +23,8 @@ import integtests.AbstractIntegTest;
 import java.util.List;
 
 import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -33,8 +35,9 @@ public class ToDoItem_ownedBy extends AbstractIntegTest {
 
     @Before
     public void setUp() throws Exception {
-        // given
-        final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+        scenarioExecution().install(new ToDoItemsFixture());
+
+        final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
         toDoItem = wrap(all.get(0));
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_finders.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_finders.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_finders.java
index b5fcf41..8dde89f 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_finders.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_finders.java
@@ -20,12 +20,13 @@ package integtests.repo;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-
 import integtests.AbstractIntegTest;
 
 import java.util.List;
 
 import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.ToDoItemsFixture;
 
 import org.hamcrest.Matchers;
 import org.junit.Before;
@@ -38,8 +39,10 @@ public class ToDoItems_finders extends AbstractIntegTest {
 
     @Before
     public void setUp() throws Exception {
-        final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
-        final List<ToDoItem> completedItems = wrap(toDoItems).complete();
+        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();
@@ -51,23 +54,22 @@ public class ToDoItems_finders extends AbstractIntegTest {
     public void complete_and_notYetComplete() throws Exception {
         
         // given
-        List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
+        List<ToDoItem> notYetCompleteItems = wrap(service(ToDoItems.class)).notYetComplete();
         final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
         
         // when
         toDoItem.completed();
         
         // then
-        assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize-1));
-        assertThat(wrap(toDoItems).complete().size(), is(completedSize+1));
+        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(toDoItems).notYetComplete().size(), is(notYetCompletedSize));
-        assertThat(wrap(toDoItems).complete().size(), is(completedSize));
+        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/1e6070f3/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_newToDo_and_delete.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_newToDo_and_delete.java b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_newToDo_and_delete.java
index 30ffc3f..f6777ae 100644
--- a/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_newToDo_and_delete.java
+++ b/example/application/quickstart_wicket_restful_jdo/integtests/src/test/java/integtests/repo/ToDoItems_newToDo_and_delete.java
@@ -22,6 +22,7 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 import integtests.AbstractIntegTest;
 import dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
 import dom.todo.ToDoItem.Category;
 
 import org.junit.Test;
@@ -32,21 +33,21 @@ public class ToDoItems_newToDo_and_delete extends AbstractIntegTest {
     public void happyCase() throws Exception {
         
         // given
-        int size = wrap(toDoItems).notYetComplete().size();
+        int size = wrap(service(ToDoItems.class)).notYetComplete().size();
         
         // when
-        final ToDoItem newToDo = wrap(toDoItems).newToDo("new todo", Category.Professional, null, null);
+        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(toDoItems).notYetComplete().size(), is(size+1));
+        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size+1));
         
         // when
         newToDo.delete();
 
         // then
-        assertThat(wrap(toDoItems).notYetComplete().size(), is(size));
+        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size));
     }
 
 }
\ No newline at end of file