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 2012/12/06 11:10:35 UTC

[30/51] [partial] ISIS-188: moving modules into core

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persist.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persist.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persist.java
new file mode 100644
index 0000000..ee82dfb
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persist.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 org.apache.isis.runtimes.dflt.objectstores.dflt;
+
+import org.apache.isis.runtimes.dflt.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures.Listener;
+import org.apache.isis.runtimes.dflt.testsupport.tck.ObjectStoreContractTest_persist;
+
+public class InMemoryObjectStoreTest_persist extends ObjectStoreContractTest_persist {
+
+    @Override
+    protected PersistenceMechanismInstaller createPersistenceMechanismInstaller() {
+        return new InMemoryPersistenceMechanismInstaller();
+    }
+
+    @Override
+    protected Listener iswfListener() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persistAggregated.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persistAggregated.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persistAggregated.java
new file mode 100644
index 0000000..6f4c240
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_persistAggregated.java
@@ -0,0 +1,57 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.objectstores.dflt;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures.Listener;
+import org.apache.isis.runtimes.dflt.testsupport.tck.ObjectStoreContractTest_persist;
+import org.apache.isis.tck.dom.refs.ReferencingEntity;
+
+public class InMemoryObjectStoreTest_persistAggregated {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder()
+        .with(createPersistenceMechanismInstaller())
+        .build();
+
+    protected PersistenceMechanismInstaller createPersistenceMechanismInstaller() {
+        return new InMemoryPersistenceMechanismInstaller();
+    }
+
+    @Test
+    public void persistAggregatedEntityWithinCollection() throws Exception {
+        final ReferencingEntity referencingEntity = iswf.fixtures.rfcg2;
+        referencingEntity.addAggregatedEntityToCollection().setName("Aggregated Entity #1");
+        iswf.persist(referencingEntity);
+    }
+    
+
+    @Test
+    public void persistAggregatedEntityWithinProperty() throws Exception {
+        final ReferencingEntity referencingEntity = iswf.fixtures.rfcg2;
+        referencingEntity.addAggregatedReference().setName("Aggregated Entity #1");
+        iswf.persist(referencingEntity);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_reset.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_reset.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_reset.java
new file mode 100644
index 0000000..2016a7b
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_reset.java
@@ -0,0 +1,81 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.objectstores.dflt;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManagerSpi;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.SimpleEntity;
+
+/**
+ * This is really just a test of the test infrastructure, not a real test per se.
+ */
+public class InMemoryObjectStoreTest_reset {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+    
+    protected ObjectAdapter epv2Adapter;
+    protected ObjectSpecification epvSpecification;
+
+    protected InMemoryObjectStore getStore() {
+        return (InMemoryObjectStore) IsisContext.getPersistenceSession().getObjectStore();
+    }
+
+    @Before
+    public void setUpFixtures() throws Exception {
+        epv2Adapter = iswf.adapterFor(iswf.fixtures.smpl2);
+        epvSpecification = iswf.loadSpecification(SimpleEntity.class);
+    }
+
+    @Test
+    public void reset_clearsAdapterFromLoader() throws Exception {
+        
+        iswf.persist(iswf.fixtures.smpl2);
+        iswf.bounceSystem();
+
+        assertNotNull(getAdapterManager().getAdapterFor(epv2Adapter.getObject()));
+
+        IsisContext.getPersistenceSession().testReset();
+
+        assertNull(getAdapterManager().getAdapterFor(epv2Adapter.getObject()));
+    }
+
+    
+    private PersistenceSession getPersistenceSession() {
+        return IsisContext.getPersistenceSession();
+    }
+
+    private AdapterManager getAdapterManager() {
+        return getPersistenceSession().getAdapterManager();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java
new file mode 100644
index 0000000..c2b335f
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java
@@ -0,0 +1,142 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.objectstores.dflt;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
+import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
+import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.runtime.persistence.ObjectNotFoundException;
+import org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryFindAllInstances;
+import org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryFindByTitle;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.SimpleEntity;
+
+public class InMemoryObjectStoreTest_retrieve {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+    
+    protected ObjectAdapter epv2Adapter;
+    protected ObjectSpecification epvSpecification;
+
+    protected InMemoryObjectStore getStore() {
+        return (InMemoryObjectStore) IsisContext.getPersistenceSession().getObjectStore();
+    }
+
+    @Before
+    public void setUpFixtures() throws Exception {
+        epv2Adapter = iswf.adapterFor(iswf.fixtures.smpl2);
+        epvSpecification = iswf.loadSpecification(SimpleEntity.class);
+    }
+
+    @Test
+    public void getObject_whenDoesNotExist() {
+        final TypedOid oid = RootOidDefault.deString("SMPL:10", new OidMarshaller());
+        try {
+            getStore().loadInstanceAndAdapt(oid);
+            fail();
+        } catch (final ObjectNotFoundException expected) {
+        }
+    }
+
+    @Test
+    public void getObject_whenExists_returnsAdapter() throws Exception {
+        
+        // given
+        iswf.persist(iswf.fixtures.smpl2);
+        iswf.bounceSystem();
+
+        final ObjectAdapter retrievedAdapter = getStore().loadInstanceAndAdapt((TypedOid) epv2Adapter.getOid());
+        
+        assertNotSame(epv2Adapter, retrievedAdapter);
+        assertEquals(((SimpleEntity)epv2Adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
+        assertEquals(epv2Adapter.getOid(), retrievedAdapter.getOid());
+    }
+
+    @Test
+    public void getInstances_whenDoesNotExist() throws Exception {
+        final List<ObjectAdapter> retrievedAdapters = getStore().loadInstancesAndAdapt(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
+        assertEquals(0, retrievedAdapters.size());
+    }
+
+    @Test
+    public void getInstances_findByTitle() throws Exception {
+        // given
+        iswf.persist(iswf.fixtures.smpl2);
+        iswf.bounceSystem();
+
+        // when
+        final List<ObjectAdapter> retrievedAdapters = getStore().loadInstancesAndAdapt(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
+        
+        // then
+        assertEquals(1, retrievedAdapters.size());
+        final ObjectAdapter retrievedAdapter = retrievedAdapters.get(0);
+
+        assertNotSame(epv2Adapter, retrievedAdapter);
+        assertEquals(((SimpleEntity)epv2Adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
+        assertEquals(epv2Adapter.getOid(), retrievedAdapter.getOid());
+    }
+
+    @Test
+    public void getInstances_findAll() throws Exception {
+        // given
+        iswf.persist(iswf.fixtures.smpl2);
+        iswf.bounceSystem();
+
+        // when
+        final List<ObjectAdapter> retrievedAdapters = getStore().loadInstancesAndAdapt(new PersistenceQueryFindAllInstances(epvSpecification));
+        
+        // then
+        assertEquals(1, retrievedAdapters.size());
+        final ObjectAdapter retrievedAdapter = retrievedAdapters.get(0);
+
+        assertNotSame(epv2Adapter, retrievedAdapter);
+        assertEquals(((SimpleEntity)epv2Adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
+        assertEquals(epv2Adapter.getOid(), retrievedAdapter.getOid());
+    }
+
+    @Test
+    public void hasInstances_whenEmpty() throws Exception {
+        assertEquals(false, getStore().hasInstances(epvSpecification));
+    }
+
+    @Test
+    public void hasInstances_whenHasSome() throws Exception {
+        iswf.persist(iswf.fixtures.smpl2);
+        iswf.bounceSystem();
+
+        assertEquals(true, getStore().hasInstances(epvSpecification));
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_serviceRegistry.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_serviceRegistry.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_serviceRegistry.java
new file mode 100644
index 0000000..e88684f
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_serviceRegistry.java
@@ -0,0 +1,114 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.objectstores.dflt;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.ParentEntityRepository;
+import org.apache.isis.tck.dom.refs.SimpleEntity;
+
+public class InMemoryObjectStoreTest_serviceRegistry {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+    
+    protected ObjectAdapter epv2Adapter;
+    protected ObjectSpecification epvSpecification;
+
+    protected InMemoryObjectStore getStore() {
+        return (InMemoryObjectStore) IsisContext.getPersistenceSession().getObjectStore();
+    }
+
+    @Before
+    public void setUpFixtures() throws Exception {
+        epv2Adapter = iswf.adapterFor(iswf.fixtures.smpl2);
+        epvSpecification = iswf.loadSpecification(SimpleEntity.class);
+    }
+
+    @Test
+    public void getOidForServices() throws Exception {
+        final Oid oidForService = getStore().getOidForService(iswf.loadSpecification(ParentEntityRepository.class));
+        assertEquals(RootOidDefault.create(ObjectSpecId.of("ParentEntities"), "1"), oidForService);
+    }
+
+
+//    @Test
+//    public void registerService_canBeRetrieved() throws Exception {
+//        registerService14();
+//
+//        final Oid oidForService = store.getOidForService(serviceSpecification);
+//        assertEquals(oid14, oidForService);
+//    }
+//
+//    @Test
+//    public void testCantRegisterServiceMoreThanOnce() throws Exception {
+//        registerService14();
+//        try {
+//            registerService14();
+//            fail();
+//        } catch (final IsisException expected) {
+//        }
+//    }
+//
+//    @Test
+//    public void testCanRegisterMoreThanOneService() throws Exception {
+//        registerService14();
+//        registerService15();
+//    }
+//
+//
+//    private void resetIdentityMap() {
+//        IsisContext.getPersistenceSession().testReset();
+//    }
+//
+//    protected void addObjectToStore(final ObjectAdapter object) {
+//        final PersistenceCommand command = store.createCreateObjectCommand(object);
+//        assertEquals(object, command.onObject());
+//        store.execute(Collections.<PersistenceCommand> singletonList(command));
+//    }
+//
+//    private RootOidDefault registerService14() {
+//        return oid14 = registerService(""+14);
+//    }
+//
+//    private RootOidDefault registerService15() {
+//        return registerService(""+15);
+//    }
+//
+//    private RootOidDefault registerService(final String id) {
+//        final RootOidDefault oid = RootOidDefault.createPersistent("SVC", id);
+//        store.registerService(oid);
+//        resetIdentityMap();
+//        return oid;
+//    }
+
+    
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java
new file mode 100644
index 0000000..e836775
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java
@@ -0,0 +1,210 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.runtime.fixturedomainservice;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.*;
+import static org.junit.Assume.assumeThat;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+import java.util.TimeZone;
+
+import junit.framework.Assert;
+
+import com.google.common.collect.Sets;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.ParentEntity;
+import org.apache.isis.tck.dom.refs.ReferencingEntity;
+import org.apache.isis.tck.dom.refs.SimpleEntity;
+
+public class ObjectFixtureFilePersistorTest {
+
+    private static final String DATEFORMAT_PATTERN = "dd-MMM-yyyy HH:mm z";
+    
+    private static final SimpleDateFormat dateFormat = new SimpleDateFormat(DATEFORMAT_PATTERN);
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder()
+        .with(configuration()).build();
+    
+    private static IsisConfiguration configuration() {
+        final IsisConfigurationDefault config = new IsisConfigurationDefault();
+        config.add("isis.value.format.datetime", DATEFORMAT_PATTERN);
+        return config;
+    }
+
+    private ObjectFixtureFilePersistor persistor;
+
+    @Before
+    public void setup() throws Exception {
+        Logger.getRootLogger().setLevel(Level.OFF);
+
+        Locale.setDefault(Locale.UK);
+
+        persistor = new ObjectFixtureFilePersistor();
+
+        iswf.fixtures.smpl1.setName("Fred Smith");
+        iswf.fixtures.smpl1.setDate(dateFormat.parse("08-Mar-2010 01:00 UTC"));
+
+        iswf.fixtures.smpl2.setName("Joe Bloggs");
+        iswf.fixtures.smpl2.setDate(dateFormat.parse("09-Apr-2011 02:10 UTC"));
+
+        assumeThat(TimeZone.getDefault().getDisplayName(), is("Greenwich Mean Time"));
+    }
+    
+
+    @Test
+    public void loadInstance() throws Exception {
+        
+        final StringReader reader = new StringReader(SimpleEntity.class.getName() + "#1\n  name: Fred Smith\n  date: 08-Mar-2010 01:00 UTC");
+        final Set<Object> objects = persistor.loadData(reader);
+
+        assertEquals(1, objects.size());
+        final Object object = objects.toArray()[0];
+        assertThat(object instanceof SimpleEntity, is(true));
+        final SimpleEntity epv = (SimpleEntity) object;
+        assertEquals("Fred Smith", epv.getName());
+        
+        assertEquals(dateFormat.parse("08-Mar-2010 01:00 GMT"), epv.getDate());
+    }
+
+    @Test
+    public void invalidFieldLine() throws Exception {
+        try {
+            final StringReader reader = new StringReader(SimpleEntity.class.getName() + "#1\n  name Fred Smith");
+            persistor.loadData(reader);
+            Assert.fail();
+        } catch (final FixtureException e) {
+            Assert.assertEquals("failed to load data at line 2", e.getMessage());
+            Assert.assertEquals("no colon (:) in: name Fred Smith", e.getCause().getMessage());
+        }
+    }
+
+    @Test
+    public void oldFieldNameSkipped() throws Exception {
+        final StringReader reader = new StringReader(SimpleEntity.class.getName() + "#1\n  xname: Fred Smith");
+        final Set<Object> objects = persistor.loadData(reader);
+        final Object object = objects.toArray()[0];
+        Assert.assertNull(((SimpleEntity) object).getName());
+
+    }
+
+    @Test
+    public void saveNoObjects() throws Exception {
+        // Person person = new Person();
+        final Set<Object> objects = new HashSet<Object>();
+        final StringWriter out = new StringWriter();
+        persistor.save(objects, out);
+        Assert.assertEquals("", out.toString());
+    }
+
+    @Test
+    public void saveOneObject() throws Exception {
+        final Set<Object> objects = Sets.newLinkedHashSet();
+        objects.add(iswf.fixtures.smpl1);
+
+        final StringWriter out = new StringWriter();
+        persistor.save(objects, out);
+        final String actual = out.toString().replaceAll("\r\n", "\n");
+        
+        final String expected = SimpleEntity.class.getName() + "#2\n  date: 08-Mar-2010 01:00 UTC\n  name: Fred Smith\n";
+        
+        assertThat(actual, IsisMatchers.startsWith(expected));
+    }
+
+    @Test
+    public void saveTwoObjects() throws Exception {
+        final Set<Object> objects = Sets.newLinkedHashSet();
+        objects.add(iswf.fixtures.smpl1);
+        objects.add(iswf.fixtures.smpl3);
+
+        final StringWriter out = new StringWriter();
+        persistor.save(objects, out);
+        final String actual = out.toString().replaceAll("\r\n", "\n");
+
+        final String expected1 = SimpleEntity.class.getName() + "#2\n  date: 08-Mar-2010 01:00 UTC\n  name: Fred Smith\n";
+        final String expected2 = SimpleEntity.class.getName() + "#3\n  date: \n  name: \n";
+        assertThat(actual, IsisMatchers.contains(expected1));
+        assertThat(actual, IsisMatchers.contains(expected2));
+    }
+
+    @Test
+    public void saveReferencedObject() throws Exception {
+
+        final Set<Object> objects = Sets.newLinkedHashSet();
+        
+        iswf.fixtures.rfcg1.setReference(iswf.fixtures.smpl1);
+        objects.add(iswf.fixtures.rfcg1);
+        objects.add(iswf.fixtures.smpl1);
+
+        final StringWriter out = new StringWriter();
+        persistor.save(objects, out);
+        final String actual = out.toString().replaceAll("\r\n", "\n");
+
+        final String expected1 = ReferencingEntity.class.getName() + "#2\n  aggregatedEntities: \n  aggregatedReference: \n  reference: " + SimpleEntity.class.getName() + "#3";
+        final String expected2 = SimpleEntity.class.getName() + "#3\n  date: 08-Mar-2010 01:00 UTC\n  name: Fred Smith\n";
+        assertThat(actual, IsisMatchers.contains(expected1));
+        assertThat(actual, IsisMatchers.contains(expected2));
+    }
+
+    
+    @Test
+    public void saveObjectAndAssociatedCollection() throws Exception {
+
+        final Set<Object> objects = Sets.newLinkedHashSet();
+        
+        iswf.fixtures.prnt1.getHomogeneousCollection().add(iswf.fixtures.smpl1);
+        iswf.fixtures.prnt1.getHomogeneousCollection().add(iswf.fixtures.smpl2);
+        objects.add(iswf.fixtures.prnt1);
+
+        objects.add(iswf.fixtures.smpl1);
+        objects.add(iswf.fixtures.smpl2);
+
+        final StringWriter out = new StringWriter();
+        persistor.save(objects, out);
+        final String actual = out.toString().replaceAll("\r\n", "\n");
+        
+        final String expected1a = ParentEntity.class.getName() + "#2\n";
+        final String expected1b = "heterogeneousCollection: \n  homogeneousCollection: " + SimpleEntity.class.getName() + "#3 " + SimpleEntity.class.getName() + "#4 " + "\n";
+        final String expected2 = SimpleEntity.class.getName() + "#3\n  date: 08-Mar-2010 01:00 UTC\n  name: Fred Smith\n";
+        final String expected3 = SimpleEntity.class.getName() + "#4\n  date: 09-Apr-2011 02:10 UTC\n  name: Joe Bloggs\n";
+        assertThat(actual.replaceAll("\n", "###"), IsisMatchers.contains(expected1a.replaceAll("\n", "###")));
+        assertThat(actual.replaceAll("\n", "###"), IsisMatchers.contains(expected1b.replaceAll("\n", "###")));
+        assertThat(actual, IsisMatchers.contains(expected2));
+        assertThat(actual, IsisMatchers.contains(expected3));
+    }
+
+}
+

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_loadFile.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_loadFile.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_loadFile.java
new file mode 100644
index 0000000..efcef62
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_loadFile.java
@@ -0,0 +1,87 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.runtime.fixturedomainservice;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.Date;
+import java.util.Locale;
+import java.util.Set;
+
+import junit.framework.Assert;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.commons.config.ConfigurationConstants;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.movies.Person;
+import org.apache.isis.tck.dom.refs.SimpleEntity;
+
+public class ObjectFixtureServiceTest_loadFile {
+
+    private static IsisConfiguration configuration() {
+        IsisConfigurationDefault configuration = new IsisConfigurationDefault();
+        configuration.add(ConfigurationConstants.ROOT + "exploration-objects.file", "test.data");
+        return configuration;
+    }
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().with(configuration()).build();
+    
+    @Rule
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+    private ObjectFixtureService service;
+
+    
+    @Before
+    public void setup() {
+        Logger.getRootLogger().setLevel(Level.OFF);
+        Locale.setDefault(Locale.UK);
+
+        service = new ObjectFixtureService();
+    }
+
+
+    @Test
+    public void loadFile() throws Exception {
+
+        // when
+        service.loadFile();
+
+        // then
+        final Set<Object> objects = service.allSavedObjects();
+        Assert.assertEquals(1, objects.size());
+        final Object object = objects.toArray()[0];
+        assertThat(object instanceof SimpleEntity, is(true));
+        Assert.assertEquals("Fred Smith", ((SimpleEntity) object).getName());
+        Assert.assertEquals(new Date(110, 2, 8, 13, 32), ((SimpleEntity) object).getDate());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_loadFile_nothingExists.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_loadFile_nothingExists.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_loadFile_nothingExists.java
new file mode 100644
index 0000000..84208b5
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_loadFile_nothingExists.java
@@ -0,0 +1,71 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.runtime.fixturedomainservice;
+
+import java.io.File;
+import java.util.Locale;
+import java.util.Set;
+
+import junit.framework.Assert;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+
+public class ObjectFixtureServiceTest_loadFile_nothingExists {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+    
+    @Rule
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+    private ObjectFixtureService service;
+
+    
+    @Before
+    public void setup() {
+        Logger.getRootLogger().setLevel(Level.OFF);
+        Locale.setDefault(Locale.UK);
+
+        service = new ObjectFixtureService();
+        deleteFixtureData();
+    }
+
+
+    private static void deleteFixtureData() {
+        new File("fixture-data").delete();
+    }
+
+    @Test
+    public void loadNothingIfNoFileExists() throws Exception {
+        service.loadFile();
+
+        final Set<Object> objects = service.allSavedObjects();
+        Assert.assertEquals(0, objects.size());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_save.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_save.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_save.java
new file mode 100644
index 0000000..b662ad9
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/fixturedomainservice/ObjectFixtureServiceTest_save.java
@@ -0,0 +1,82 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.runtime.fixturedomainservice;
+
+import java.io.File;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Set;
+
+import junit.framework.Assert;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.ParentEntity;
+import org.apache.isis.tck.dom.refs.SimpleEntity;
+
+public class ObjectFixtureServiceTest_save {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+    
+    @Rule
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+    private ObjectFixtureService service;
+
+    
+    @Before
+    public void setup() {
+        Logger.getRootLogger().setLevel(Level.OFF);
+        Locale.setDefault(Locale.UK);
+
+        service = new ObjectFixtureService();
+        deleteFixtureData();
+    }
+
+
+    private static void deleteFixtureData() {
+        new File("fixture-data").delete();
+    }
+
+
+    @Test
+    public void saveObjectAddedToList() throws Exception {
+        
+        final SimpleEntity epv = iswf.fixtures.smpl1;
+        epv.setName("Fred Smith");
+        epv.setDate(new Date(110, 2, 8, 13, 32));
+        
+        final ParentEntity epc = iswf.fixtures.prnt1;
+        epc.getHomogeneousCollection().add(iswf.fixtures.smpl1);
+        epc.getHomogeneousCollection().add(iswf.fixtures.smpl2);
+        service.save(epc);
+
+        final Set<Object> savedObjects = service.allSavedObjects();
+        Assert.assertEquals(3, savedObjects.size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest.java
new file mode 100644
index 0000000..9bff553
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest.java
@@ -0,0 +1,218 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.runtime.memento;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.log4j.Appender;
+import org.apache.log4j.BasicConfigurator;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.commons.encoding.DataInputStreamExtended;
+import org.apache.isis.core.commons.encoding.DataOutputStreamExtended;
+import org.apache.isis.core.commons.encoding.FieldType;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.refs.BaseEntity;
+import org.apache.isis.tck.dom.refs.ParentEntity;
+import org.apache.isis.tck.dom.refs.ReferencingEntity;
+import org.apache.isis.tck.dom.refs.SimpleEntity;
+
+public class MementoTest {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+    
+    private ObjectAdapter originalAdapterForEpv1;
+    private ObjectAdapter originalAdapterForEpr1;
+    private ObjectAdapter originalAdapterForEpc1;
+    
+    private ObjectAdapter recreatedAdapter;
+
+    private Memento mementoForEpv1;
+    private Memento mementoForEpr1;
+    private Memento mementoForEpc1;
+    
+    private byte[] bytesForEpv1;
+    private byte[] bytesForEpr1;
+    private byte[] bytesForEpc1;
+
+    private ByteArrayInputStream bais;
+    
+
+    @Before
+    public void setUpSystem() throws Exception {
+        
+//        final Logger logger = Logger.getLogger(FieldType.class);
+//        logger.setLevel(Level.DEBUG);
+//        logger.addAppender(new ConsoleAppender());
+//        BasicConfigurator.configure();
+
+        iswf.fixtures.smpl1.setName("Fred");
+        iswf.fixtures.smpl2.setName("Harry");
+        
+        iswf.fixtures.rfcg1_a1.setName("Tom");
+        
+        iswf.fixtures.rfcg1.setReference(iswf.fixtures.smpl1);
+        iswf.fixtures.rfcg1.setAggregatedReference(iswf.fixtures.rfcg1_a1);
+        
+        iswf.fixtures.prnt1.getHomogeneousCollection().add(iswf.fixtures.smpl1);
+        iswf.fixtures.prnt1.getHomogeneousCollection().add(iswf.fixtures.smpl2);
+        
+        iswf.fixtures.prnt1.getHeterogeneousCollection().add(iswf.fixtures.smpl1);
+        iswf.fixtures.prnt1.getHeterogeneousCollection().add(iswf.fixtures.rfcg1);
+        
+        originalAdapterForEpv1 = iswf.adapterFor(iswf.fixtures.smpl1);
+        originalAdapterForEpr1 = iswf.adapterFor(iswf.fixtures.rfcg1);
+        originalAdapterForEpc1 = iswf.adapterFor(iswf.fixtures.prnt1);
+
+        mementoForEpv1 = new Memento(originalAdapterForEpv1);
+        mementoForEpr1 = new Memento(originalAdapterForEpr1);
+        mementoForEpc1 = new Memento(originalAdapterForEpc1);
+        
+        bytesForEpv1 = toBytes(mementoForEpv1);
+        bytesForEpr1 = toBytes(mementoForEpr1);
+        bytesForEpc1 = toBytes(mementoForEpc1);
+    
+        iswf.tearDownSystem();
+        
+//        logger.debug("*************************************");
+        
+        iswf.setUpSystem();
+        
+        mementoForEpv1 = fromBytes(bytesForEpv1);
+        mementoForEpr1 = fromBytes(bytesForEpr1);
+        mementoForEpc1 = fromBytes(bytesForEpc1);
+    }
+
+
+    private Memento fromBytes(final byte[] bytes) throws IOException {
+        bais = new ByteArrayInputStream(bytes);
+        DataInputStreamExtended input = new DataInputStreamExtended(bais);
+        final Memento recreate = Memento.recreateFrom(input);
+        return recreate;
+    }
+
+
+    private static byte[] toBytes(final Memento memento) throws IOException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        DataOutputStreamExtended output = new DataOutputStreamExtended(baos);
+        memento.encodedData(output);
+        return baos.toByteArray();
+    }
+
+
+    @Test
+    public void recreateObject_adaptersAreNotSame() throws Exception {
+
+        recreatedAdapter = mementoForEpv1.recreateObject();
+        
+        assertNotSame(originalAdapterForEpv1, recreatedAdapter);
+    }
+
+    @Test
+    public void recreateObject_getOid_areEquals() throws Exception {
+        recreatedAdapter = mementoForEpv1.recreateObject();
+
+        assertEquals(originalAdapterForEpv1.getOid(), recreatedAdapter.getOid());
+    }
+
+    @Test
+    public void recreateObject_getSpecification_isSame() throws Exception {
+        recreatedAdapter = mementoForEpv1.recreateObject();
+        
+        final ObjectSpecification specification = originalAdapterForEpv1.getSpecification();
+        final ObjectSpecification recreatedSpecification = recreatedAdapter.getSpecification();
+        assertSame(specification, recreatedSpecification);
+    }
+
+    @Test
+    public void recreateObject_valuePreserved() throws Exception {
+        recreatedAdapter = mementoForEpv1.recreateObject();
+        final SimpleEntity recreatedObject = (SimpleEntity)recreatedAdapter.getObject();
+        assertEquals("Fred", recreatedObject.getName());
+    }
+
+    @Test
+    public void recreateObject_referencePreserved() throws Exception {
+        recreatedAdapter = mementoForEpr1.recreateObject();
+        final ReferencingEntity recreatedObject = (ReferencingEntity)recreatedAdapter.getObject();
+        final SimpleEntity reference1 = recreatedObject.getReference();
+        assertNotNull(reference1);
+        
+        assertThat("Fred", equalTo(reference1.getName()));
+    }
+
+    @Test
+    public void recreateObject_homogeneousCollectionPreserved() throws Exception {
+        recreatedAdapter = mementoForEpc1.recreateObject();
+        final ParentEntity recreatedObject = (ParentEntity)recreatedAdapter.getObject();
+        final List<SimpleEntity> homogenousCollection = recreatedObject.getHomogeneousCollection();
+        assertNotNull(homogenousCollection);
+        
+        assertThat(homogenousCollection.size(), is(2));
+        assertThat(homogenousCollection.get(0).getName(), is("Fred"));
+        assertThat(homogenousCollection.get(1).getName(), is("Harry"));
+    }
+
+    @Test
+    public void recreateObject_heterogeneousCollectionPreserved() throws Exception {
+        recreatedAdapter = mementoForEpc1.recreateObject();
+        final ParentEntity recreatedObject = (ParentEntity)recreatedAdapter.getObject();
+        final List<BaseEntity> hetrogenousCollection = recreatedObject.getHeterogeneousCollection();
+        assertNotNull(hetrogenousCollection);
+        
+        assertThat(hetrogenousCollection.size(), is(2));
+        final SimpleEntity firstObj = (SimpleEntity)hetrogenousCollection.get(0);
+        assertThat(firstObj.getName(), is("Fred"));
+        
+        final ReferencingEntity secondObj = (ReferencingEntity)hetrogenousCollection.get(1);
+        final SimpleEntity reference1 = secondObj.getReference();
+        assertThat(reference1.getName(), is("Fred"));
+        
+        assertSame(firstObj, reference1);
+    }
+
+    @Test
+    public void recreateObject_whenNull() throws Exception {
+        final Memento memento = new Memento(null);
+        ObjectAdapter returnedAdapter = memento.recreateObject();
+        assertNull(returnedAdapter);
+    }
+
+    
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest_data.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest_data.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest_data.java
new file mode 100644
index 0000000..a77a685
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest_data.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 org.apache.isis.runtimes.dflt.runtime.memento;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.WrapperValuedEntity;
+
+public class MementoTest_data {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+
+    private ObjectAdapter originalAdapter1, originalAdapter2;
+    private Oid oid1, oid2;
+
+    private Memento memento1, memento2;
+    private Data data1, data2;
+
+    @Before
+    public void setUpSystem() throws Exception {
+        iswf.fixtures.wve1.setStringProperty("Fred");
+        
+        originalAdapter1 = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(iswf.fixtures.wve1);
+        oid1 = originalAdapter1.getOid();
+        memento1 = new Memento(originalAdapter1);
+        data1 = memento1.getData();
+        
+        iswf.fixtures.wve2.setStringProperty("Harry");
+        iswf.container.persist(iswf.fixtures.wve2);
+        
+        originalAdapter2 = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(iswf.fixtures.wve2);
+        oid2 = originalAdapter2.getOid();
+        memento2 = new Memento(originalAdapter2);
+        data2 = memento2.getData();
+    }
+
+    
+    @Test
+    public void data_whenNull() throws Exception {
+        final Memento memento = new Memento(null);
+        Data data = memento.getData();
+
+        assertEquals(null, data);
+    }
+
+
+    @Test
+    public void data_getOid_equal() throws Exception {
+        assertEquals(oid1, data1.getOid());
+    }
+
+
+
+    @Test
+    public void data_getClassName() throws Exception {
+        assertEquals(WrapperValuedEntity.class.getName(), data1.getClassName());
+    }
+    
+    
+    @Test
+    public void data_getEntry_forStringField() throws Exception {
+        assertEquals(ObjectData.class, data1.getClass());
+        final ObjectData objectData = (ObjectData) data1;
+        assertEquals("Fred", objectData.getEntry("stringProperty"));
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest_encodedData.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest_encodedData.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest_encodedData.java
new file mode 100644
index 0000000..7b30b48
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/memento/MementoTest_encodedData.java
@@ -0,0 +1,80 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.runtime.memento;
+
+import org.jmock.Expectations;
+import org.jmock.auto.Mock;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.commons.encoding.DataOutputStreamExtended;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+
+public class MementoTest_encodedData {
+
+    @Rule
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+
+    private ObjectAdapter rootAdapter;
+
+    private Memento memento;
+
+    @Mock
+    private DataOutputStreamExtended mockOutputImpl;
+
+    @Before
+    public void setUpSystem() throws Exception {
+        iswf.fixtures.smpl1.setName("Fred");
+        iswf.fixtures.smpl2.setName("Harry");
+        
+        iswf.fixtures.rfcg1.setReference(iswf.fixtures.smpl1);
+        
+        iswf.fixtures.prnt1.getHomogeneousCollection().add(iswf.fixtures.smpl1);
+        iswf.fixtures.prnt1.getHomogeneousCollection().add(iswf.fixtures.smpl2);
+        
+        iswf.fixtures.prnt1.getHeterogeneousCollection().add(iswf.fixtures.smpl1);
+        iswf.fixtures.prnt1.getHeterogeneousCollection().add(iswf.fixtures.rfcg1);
+
+        
+        rootAdapter = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(iswf.fixtures.smpl1);
+
+        memento = new Memento(rootAdapter);
+    }
+
+    
+    @Test
+    public void encodedData() throws Exception {
+        context.checking(new Expectations() {
+            {
+                one(mockOutputImpl).writeEncodable(memento.getData());
+            }
+        });
+        memento.encodedData(mockOutputImpl);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorSessionHydratorTest.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorSessionHydratorTest.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorSessionHydratorTest.java
new file mode 100644
index 0000000..e6042c3
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorSessionHydratorTest.java
@@ -0,0 +1,119 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.runtime.persistence;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.jmock.Expectations;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
+import org.apache.isis.core.metamodel.adapter.oid.RootOid;
+import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
+import org.apache.isis.runtimes.dflt.objectstores.dflt.InMemoryPersistenceMechanismInstaller;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures.Fixtures.Initialization;
+import org.apache.isis.tck.dom.refs.ParentEntityRepository;
+import org.apache.isis.tck.dom.refs.SimpleEntity;
+
+public class PersistorSessionHydratorTest {
+
+    @Rule
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+    private RootOid epvTransientOid = RootOidDefault.deString("!SMPL:-999", new OidMarshaller());
+
+    private IdentifierGenerator mockIdentifierGenerator = context.mock(IdentifierGenerator.class);
+    {
+        context.checking(new Expectations() {
+            {
+                allowing(mockIdentifierGenerator).createTransientIdentifierFor(with(equalTo(ObjectSpecId.of("ParentEntities"))), with(an(ParentEntityRepository.class)));
+                will(returnValue("1"));
+                allowing(mockIdentifierGenerator).createPersistentIdentifierFor(with(equalTo(ObjectSpecId.of("ParentEntities"))), with(an(ParentEntityRepository.class)), with(any(RootOid.class)));
+                will(returnValue("1"));
+                
+                allowing(mockIdentifierGenerator).createTransientIdentifierFor(with(equalTo(ObjectSpecId.of("SMPL"))), with(an(SimpleEntity.class)));
+                will(returnValue("-999"));
+                
+                allowing(mockIdentifierGenerator).createPersistentIdentifierFor(with(equalTo(ObjectSpecId.of("SMPL"))), with(an(SimpleEntity.class)), with(any(RootOid.class)));
+                will(returnValue("1"));
+            }
+        });
+    }
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder()
+        .with(Initialization.NO_INIT)
+        .with(new InMemoryPersistenceMechanismInstaller() {
+            public IdentifierGenerator createIdentifierGenerator(IsisConfiguration configuration) {
+                return mockIdentifierGenerator;
+            };
+        })
+        .build();
+
+    
+    @Test
+    public void adaptorFor_whenTransient() {
+        // given
+        iswf.fixtures.smpl1 = iswf.container.newTransientInstance(SimpleEntity.class);
+        
+        // when
+        final ObjectAdapter adapter = iswf.adapterFor(iswf.fixtures.smpl1);
+
+        // then
+        assertEquals(epvTransientOid, adapter.getOid());
+        assertEquals(iswf.fixtures.smpl1, adapter.getObject());
+        assertEquals(ResolveState.TRANSIENT, adapter.getResolveState());
+        assertEquals(null, adapter.getVersion());
+    }
+
+    @Test
+    public void recreateAdapter_whenPersistent() throws Exception {
+        
+        // given persisted object
+        iswf.fixtures.smpl1 = iswf.container.newTransientInstance(SimpleEntity.class);
+        iswf.fixtures.smpl1.setName("Fred");
+        iswf.persist(iswf.fixtures.smpl1);
+        iswf.tearDownSystem();
+        iswf.setUpSystem();
+        
+        // when
+        final RootOidDefault oid = RootOidDefault.deString("SMPL:1", new OidMarshaller());
+        final ObjectAdapter adapter = iswf.recreateAdapter(oid);
+        
+        // then
+        assertEquals(oid, adapter.getOid());
+        assertEquals(ResolveState.GHOST, adapter.getResolveState());
+
+        final SimpleEntity epv = (SimpleEntity)adapter.getObject();
+        assertEquals("Fred", epv.getName());
+        assertNotNull(adapter.getVersion());
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/RuntimeTestPojo.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/RuntimeTestPojo.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/RuntimeTestPojo.java
new file mode 100644
index 0000000..a6756c3
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/RuntimeTestPojo.java
@@ -0,0 +1,52 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.runtime.persistence;
+
+public class RuntimeTestPojo {
+    
+    private static int nextId;
+    private final int id = nextId++;
+    private final String state = "pojo" + id;
+
+    @Override
+    public String toString() {
+        return "Pojo#" + id;
+    }
+
+    @Override
+    public boolean equals(final Object other) {
+        if (other == null) {
+            return false;
+        }
+        if (other == this) {
+            return true;
+        }
+        if (other.getClass() == getClass()) {
+            final RuntimeTestPojo otherTestPojo = (RuntimeTestPojo) other;
+            return otherTestPojo.state.equals(state);
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return state.hashCode();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixturesTest_basicTest.java
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixturesTest_basicTest.java b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixturesTest_basicTest.java
new file mode 100644
index 0000000..088a981
--- /dev/null
+++ b/framework/core/integtestsupport/src/test/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixturesTest_basicTest.java
@@ -0,0 +1,45 @@
+/*
+ *  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 org.apache.isis.runtimes.dflt.testsupport;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.tck.dom.scalars.JdkValuedEntity;
+
+public class IsisSystemWithFixturesTest_basicTest {
+
+    @Rule
+    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();
+    
+    @Test
+    public void savePojo() throws Exception {
+
+        assertThat(iswf.container.allInstances(JdkValuedEntity.class).size(), is(0));
+        
+        iswf.container.persist(iswf.fixtures.jve1);
+        
+        assertThat(iswf.container.allInstances(JdkValuedEntity.class).size(), is(1));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/integtestsupport/test.data
----------------------------------------------------------------------
diff --git a/framework/core/integtestsupport/test.data b/framework/core/integtestsupport/test.data
new file mode 100644
index 0000000..56a616b
--- /dev/null
+++ b/framework/core/integtestsupport/test.data
@@ -0,0 +1,5 @@
+org.apache.isis.tck.dom.refs.SimpleEntity#4
+  date: 08-Mar-2010 13:32
+  name: Fred Smith
+  nullable: 
+  size: 0

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/pom.xml b/framework/core/metamodel/pom.xml
index cad70db..b6dde15 100644
--- a/framework/core/metamodel/pom.xml
+++ b/framework/core/metamodel/pom.xml
@@ -23,8 +23,8 @@
     <name>Core MetaModel</name>
 
     <properties>
-        <siteBaseDir>../..</siteBaseDir>
-        <relativeUrl>core/metamodel/</relativeUrl>
+        <siteBaseDir>..</siteBaseDir>
+        <relativeUrl>metamodel/</relativeUrl>
     </properties>
 
     <!-- used in Site generation for relative references. -->

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/objectstore-inmemory/NOTICE
----------------------------------------------------------------------
diff --git a/framework/core/objectstore-inmemory/NOTICE b/framework/core/objectstore-inmemory/NOTICE
new file mode 100644
index 0000000..d391f54
--- /dev/null
+++ b/framework/core/objectstore-inmemory/NOTICE
@@ -0,0 +1,7 @@
+Apache Isis
+Copyright 2010-2011 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/core/objectstore-inmemory/pom.xml
----------------------------------------------------------------------
diff --git a/framework/core/objectstore-inmemory/pom.xml b/framework/core/objectstore-inmemory/pom.xml
new file mode 100644
index 0000000..48ab8ac
--- /dev/null
+++ b/framework/core/objectstore-inmemory/pom.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+         http://www.apache.org/licenses/LICENSE-2.0
+         
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.isis</groupId>
+		<artifactId>core</artifactId>
+		<version>0.3.1-SNAPSHOT</version>
+	</parent>
+
+	<groupId>org.apache.isis.runtimes.dflt.objectstores</groupId>
+	<artifactId>dflt</artifactId>
+	<name>Default Runtime Default ObjectStore (In-Memory)</name>
+
+	<properties>
+        <siteBaseDir>..</siteBaseDir>
+		<relativeUrl>objectstore-inmemory/</relativeUrl>
+	</properties>
+
+    <!-- used in Site generation for relative references. -->
+    <url>http://incubator.apache.org/isis/${relativeUrl}</url>
+
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-project-info-reports-plugin</artifactId>
+				<version>${maven-project-info-reports-plugin}</version>
+                <inherited>false</inherited>
+                <configuration>
+                	<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
+                </configuration>
+                <reportSets>
+                    <reportSet>
+                        <inherited>false</inherited>
+                        <reports>
+                            <report>dependencies</report>
+                            <report>dependency-convergence</report>
+                            <report>plugins</report>
+                            <report>summary</report>
+                        </reports>
+                    </reportSet>
+                </reportSets>
+            </plugin>
+        </plugins>
+    </reporting>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-unittestsupport</artifactId>
+            <version>0.3.1-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-metamodel</artifactId>
+            <version>0.3.1-SNAPSHOT</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+		<dependency>
+		    <groupId>org.apache.isis.runtimes.dflt</groupId>
+		    <artifactId>runtime</artifactId>
+            <version>0.3.1-SNAPSHOT</version>
+		</dependency>
+
+	</dependencies>
+
+</project>